{
"require": [
"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js",
"$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
"$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
"$:/plugins/tiddlywiki/codemirror/keymap/emacs.js"
],
"configuration": {
"keyMap": "emacs",
"matchBrackets":true,
"showCursorWhenSelecting": true
}
}
{
"filesystem": {
"PATH": "SocialCalc/Demos"
},
"graphics": "native",
"grid": "yes",
"LANG": "en-GB",
"heightInTiddlerEditor": 500,
"":""
}
{
"filesystem": {
"PATH": "Three.js/Tests"
},
"":""
}
{
"tiddlers": {
"$:/Acknowledgements": {
"title": "$:/Acknowledgements",
"type": "text/vnd.tiddlywiki",
"text": "TiddlyWiki incorporates code from these fine OpenSource projects:\n\n* [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]]\n* [[The Jasmine JavaScript Test Framework|http://pivotal.github.io/jasmine/]]\n* [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]]\n\nAnd media from these projects:\n\n* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]]\n"
},
"$:/core/copyright.txt": {
"title": "$:/core/copyright.txt",
"type": "text/plain",
"text": "TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)\n\nCopyright © Jeremy Ruston 2004-2007\nCopyright © UnaMesa Association 2007-2014\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\nRedistributions in binary form must reproduce the above copyright notice, this\nlist of conditions and the following disclaimer in the documentation and/or other\nmaterials provided with the distribution.\n\nNeither the name of the UnaMesa Association nor the names of its contributors may be\nused to endorse or promote products derived from this software without specific\nprior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\nSHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGE.\n"
},
"$:/core/icon": {
"title": "$:/core/icon",
"tags": "$:/tags/Image",
"text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z M85.1274062,95.4080042 C81.5494069,95.3047989 79.9756384,95.3136745 78.1534289,92.2560668 L76.733228,92.2975844 C75.0801573,92.2226776 75.7690718,92.256631 74.6662332,92.2006037 C72.822332,92.1273894 73.1177105,90.3396383 72.7933215,89.3950941 C72.2744094,86.1888106 73.4800004,82.9659571 73.4419681,79.7590415 C73.428503,78.6206623 71.8498363,74.5912119 71.2858469,73.150598 C69.5178104,73.490271 67.7401827,73.5550323 65.9465048,73.6462337 C61.8120677,73.6358996 57.7056703,73.1192806 53.628962,72.4632293 C52.8345141,75.8119659 50.473106,80.4990751 52.4249964,83.9024219 C54.794228,87.4227874 56.45684,88.3980868 59.0339286,88.6103485 C61.6109895,88.8224384 62.1929077,91.7913467 61.5694236,92.8517379 C61.0175661,93.5845847 60.0476425,93.7176093 59.2235739,93.8951553 L57.5752147,93.9742093 C56.2780933,93.9296822 55.1187057,93.5723203 53.9629071,93.0211763 C52.0327307,91.9217335 50.0392154,89.6360411 48.5580719,87.9950695 C48.9028934,88.6503604 49.1085703,89.9296134 48.7958122,90.5249222 C47.9200982,91.7907825 44.1326257,91.7830485 42.3980986,90.996433 C40.4277043,90.1030197 35.6664658,83.8299171 34.9303347,79.1316435 C36.8887135,75.3525836 39.7416856,72.0607931 41.1850909,67.9459622 C38.038852,65.8974525 36.3537697,62.5626501 36.5725198,58.7851619 L36.6514762,58.3478913 C33.5557196,58.9392548 35.1611076,58.7192345 31.8308843,58.9762949 C21.2252017,58.9431831 11.8983553,51.6054609 17.1501626,40.2013394 C17.4916881,39.5260388 17.8165752,38.9120742 18.3955298,39.205288 C18.8602051,39.440565 18.793457,40.3843583 18.5597268,41.4309776 C15.5577203,55.057365 30.2297484,55.161659 39.2489049,52.6401668 C40.1440491,52.3898612 41.9243599,50.7040626 43.1576153,50.1452033 C45.1734825,49.231769 47.3615008,48.8611654 49.5329344,48.5941256 C54.9337165,47.9661653 61.4247946,50.8693254 64.7228943,50.9641212 C68.0210328,51.0589131 72.7127563,50.1582941 75.5928121,50.3479196 C77.6825379,50.4454833 79.734518,50.8303777 81.7507717,51.3786556 C83.0558682,44.8897102 83.1481363,40.1071855 86.2420439,39 C88.0578592,39.2926449 89.4570618,41.8175853 90.4927503,43.1666676 C92.6062592,43.0809984 94.6134653,43.6270518 96.6091885,44.233091 C100.222332,43.7098824 103.254293,41.6394732 106.445091,40.0288813 C103.211767,42.7223157 102.77315,47.1042714 103.142605,51.1564486 C103.280001,53.2591496 102.697713,55.5420684 101.977868,57.6949551 C100.630795,61.2025356 98.0292951,64.8997754 95.009908,64.7101481 C93.868464,64.673306 93.2053722,64.0138 92.3570101,63.3096933 C92.1924386,64.7358711 91.5456263,66.0084523 90.9221089,67.2697748 C89.4822206,70.066388 85.7194927,71.2987762 82.2354164,74.2849828 C78.7515768,77.2712347 83.3502408,87.9363951 84.4652464,89.8796277 C85.5800708,91.8230453 88.6922789,92.5339992 87.484639,94.28798 C87.1151913,94.8672415 86.5502884,95.0744181 85.9465544,95.2991347 L85.1274062,95.4080042 Z M45.0303574,86.5575217 L45.5828655,86.699414 C46.277142,86.4290005 47.6727292,86.8469317 48.4130246,87.0512628 C47.0498362,85.7357167 44.9960929,83.8038623 43.5164417,82.5859671 C43.0307739,81.1115156 43.2380006,79.6278431 43.3424927,78.122648 L43.3634516,77.9981264 C42.7802099,79.2030731 42.040056,80.3743566 41.6422405,81.6426885 C41.176708,83.3537773 43.7112632,85.1999538 44.6940603,86.2580263 L45.0303574,86.5575217 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/advanced-search-button": {
"title": "$:/core/images/advanced-search-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-advanced-search-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M74.5651535,87.9848361 C66.9581537,93.0488876 57.8237115,96 48,96 C21.490332,96 0,74.509668 0,48 C0,21.490332 21.490332,0 48,0 C74.509668,0 96,21.490332 96,48 C96,57.8541369 93.0305793,67.0147285 87.9377231,74.6357895 L122.284919,108.982985 C125.978897,112.676963 125.973757,118.65366 122.284271,122.343146 C118.593975,126.033442 112.613238,126.032921 108.92411,122.343793 L74.5651535,87.9848361 Z M48,80 C65.673112,80 80,65.673112 80,48 C80,30.326888 65.673112,16 48,16 C30.326888,16 16,30.326888 16,48 C16,65.673112 30.326888,80 48,80 Z\"></path>\n <circle cx=\"48\" cy=\"48\" r=\"8\"></circle>\n <circle cx=\"28\" cy=\"48\" r=\"8\"></circle>\n <circle cx=\"68\" cy=\"48\" r=\"8\"></circle>\n </g>\n</svg>"
},
"$:/core/images/blank": {
"title": "$:/core/images/blank",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-blank tc-image-button\" viewBox=\"63 152 64 64\" width=\"22pt\" height=\"22pt\"></svg>\n"
},
"$:/core/images/cancel-button": {
"title": "$:/core/images/cancel-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-cancel-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n\t<g fill-rule=\"evenodd\">\n\t <path d=\"M64,76.3137085 L47.0294734,93.2842351 C43.9038742,96.4098343 38.8399231,96.4084656 35.7157288,93.2842712 C32.5978915,90.166434 32.5915506,85.0947409 35.7157649,81.9705266 L52.6862915,65 L35.7157649,48.0294734 C32.5901657,44.9038742 32.5915344,39.8399231 35.7157288,36.7157288 C38.833566,33.5978915 43.9052591,33.5915506 47.0294734,36.7157649 L64,53.6862915 L80.9705266,36.7157649 C84.0961258,33.5901657 89.1600769,33.5915344 92.2842712,36.7157288 C95.4021085,39.833566 95.4084494,44.9052591 92.2842351,48.0294734 L75.3137085,65 L92.2842351,81.9705266 C95.4098343,85.0961258 95.4084656,90.1600769 92.2842712,93.2842712 C89.166434,96.4021085 84.0947409,96.4084494 80.9705266,93.2842351 L64,76.3137085 Z M64,129 C99.346224,129 128,100.346224 128,65 C128,29.653776 99.346224,1 64,1 C28.653776,1 1.13686838e-13,29.653776 1.13686838e-13,65 C1.13686838e-13,100.346224 28.653776,129 64,129 Z M64,113 C90.509668,113 112,91.509668 112,65 C112,38.490332 90.509668,17 64,17 C37.490332,17 16,38.490332 16,65 C16,91.509668 37.490332,113 64,113 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/chevron-down": {
"title": "$:/core/images/chevron-down",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-chevron-down tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\" transform=\"translate(64.000000, 40.500000) rotate(-270.000000) translate(-64.000000, -40.500000) translate(-22.500000, -26.500000)\">\n <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n\t</g>\n</svg>"
},
"$:/core/images/chevron-left": {
"title": "$:/core/images/chevron-left",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-chevron-left tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\" version=\"1.1\">\n <g fill-rule=\"evenodd\" transform=\"translate(92.500000, 64.000000) rotate(-180.000000) translate(-92.500000, -64.000000) translate(6.000000, -3.000000)\">\n <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n </g>\n</svg>"
},
"$:/core/images/chevron-right": {
"title": "$:/core/images/chevron-right",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-chevron-right tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\" transform=\"translate(-48.000000, -3.000000)\">\n <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n </g>\n</svg>"
},
"$:/core/images/chevron-up": {
"title": "$:/core/images/chevron-up",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-chevron-up tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n\t<g fill-rule=\"evenodd\" transform=\"translate(64.000000, 89.500000) rotate(-90.000000) translate(-64.000000, -89.500000) translate(-22.500000, 22.500000)\">\n <path d=\"M112.743107,112.12741 C111.310627,113.561013 109.331747,114.449239 107.145951,114.449239 L27.9777917,114.449239 C23.6126002,114.449239 20.0618714,110.904826 20.0618714,106.532572 C20.0618714,102.169214 23.6059497,98.6159054 27.9777917,98.6159054 L99.2285381,98.6159054 L99.2285381,27.365159 C99.2285381,22.9999675 102.77295,19.4492387 107.145205,19.4492387 C111.508562,19.4492387 115.061871,22.993317 115.061871,27.365159 L115.061871,106.533318 C115.061871,108.71579 114.175869,110.694669 112.743378,112.127981 Z\" transform=\"translate(67.561871, 66.949239) rotate(-45.000000) translate(-67.561871, -66.949239) \"></path>\n <path d=\"M151.35638,112.12741 C149.923899,113.561013 147.94502,114.449239 145.759224,114.449239 L66.5910645,114.449239 C62.225873,114.449239 58.6751442,110.904826 58.6751442,106.532572 C58.6751442,102.169214 62.2192225,98.6159054 66.5910645,98.6159054 L137.841811,98.6159054 L137.841811,27.365159 C137.841811,22.9999675 141.386223,19.4492387 145.758478,19.4492387 C150.121835,19.4492387 153.675144,22.993317 153.675144,27.365159 L153.675144,106.533318 C153.675144,108.71579 152.789142,110.694669 151.356651,112.127981 Z\" transform=\"translate(106.175144, 66.949239) rotate(-45.000000) translate(-106.175144, -66.949239) \"></path>\n\t</g>\n</svg>"
},
"$:/core/images/clone-button": {
"title": "$:/core/images/clone-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-clone-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M32.2650915,96 L32.2650915,120.002359 C32.2650915,124.419334 35.8432884,128 40.2627323,128 L120.002359,128 C124.419334,128 128,124.421803 128,120.002359 L128,40.2627323 C128,35.8457573 124.421803,32.2650915 120.002359,32.2650915 L96,32.2650915 L96,48 L108.858899,48 C110.519357,48 111.853018,49.3405131 111.853018,50.9941198 L111.853018,108.858899 C111.853018,110.519357 110.512505,111.853018 108.858899,111.853018 L50.9941198,111.853018 C49.333661,111.853018 48,110.512505 48,108.858899 L48,96 L32.2650915,96 Z\"></path>\n <path d=\"M40,56 L32.0070969,56 C27.5881712,56 24,52.418278 24,48 C24,43.5907123 27.5848994,40 32.0070969,40 L40,40 L40,32.0070969 C40,27.5881712 43.581722,24 48,24 C52.4092877,24 56,27.5848994 56,32.0070969 L56,40 L63.9929031,40 C68.4118288,40 72,43.581722 72,48 C72,52.4092877 68.4151006,56 63.9929031,56 L56,56 L56,63.9929031 C56,68.4118288 52.418278,72 48,72 C43.5907123,72 40,68.4151006 40,63.9929031 L40,56 Z M7.9992458,0 C3.58138434,0 0,3.5881049 0,7.9992458 L0,88.0007542 C0,92.4186157 3.5881049,96 7.9992458,96 L88.0007542,96 C92.4186157,96 96,92.4118951 96,88.0007542 L96,7.9992458 C96,3.58138434 92.4118951,0 88.0007542,0 L7.9992458,0 Z M19.0010118,16 C17.3435988,16 16,17.336731 16,19.0010118 L16,76.9989882 C16,78.6564012 17.336731,80 19.0010118,80 L76.9989882,80 C78.6564012,80 80,78.663269 80,76.9989882 L80,19.0010118 C80,17.3435988 78.663269,16 76.9989882,16 L19.0010118,16 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/close-all-button": {
"title": "$:/core/images/close-all-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-close-all-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\" transform=\"translate(-23.000000, -23.000000)\">\n <path d=\"M43,131 L22.9976794,131 C18.5827987,131 15,127.418278 15,123 C15,118.590712 18.5806831,115 22.9976794,115 L43,115 L43,94.9976794 C43,90.5827987 46.581722,87 51,87 C55.4092877,87 59,90.5806831 59,94.9976794 L59,115 L79.0023206,115 C83.4172013,115 87,118.581722 87,123 C87,127.409288 83.4193169,131 79.0023206,131 L59,131 L59,151.002321 C59,155.417201 55.418278,159 51,159 C46.5907123,159 43,155.419317 43,151.002321 L43,131 Z\" transform=\"translate(51.000000, 123.000000) rotate(-45.000000) translate(-51.000000, -123.000000) \"></path>\n <path d=\"M43,59 L22.9976794,59 C18.5827987,59 15,55.418278 15,51 C15,46.5907123 18.5806831,43 22.9976794,43 L43,43 L43,22.9976794 C43,18.5827987 46.581722,15 51,15 C55.4092877,15 59,18.5806831 59,22.9976794 L59,43 L79.0023206,43 C83.4172013,43 87,46.581722 87,51 C87,55.4092877 83.4193169,59 79.0023206,59 L59,59 L59,79.0023206 C59,83.4172013 55.418278,87 51,87 C46.5907123,87 43,83.4193169 43,79.0023206 L43,59 Z\" transform=\"translate(51.000000, 51.000000) rotate(-45.000000) translate(-51.000000, -51.000000) \"></path>\n <path d=\"M115,59 L94.9976794,59 C90.5827987,59 87,55.418278 87,51 C87,46.5907123 90.5806831,43 94.9976794,43 L115,43 L115,22.9976794 C115,18.5827987 118.581722,15 123,15 C127.409288,15 131,18.5806831 131,22.9976794 L131,43 L151.002321,43 C155.417201,43 159,46.581722 159,51 C159,55.4092877 155.419317,59 151.002321,59 L131,59 L131,79.0023206 C131,83.4172013 127.418278,87 123,87 C118.590712,87 115,83.4193169 115,79.0023206 L115,59 Z\" transform=\"translate(123.000000, 51.000000) rotate(-45.000000) translate(-123.000000, -51.000000) \"></path>\n <path d=\"M115,131 L94.9976794,131 C90.5827987,131 87,127.418278 87,123 C87,118.590712 90.5806831,115 94.9976794,115 L115,115 L115,94.9976794 C115,90.5827987 118.581722,87 123,87 C127.409288,87 131,90.5806831 131,94.9976794 L131,115 L151.002321,115 C155.417201,115 159,118.581722 159,123 C159,127.409288 155.419317,131 151.002321,131 L131,131 L131,151.002321 C131,155.417201 127.418278,159 123,159 C118.590712,159 115,155.419317 115,151.002321 L115,131 Z\" transform=\"translate(123.000000, 123.000000) rotate(-45.000000) translate(-123.000000, -123.000000) \"></path>\n </g>\n</svg>"
},
"$:/core/images/close-button": {
"title": "$:/core/images/close-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-close-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M65.0864256,75.4091629 L14.9727349,125.522854 C11.8515951,128.643993 6.78104858,128.64922 3.65685425,125.525026 C0.539017023,122.407189 0.5336324,117.334539 3.65902635,114.209145 L53.7727171,64.0954544 L3.65902635,13.9817637 C0.537886594,10.8606239 0.532659916,5.79007744 3.65685425,2.6658831 C6.77469148,-0.451954124 11.8473409,-0.457338747 14.9727349,2.66805521 L65.0864256,52.7817459 L115.200116,2.66805521 C118.321256,-0.453084553 123.391803,-0.458311231 126.515997,2.6658831 C129.633834,5.78372033 129.639219,10.8563698 126.513825,13.9817637 L76.4001341,64.0954544 L126.513825,114.209145 C129.634965,117.330285 129.640191,122.400831 126.515997,125.525026 C123.39816,128.642863 118.32551,128.648248 115.200116,125.522854 L65.0864256,75.4091629 L65.0864256,75.4091629 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/close-others-button": {
"title": "$:/core/images/close-others-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-close-others-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 127\">\n <g fill-rule=\"evenodd\">\n <path d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z M64,96 C81.673112,96 96,81.673112 96,64 C96,46.326888 81.673112,32 64,32 C46.326888,32 32,46.326888 32,64 C32,81.673112 46.326888,96 64,96 Z M64,80 C72.836556,80 80,72.836556 80,64 C80,55.163444 72.836556,48 64,48 C55.163444,48 48,55.163444 48,64 C48,72.836556 55.163444,80 64,80 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/delete-button": {
"title": "$:/core/images/delete-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-delete-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\" transform=\"translate(12.000000, 0.000000)\">\n <rect x=\"0\" y=\"11\" width=\"105\" height=\"16\" rx=\"8\"></rect>\n <rect x=\"28\" y=\"0\" width=\"48\" height=\"16\" rx=\"8\"></rect>\n <rect x=\"8\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n <rect x=\"8\" y=\"112\" width=\"88\" height=\"16\" rx=\"8\"></rect>\n <rect x=\"80\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n <rect x=\"56\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n <rect x=\"32\" y=\"16\" width=\"16\" height=\"112\" rx=\"8\"></rect>\n </g>\n</svg>\n"
},
"$:/core/images/done-button": {
"title": "$:/core/images/done-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-done-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M3.52445141,76.8322939 C2.07397484,75.3828178 1.17514421,73.3795385 1.17514421,71.1666288 L1.17514421,23.1836596 C1.17514421,18.7531992 4.75686621,15.1751442 9.17514421,15.1751442 C13.5844319,15.1751442 17.1751442,18.7606787 17.1751442,23.1836596 L17.1751442,63.1751442 L119.173716,63.1751442 C123.590457,63.1751442 127.175144,66.7568662 127.175144,71.1751442 C127.175144,75.5844319 123.592783,79.1751442 119.173716,79.1751442 L9.17657227,79.1751442 C6.96796403,79.1751442 4.9674142,78.279521 3.51911285,76.8315312 Z\" id=\"Rectangle-285\" transform=\"translate(64.175144, 47.175144) rotate(-45.000000) translate(-64.175144, -47.175144) \"></path>\n </g>\n</svg>\n"
},
"$:/core/images/down-arrow": {
"title": "$:/core/images/down-arrow",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-down-arrow tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <path d=\"M109.35638,81.3533152 C107.923899,82.7869182 105.94502,83.6751442 103.759224,83.6751442 L24.5910645,83.6751442 C20.225873,83.6751442 16.6751442,80.1307318 16.6751442,75.7584775 C16.6751442,71.3951199 20.2192225,67.8418109 24.5910645,67.8418109 L95.8418109,67.8418109 L95.8418109,-3.40893546 C95.8418109,-7.77412698 99.3862233,-11.3248558 103.758478,-11.3248558 C108.121835,-11.3248558 111.675144,-7.78077754 111.675144,-3.40893546 L111.675144,75.7592239 C111.675144,77.9416955 110.789142,79.9205745 109.356651,81.3538862 Z\" transform=\"translate(64.175144, 36.175144) rotate(45.000000) translate(-64.175144, -36.175144) \"></path>\n</svg>\n"
},
"$:/core/images/download-button": {
"title": "$:/core/images/download-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-download-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 129 128\"><g fill-rule=\"evenodd\"><path class=\"tc-image-download-button-ring\" d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z\"/><path d=\"M34.3496823,66.4308767 L61.2415823,93.634668 C63.0411536,95.4551107 65.9588502,95.4551107 67.7584215,93.634668 L94.6503215,66.4308767 C96.4498928,64.610434 96.4498928,61.6588981 94.6503215,59.8384554 C93.7861334,58.9642445 92.6140473,58.4731195 91.3919019,58.4731195 L82.9324098,58.4731195 C80.3874318,58.4731195 78.3243078,56.3860674 78.3243078,53.8115729 L78.3243078,38.6615466 C78.3243078,36.0870521 76.2611837,34 73.7162058,34 L55.283798,34 C52.7388201,34 50.675696,36.0870521 50.675696,38.6615466 L50.675696,38.6615466 L50.675696,53.8115729 C50.675696,56.3860674 48.612572,58.4731195 46.0675941,58.4731195 L37.608102,58.4731195 C35.063124,58.4731195 33,60.5601716 33,63.134666 C33,64.3709859 33.4854943,65.5566658 34.3496823,66.4308767 L34.3496823,66.4308767 Z\"/></g></svg>"
},
"$:/core/images/edit-button": {
"title": "$:/core/images/edit-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-edit-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M116.870058,45.3431458 L108.870058,45.3431458 L108.870058,45.3431458 L108.870058,61.3431458 L116.870058,61.3431458 L116.870058,45.3431458 Z M124.870058,45.3431458 L127.649881,45.3431458 C132.066101,45.3431458 135.656854,48.9248678 135.656854,53.3431458 C135.656854,57.7524334 132.07201,61.3431458 127.649881,61.3431458 L124.870058,61.3431458 L124.870058,45.3431458 Z M100.870058,45.3431458 L15.6638275,45.3431458 C15.5064377,45.3431458 15.3501085,45.3476943 15.1949638,45.3566664 L15.1949638,45.3566664 C15.0628002,45.3477039 14.928279,45.3431458 14.7913977,45.3431458 C6.68160973,45.3431458 -8.34314575,53.3431458 -8.34314575,53.3431458 C-8.34314575,53.3431458 6.85614548,61.3431458 14.7913977,61.3431458 C14.9266533,61.3431458 15.0596543,61.3384973 15.190398,61.3293588 C15.3470529,61.3385075 15.5049057,61.3431458 15.6638275,61.3431458 L100.870058,61.3431458 L100.870058,45.3431458 L100.870058,45.3431458 Z\" transform=\"translate(63.656854, 53.343146) rotate(-45.000000) translate(-63.656854, -53.343146) \"></path>\n <path d=\"M35.1714596,124.189544 C41.9594858,123.613403 49.068777,121.917633 58.85987,118.842282 C60.6854386,118.268877 62.4306907,117.705515 65.1957709,116.802278 C81.1962861,111.575575 87.0734839,109.994907 93.9414474,109.655721 C102.29855,109.242993 107.795169,111.785371 111.520478,118.355045 C112.610163,120.276732 115.051363,120.951203 116.97305,119.861518 C118.894737,118.771832 119.569207,116.330633 118.479522,114.408946 C113.146151,105.003414 104.734907,101.112919 93.5468356,101.66546 C85.6716631,102.054388 79.4899908,103.716944 62.7116783,109.197722 C59.9734132,110.092199 58.2519873,110.64787 56.4625698,111.20992 C37.002649,117.322218 25.6914684,118.282267 16.8654804,112.957098 C14.9739614,111.815848 12.5154166,112.424061 11.3741667,114.31558 C10.2329168,116.207099 10.84113,118.665644 12.7326489,119.806894 C19.0655164,123.627836 26.4866335,124.926678 35.1714596,124.189544 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/export-button": {
"title": "$:/core/images/export-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-export-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M8.00348646,127.999999 C8.00464867,128 8.00581094,128 8.00697327,128 L119.993027,128 C122.205254,128 124.207939,127.101378 125.657096,125.651198 L125.656838,125.65759 C127.104563,124.210109 128,122.21009 128,119.999949 L128,56.0000511 C128,51.5817449 124.409288,48 120,48 C115.581722,48 112,51.5797863 112,56.0000511 L112,112 L16,112 L16,56.0000511 C16,51.5817449 12.4092877,48 8,48 C3.581722,48 7.10542736e-15,51.5797863 7.10542736e-15,56.0000511 L7.10542736e-15,119.999949 C7.10542736e-15,124.418255 3.59071231,128 8,128 C8.00116233,128 8.0023246,128 8.00348681,127.999999 Z M56.6235633,27.3113724 L47.6580188,36.2769169 C44.5333664,39.4015692 39.4634864,39.4061295 36.339292,36.2819351 C33.2214548,33.1640979 33.2173444,28.0901742 36.3443103,24.9632084 L58.9616908,2.34582788 C60.5248533,0.782665335 62.5748436,0.000361191261 64.624516,2.38225238e-14 L64.6193616,0.00151809229 C66.6695374,0.000796251595 68.7211167,0.781508799 70.2854358,2.34582788 L92.9028163,24.9632084 C96.0274686,28.0878607 96.0320289,33.1577408 92.9078345,36.2819351 C89.7899973,39.3997724 84.7160736,39.4038827 81.5891078,36.2769169 L72.6235633,27.3113724 L72.6235633,88.5669606 C72.6235633,92.9781015 69.0418413,96.5662064 64.6235633,96.5662064 C60.2142756,96.5662064 56.6235633,92.984822 56.6235633,88.5669606 L56.6235633,27.3113724 L56.6235633,27.3113724 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/full-screen-button": {
"title": "$:/core/images/full-screen-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-full-screen-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g>\n <g>\n <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n </g>\n <g transform=\"translate(104.000000, 104.000000) rotate(-180.000000) translate(-104.000000, -104.000000) translate(80.000000, 80.000000)\">\n <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n </g>\n <g transform=\"translate(24.000000, 104.000000) rotate(-90.000000) translate(-24.000000, -104.000000) translate(0.000000, 80.000000)\">\n <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n </g>\n <g transform=\"translate(104.000000, 24.000000) rotate(90.000000) translate(-104.000000, -24.000000) translate(80.000000, 0.000000)\">\n <path d=\"M5.29777586e-31,8 C1.59060409e-15,3.581722 3.581722,0 8,0 L40,0 C44.418278,0 48,3.581722 48,8 C48,12.418278 44.418278,16 40,16 L16,16 L16,40 C16,44.418278 12.418278,48 8,48 C3.581722,48 -3.55271368e-15,44.418278 0,40 L3.55271368e-15,8 Z\"></path>\n </g>\n </g>\n</svg>"
},
"$:/core/images/globe": {
"title": "$:/core/images/globe",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-globe tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M72.8111354,37.1275855 C72.8111354,37.9789875 72.8111354,38.8303894 72.8111354,39.6817913 C72.8111354,41.8784743 73.7885604,46.5631866 72.8111354,48.5143758 C71.3445471,51.4420595 68.1617327,52.0543531 66.4170946,54.3812641 C65.2352215,55.9575873 61.7987417,64.9821523 62.7262858,67.3005778 C66.6959269,77.2228204 74.26087,70.4881886 80.6887657,76.594328 C81.5527211,77.415037 83.5758191,78.8666631 83.985137,79.8899578 C87.2742852,88.1128283 76.4086873,94.8989524 87.7419325,106.189751 C88.9872885,107.430443 91.555495,102.372895 91.8205061,101.575869 C92.6726866,99.0129203 98.5458765,96.1267309 100.908882,94.5234439 C102.928056,93.1534443 105.782168,91.8557166 107.236936,89.7775886 C109.507391,86.5342557 108.717505,82.2640435 110.334606,79.0328716 C112.473794,74.7585014 114.163418,69.3979002 116.332726,65.0674086 C120.230862,57.2857361 121.054075,67.1596684 121.400359,67.5059523 C121.757734,67.8633269 122.411167,67.5059523 122.916571,67.5059523 C123.011132,67.5059523 124.364019,67.6048489 124.432783,67.5059523 C125.0832,66.5705216 123.390209,49.5852316 123.114531,48.2089091 C121.710578,41.1996597 116.17083,32.4278331 111.249523,27.7092761 C104.975994,21.6942076 104.160516,11.5121686 92.9912146,12.7547535 C92.7872931,12.7774397 87.906794,22.9027026 85.2136766,26.2672064 C81.486311,30.9237934 82.7434931,22.1144904 78.6876623,22.1144904 C78.6065806,22.1144904 77.5045497,22.0107615 77.4353971,22.1144904 C76.8488637,22.9942905 75.9952305,26.0101404 75.1288269,26.5311533 C74.8635477,26.6906793 73.4071369,26.2924966 73.2826811,26.5311533 C71.0401728,30.8313939 81.5394677,28.7427264 79.075427,34.482926 C76.7225098,39.9642538 72.747373,32.4860199 72.747373,43.0434079\"></path>\n <path d=\"M44.4668556,7.01044608 C54.151517,13.1403033 45.1489715,19.2084878 47.1611905,23.2253896 C48.8157833,26.5283781 51.4021933,28.6198851 48.8753629,33.038878 C46.8123257,36.6467763 42.0052989,37.0050492 39.251679,39.7621111 C36.2115749,42.8060154 33.7884281,48.7028116 32.4624592,52.6732691 C30.8452419,57.5158356 47.0088721,59.5388126 44.5246867,63.6811917 C43.1386839,65.9923513 37.7785192,65.1466282 36.0880227,63.8791519 C34.9234453,63.0059918 32.4946425,63.3331166 31.6713597,62.0997342 C29.0575851,58.1839669 29.4107339,54.0758543 28.0457962,49.9707786 C27.1076833,47.1493864 21.732611,47.8501656 20.2022714,49.3776393 C19.6790362,49.8998948 19.8723378,51.1703278 19.8723378,51.8829111 C19.8723378,57.1682405 26.9914913,55.1986414 26.9914913,58.3421973 C26.9914913,72.9792302 30.9191897,64.8771867 38.1313873,69.6793121 C48.1678018,76.3618966 45.9763926,76.981595 53.0777543,84.0829567 C56.7511941,87.7563965 60.8192437,87.7689005 62.503478,93.3767069 C64.1046972,98.7081071 53.1759798,98.7157031 50.786754,100.825053 C49.663965,101.816317 47.9736094,104.970571 46.5680513,105.439676 C44.7757187,106.037867 43.334221,105.93607 41.6242359,107.219093 C39.1967302,109.040481 37.7241465,112.151588 37.6034934,112.030935 C35.4555278,109.88297 34.0848666,96.5511248 33.7147244,93.7726273 C33.1258872,89.3524817 28.1241923,88.2337027 26.7275443,84.7420826 C25.1572737,80.8164061 28.2518481,75.223612 25.599097,70.9819941 C19.0797019,60.557804 13.7775712,56.4811506 10.2493953,44.6896152 C9.3074899,41.5416683 13.5912267,38.1609942 15.1264825,35.8570308 C17.0029359,33.0410312 17.7876232,30.0028946 19.8723378,27.2224065 C22.146793,24.1888519 40.8551166,9.46076832 43.8574051,8.63490613 L44.4668556,7.01044608 Z\"></path>\n <path d=\"M64,126 C98.2416545,126 126,98.2416545 126,64 C126,29.7583455 98.2416545,2 64,2 C29.7583455,2 2,29.7583455 2,64 C2,98.2416545 29.7583455,126 64,126 Z M64,120 C94.927946,120 120,94.927946 120,64 C120,33.072054 94.927946,8 64,8 C33.072054,8 8,33.072054 8,64 C8,94.927946 33.072054,120 64,120 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/home-button": {
"title": "$:/core/images/home-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-home-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M112.9847,119.501583 C112.99485,119.336814 113,119.170705 113,119.003406 L113,67.56802 C116.137461,70.5156358 121.076014,70.4518569 124.133985,67.3938855 C127.25818,64.2696912 127.260618,59.2068102 124.131541,56.0777326 L70.3963143,2.34250601 C68.8331348,0.779326498 66.7828947,-0.000743167069 64.7337457,1.61675364e-05 C62.691312,-0.00409949529 60.6426632,0.777559815 59.077717,2.34250601 L33,28.420223 L33,28.420223 L33,8.00697327 C33,3.58484404 29.4092877,0 25,0 C20.581722,0 17,3.59075293 17,8.00697327 L17,44.420223 L5.3424904,56.0777326 C2.21694607,59.2032769 2.22220878,64.2760483 5.34004601,67.3938855 C8.46424034,70.5180798 13.5271213,70.5205187 16.6561989,67.3914411 L17,67.04764 L17,119.993027 C17,119.994189 17.0000002,119.995351 17.0000007,119.996514 C17.0000002,119.997675 17,119.998838 17,120 C17,124.418278 20.5881049,128 24.9992458,128 L105.000754,128 C109.418616,128 113,124.409288 113,120 C113,119.832611 112.99485,119.666422 112.9847,119.501583 Z M97,112 L97,51.5736087 L97,51.5736087 L64.7370156,19.3106244 L33,51.04764 L33,112 L97,112 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/import-button": {
"title": "$:/core/images/import-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-import-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M105.449437,94.2138951 C105.449437,94.2138951 110.049457,94.1897106 110.049457,99.4026111 C110.049457,104.615512 105.163246,104.615511 105.163246,104.615511 L45.0075072,105.157833 C45.0075072,105.157833 0.367531803,106.289842 0.367532368,66.6449212 C0.367532934,27.0000003 45.0428249,27.0000003 45.0428249,27.0000003 L105.532495,27.0000003 C105.532495,27.0000003 138.996741,25.6734987 138.996741,55.1771866 C138.996741,84.6808745 105.727102,82.8457535 105.727102,82.8457535 L56.1735087,82.8457535 C56.1735087,82.8457535 22.6899229,85.1500223 22.6899229,66.0913753 C22.6899229,47.0327282 56.1735087,49.3383013 56.1735087,49.3383013 L105.727102,49.3383013 C105.727102,49.3383013 111.245209,49.3383024 111.245209,54.8231115 C111.245209,60.3079206 105.727102,60.5074524 105.727102,60.5074524 L56.1735087,60.5074524 C56.1735087,60.5074524 37.48913,60.5074528 37.48913,66.6449195 C37.48913,72.7823862 56.1735087,71.6766023 56.1735087,71.6766023 L105.727102,71.6766029 C105.727102,71.6766029 127.835546,73.1411469 127.835546,55.1771866 C127.835546,35.5304025 105.727102,38.3035317 105.727102,38.3035317 L45.0428249,38.3035317 C45.0428249,38.3035317 11.5287276,38.3035313 11.5287276,66.6449208 C11.5287276,94.9863103 45.0428244,93.9579678 45.0428244,93.9579678 L105.449437,94.2138951 Z\" transform=\"translate(69.367532, 66.000000) rotate(-45.000000) translate(-69.367532, -66.000000) \"></path>\n </g>\n</svg>"
},
"$:/core/images/info-button": {
"title": "$:/core/images/info-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-info-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <g transform=\"translate(0.049406, 0.000000)\">\n <path d=\"M64,128 C99.346224,128 128,99.346224 128,64 C128,28.653776 99.346224,0 64,0 C28.653776,0 0,28.653776 0,64 C0,99.346224 28.653776,128 64,128 Z M64,112 C90.509668,112 112,90.509668 112,64 C112,37.490332 90.509668,16 64,16 C37.490332,16 16,37.490332 16,64 C16,90.509668 37.490332,112 64,112 Z\"></path>\n <circle cx=\"64\" cy=\"32\" r=\"8\"></circle>\n <rect x=\"56\" y=\"48\" width=\"16\" height=\"56\" rx=\"8\"></rect>\n </g>\n </g>\n </g>\n</svg>\n"
},
"$:/core/images/locked-padlock": {
"title": "$:/core/images/locked-padlock",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-locked-padlock tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M96.4723753,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L32.0000269,64 C32.0028554,48.2766389 32.3030338,16.2688026 64.1594984,16.2688041 C95.9543927,16.2688056 96.4648869,48.325931 96.4723753,64 Z M80.5749059,64 L48.4413579,64 C48.4426205,47.71306 48.5829272,31.9999996 64.1595001,31.9999996 C79.8437473,31.9999996 81.1369461,48.1359182 80.5749059,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/menu-button": {
"title": "$:/core/images/menu-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-menu-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <rect x=\"0\" y=\"16\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n <rect x=\"0\" y=\"56\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n <rect x=\"0\" y=\"96\" width=\"128\" height=\"16\" rx=\"8\"></rect>\n</svg>\n"
},
"$:/core/images/new-button": {
"title": "$:/core/images/new-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-new-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M56,72 L8.00697327,72 C3.59075293,72 0,68.418278 0,64 C0,59.5907123 3.58484404,56 8.00697327,56 L56,56 L56,8.00697327 C56,3.59075293 59.581722,0 64,0 C68.4092877,0 72,3.58484404 72,8.00697327 L72,56 L119.993027,56 C124.409247,56 128,59.581722 128,64 C128,68.4092877 124.415156,72 119.993027,72 L72,72 L72,119.993027 C72,124.409247 68.418278,128 64,128 C59.5907123,128 56,124.415156 56,119.993027 L56,72 L56,72 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/new-here-button": {
"title": "$:/core/images/new-here-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-new-here-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n \t<g transform=\"translate(52.233611, 64.389922) rotate(75.000000) translate(-52.233611, -64.389922) translate(-7.734417, 3.702450)\">\n\t <path d=\"M18.9270186,45.959338 L18.9080585,49.6521741 C18.8884833,53.4648378 21.0574548,58.7482162 23.7526408,61.4434022 L78.5671839,116.257945 C81.2617332,118.952495 85.6348701,118.950391 88.3334363,116.251825 L115.863237,88.7220241 C118.555265,86.0299959 118.564544,81.6509578 115.869358,78.9557717 L61.0548144,24.1412286 C58.3602652,21.4466794 53.0787224,19.2788426 49.2595808,19.3006519 L25.9781737,19.4336012 C22.1633003,19.4553862 19.0471195,22.5673232 19.0275223,26.3842526 L18.9871663,34.2443819 C19.0818862,34.255617 19.1779758,34.2665345 19.2754441,34.2771502 C22.6891275,34.6489512 27.0485594,34.2348566 31.513244,33.2285542 C31.7789418,32.8671684 32.075337,32.5211298 32.4024112,32.1940556 C34.8567584,29.7397084 38.3789778,29.0128681 41.4406288,30.0213822 C41.5958829,29.9543375 41.7503946,29.8866669 41.9041198,29.8183808 L42.1110981,30.2733467 C43.1114373,30.6972371 44.0473796,31.3160521 44.8614145,32.1300869 C48.2842088,35.5528813 48.2555691,41.130967 44.7974459,44.5890903 C41.4339531,47.952583 36.0649346,48.0717177 32.6241879,44.9262969 C27.8170558,45.8919233 23.0726921,46.2881596 18.9270186,45.959338 Z\"></path>\n\t <path d=\"M45.4903462,38.8768094 C36.7300141,42.6833154 26.099618,44.7997354 18.1909048,43.9383587 C7.2512621,42.7468685 1.50150083,35.8404432 4.66865776,24.7010202 C7.51507386,14.6896965 15.4908218,6.92103848 24.3842626,4.38423012 C34.1310219,1.60401701 42.4070208,6.15882777 42.4070209,16.3101169 L34.5379395,16.310117 C34.5379394,11.9285862 31.728784,10.3825286 26.5666962,11.8549876 C20.2597508,13.6540114 14.3453742,19.4148216 12.2444303,26.8041943 C10.4963869,32.9523565 12.6250796,35.5092726 19.0530263,36.2093718 C25.5557042,36.9176104 35.0513021,34.9907189 42.7038419,31.5913902 L42.7421786,31.6756595 C44.3874154,31.5384763 47.8846101,37.3706354 45.9274416,38.6772897 L45.9302799,38.6835285 C45.9166992,38.6895612 45.9031139,38.6955897 45.8895238,38.7016142 C45.8389288,38.7327898 45.7849056,38.7611034 45.7273406,38.7863919 C45.6506459,38.8200841 45.571574,38.8501593 45.4903462,38.8768094 Z\"></path>\n </g>\n <rect x=\"96\" y=\"80\" width=\"16\" height=\"48\" rx=\"8\"></rect>\n <rect x=\"80\" y=\"96\" width=\"48\" height=\"16\" rx=\"8\"></rect>\n </g>\n </g>\n</svg>\n"
},
"$:/core/images/new-journal-button": {
"title": "$:/core/images/new-journal-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-new-journal-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M102.545455,112.818182 L102.545455,124.636364 L102.545455,124.636364 L102.545455,124.636364 C102.545455,125.941761 103.630828,127 104.969697,127 L111.030303,127 C112.369172,127 113.454545,125.941761 113.454545,124.636364 L113.454545,112.818182 L125.575758,112.818182 C126.914626,112.818182 128,111.759982 128,110.454545 L128,104.545455 C128,103.240018 126.914626,102.181818 125.575758,102.181818 L113.454545,102.181818 L113.454545,90.3636364 C113.454545,89.0582 112.369172,88 111.030303,88 L104.969697,88 L104.969697,88 C103.630828,88 102.545455,89.0582 102.545455,90.3636364 L102.545455,102.181818 L90.4242424,102.181818 L90.4242424,102.181818 C89.0853705,102.181818 88,103.240018 88,104.545455 L88,110.454545 L88,110.454545 L88,110.454545 C88,111.759982 89.0853705,112.818182 90.4242424,112.818182 L102.545455,112.818182 Z\"></path>\n <g transform=\"translate(59.816987, 64.316987) rotate(30.000000) translate(-59.816987, -64.316987) translate(20.316987, 12.816987)\">\n <g transform=\"translate(0.000000, 0.000000)\">\n <path d=\"M9.99631148,0 C4.4755011,0 -2.27373675e-13,4.48070044 -2.27373675e-13,9.99759461 L-2.27373675e-13,91.6128884 C-2.27373675e-13,97.1344074 4.46966773,101.610483 9.99631148,101.610483 L68.9318917,101.610483 C74.4527021,101.610483 78.9282032,97.1297826 78.9282032,91.6128884 L78.9282032,9.99759461 C78.9282032,4.47607557 74.4585355,0 68.9318917,0 L9.99631148,0 Z M20.8885263,26 C24.2022348,26 26.8885263,23.3137085 26.8885263,20 C26.8885263,16.6862915 24.2022348,14 20.8885263,14 C17.5748178,14 14.8885263,16.6862915 14.8885263,20 C14.8885263,23.3137085 17.5748178,26 20.8885263,26 Z M57.3033321,25.6783342 C60.6170406,25.6783342 63.3033321,22.9920427 63.3033321,19.6783342 C63.3033321,16.3646258 60.6170406,13.6783342 57.3033321,13.6783342 C53.9896236,13.6783342 51.3033321,16.3646258 51.3033321,19.6783342 C51.3033321,22.9920427 53.9896236,25.6783342 57.3033321,25.6783342 Z\"></path>\n <text font-family=\"Helvetica\" font-size=\"47.1724138\" font-weight=\"bold\" fill=\"#FFFFFF\">\n <tspan x=\"42\" y=\"77.4847912\" text-anchor=\"middle\"><<now \"DD\">></tspan>\n </text>\n </g>\n </g>\n </g>\n</svg>\n"
},
"$:/core/images/options-button": {
"title": "$:/core/images/options-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-options-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M110.48779,76.0002544 C109.354214,80.4045063 107.611262,84.5641217 105.354171,88.3838625 L105.354171,88.3838625 L112.07833,95.1080219 C115.20107,98.2307613 115.210098,103.299824 112.089164,106.420759 L106.420504,112.089418 C103.301049,115.208874 98.2346851,115.205502 95.1077675,112.078585 L88.3836082,105.354425 C84.5638673,107.611516 80.4042519,109.354468 76,110.488045 L76,110.488045 L76,119.993281 C76,124.409501 72.4220153,128.000254 68.0083475,128.000254 L59.9916525,128.000254 C55.5800761,128.000254 52,124.41541 52,119.993281 L52,110.488045 C47.5957481,109.354468 43.4361327,107.611516 39.6163918,105.354425 L32.8922325,112.078585 C29.7694931,115.201324 24.7004301,115.210353 21.5794957,112.089418 L15.9108363,106.420759 C12.7913807,103.301303 12.7947522,98.2349395 15.9216697,95.1080219 L22.6458291,88.3838625 C20.3887383,84.5641217 18.6457859,80.4045063 17.5122098,76.0002544 L8.00697327,76.0002544 C3.59075293,76.0002544 2.19088375e-16,72.4222697 4.89347582e-16,68.0086019 L9.80228577e-16,59.9919069 C1.25035972e-15,55.5803305 3.58484404,52.0002544 8.00697327,52.0002544 L17.5122098,52.0002544 C18.6457859,47.5960025 20.3887383,43.4363871 22.6458291,39.6166462 L15.9216697,32.8924868 C12.7989304,29.7697475 12.7899019,24.7006845 15.9108363,21.5797501 L21.5794957,15.9110907 C24.6989513,12.7916351 29.7653149,12.7950065 32.8922325,15.9219241 L39.6163918,22.6460835 C43.4361327,20.3889927 47.5957481,18.6460403 52,17.5124642 L52,8.00722764 C52,3.5910073 55.5779847,0.000254375069 59.9916525,0.000254375069 L68.0083475,0.000254375069 C72.4199239,0.000254375069 76,3.58509841 76,8.00722764 L76,17.5124642 C80.4042519,18.6460403 84.5638673,20.3889927 88.3836082,22.6460835 L95.1077675,15.9219241 C98.2305069,12.7991848 103.29957,12.7901562 106.420504,15.9110907 L112.089164,21.5797501 C115.208619,24.6992057 115.205248,29.7655693 112.07833,32.8924868 L105.354171,39.6166462 L105.354171,39.6166462 C107.611262,43.4363871 109.354214,47.5960025 110.48779,52.0002544 L119.993027,52.0002544 C124.409247,52.0002544 128,55.5782391 128,59.9919069 L128,68.0086019 C128,72.4201783 124.415156,76.0002544 119.993027,76.0002544 L110.48779,76.0002544 L110.48779,76.0002544 Z M64,96.0002544 C81.673112,96.0002544 96,81.6733664 96,64.0002544 C96,46.3271424 81.673112,32.0002544 64,32.0002544 C46.326888,32.0002544 32,46.3271424 32,64.0002544 C32,81.6733664 46.326888,96.0002544 64,96.0002544 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/permalink-button": {
"title": "$:/core/images/permalink-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-permalink-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M80.4834582,48 L73.0956761,80 L73.0956761,80 L47.5165418,80 L54.9043239,48 L80.4834582,48 Z M84.1773493,32 L89.8007299,7.64246248 C90.7941633,3.33942958 95.0918297,0.64641956 99.3968675,1.64031585 C103.693145,2.63218977 106.385414,6.93288901 105.390651,11.2416793 L100.598215,32 L104.000754,32 C108.411895,32 112,35.581722 112,40 C112,44.4092877 108.418616,48 104.000754,48 L96.9043239,48 L89.5165418,80 L104.000754,80 C108.411895,80 112,83.581722 112,88 C112,92.4092877 108.418616,96 104.000754,96 L85.8226507,96 L80.1992701,120.357538 C79.2058367,124.66057 74.9081703,127.35358 70.6031325,126.359684 C66.3068546,125.36781 63.6145865,121.067111 64.6093491,116.758321 L69.401785,96 L43.8226507,96 L38.1992701,120.357538 C37.2058367,124.66057 32.9081703,127.35358 28.6031325,126.359684 C24.3068546,125.36781 21.6145865,121.067111 22.6093491,116.758321 L27.401785,96 L23.9992458,96 C19.5881049,96 16,92.418278 16,88 C16,83.5907123 19.5813843,80 23.9992458,80 L31.0956761,80 L38.4834582,48 L23.9992458,48 C19.5881049,48 16,44.418278 16,40 C16,35.5907123 19.5813843,32 23.9992458,32 L42.1773493,32 L47.8007299,7.64246248 C48.7941633,3.33942958 53.0918297,0.64641956 57.3968675,1.64031585 C61.6931454,2.63218977 64.3854135,6.93288901 63.3906509,11.2416793 L58.598215,32 L84.1773493,32 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/permaview-button": {
"title": "$:/core/images/permaview-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-permaview-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M81.4834582,48 L79.6365127,56 L79.6365127,56 L74.0573784,56 L75.9043239,48 L81.4834582,48 Z M85.1773493,32 L90.8007299,7.64246248 C91.7941633,3.33942958 96.0918297,0.64641956 100.396867,1.64031585 C104.693145,2.63218977 107.385414,6.93288901 106.390651,11.2416793 L101.598215,32 L104.000754,32 C108.411895,32 112,35.581722 112,40 C112,44.4092877 108.418616,48 104.000754,48 L97.9043239,48 L96.0573784,56 L104.000754,56 C108.411895,56 112,59.581722 112,64 C112,68.4092877 108.418616,72 104.000754,72 L92.3634873,72 L90.5165418,80 L104.000754,80 C108.411895,80 112,83.581722 112,88 C112,92.4092877 108.418616,96 104.000754,96 L86.8226507,96 L81.1992701,120.357538 C80.2058367,124.66057 75.9081703,127.35358 71.6031325,126.359684 C67.3068546,125.36781 64.6145865,121.067111 65.6093491,116.758321 L70.401785,96 L64.8226507,96 L59.1992701,120.357538 C58.2058367,124.66057 53.9081703,127.35358 49.6031325,126.359684 C45.3068546,125.36781 42.6145865,121.067111 43.6093491,116.758321 L48.401785,96 L42.8226507,96 L37.1992701,120.357538 C36.2058367,124.66057 31.9081703,127.35358 27.6031325,126.359684 C23.3068546,125.36781 20.6145865,121.067111 21.6093491,116.758321 L26.401785,96 L23.9992458,96 C19.5881049,96 16,92.418278 16,88 C16,83.5907123 19.5813843,80 23.9992458,80 L30.0956761,80 L31.9426216,72 L23.9992458,72 C19.5881049,72 16,68.418278 16,64 C16,59.5907123 19.5813843,56 23.9992458,56 L35.6365127,56 L37.4834582,48 L23.9992458,48 C19.5881049,48 16,44.418278 16,40 C16,35.5907123 19.5813843,32 23.9992458,32 L41.1773493,32 L46.8007299,7.64246248 C47.7941633,3.33942958 52.0918297,0.64641956 56.3968675,1.64031585 C60.6931454,2.63218977 63.3854135,6.93288901 62.3906509,11.2416793 L57.598215,32 L63.1773493,32 L68.8007299,7.64246248 C69.7941633,3.33942958 74.0918297,0.64641956 78.3968675,1.64031585 C82.6931454,2.63218977 85.3854135,6.93288901 84.3906509,11.2416793 L79.598215,32 L85.1773493,32 Z M53.9043239,48 L52.0573784,56 L57.6365127,56 L59.4834582,48 L53.9043239,48 Z M75.9426216,72 L74.0956761,80 L74.0956761,80 L68.5165418,80 L70.3634873,72 L75.9426216,72 L75.9426216,72 Z M48.3634873,72 L46.5165418,80 L52.0956761,80 L53.9426216,72 L48.3634873,72 L48.3634873,72 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/plugin-generic-language": {
"title": "$:/core/images/plugin-generic-language",
"tags": "$:/tags/Image",
"text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M61.2072232,68.1369825 C56.8829239,70.9319564 54.2082892,74.793177 54.2082892,79.0581634 C54.2082892,86.9638335 63.3980995,93.4821994 75.2498076,94.3940006 C77.412197,98.2964184 83.8475284,101.178858 91.5684735,101.403106 C86.4420125,100.27851 82.4506393,97.6624107 80.9477167,94.3948272 C92.8046245,93.4861461 102,86.9662269 102,79.0581634 C102,70.5281905 91.3014611,63.6132813 78.1041446,63.6132813 C71.5054863,63.6132813 65.5315225,65.3420086 61.2072232,68.1369825 Z M74.001066,53.9793443 C69.6767667,56.7743182 63.7028029,58.5030456 57.1041446,58.5030456 C54.4851745,58.5030456 51.9646095,58.2307276 49.6065315,57.7275105 C46.2945155,59.9778212 41.2235699,61.4171743 35.5395922,61.4171743 C35.4545771,61.4171743 35.3696991,61.4168523 35.2849622,61.4162104 C39.404008,60.5235193 42.7961717,58.6691298 44.7630507,56.286533 C37.8379411,53.5817651 33.2082892,48.669413 33.2082892,43.0581634 C33.2082892,34.5281905 43.9068281,27.6132812 57.1041446,27.6132812 C70.3014611,27.6132812 81,34.5281905 81,43.0581634 C81,47.3231498 78.3253653,51.1843704 74.001066,53.9793443 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/plugin-generic-plugin": {
"title": "$:/core/images/plugin-generic-plugin",
"tags": "$:/tags/Image",
"text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M40.3972881,76.4456988 L40.3972881,95.3404069 L54.5170166,95.3404069 L54.5170166,95.3404069 C54.5165526,95.3385183 54.516089,95.3366295 54.515626,95.3347404 C54.6093153,95.3385061 54.7034848,95.3404069 54.7980982,95.3404069 C58.6157051,95.3404069 61.710487,92.245625 61.710487,88.4280181 C61.710487,86.6197822 61.01617,84.9737128 59.8795929,83.7418666 L59.8795929,83.7418666 C59.8949905,83.7341665 59.9104102,83.7265043 59.925852,83.7188798 C58.8840576,82.5086663 58.2542926,80.9336277 58.2542926,79.2114996 C58.2542926,75.3938927 61.3490745,72.2991108 65.1666814,72.2991108 C68.9842884,72.2991108 72.0790703,75.3938927 72.0790703,79.2114996 C72.0790703,81.1954221 71.2432806,82.9841354 69.9045961,84.2447446 L69.9045961,84.2447446 C69.9333407,84.2629251 69.9619885,84.281245 69.9905383,84.2997032 L69.9905383,84.2997032 C69.1314315,85.4516923 68.6228758,86.8804654 68.6228758,88.4280181 C68.6228758,91.8584969 71.1218232,94.7053153 74.3986526,95.2474079 C74.3913315,95.2784624 74.3838688,95.3094624 74.3762652,95.3404069 L95.6963988,95.3404069 L95.6963988,75.5678578 L95.6963988,75.5678578 C95.6466539,75.5808558 95.5967614,75.5934886 95.5467242,75.6057531 C95.5504899,75.5120637 95.5523907,75.4178943 95.5523907,75.3232809 C95.5523907,71.505674 92.4576088,68.4108921 88.6400019,68.4108921 C86.831766,68.4108921 85.1856966,69.105209 83.9538504,70.2417862 L83.9538504,70.2417862 C83.9461503,70.2263886 83.938488,70.2109688 83.9308636,70.1955271 C82.7206501,71.2373215 81.1456115,71.8670865 79.4234834,71.8670865 C75.6058765,71.8670865 72.5110946,68.7723046 72.5110946,64.9546976 C72.5110946,61.1370907 75.6058765,58.0423088 79.4234834,58.0423088 C81.4074059,58.0423088 83.1961192,58.8780985 84.4567284,60.2167829 L84.4567284,60.2167829 C84.4749089,60.1880383 84.4932288,60.1593906 84.511687,60.1308407 L84.511687,60.1308407 C85.6636761,60.9899475 87.0924492,61.4985032 88.6400019,61.4985032 C92.0704807,61.4985032 94.9172991,58.9995558 95.4593917,55.7227265 C95.538755,55.7414363 95.6177614,55.761071 95.6963988,55.7816184 L95.6963988,40.0412962 L74.3762652,40.0412962 L74.3762652,40.0412962 C74.3838688,40.0103516 74.3913315,39.9793517 74.3986526,39.9482971 L74.3986526,39.9482971 C71.1218232,39.4062046 68.6228758,36.5593862 68.6228758,33.1289073 C68.6228758,31.5813547 69.1314315,30.1525815 69.9905383,29.0005925 C69.9619885,28.9821342 69.9333407,28.9638143 69.9045961,28.9456339 C71.2432806,27.6850247 72.0790703,25.8963113 72.0790703,23.9123888 C72.0790703,20.0947819 68.9842884,17 65.1666814,17 C61.3490745,17 58.2542926,20.0947819 58.2542926,23.9123888 C58.2542926,25.6345169 58.8840576,27.2095556 59.925852,28.419769 L59.925852,28.419769 C59.9104102,28.4273935 59.8949905,28.4350558 59.8795929,28.4427558 C61.01617,29.674602 61.710487,31.3206715 61.710487,33.1289073 C61.710487,36.9465143 58.6157051,40.0412962 54.7980982,40.0412962 C54.7034848,40.0412962 54.6093153,40.0393953 54.515626,40.0356296 L54.515626,40.0356296 C54.516089,40.0375187 54.5165526,40.0394075 54.5170166,40.0412962 L40.3972881,40.0412962 L40.3972881,52.887664 L40.3972881,52.887664 C40.4916889,53.3430132 40.5412962,53.8147625 40.5412962,54.2980982 C40.5412962,58.1157051 37.4465143,61.210487 33.6289073,61.210487 C32.0813547,61.210487 30.6525815,60.7019313 29.5005925,59.8428245 C29.4821342,59.8713744 29.4638143,59.9000221 29.4456339,59.9287667 C28.1850247,58.5900823 26.3963113,57.7542926 24.4123888,57.7542926 C20.5947819,57.7542926 17.5,60.8490745 17.5,64.6666814 C17.5,68.4842884 20.5947819,71.5790703 24.4123888,71.5790703 C26.134517,71.5790703 27.7095556,70.9493053 28.919769,69.9075109 L28.919769,69.9075109 C28.9273935,69.9229526 28.9350558,69.9383724 28.9427558,69.95377 C30.174602,68.8171928 31.8206715,68.1228758 33.6289073,68.1228758 C37.4465143,68.1228758 40.5412962,71.2176578 40.5412962,75.0352647 C40.5412962,75.5186004 40.4916889,75.9903496 40.3972881,76.4456988 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/plugin-generic-theme": {
"title": "$:/core/images/plugin-generic-theme",
"tags": "$:/tags/Image",
"text": "<svg width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M27.6619958,98.5383065 C27.5690581,98.5388896 27.4761291,98.539182 27.383212,98.539182 C41.5122315,92.2342259 36.7359182,71.4340774 52.2062903,71.4340772 C52.3396942,72.0325374 52.4778143,72.6764878 52.6543744,73.3309353 C41.7206358,71.5725612 42.70852,93.6013809 27.6619958,98.5383065 Z M27.962646,98.5354078 C44.3675979,98.3221342 60.9448114,89.104528 60.944811,79.6231217 C57.0326028,79.6231217 55.0057081,78.1546059 53.8483468,76.2715831 C46.8437297,73.3160546 41.0335584,95.5643154 27.9626323,98.5354081 Z M60.4476718,66.8723739 C57.4632888,63.6421817 54.9582687,60.7541572 53.4305549,58.7453802 C47.3662923,50.7715364 44.307483,54.9700909 40.8462757,58.7453801 C37.3850684,62.5206692 41.7580858,65.5796149 38.4732643,68.2464352 C35.1884428,70.9132556 35.391237,71.8376623 29.8473278,66.9588778 C24.3034186,62.0800933 23.919977,60.7368279 26.4649349,57.9530299 C29.0098928,55.1692318 31.1369568,59.5524845 36.3357237,54.6053302 C41.5344905,49.6581758 37.1673192,45.2736183 37.1673192,45.2736183 C37.1673192,45.2736183 47.9916921,23.1463023 62.4556497,24.7805686 C76.9196074,26.4148348 56.9839048,22.6644011 52.0250205,40.0179431 C49.9018746,47.4478606 52.4201529,45.6971267 56.4460414,48.8353078 C57.8695188,49.9449088 63.120208,53.6842856 69.3136884,58.3372485 C77.8095419,50.1273311 87.3705002,40.8200581 90.1462007,38.0443577 C94.9225135,33.268045 99.6988262,38.0443577 94.9225134,42.8206705 C92.2168565,45.5263274 83.0052228,54.3768782 74.6585455,62.4104777 C84.7196352,70.2010353 95.1107413,79.0341049 95.1107416,82.5307694 C95.1107421,88.9149413 92.3944614,92.7263341 86.6764506,90.6368273 C83.0906414,89.3264812 73.3126471,80.2536547 65.0234105,71.7029822 C62.8994697,73.7599251 61.2357389,75.3821997 60.3189624,76.2989761 C57.6045976,78.4574835 53.6647127,73.2589589 55.5426497,71.5226634 C56.5140946,70.6244887 58.249291,68.9770292 60.4476718,66.8723739 L60.4476718,66.8723739 Z M64,0 L118.5596,32 L118.5596,96 L64,128 L9.44039956,96 L9.44039956,32 L64,0 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/refresh-button": {
"title": "$:/core/images/refresh-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-refresh-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M106.369002,39.4325143 C116.529932,60.3119371 112.939592,86.1974934 95.5979797,103.539105 C73.7286194,125.408466 38.2713806,125.408466 16.4020203,103.539105 C-5.46734008,81.6697449 -5.46734008,46.2125061 16.4020203,24.3431458 C19.5262146,21.2189514 24.5915344,21.2189514 27.7157288,24.3431458 C30.8399231,27.4673401 30.8399231,32.5326599 27.7157288,35.6568542 C12.0947571,51.2778259 12.0947571,76.6044251 27.7157288,92.2253967 C43.3367004,107.846368 68.6632996,107.846368 84.2842712,92.2253967 C97.71993,78.7897379 99.5995262,58.1740623 89.9230597,42.729491 L83.4844861,54.9932839 C81.4307001,58.9052072 76.5945372,60.4115251 72.682614,58.3577391 C68.7706907,56.3039532 67.2643728,51.4677903 69.3181587,47.555867 L84.4354914,18.7613158 C86.4966389,14.8353707 91.3577499,13.3347805 95.273202,15.415792 L124.145886,30.7612457 C128.047354,32.8348248 129.52915,37.6785572 127.455571,41.5800249 C125.381992,45.4814927 120.53826,46.9632892 116.636792,44.8897102 L106.369002,39.4325143 Z M98.1470904,27.0648707 C97.9798954,26.8741582 97.811187,26.6843098 97.6409651,26.4953413 L98.6018187,26.1987327 L98.1470904,27.0648707 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/right-arrow": {
"title": "$:/core/images/right-arrow",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-right-arrow tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <path d=\"M80.3563798,109.353315 C78.9238993,110.786918 76.9450203,111.675144 74.7592239,111.675144 L-4.40893546,111.675144 C-8.77412698,111.675144 -12.3248558,108.130732 -12.3248558,103.758478 C-12.3248558,99.3951199 -8.78077754,95.8418109 -4.40893546,95.8418109 L66.8418109,95.8418109 L66.8418109,24.5910645 C66.8418109,20.225873 70.3862233,16.6751442 74.7584775,16.6751442 C79.1218352,16.6751442 82.6751442,20.2192225 82.6751442,24.5910645 L82.6751442,103.759224 C82.6751442,105.941695 81.7891419,107.920575 80.3566508,109.353886 Z\" transform=\"translate(35.175144, 64.175144) rotate(-45.000000) translate(-35.175144, -64.175144) \"></path>\n</svg>"
},
"$:/core/images/save-button": {
"title": "$:/core/images/save-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-save-button tc-image-button\" viewBox=\"0 0 128 128\" width=\"22pt\" height=\"22pt\">\n <g fill-rule=\"evenodd\">\n <path d=\"M120.78304,34.329058 C125.424287,43.1924006 128.049406,53.2778608 128.049406,63.9764502 C128.049406,99.3226742 99.3956295,127.97645 64.0494055,127.97645 C28.7031816,127.97645 0.0494055385,99.3226742 0.0494055385,63.9764502 C0.0494055385,28.6302262 28.7031816,-0.0235498012 64.0494055,-0.0235498012 C82.8568763,-0.0235498012 99.769563,8.08898558 111.479045,21.0056358 L114.159581,18.3250998 C117.289194,15.1954866 122.356036,15.1939641 125.480231,18.3181584 C128.598068,21.4359957 128.601317,26.5107804 125.473289,29.6388083 L120.78304,34.329058 Z M108.72451,46.3875877 C110.870571,51.8341374 112.049406,57.767628 112.049406,63.9764502 C112.049406,90.4861182 90.5590735,111.97645 64.0494055,111.97645 C37.5397375,111.97645 16.0494055,90.4861182 16.0494055,63.9764502 C16.0494055,37.4667822 37.5397375,15.9764502 64.0494055,15.9764502 C78.438886,15.9764502 91.3495036,22.308215 100.147097,32.3375836 L58.9411255,73.5435552 L41.975581,56.5780107 C38.8486152,53.4510448 33.7746915,53.4551552 30.6568542,56.5729924 C27.5326599,59.6971868 27.5372202,64.7670668 30.6618725,67.8917192 L53.279253,90.5090997 C54.8435723,92.073419 56.8951519,92.8541315 58.9380216,92.8558261 C60.987971,92.8559239 63.0389578,92.0731398 64.6049211,90.5071765 L108.72451,46.3875877 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/star-filled": {
"title": "$:/core/images/star-filled",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-star-filled tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"nonzero\">\n <path d=\"M61.8361286,96.8228569 L99.1627704,124.110219 C101.883827,126.099427 105.541968,123.420868 104.505636,120.198072 L90.2895569,75.9887263 L89.0292911,79.8977279 L126.314504,52.5528988 C129.032541,50.5595011 127.635256,46.2255025 124.273711,46.2229134 L78.1610486,46.1873965 L81.4604673,48.6032923 L67.1773543,4.41589688 C66.1361365,1.19470104 61.6144265,1.19470104 60.5732087,4.41589688 L46.2900957,48.6032923 L49.5895144,46.1873965 L3.47685231,46.2229134 C0.115307373,46.2255025 -1.28197785,50.5595011 1.43605908,52.5528988 L38.7212719,79.8977279 L37.4610061,75.9887263 L23.2449266,120.198072 C22.2085954,123.420868 25.8667356,126.099427 28.5877926,124.110219 L65.9144344,96.8228569 L61.8361286,96.8228569 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/storyview-classic": {
"title": "$:/core/images/storyview-classic",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-storyview-classic tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 129 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.5776607 16,23.9924054 L16,40.0075946 C16,44.4216782 19.5881049,48 23.9992458,48 L104.000754,48 C108.418616,48 112,44.4223393 112,40.0075946 L112,23.9924054 C112,19.5783218 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z M23.9992458,64 C19.5813843,64 16,67.5907123 16,72 C16,76.418278 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.4092877 112,72 C112,67.581722 108.411895,64 104.000754,64 L23.9992458,64 L23.9992458,64 Z M23.9992458,96 C19.5813843,96 16,99.5907123 16,104 C16,108.418278 19.5881049,112 23.9992458,112 L104.000754,112 C108.418616,112 112,108.409288 112,104 C112,99.581722 108.411895,96 104.000754,96 L23.9992458,96 L23.9992458,96 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/storyview-pop": {
"title": "$:/core/images/storyview-pop",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-storyview-pop tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.5776607 16,23.9924054 L16,40.0075946 C16,44.4216782 19.5881049,48 23.9992458,48 L104.000754,48 C108.418616,48 112,44.4223393 112,40.0075946 L112,23.9924054 C112,19.5783218 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z M16.0098166,56 C11.586117,56 8,59.5776607 8,63.9924054 L8,80.0075946 C8,84.4216782 11.5838751,88 16.0098166,88 L111.990183,88 C116.413883,88 120,84.4223393 120,80.0075946 L120,63.9924054 C120,59.5783218 116.416125,56 111.990183,56 L16.0098166,56 L16.0098166,56 Z M23.9992458,96 C19.5813843,96 16,99.5907123 16,104 C16,108.418278 19.5881049,112 23.9992458,112 L104.000754,112 C108.418616,112 112,108.409288 112,104 C112,99.581722 108.411895,96 104.000754,96 L23.9992458,96 L23.9992458,96 Z M23.9992458,64 C19.5813843,64 16,67.5907123 16,72 C16,76.418278 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.4092877 112,72 C112,67.581722 108.411895,64 104.000754,64 L23.9992458,64 L23.9992458,64 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/storyview-zoomin": {
"title": "$:/core/images/storyview-zoomin",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-storyview-zoomin tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M8.00697327,0 C3.58484404,0 0,3.59075293 0,8.00697327 L0,119.993027 C0,124.415156 3.59075293,128 8.00697327,128 L119.993027,128 C124.415156,128 128,124.409247 128,119.993027 L128,8.00697327 C128,3.58484404 124.409247,0 119.993027,0 L8.00697327,0 L8.00697327,0 Z M23.9992458,16 C19.5813843,16 16,19.578055 16,24.0085154 L16,71.9914846 C16,76.4144655 19.5881049,80 23.9992458,80 L104.000754,80 C108.418616,80 112,76.421945 112,71.9914846 L112,24.0085154 C112,19.5855345 108.411895,16 104.000754,16 L23.9992458,16 L23.9992458,16 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/tag-button": {
"title": "$:/core/images/tag-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-tag-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M18.1643182,47.6600756 L18.1677196,51.7651887 C18.1708869,55.5878829 20.3581578,60.8623899 23.0531352,63.5573673 L84.9021823,125.406414 C87.5996731,128.103905 91.971139,128.096834 94.6717387,125.396234 L125.766905,94.3010679 C128.473612,91.5943612 128.472063,87.2264889 125.777085,84.5315115 L63.9280381,22.6824644 C61.2305472,19.9849735 55.9517395,17.801995 52.1318769,17.8010313 L25.0560441,17.7942007 C21.2311475,17.7932358 18.1421354,20.8872832 18.1452985,24.7049463 L18.1535504,34.6641936 C18.2481119,34.6754562 18.3439134,34.6864294 18.4409623,34.6971263 C22.1702157,35.1081705 26.9295004,34.6530132 31.806204,33.5444844 C32.1342781,33.0700515 32.5094815,32.6184036 32.9318197,32.1960654 C35.6385117,29.4893734 39.5490441,28.718649 42.94592,29.8824694 C43.0432142,29.8394357 43.1402334,29.7961748 43.2369683,29.7526887 L43.3646982,30.0368244 C44.566601,30.5115916 45.6933052,31.2351533 46.6655958,32.2074439 C50.4612154,36.0030635 50.4663097,42.1518845 46.6769742,45.94122 C43.0594074,49.5587868 37.2914155,49.7181264 33.4734256,46.422636 C28.1082519,47.5454734 22.7987486,48.0186448 18.1643182,47.6600756 Z\"></path>\n <path d=\"M47.6333528,39.5324628 L47.6562932,39.5834939 C37.9670934,43.9391617 26.0718874,46.3819521 17.260095,45.4107025 C5.27267473,44.0894301 -1.02778744,36.4307276 2.44271359,24.0779512 C5.56175386,12.9761516 14.3014034,4.36129832 24.0466405,1.54817001 C34.7269254,-1.53487574 43.7955833,3.51606438 43.7955834,14.7730751 L35.1728168,14.7730752 C35.1728167,9.91428944 32.0946059,8.19982862 26.4381034,9.83267419 C19.5270911,11.8276553 13.046247,18.2159574 10.7440788,26.4102121 C8.82861123,33.2280582 11.161186,36.0634845 18.2047888,36.8398415 C25.3302805,37.6252244 35.7353482,35.4884477 44.1208333,31.7188498 L44.1475077,31.7781871 C44.159701,31.7725635 44.1718402,31.7671479 44.1839238,31.7619434 C45.9448098,31.0035157 50.4503245,38.3109156 47.7081571,39.5012767 C47.6834429,39.512005 47.6585061,39.5223987 47.6333528,39.5324628 Z\"></path>\n </g>\n</svg>\n"
},
"$:/core/images/theme-button": {
"title": "$:/core/images/theme-button",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-theme-button tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 129\">\n <g fill-rule=\"evenodd\">\n <g transform=\"translate(6.762422, 19.968999)\">\n <path d=\"M0.824945506,108.186742 C0.664785639,108.187747 0.504640965,108.188251 0.344516735,108.188251 C24.6927592,97.3230528 16.4618388,61.4785938 43.121606,61.4785936 C43.3514982,62.5099075 43.5895175,63.6196137 43.8937798,64.7474092 C25.0518979,61.7172401 26.754298,99.6790423 0.824939051,108.186742 Z M1.34304326,108.181747 C29.613352,107.814217 58.1805158,91.9297101 58.1805151,75.5906019 C51.4386888,75.5906018 47.9457839,73.0599394 45.9513275,69.8149659 C33.880418,64.7217657 23.8678719,103.061726 1.34301955,108.181748 Z\"></path>\n <path d=\"M48.871084,61.6312522 C45.6348746,64.6233738 52.4243955,73.581882 57.1020034,69.8621716 C65.3329228,61.631253 108.502656,20.4006304 116.733576,12.169711 C124.964495,3.9387916 116.733576,-4.29212771 108.502656,3.9387916 C100.271737,12.1697108 57.4180113,53.7289683 48.871084,61.6312522 Z\"></path>\n </g>\n <path d=\"M62.2824054,71.6211067 C57.93733,66.8541323 54.3123948,62.6301561 51.9937779,59.5814279 C41.5433616,45.8402704 36.2721798,53.0755512 30.307554,59.5814276 C24.3429282,66.0873041 31.8788571,71.3587209 26.2181932,75.9543964 C20.5575294,80.5500719 20.9070004,82.1430826 11.3532982,73.7355757 C1.79959591,65.3280689 1.13881905,63.0132479 5.52449152,58.2159872 C9.91016399,53.4187265 13.5756887,60.9722938 22.5346144,52.4469667 C31.4935401,43.9216395 23.9676854,36.3658236 23.9676854,36.3658236 C23.9676854,36.3658236 42.6210998,-1.76571499 67.5465342,1.05058165 C92.4719685,3.8668783 58.1171911,-2.5961653 49.5716499,27.3088291 C45.9128772,40.1126497 50.2525733,37.0956468 57.1903023,42.5036084 C59.4792141,44.2878157 67.5103988,50.0176866 77.2457031,57.2905766 C71.4143155,62.9019825 66.2337717,67.8661661 62.2824054,71.6211067 Z M73.4870997,83.4678852 C87.4278174,97.7290403 103.323635,112.360587 109.285731,114.539289 C119.139459,118.140092 123.820369,111.571999 123.820368,100.570289 C123.820367,94.7414103 107.064445,80.3074425 90.2759123,67.2185217 C83.6390655,73.6178 77.7700759,79.2918373 73.4870997,83.4678852 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/unlocked-padlock": {
"title": "$:/core/images/unlocked-padlock",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-unlocked-padlock tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M48.6266053,64 L105,64 L105,96.0097716 C105,113.673909 90.6736461,128 73.001193,128 L55.998807,128 C38.3179793,128 24,113.677487 24,96.0097716 L24,64 L30.136303,64 C19.6806213,51.3490406 2.77158986,28.2115132 25.8366966,8.85759246 C50.4723026,-11.8141335 71.6711028,13.2108337 81.613302,25.0594855 C91.5555012,36.9081373 78.9368488,47.4964439 69.1559674,34.9513593 C59.375086,22.4062748 47.9893192,10.8049522 35.9485154,20.9083862 C23.9077117,31.0118202 34.192312,43.2685325 44.7624679,55.8655518 C47.229397,58.805523 48.403443,61.5979188 48.6266053,64 Z M67.7315279,92.3641717 C70.8232551,91.0923621 73,88.0503841 73,84.5 C73,79.8055796 69.1944204,76 64.5,76 C59.8055796,76 56,79.8055796 56,84.5 C56,87.947435 58.0523387,90.9155206 61.0018621,92.2491029 L55.9067479,115.020857 L72.8008958,115.020857 L67.7315279,92.3641717 L67.7315279,92.3641717 Z\"></path>\n </g>\n</svg>"
},
"$:/core/images/video": {
"title": "$:/core/images/video",
"tags": "$:/tags/Image",
"text": "<svg class=\"tc-image-video tc-image-button\" width=\"22pt\" height=\"22pt\" viewBox=\"0 0 128 128\">\n <g fill-rule=\"evenodd\">\n <path d=\"M64,12 C29.0909091,12 8.72727273,14.9166667 5.81818182,17.8333333 C2.90909091,20.75 1.93784382e-15,41.1666667 0,64.5 C1.93784382e-15,87.8333333 2.90909091,108.25 5.81818182,111.166667 C8.72727273,114.083333 29.0909091,117 64,117 C98.9090909,117 119.272727,114.083333 122.181818,111.166667 C125.090909,108.25 128,87.8333333 128,64.5 C128,41.1666667 125.090909,20.75 122.181818,17.8333333 C119.272727,14.9166667 98.9090909,12 64,12 Z M54.9161194,44.6182253 C51.102648,42.0759111 48.0112186,43.7391738 48.0112186,48.3159447 L48.0112186,79.6840553 C48.0112186,84.2685636 51.109784,85.9193316 54.9161194,83.3817747 L77.0838806,68.6032672 C80.897352,66.0609529 80.890216,61.9342897 77.0838806,59.3967328 L54.9161194,44.6182253 Z\"></path>\n </g>\n</svg>"
},
"$:/language/Buttons/AdvancedSearch/Caption": {
"title": "$:/language/Buttons/AdvancedSearch/Caption",
"text": "advanced search"
},
"$:/language/Buttons/AdvancedSearch/Hint": {
"title": "$:/language/Buttons/AdvancedSearch/Hint",
"text": "Advanced search"
},
"$:/language/Buttons/Cancel/Caption": {
"title": "$:/language/Buttons/Cancel/Caption",
"text": "cancel"
},
"$:/language/Buttons/Cancel/Hint": {
"title": "$:/language/Buttons/Cancel/Hint",
"text": "Discard changes to this tiddler"
},
"$:/language/Buttons/Clone/Caption": {
"title": "$:/language/Buttons/Clone/Caption",
"text": "clone"
},
"$:/language/Buttons/Clone/Hint": {
"title": "$:/language/Buttons/Clone/Hint",
"text": "Clone this tiddler"
},
"$:/language/Buttons/Close/Caption": {
"title": "$:/language/Buttons/Close/Caption",
"text": "close"
},
"$:/language/Buttons/Close/Hint": {
"title": "$:/language/Buttons/Close/Hint",
"text": "Close this tiddler"
},
"$:/language/Buttons/CloseAll/Caption": {
"title": "$:/language/Buttons/CloseAll/Caption",
"text": "close all"
},
"$:/language/Buttons/CloseAll/Hint": {
"title": "$:/language/Buttons/CloseAll/Hint",
"text": "Close all tiddlers"
},
"$:/language/Buttons/CloseOthers/Caption": {
"title": "$:/language/Buttons/CloseOthers/Caption",
"text": "close others"
},
"$:/language/Buttons/CloseOthers/Hint": {
"title": "$:/language/Buttons/CloseOthers/Hint",
"text": "Close other tiddlers"
},
"$:/language/Buttons/ControlPanel/Caption": {
"title": "$:/language/Buttons/ControlPanel/Caption",
"text": "control panel"
},
"$:/language/Buttons/ControlPanel/Hint": {
"title": "$:/language/Buttons/ControlPanel/Hint",
"text": "Open control panel"
},
"$:/language/Buttons/Delete/Caption": {
"title": "$:/language/Buttons/Delete/Caption",
"text": "delete"
},
"$:/language/Buttons/Delete/Hint": {
"title": "$:/language/Buttons/Delete/Hint",
"text": "Delete this tiddler"
},
"$:/language/Buttons/Edit/Caption": {
"title": "$:/language/Buttons/Edit/Caption",
"text": "edit"
},
"$:/language/Buttons/Edit/Hint": {
"title": "$:/language/Buttons/Edit/Hint",
"text": "Edit this tiddler"
},
"$:/language/Buttons/Encryption/Caption": {
"title": "$:/language/Buttons/Encryption/Caption",
"text": "encryption"
},
"$:/language/Buttons/Encryption/Hint": {
"title": "$:/language/Buttons/Encryption/Hint",
"text": "Set or clear a password for saving this wiki"
},
"$:/language/Buttons/Encryption/ClearPassword/Caption": {
"title": "$:/language/Buttons/Encryption/ClearPassword/Caption",
"text": "clear password"
},
"$:/language/Buttons/Encryption/ClearPassword/Hint": {
"title": "$:/language/Buttons/Encryption/ClearPassword/Hint",
"text": "Clear the password and save this wiki without encryption"
},
"$:/language/Buttons/Encryption/SetPassword/Caption": {
"title": "$:/language/Buttons/Encryption/SetPassword/Caption",
"text": "set password"
},
"$:/language/Buttons/Encryption/SetPassword/Hint": {
"title": "$:/language/Buttons/Encryption/SetPassword/Hint",
"text": "Set a password for saving this wiki with encryption"
},
"$:/language/Buttons/ExportPage/Caption": {
"title": "$:/language/Buttons/ExportPage/Caption",
"text": "export all"
},
"$:/language/Buttons/ExportPage/Hint": {
"title": "$:/language/Buttons/ExportPage/Hint",
"text": "Export all tiddlers"
},
"$:/language/Buttons/ExportTiddler/Caption": {
"title": "$:/language/Buttons/ExportTiddler/Caption",
"text": "export tiddler"
},
"$:/language/Buttons/ExportTiddler/Hint": {
"title": "$:/language/Buttons/ExportTiddler/Hint",
"text": "Export tiddler"
},
"$:/language/Buttons/ExportTiddlers/Caption": {
"title": "$:/language/Buttons/ExportTiddlers/Caption",
"text": "export tiddlers"
},
"$:/language/Buttons/ExportTiddlers/Hint": {
"title": "$:/language/Buttons/ExportTiddlers/Hint",
"text": "Export tiddlers"
},
"$:/language/Buttons/FullScreen/Caption": {
"title": "$:/language/Buttons/FullScreen/Caption",
"text": "full-screen"
},
"$:/language/Buttons/FullScreen/Hint": {
"title": "$:/language/Buttons/FullScreen/Hint",
"text": "Enter or leave full-screen mode"
},
"$:/language/Buttons/Import/Caption": {
"title": "$:/language/Buttons/Import/Caption",
"text": "import"
},
"$:/language/Buttons/Import/Hint": {
"title": "$:/language/Buttons/Import/Hint",
"text": "Import files"
},
"$:/language/Buttons/Info/Caption": {
"title": "$:/language/Buttons/Info/Caption",
"text": "info"
},
"$:/language/Buttons/Info/Hint": {
"title": "$:/language/Buttons/Info/Hint",
"text": "Show information for this tiddler"
},
"$:/language/Buttons/Home/Caption": {
"title": "$:/language/Buttons/Home/Caption",
"text": "home"
},
"$:/language/Buttons/Home/Hint": {
"title": "$:/language/Buttons/Home/Hint",
"text": "Open the default tiddlers"
},
"$:/language/Buttons/Language/Caption": {
"title": "$:/language/Buttons/Language/Caption",
"text": "language"
},
"$:/language/Buttons/Language/Hint": {
"title": "$:/language/Buttons/Language/Hint",
"text": "Choose the user interface language"
},
"$:/language/Buttons/More/Caption": {
"title": "$:/language/Buttons/More/Caption",
"text": "more"
},
"$:/language/Buttons/More/Hint": {
"title": "$:/language/Buttons/More/Hint",
"text": "More actions"
},
"$:/language/Buttons/NewHere/Caption": {
"title": "$:/language/Buttons/NewHere/Caption",
"text": "new here"
},
"$:/language/Buttons/NewHere/Hint": {
"title": "$:/language/Buttons/NewHere/Hint",
"text": "Create a new tiddler tagged with this one"
},
"$:/language/Buttons/NewJournal/Caption": {
"title": "$:/language/Buttons/NewJournal/Caption",
"text": "new journal"
},
"$:/language/Buttons/NewJournal/Hint": {
"title": "$:/language/Buttons/NewJournal/Hint",
"text": "Create a new journal tiddler"
},
"$:/language/Buttons/NewJournalHere/Caption": {
"title": "$:/language/Buttons/NewJournalHere/Caption",
"text": "new journal here"
},
"$:/language/Buttons/NewJournalHere/Hint": {
"title": "$:/language/Buttons/NewJournalHere/Hint",
"text": "Create a new journal tiddler tagged with this one"
},
"$:/language/Buttons/NewTiddler/Caption": {
"title": "$:/language/Buttons/NewTiddler/Caption",
"text": "new tiddler"
},
"$:/language/Buttons/NewTiddler/Hint": {
"title": "$:/language/Buttons/NewTiddler/Hint",
"text": "Create a new tiddler"
},
"$:/language/Buttons/Permalink/Caption": {
"title": "$:/language/Buttons/Permalink/Caption",
"text": "permalink"
},
"$:/language/Buttons/Permalink/Hint": {
"title": "$:/language/Buttons/Permalink/Hint",
"text": "Set browser address bar to a direct link to this tiddler"
},
"$:/language/Buttons/Permaview/Caption": {
"title": "$:/language/Buttons/Permaview/Caption",
"text": "permaview"
},
"$:/language/Buttons/Permaview/Hint": {
"title": "$:/language/Buttons/Permaview/Hint",
"text": "Set browser address bar to a direct link to all the tiddlers in this story"
},
"$:/language/Buttons/Refresh/Caption": {
"title": "$:/language/Buttons/Refresh/Caption",
"text": "refresh"
},
"$:/language/Buttons/Refresh/Hint": {
"title": "$:/language/Buttons/Refresh/Hint",
"text": "Perform a full refresh of the wiki"
},
"$:/language/Buttons/Save/Caption": {
"title": "$:/language/Buttons/Save/Caption",
"text": "ok"
},
"$:/language/Buttons/Save/Hint": {
"title": "$:/language/Buttons/Save/Hint",
"text": "Store changes to this tiddler"
},
"$:/language/Buttons/SaveWiki/Caption": {
"title": "$:/language/Buttons/SaveWiki/Caption",
"text": "save changes"
},
"$:/language/Buttons/SaveWiki/Hint": {
"title": "$:/language/Buttons/SaveWiki/Hint",
"text": "Save changes"
},
"$:/language/Buttons/StoryView/Caption": {
"title": "$:/language/Buttons/StoryView/Caption",
"text": "storyview"
},
"$:/language/Buttons/StoryView/Hint": {
"title": "$:/language/Buttons/StoryView/Hint",
"text": "Choose the story visualisation"
},
"$:/language/Buttons/HideSideBar/Caption": {
"title": "$:/language/Buttons/HideSideBar/Caption",
"text": "hide sidebar"
},
"$:/language/Buttons/HideSideBar/Hint": {
"title": "$:/language/Buttons/HideSideBar/Hint",
"text": "Hide sidebar"
},
"$:/language/Buttons/ShowSideBar/Caption": {
"title": "$:/language/Buttons/ShowSideBar/Caption",
"text": "show sidebar"
},
"$:/language/Buttons/ShowSideBar/Hint": {
"title": "$:/language/Buttons/ShowSideBar/Hint",
"text": "Show sidebar"
},
"$:/language/Buttons/TagManager/Caption": {
"title": "$:/language/Buttons/TagManager/Caption",
"text": "tag manager"
},
"$:/language/Buttons/TagManager/Hint": {
"title": "$:/language/Buttons/TagManager/Hint",
"text": "Open tag manager"
},
"$:/language/Buttons/Theme/Caption": {
"title": "$:/language/Buttons/Theme/Caption",
"text": "theme"
},
"$:/language/Buttons/Theme/Hint": {
"title": "$:/language/Buttons/Theme/Hint",
"text": "Choose the display theme"
},
"$:/language/ControlPanel/Advanced/Caption": {
"title": "$:/language/ControlPanel/Advanced/Caption",
"text": "Advanced"
},
"$:/language/ControlPanel/Advanced/Hint": {
"title": "$:/language/ControlPanel/Advanced/Hint",
"text": "Internal information about this TiddlyWiki"
},
"$:/language/ControlPanel/Appearance/Caption": {
"title": "$:/language/ControlPanel/Appearance/Caption",
"text": "Appearance"
},
"$:/language/ControlPanel/Appearance/Hint": {
"title": "$:/language/ControlPanel/Appearance/Hint",
"text": "Ways to customise the appearance of your TiddlyWiki."
},
"$:/language/ControlPanel/Basics/AnimDuration/Prompt": {
"title": "$:/language/ControlPanel/Basics/AnimDuration/Prompt",
"text": "Animation duration:"
},
"$:/language/ControlPanel/Basics/Caption": {
"title": "$:/language/ControlPanel/Basics/Caption",
"text": "Basics"
},
"$:/language/ControlPanel/Basics/DefaultTiddlers/BottomHint": {
"title": "$:/language/ControlPanel/Basics/DefaultTiddlers/BottomHint",
"text": "Use [[double square brackets]] for titles with spaces. Or you can choose to <$button set=\"$:/DefaultTiddlers\" setTo=\"[list[$:/StoryList]]\">retain story ordering</$button>"
},
"$:/language/ControlPanel/Basics/DefaultTiddlers/Prompt": {
"title": "$:/language/ControlPanel/Basics/DefaultTiddlers/Prompt",
"text": "Default tiddlers:"
},
"$:/language/ControlPanel/Basics/DefaultTiddlers/TopHint": {
"title": "$:/language/ControlPanel/Basics/DefaultTiddlers/TopHint",
"text": "Choose which tiddlers are displayed at startup:"
},
"$:/language/ControlPanel/Basics/Language/Prompt": {
"title": "$:/language/ControlPanel/Basics/Language/Prompt",
"text": "Hello! Current language:"
},
"$:/language/ControlPanel/Basics/NewJournal/Title/Prompt": {
"title": "$:/language/ControlPanel/Basics/NewJournal/Title/Prompt",
"text": "Title of new journal tiddlers"
},
"$:/language/ControlPanel/Basics/NewJournal/Tags/Prompt": {
"title": "$:/language/ControlPanel/Basics/NewJournal/Tags/Prompt",
"text": "Tags for new journal tiddlers"
},
"$:/language/ControlPanel/Basics/OverriddenShadowTiddlers/Prompt": {
"title": "$:/language/ControlPanel/Basics/OverriddenShadowTiddlers/Prompt",
"text": "Number of overridden shadow tiddlers:"
},
"$:/language/ControlPanel/Basics/ShadowTiddlers/Prompt": {
"title": "$:/language/ControlPanel/Basics/ShadowTiddlers/Prompt",
"text": "Number of shadow tiddlers:"
},
"$:/language/ControlPanel/Basics/Subtitle/Prompt": {
"title": "$:/language/ControlPanel/Basics/Subtitle/Prompt",
"text": "Subtitle:"
},
"$:/language/ControlPanel/Basics/SystemTiddlers/Prompt": {
"title": "$:/language/ControlPanel/Basics/SystemTiddlers/Prompt",
"text": "Number of system tiddlers:"
},
"$:/language/ControlPanel/Basics/Tags/Prompt": {
"title": "$:/language/ControlPanel/Basics/Tags/Prompt",
"text": "Number of tags:"
},
"$:/language/ControlPanel/Basics/Tiddlers/Prompt": {
"title": "$:/language/ControlPanel/Basics/Tiddlers/Prompt",
"text": "Number of tiddlers:"
},
"$:/language/ControlPanel/Basics/Title/Prompt": {
"title": "$:/language/ControlPanel/Basics/Title/Prompt",
"text": "Title of this ~TiddlyWiki:"
},
"$:/language/ControlPanel/Basics/Username/Prompt": {
"title": "$:/language/ControlPanel/Basics/Username/Prompt",
"text": "Username for signing edits:"
},
"$:/language/ControlPanel/Basics/Version/Prompt": {
"title": "$:/language/ControlPanel/Basics/Version/Prompt",
"text": "~TiddlyWiki version:"
},
"$:/language/ControlPanel/EditorTypes/Caption": {
"title": "$:/language/ControlPanel/EditorTypes/Caption",
"text": "Editor Types"
},
"$:/language/ControlPanel/EditorTypes/Editor/Caption": {
"title": "$:/language/ControlPanel/EditorTypes/Editor/Caption",
"text": "Editor"
},
"$:/language/ControlPanel/EditorTypes/Hint": {
"title": "$:/language/ControlPanel/EditorTypes/Hint",
"text": "These tiddlers determine which editor is used to edit specific tiddler types."
},
"$:/language/ControlPanel/EditorTypes/Type/Caption": {
"title": "$:/language/ControlPanel/EditorTypes/Type/Caption",
"text": "Type"
},
"$:/language/ControlPanel/Info/Caption": {
"title": "$:/language/ControlPanel/Info/Caption",
"text": "Info"
},
"$:/language/ControlPanel/Info/Hint": {
"title": "$:/language/ControlPanel/Info/Hint",
"text": "Information about this TiddlyWiki"
},
"$:/language/ControlPanel/LoadedModules/Caption": {
"title": "$:/language/ControlPanel/LoadedModules/Caption",
"text": "Loaded Modules"
},
"$:/language/ControlPanel/LoadedModules/Hint": {
"title": "$:/language/ControlPanel/LoadedModules/Hint",
"text": "These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process."
},
"$:/language/ControlPanel/Palette/Caption": {
"title": "$:/language/ControlPanel/Palette/Caption",
"text": "Palette"
},
"$:/language/ControlPanel/Palette/Editor/Clone/Caption": {
"title": "$:/language/ControlPanel/Palette/Editor/Clone/Caption",
"text": "clone"
},
"$:/language/ControlPanel/Palette/Editor/Clone/Prompt": {
"title": "$:/language/ControlPanel/Palette/Editor/Clone/Prompt",
"text": "It is recommended that you clone this shadow palette before editing it"
},
"$:/language/ControlPanel/Palette/Editor/Prompt/Modified": {
"title": "$:/language/ControlPanel/Palette/Editor/Prompt/Modified",
"text": "This shadow palette has been modified"
},
"$:/language/ControlPanel/Palette/Editor/Prompt": {
"title": "$:/language/ControlPanel/Palette/Editor/Prompt",
"text": "Editing"
},
"$:/language/ControlPanel/Palette/Editor/Reset/Caption": {
"title": "$:/language/ControlPanel/Palette/Editor/Reset/Caption",
"text": "reset"
},
"$:/language/ControlPanel/Palette/HideEditor/Caption": {
"title": "$:/language/ControlPanel/Palette/HideEditor/Caption",
"text": "hide editor"
},
"$:/language/ControlPanel/Palette/Prompt": {
"title": "$:/language/ControlPanel/Palette/Prompt",
"text": "Current palette:"
},
"$:/language/ControlPanel/Palette/ShowEditor/Caption": {
"title": "$:/language/ControlPanel/Palette/ShowEditor/Caption",
"text": "show editor"
},
"$:/language/ControlPanel/Plugins/Caption": {
"title": "$:/language/ControlPanel/Plugins/Caption",
"text": "Plugins"
},
"$:/language/ControlPanel/Plugins/Disable/Caption": {
"title": "$:/language/ControlPanel/Plugins/Disable/Caption",
"text": "disable"
},
"$:/language/ControlPanel/Plugins/Disable/Hint": {
"title": "$:/language/ControlPanel/Plugins/Disable/Hint",
"text": "Disable this plugin when reloading page"
},
"$:/language/ControlPanel/Plugins/Disabled/Status": {
"title": "$:/language/ControlPanel/Plugins/Disabled/Status",
"text": "(disabled)"
},
"$:/language/ControlPanel/Plugins/Empty/Hint": {
"title": "$:/language/ControlPanel/Plugins/Empty/Hint",
"text": "None"
},
"$:/language/ControlPanel/Plugins/Enable/Caption": {
"title": "$:/language/ControlPanel/Plugins/Enable/Caption",
"text": "enable"
},
"$:/language/ControlPanel/Plugins/Enable/Hint": {
"title": "$:/language/ControlPanel/Plugins/Enable/Hint",
"text": "Enable this plugin when reloading page"
},
"$:/language/ControlPanel/Plugins/Language/Prompt": {
"title": "$:/language/ControlPanel/Plugins/Language/Prompt",
"text": "Languages"
},
"$:/language/ControlPanel/Plugins/Plugin/Prompt": {
"title": "$:/language/ControlPanel/Plugins/Plugin/Prompt",
"text": "Plugins"
},
"$:/language/ControlPanel/Plugins/Theme/Prompt": {
"title": "$:/language/ControlPanel/Plugins/Theme/Prompt",
"text": "Themes"
},
"$:/language/ControlPanel/Saving/Caption": {
"title": "$:/language/ControlPanel/Saving/Caption",
"text": "Saving"
},
"$:/language/ControlPanel/Saving/Heading": {
"title": "$:/language/ControlPanel/Saving/Heading",
"text": "Saving"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Advanced/Heading": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Advanced/Heading",
"text": "Advanced Settings"
},
"$:/language/ControlPanel/Saving/TiddlySpot/BackupDir": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/BackupDir",
"text": "Backup Directory"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Backups": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Backups",
"text": "Backups"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Description": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Description",
"text": "These settings are only used when saving to http://tiddlyspot.com or a compatible remote server"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Filename": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Filename",
"text": "Upload Filename"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Heading": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Heading",
"text": "~TiddlySpot"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Hint": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Hint",
"text": "//The server URL defaults to `http://<wikiname>.tiddlyspot.com/store.cgi` and can be changed to use a custom server address//"
},
"$:/language/ControlPanel/Saving/TiddlySpot/Password": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/Password",
"text": "Password"
},
"$:/language/ControlPanel/Saving/TiddlySpot/ServerURL": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/ServerURL",
"text": "Server URL"
},
"$:/language/ControlPanel/Saving/TiddlySpot/UploadDir": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/UploadDir",
"text": "Upload Directory"
},
"$:/language/ControlPanel/Saving/TiddlySpot/UserName": {
"title": "$:/language/ControlPanel/Saving/TiddlySpot/UserName",
"text": "Wiki Name"
},
"$:/language/ControlPanel/Settings/AutoSave/Caption": {
"title": "$:/language/ControlPanel/Settings/AutoSave/Caption",
"text": "Autosave"
},
"$:/language/ControlPanel/Settings/AutoSave/Disabled/Description": {
"title": "$:/language/ControlPanel/Settings/AutoSave/Disabled/Description",
"text": "Do not save changes automatically"
},
"$:/language/ControlPanel/Settings/AutoSave/Enabled/Description": {
"title": "$:/language/ControlPanel/Settings/AutoSave/Enabled/Description",
"text": "Save changes automatically"
},
"$:/language/ControlPanel/Settings/AutoSave/Hint": {
"title": "$:/language/ControlPanel/Settings/AutoSave/Hint",
"text": "Automatically save changes during editing"
},
"$:/language/ControlPanel/Settings/Caption": {
"title": "$:/language/ControlPanel/Settings/Caption",
"text": "Settings"
},
"$:/language/ControlPanel/Settings/Hint": {
"title": "$:/language/ControlPanel/Settings/Hint",
"text": "These settings let you customise the behaviour of TiddlyWiki."
},
"$:/language/ControlPanel/Settings/NavigationAddressBar/Caption": {
"title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Caption",
"text": "Navigation Address Bar"
},
"$:/language/ControlPanel/Settings/NavigationAddressBar/Hint": {
"title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Hint",
"text": "Behaviour of the browser address bar when navigating to a tiddler:"
},
"$:/language/ControlPanel/Settings/NavigationAddressBar/No/Description": {
"title": "$:/language/ControlPanel/Settings/NavigationAddressBar/No/Description",
"text": "Do not update the address bar"
},
"$:/language/ControlPanel/Settings/NavigationAddressBar/Permalink/Description": {
"title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Permalink/Description",
"text": "Include the target tiddler"
},
"$:/language/ControlPanel/Settings/NavigationAddressBar/Permaview/Description": {
"title": "$:/language/ControlPanel/Settings/NavigationAddressBar/Permaview/Description",
"text": "Include the target tiddler and the current story sequence"
},
"$:/language/ControlPanel/Settings/NavigationHistory/Caption": {
"title": "$:/language/ControlPanel/Settings/NavigationHistory/Caption",
"text": "Navigation History"
},
"$:/language/ControlPanel/Settings/NavigationHistory/Hint": {
"title": "$:/language/ControlPanel/Settings/NavigationHistory/Hint",
"text": "Update browser history when navigating to a tiddler:"
},
"$:/language/ControlPanel/Settings/NavigationHistory/No/Description": {
"title": "$:/language/ControlPanel/Settings/NavigationHistory/No/Description",
"text": "Do not update history"
},
"$:/language/ControlPanel/Settings/NavigationHistory/Yes/Description": {
"title": "$:/language/ControlPanel/Settings/NavigationHistory/Yes/Description",
"text": "Update history"
},
"$:/language/ControlPanel/Settings/ToolbarButtons/Caption": {
"title": "$:/language/ControlPanel/Settings/ToolbarButtons/Caption",
"text": "Toolbar Buttons"
},
"$:/language/ControlPanel/Settings/ToolbarButtons/Hint": {
"title": "$:/language/ControlPanel/Settings/ToolbarButtons/Hint",
"text": "Default toolbar button appearance:"
},
"$:/language/ControlPanel/Settings/ToolbarButtons/Icons/Description": {
"title": "$:/language/ControlPanel/Settings/ToolbarButtons/Icons/Description",
"text": "Include icon"
},
"$:/language/ControlPanel/Settings/ToolbarButtons/Text/Description": {
"title": "$:/language/ControlPanel/Settings/ToolbarButtons/Text/Description",
"text": "Include text"
},
"$:/language/ControlPanel/StoryView/Caption": {
"title": "$:/language/ControlPanel/StoryView/Caption",
"text": "Story View"
},
"$:/language/ControlPanel/StoryView/Prompt": {
"title": "$:/language/ControlPanel/StoryView/Prompt",
"text": "Current view:"
},
"$:/language/ControlPanel/Theme/Caption": {
"title": "$:/language/ControlPanel/Theme/Caption",
"text": "Theme"
},
"$:/language/ControlPanel/Theme/Prompt": {
"title": "$:/language/ControlPanel/Theme/Prompt",
"text": "Current theme:"
},
"$:/language/ControlPanel/TiddlerFields/Caption": {
"title": "$:/language/ControlPanel/TiddlerFields/Caption",
"text": "Tiddler Fields"
},
"$:/language/ControlPanel/TiddlerFields/Hint": {
"title": "$:/language/ControlPanel/TiddlerFields/Hint",
"text": "This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers)."
},
"$:/language/ControlPanel/Toolbars/Caption": {
"title": "$:/language/ControlPanel/Toolbars/Caption",
"text": "Toolbars"
},
"$:/language/ControlPanel/Toolbars/EditToolbar/Caption": {
"title": "$:/language/ControlPanel/Toolbars/EditToolbar/Caption",
"text": "Edit Toolbar"
},
"$:/language/ControlPanel/Toolbars/EditToolbar/Hint": {
"title": "$:/language/ControlPanel/Toolbars/EditToolbar/Hint",
"text": "Choose which buttons are displayed for tiddlers in edit mode"
},
"$:/language/ControlPanel/Toolbars/Hint": {
"title": "$:/language/ControlPanel/Toolbars/Hint",
"text": "Select which toolbar buttons are displayed"
},
"$:/language/ControlPanel/Toolbars/PageControls/Caption": {
"title": "$:/language/ControlPanel/Toolbars/PageControls/Caption",
"text": "Page Toolbar"
},
"$:/language/ControlPanel/Toolbars/PageControls/Hint": {
"title": "$:/language/ControlPanel/Toolbars/PageControls/Hint",
"text": "Choose which buttons are displayed on the main page toolbar "
},
"$:/language/ControlPanel/Toolbars/ViewToolbar/Caption": {
"title": "$:/language/ControlPanel/Toolbars/ViewToolbar/Caption",
"text": "View Toolbar"
},
"$:/language/ControlPanel/Toolbars/ViewToolbar/Hint": {
"title": "$:/language/ControlPanel/Toolbars/ViewToolbar/Hint",
"text": "Choose which buttons are displayed for tiddlers in view mode"
},
"$:/language/ControlPanel/Tools/Download/Full/Caption": {
"title": "$:/language/ControlPanel/Tools/Download/Full/Caption",
"text": "Download full wiki"
},
"$:/language/Date/DaySuffix/1": {
"title": "$:/language/Date/DaySuffix/1",
"text": "st"
},
"$:/language/Date/DaySuffix/2": {
"title": "$:/language/Date/DaySuffix/2",
"text": "nd"
},
"$:/language/Date/DaySuffix/3": {
"title": "$:/language/Date/DaySuffix/3",
"text": "rd"
},
"$:/language/Date/DaySuffix/4": {
"title": "$:/language/Date/DaySuffix/4",
"text": "th"
},
"$:/language/Date/DaySuffix/5": {
"title": "$:/language/Date/DaySuffix/5",
"text": "th"
},
"$:/language/Date/DaySuffix/6": {
"title": "$:/language/Date/DaySuffix/6",
"text": "th"
},
"$:/language/Date/DaySuffix/7": {
"title": "$:/language/Date/DaySuffix/7",
"text": "th"
},
"$:/language/Date/DaySuffix/8": {
"title": "$:/language/Date/DaySuffix/8",
"text": "th"
},
"$:/language/Date/DaySuffix/9": {
"title": "$:/language/Date/DaySuffix/9",
"text": "th"
},
"$:/language/Date/DaySuffix/10": {
"title": "$:/language/Date/DaySuffix/10",
"text": "th"
},
"$:/language/Date/DaySuffix/11": {
"title": "$:/language/Date/DaySuffix/11",
"text": "th"
},
"$:/language/Date/DaySuffix/12": {
"title": "$:/language/Date/DaySuffix/12",
"text": "th"
},
"$:/language/Date/DaySuffix/13": {
"title": "$:/language/Date/DaySuffix/13",
"text": "th"
},
"$:/language/Date/DaySuffix/14": {
"title": "$:/language/Date/DaySuffix/14",
"text": "th"
},
"$:/language/Date/DaySuffix/15": {
"title": "$:/language/Date/DaySuffix/15",
"text": "th"
},
"$:/language/Date/DaySuffix/16": {
"title": "$:/language/Date/DaySuffix/16",
"text": "th"
},
"$:/language/Date/DaySuffix/17": {
"title": "$:/language/Date/DaySuffix/17",
"text": "th"
},
"$:/language/Date/DaySuffix/18": {
"title": "$:/language/Date/DaySuffix/18",
"text": "th"
},
"$:/language/Date/DaySuffix/19": {
"title": "$:/language/Date/DaySuffix/19",
"text": "th"
},
"$:/language/Date/DaySuffix/20": {
"title": "$:/language/Date/DaySuffix/20",
"text": "th"
},
"$:/language/Date/DaySuffix/21": {
"title": "$:/language/Date/DaySuffix/21",
"text": "st"
},
"$:/language/Date/DaySuffix/22": {
"title": "$:/language/Date/DaySuffix/22",
"text": "nd"
},
"$:/language/Date/DaySuffix/23": {
"title": "$:/language/Date/DaySuffix/23",
"text": "rd"
},
"$:/language/Date/DaySuffix/24": {
"title": "$:/language/Date/DaySuffix/24",
"text": "th"
},
"$:/language/Date/DaySuffix/25": {
"title": "$:/language/Date/DaySuffix/25",
"text": "th"
},
"$:/language/Date/DaySuffix/26": {
"title": "$:/language/Date/DaySuffix/26",
"text": "th"
},
"$:/language/Date/DaySuffix/27": {
"title": "$:/language/Date/DaySuffix/27",
"text": "th"
},
"$:/language/Date/DaySuffix/28": {
"title": "$:/language/Date/DaySuffix/28",
"text": "th"
},
"$:/language/Date/DaySuffix/29": {
"title": "$:/language/Date/DaySuffix/29",
"text": "th"
},
"$:/language/Date/DaySuffix/30": {
"title": "$:/language/Date/DaySuffix/30",
"text": "th"
},
"$:/language/Date/DaySuffix/31": {
"title": "$:/language/Date/DaySuffix/31",
"text": "st"
},
"$:/language/Date/Long/Day/0": {
"title": "$:/language/Date/Long/Day/0",
"text": "Sunday"
},
"$:/language/Date/Long/Day/1": {
"title": "$:/language/Date/Long/Day/1",
"text": "Monday"
},
"$:/language/Date/Long/Day/2": {
"title": "$:/language/Date/Long/Day/2",
"text": "Tuesday"
},
"$:/language/Date/Long/Day/3": {
"title": "$:/language/Date/Long/Day/3",
"text": "Wednesday"
},
"$:/language/Date/Long/Day/4": {
"title": "$:/language/Date/Long/Day/4",
"text": "Thursday"
},
"$:/language/Date/Long/Day/5": {
"title": "$:/language/Date/Long/Day/5",
"text": "Friday"
},
"$:/language/Date/Long/Day/6": {
"title": "$:/language/Date/Long/Day/6",
"text": "Saturday"
},
"$:/language/Date/Long/Month/1": {
"title": "$:/language/Date/Long/Month/1",
"text": "January"
},
"$:/language/Date/Long/Month/2": {
"title": "$:/language/Date/Long/Month/2",
"text": "February"
},
"$:/language/Date/Long/Month/3": {
"title": "$:/language/Date/Long/Month/3",
"text": "March"
},
"$:/language/Date/Long/Month/4": {
"title": "$:/language/Date/Long/Month/4",
"text": "April"
},
"$:/language/Date/Long/Month/5": {
"title": "$:/language/Date/Long/Month/5",
"text": "May"
},
"$:/language/Date/Long/Month/6": {
"title": "$:/language/Date/Long/Month/6",
"text": "June"
},
"$:/language/Date/Long/Month/7": {
"title": "$:/language/Date/Long/Month/7",
"text": "July"
},
"$:/language/Date/Long/Month/8": {
"title": "$:/language/Date/Long/Month/8",
"text": "August"
},
"$:/language/Date/Long/Month/9": {
"title": "$:/language/Date/Long/Month/9",
"text": "September"
},
"$:/language/Date/Long/Month/10": {
"title": "$:/language/Date/Long/Month/10",
"text": "October"
},
"$:/language/Date/Long/Month/11": {
"title": "$:/language/Date/Long/Month/11",
"text": "November"
},
"$:/language/Date/Long/Month/12": {
"title": "$:/language/Date/Long/Month/12",
"text": "December"
},
"$:/language/Date/Period/am": {
"title": "$:/language/Date/Period/am",
"text": "am"
},
"$:/language/Date/Period/pm": {
"title": "$:/language/Date/Period/pm",
"text": "pm"
},
"$:/language/Date/Short/Day/0": {
"title": "$:/language/Date/Short/Day/0",
"text": "Sun"
},
"$:/language/Date/Short/Day/1": {
"title": "$:/language/Date/Short/Day/1",
"text": "Mon"
},
"$:/language/Date/Short/Day/2": {
"title": "$:/language/Date/Short/Day/2",
"text": "Tue"
},
"$:/language/Date/Short/Day/3": {
"title": "$:/language/Date/Short/Day/3",
"text": "Wed"
},
"$:/language/Date/Short/Day/4": {
"title": "$:/language/Date/Short/Day/4",
"text": "Thu"
},
"$:/language/Date/Short/Day/5": {
"title": "$:/language/Date/Short/Day/5",
"text": "Fri"
},
"$:/language/Date/Short/Day/6": {
"title": "$:/language/Date/Short/Day/6",
"text": "Sat"
},
"$:/language/Date/Short/Month/1": {
"title": "$:/language/Date/Short/Month/1",
"text": "Jan"
},
"$:/language/Date/Short/Month/2": {
"title": "$:/language/Date/Short/Month/2",
"text": "Feb"
},
"$:/language/Date/Short/Month/3": {
"title": "$:/language/Date/Short/Month/3",
"text": "Mar"
},
"$:/language/Date/Short/Month/4": {
"title": "$:/language/Date/Short/Month/4",
"text": "Apr"
},
"$:/language/Date/Short/Month/5": {
"title": "$:/language/Date/Short/Month/5",
"text": "May"
},
"$:/language/Date/Short/Month/6": {
"title": "$:/language/Date/Short/Month/6",
"text": "Jun"
},
"$:/language/Date/Short/Month/7": {
"title": "$:/language/Date/Short/Month/7",
"text": "Jul"
},
"$:/language/Date/Short/Month/8": {
"title": "$:/language/Date/Short/Month/8",
"text": "Aug"
},
"$:/language/Date/Short/Month/9": {
"title": "$:/language/Date/Short/Month/9",
"text": "Sep"
},
"$:/language/Date/Short/Month/10": {
"title": "$:/language/Date/Short/Month/10",
"text": "Oct"
},
"$:/language/Date/Short/Month/11": {
"title": "$:/language/Date/Short/Month/11",
"text": "Nov"
},
"$:/language/Date/Short/Month/12": {
"title": "$:/language/Date/Short/Month/12",
"text": "Dec"
},
"$:/language/RelativeDate/Future/Days": {
"title": "$:/language/RelativeDate/Future/Days",
"text": "<<period>> days from now"
},
"$:/language/RelativeDate/Future/Hours": {
"title": "$:/language/RelativeDate/Future/Hours",
"text": "<<period>> hours from now"
},
"$:/language/RelativeDate/Future/Minutes": {
"title": "$:/language/RelativeDate/Future/Minutes",
"text": "<<period>> minutes from now"
},
"$:/language/RelativeDate/Future/Months": {
"title": "$:/language/RelativeDate/Future/Months",
"text": "<<period>> months from now"
},
"$:/language/RelativeDate/Future/Second": {
"title": "$:/language/RelativeDate/Future/Second",
"text": "1 second from now"
},
"$:/language/RelativeDate/Future/Seconds": {
"title": "$:/language/RelativeDate/Future/Seconds",
"text": "<<period>> seconds from now"
},
"$:/language/RelativeDate/Future/Years": {
"title": "$:/language/RelativeDate/Future/Years",
"text": "<<period>> years from now"
},
"$:/language/RelativeDate/Past/Days": {
"title": "$:/language/RelativeDate/Past/Days",
"text": "<<period>> days ago"
},
"$:/language/RelativeDate/Past/Hours": {
"title": "$:/language/RelativeDate/Past/Hours",
"text": "<<period>> hours ago"
},
"$:/language/RelativeDate/Past/Minutes": {
"title": "$:/language/RelativeDate/Past/Minutes",
"text": "<<period>> minutes ago"
},
"$:/language/RelativeDate/Past/Months": {
"title": "$:/language/RelativeDate/Past/Months",
"text": "<<period>> months ago"
},
"$:/language/RelativeDate/Past/Second": {
"title": "$:/language/RelativeDate/Past/Second",
"text": "1 second ago"
},
"$:/language/RelativeDate/Past/Seconds": {
"title": "$:/language/RelativeDate/Past/Seconds",
"text": "<<period>> seconds ago"
},
"$:/language/RelativeDate/Past/Years": {
"title": "$:/language/RelativeDate/Past/Years",
"text": "<<period>> years ago"
},
"$:/language/Docs/ModuleTypes/animation": {
"title": "$:/language/Docs/ModuleTypes/animation",
"text": "Animations that may be used with the RevealWidget."
},
"$:/language/Docs/ModuleTypes/command": {
"title": "$:/language/Docs/ModuleTypes/command",
"text": "Commands that can be executed under Node.js."
},
"$:/language/Docs/ModuleTypes/config": {
"title": "$:/language/Docs/ModuleTypes/config",
"text": "Data to be inserted into `$tw.config`."
},
"$:/language/Docs/ModuleTypes/filteroperator": {
"title": "$:/language/Docs/ModuleTypes/filteroperator",
"text": "Individual filter operator methods."
},
"$:/language/Docs/ModuleTypes/global": {
"title": "$:/language/Docs/ModuleTypes/global",
"text": "Global data to be inserted into `$tw`."
},
"$:/language/Docs/ModuleTypes/isfilteroperator": {
"title": "$:/language/Docs/ModuleTypes/isfilteroperator",
"text": "Operands for the ''is'' filter operator."
},
"$:/language/Docs/ModuleTypes/macro": {
"title": "$:/language/Docs/ModuleTypes/macro",
"text": "JavaScript macro definitions."
},
"$:/language/Docs/ModuleTypes/parser": {
"title": "$:/language/Docs/ModuleTypes/parser",
"text": "Parsers for different content types."
},
"$:/language/Docs/ModuleTypes/saver": {
"title": "$:/language/Docs/ModuleTypes/saver",
"text": "Savers handle different methods for saving files from the browser."
},
"$:/language/Docs/ModuleTypes/startup": {
"title": "$:/language/Docs/ModuleTypes/startup",
"text": "Startup functions."
},
"$:/language/Docs/ModuleTypes/storyview": {
"title": "$:/language/Docs/ModuleTypes/storyview",
"text": "Story views customise the animation and behaviour of list widgets."
},
"$:/language/Docs/ModuleTypes/tiddlerdeserializer": {
"title": "$:/language/Docs/ModuleTypes/tiddlerdeserializer",
"text": "Converts different content types into tiddlers."
},
"$:/language/Docs/ModuleTypes/tiddlerfield": {
"title": "$:/language/Docs/ModuleTypes/tiddlerfield",
"text": "Defines the behaviour of an individual tiddler field."
},
"$:/language/Docs/ModuleTypes/tiddlermethod": {
"title": "$:/language/Docs/ModuleTypes/tiddlermethod",
"text": "Adds methods to the `$tw.Tiddler` prototype."
},
"$:/language/Docs/ModuleTypes/upgrader": {
"title": "$:/language/Docs/ModuleTypes/upgrader",
"text": "Applies upgrade processing to tiddlers during an upgrade/import."
},
"$:/language/Docs/ModuleTypes/utils": {
"title": "$:/language/Docs/ModuleTypes/utils",
"text": "Adds methods to `$tw.utils`."
},
"$:/language/Docs/ModuleTypes/utils-node": {
"title": "$:/language/Docs/ModuleTypes/utils-node",
"text": "Adds Node.js-specific methods to `$tw.utils`."
},
"$:/language/Docs/ModuleTypes/widget": {
"title": "$:/language/Docs/ModuleTypes/widget",
"text": "Widgets encapsulate DOM rendering and refreshing."
},
"$:/language/Docs/ModuleTypes/wikimethod": {
"title": "$:/language/Docs/ModuleTypes/wikimethod",
"text": "Adds methods to `$tw.Wiki`."
},
"$:/language/Docs/ModuleTypes/wikirule": {
"title": "$:/language/Docs/ModuleTypes/wikirule",
"text": "Individual parser rules for the main WikiText parser."
},
"$:/language/Docs/PaletteColours/alert-background": {
"title": "$:/language/Docs/PaletteColours/alert-background",
"text": "Alert background"
},
"$:/language/Docs/PaletteColours/alert-border": {
"title": "$:/language/Docs/PaletteColours/alert-border",
"text": "Alert border"
},
"$:/language/Docs/PaletteColours/alert-highlight": {
"title": "$:/language/Docs/PaletteColours/alert-highlight",
"text": "Alert highlight"
},
"$:/language/Docs/PaletteColours/alert-muted-foreground": {
"title": "$:/language/Docs/PaletteColours/alert-muted-foreground",
"text": "Alert muted foreground"
},
"$:/language/Docs/PaletteColours/background": {
"title": "$:/language/Docs/PaletteColours/background",
"text": "General background"
},
"$:/language/Docs/PaletteColours/blockquote-bar": {
"title": "$:/language/Docs/PaletteColours/blockquote-bar",
"text": "Blockquote bar"
},
"$:/language/Docs/PaletteColours/dirty-indicator": {
"title": "$:/language/Docs/PaletteColours/dirty-indicator",
"text": "Unsaved changes indicator"
},
"$:/language/Docs/PaletteColours/code-background": {
"title": "$:/language/Docs/PaletteColours/code-background",
"text": "Code background"
},
"$:/language/Docs/PaletteColours/code-border": {
"title": "$:/language/Docs/PaletteColours/code-border",
"text": "Code border"
},
"$:/language/Docs/PaletteColours/code-foreground": {
"title": "$:/language/Docs/PaletteColours/code-foreground",
"text": "Code foreground"
},
"$:/language/Docs/PaletteColours/download-background": {
"title": "$:/language/Docs/PaletteColours/download-background",
"text": "Download button background"
},
"$:/language/Docs/PaletteColours/download-foreground": {
"title": "$:/language/Docs/PaletteColours/download-foreground",
"text": "Download button foreground"
},
"$:/language/Docs/PaletteColours/dragger-background": {
"title": "$:/language/Docs/PaletteColours/dragger-background",
"text": "Dragger background"
},
"$:/language/Docs/PaletteColours/dragger-foreground": {
"title": "$:/language/Docs/PaletteColours/dragger-foreground",
"text": "Dragger foreground"
},
"$:/language/Docs/PaletteColours/dropdown-background": {
"title": "$:/language/Docs/PaletteColours/dropdown-background",
"text": "Dropdown background"
},
"$:/language/Docs/PaletteColours/dropdown-border": {
"title": "$:/language/Docs/PaletteColours/dropdown-border",
"text": "Dropdown border"
},
"$:/language/Docs/PaletteColours/dropdown-tab-background-selected": {
"title": "$:/language/Docs/PaletteColours/dropdown-tab-background-selected",
"text": "Dropdown tab background for selected tabs"
},
"$:/language/Docs/PaletteColours/dropdown-tab-background": {
"title": "$:/language/Docs/PaletteColours/dropdown-tab-background",
"text": "Dropdown tab background"
},
"$:/language/Docs/PaletteColours/dropzone-background": {
"title": "$:/language/Docs/PaletteColours/dropzone-background",
"text": "Dropzone background"
},
"$:/language/Docs/PaletteColours/external-link-background-hover": {
"title": "$:/language/Docs/PaletteColours/external-link-background-hover",
"text": "External link background hover"
},
"$:/language/Docs/PaletteColours/external-link-background-visited": {
"title": "$:/language/Docs/PaletteColours/external-link-background-visited",
"text": "External link background visited"
},
"$:/language/Docs/PaletteColours/external-link-background": {
"title": "$:/language/Docs/PaletteColours/external-link-background",
"text": "External link background"
},
"$:/language/Docs/PaletteColours/external-link-foreground-hover": {
"title": "$:/language/Docs/PaletteColours/external-link-foreground-hover",
"text": "External link foreground hover"
},
"$:/language/Docs/PaletteColours/external-link-foreground-visited": {
"title": "$:/language/Docs/PaletteColours/external-link-foreground-visited",
"text": "External link foreground visited"
},
"$:/language/Docs/PaletteColours/external-link-foreground": {
"title": "$:/language/Docs/PaletteColours/external-link-foreground",
"text": "External link foreground"
},
"$:/language/Docs/PaletteColours/foreground": {
"title": "$:/language/Docs/PaletteColours/foreground",
"text": "General foreground"
},
"$:/language/Docs/PaletteColours/message-background": {
"title": "$:/language/Docs/PaletteColours/message-background",
"text": "Message box background"
},
"$:/language/Docs/PaletteColours/message-border": {
"title": "$:/language/Docs/PaletteColours/message-border",
"text": "Message box border"
},
"$:/language/Docs/PaletteColours/message-foreground": {
"title": "$:/language/Docs/PaletteColours/message-foreground",
"text": "Message box foreground"
},
"$:/language/Docs/PaletteColours/modal-backdrop": {
"title": "$:/language/Docs/PaletteColours/modal-backdrop",
"text": "Modal backdrop"
},
"$:/language/Docs/PaletteColours/modal-background": {
"title": "$:/language/Docs/PaletteColours/modal-background",
"text": "Modal background"
},
"$:/language/Docs/PaletteColours/modal-border": {
"title": "$:/language/Docs/PaletteColours/modal-border",
"text": "Modal border"
},
"$:/language/Docs/PaletteColours/modal-footer-background": {
"title": "$:/language/Docs/PaletteColours/modal-footer-background",
"text": "Modal footer background"
},
"$:/language/Docs/PaletteColours/modal-footer-border": {
"title": "$:/language/Docs/PaletteColours/modal-footer-border",
"text": "Modal footer border"
},
"$:/language/Docs/PaletteColours/modal-header-border": {
"title": "$:/language/Docs/PaletteColours/modal-header-border",
"text": "Modal header border"
},
"$:/language/Docs/PaletteColours/muted-foreground": {
"title": "$:/language/Docs/PaletteColours/muted-foreground",
"text": "General muted foreground"
},
"$:/language/Docs/PaletteColours/notification-background": {
"title": "$:/language/Docs/PaletteColours/notification-background",
"text": "Notification background"
},
"$:/language/Docs/PaletteColours/notification-border": {
"title": "$:/language/Docs/PaletteColours/notification-border",
"text": "Notification border"
},
"$:/language/Docs/PaletteColours/page-background": {
"title": "$:/language/Docs/PaletteColours/page-background",
"text": "Page background"
},
"$:/language/Docs/PaletteColours/pre-background": {
"title": "$:/language/Docs/PaletteColours/pre-background",
"text": "Preformatted code background"
},
"$:/language/Docs/PaletteColours/pre-border": {
"title": "$:/language/Docs/PaletteColours/pre-border",
"text": "Preformatted code border"
},
"$:/language/Docs/PaletteColours/primary": {
"title": "$:/language/Docs/PaletteColours/primary",
"text": "General primary"
},
"$:/language/Docs/PaletteColours/sidebar-button-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-button-foreground",
"text": "Sidebar button foreground"
},
"$:/language/Docs/PaletteColours/sidebar-controls-foreground-hover": {
"title": "$:/language/Docs/PaletteColours/sidebar-controls-foreground-hover",
"text": "Sidebar controls foreground hover"
},
"$:/language/Docs/PaletteColours/sidebar-controls-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-controls-foreground",
"text": "Sidebar controls foreground"
},
"$:/language/Docs/PaletteColours/sidebar-foreground-shadow": {
"title": "$:/language/Docs/PaletteColours/sidebar-foreground-shadow",
"text": "Sidebar foreground shadow"
},
"$:/language/Docs/PaletteColours/sidebar-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-foreground",
"text": "Sidebar foreground"
},
"$:/language/Docs/PaletteColours/sidebar-muted-foreground-hover": {
"title": "$:/language/Docs/PaletteColours/sidebar-muted-foreground-hover",
"text": "Sidebar muted foreground hover"
},
"$:/language/Docs/PaletteColours/sidebar-muted-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-muted-foreground",
"text": "Sidebar muted foreground"
},
"$:/language/Docs/PaletteColours/sidebar-tab-background-selected": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-background-selected",
"text": "Sidebar tab background for selected tabs"
},
"$:/language/Docs/PaletteColours/sidebar-tab-background": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-background",
"text": "Sidebar tab background"
},
"$:/language/Docs/PaletteColours/sidebar-tab-border-selected": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-border-selected",
"text": "Sidebar tab border for selected tabs"
},
"$:/language/Docs/PaletteColours/sidebar-tab-border": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-border",
"text": "Sidebar tab border"
},
"$:/language/Docs/PaletteColours/sidebar-tab-divider": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-divider",
"text": "Sidebar tab divider"
},
"$:/language/Docs/PaletteColours/sidebar-tab-foreground-selected": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-foreground-selected",
"text": "Sidebar tab foreground for selected tabs"
},
"$:/language/Docs/PaletteColours/sidebar-tab-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-tab-foreground",
"text": "Sidebar tab foreground"
},
"$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground-hover": {
"title": "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground-hover",
"text": "Sidebar tiddler link foreground hover"
},
"$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground": {
"title": "$:/language/Docs/PaletteColours/sidebar-tiddler-link-foreground",
"text": "Sidebar tiddler link foreground"
},
"$:/language/Docs/PaletteColours/static-alert-foreground": {
"title": "$:/language/Docs/PaletteColours/static-alert-foreground",
"text": "Static alert foreground"
},
"$:/language/Docs/PaletteColours/tab-background-selected": {
"title": "$:/language/Docs/PaletteColours/tab-background-selected",
"text": "Tab background for selected tabs"
},
"$:/language/Docs/PaletteColours/tab-background": {
"title": "$:/language/Docs/PaletteColours/tab-background",
"text": "Tab background"
},
"$:/language/Docs/PaletteColours/tab-border-selected": {
"title": "$:/language/Docs/PaletteColours/tab-border-selected",
"text": "Tab border for selected tabs"
},
"$:/language/Docs/PaletteColours/tab-border": {
"title": "$:/language/Docs/PaletteColours/tab-border",
"text": "Tab border"
},
"$:/language/Docs/PaletteColours/tab-divider": {
"title": "$:/language/Docs/PaletteColours/tab-divider",
"text": "Tab divider"
},
"$:/language/Docs/PaletteColours/tab-foreground-selected": {
"title": "$:/language/Docs/PaletteColours/tab-foreground-selected",
"text": "Tab foreground for selected tabs"
},
"$:/language/Docs/PaletteColours/tab-foreground": {
"title": "$:/language/Docs/PaletteColours/tab-foreground",
"text": "Tab foreground"
},
"$:/language/Docs/PaletteColours/table-border": {
"title": "$:/language/Docs/PaletteColours/table-border",
"text": "Table border"
},
"$:/language/Docs/PaletteColours/table-footer-background": {
"title": "$:/language/Docs/PaletteColours/table-footer-background",
"text": "Table footer background"
},
"$:/language/Docs/PaletteColours/table-header-background": {
"title": "$:/language/Docs/PaletteColours/table-header-background",
"text": "Table header background"
},
"$:/language/Docs/PaletteColours/tag-background": {
"title": "$:/language/Docs/PaletteColours/tag-background",
"text": "Tag background"
},
"$:/language/Docs/PaletteColours/tag-foreground": {
"title": "$:/language/Docs/PaletteColours/tag-foreground",
"text": "Tag foreground"
},
"$:/language/Docs/PaletteColours/tiddler-background": {
"title": "$:/language/Docs/PaletteColours/tiddler-background",
"text": "Tiddler background"
},
"$:/language/Docs/PaletteColours/tiddler-border": {
"title": "$:/language/Docs/PaletteColours/tiddler-border",
"text": "Tiddler border"
},
"$:/language/Docs/PaletteColours/tiddler-controls-foreground-hover": {
"title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground-hover",
"text": "Tiddler controls foreground hover"
},
"$:/language/Docs/PaletteColours/tiddler-controls-foreground-selected": {
"title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground-selected",
"text": "Tiddler controls foreground for selected controls"
},
"$:/language/Docs/PaletteColours/tiddler-controls-foreground": {
"title": "$:/language/Docs/PaletteColours/tiddler-controls-foreground",
"text": "Tiddler controls foreground"
},
"$:/language/Docs/PaletteColours/tiddler-editor-background": {
"title": "$:/language/Docs/PaletteColours/tiddler-editor-background",
"text": "Tiddler editor background"
},
"$:/language/Docs/PaletteColours/tiddler-editor-border-image": {
"title": "$:/language/Docs/PaletteColours/tiddler-editor-border-image",
"text": "Tiddler editor border image"
},
"$:/language/Docs/PaletteColours/tiddler-editor-border": {
"title": "$:/language/Docs/PaletteColours/tiddler-editor-border",
"text": "Tiddler editor border"
},
"$:/language/Docs/PaletteColours/tiddler-editor-fields-even": {
"title": "$:/language/Docs/PaletteColours/tiddler-editor-fields-even",
"text": "Tiddler editor background for even fields"
},
"$:/language/Docs/PaletteColours/tiddler-editor-fields-odd": {
"title": "$:/language/Docs/PaletteColours/tiddler-editor-fields-odd",
"text": "Tiddler editor background for odd fields"
},
"$:/language/Docs/PaletteColours/tiddler-info-background": {
"title": "$:/language/Docs/PaletteColours/tiddler-info-background",
"text": "Tiddler info panel background"
},
"$:/language/Docs/PaletteColours/tiddler-info-border": {
"title": "$:/language/Docs/PaletteColours/tiddler-info-border",
"text": "Tiddler info panel border"
},
"$:/language/Docs/PaletteColours/tiddler-info-tab-background": {
"title": "$:/language/Docs/PaletteColours/tiddler-info-tab-background",
"text": "Tiddler info panel tab background"
},
"$:/language/Docs/PaletteColours/tiddler-link-background": {
"title": "$:/language/Docs/PaletteColours/tiddler-link-background",
"text": "Tiddler link background"
},
"$:/language/Docs/PaletteColours/tiddler-link-foreground": {
"title": "$:/language/Docs/PaletteColours/tiddler-link-foreground",
"text": "Tiddler link foreground"
},
"$:/language/Docs/PaletteColours/tiddler-subtitle-foreground": {
"title": "$:/language/Docs/PaletteColours/tiddler-subtitle-foreground",
"text": "Tiddler subtitle foreground"
},
"$:/language/Docs/PaletteColours/tiddler-title-foreground": {
"title": "$:/language/Docs/PaletteColours/tiddler-title-foreground",
"text": "Tiddler title foreground"
},
"$:/language/Docs/PaletteColours/toolbar-new-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-new-button",
"text": "Toolbar 'new tiddler' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-options-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-options-button",
"text": "Toolbar 'options' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-save-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-save-button",
"text": "Toolbar 'save' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-info-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-info-button",
"text": "Toolbar 'info' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-edit-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-edit-button",
"text": "Toolbar 'edit' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-close-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-close-button",
"text": "Toolbar 'close' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-delete-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-delete-button",
"text": "Toolbar 'delete' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-cancel-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-cancel-button",
"text": "Toolbar 'cancel' button foreground"
},
"$:/language/Docs/PaletteColours/toolbar-done-button": {
"title": "$:/language/Docs/PaletteColours/toolbar-done-button",
"text": "Toolbar 'done' button foreground"
},
"$:/language/Docs/PaletteColours/untagged-background": {
"title": "$:/language/Docs/PaletteColours/untagged-background",
"text": "Untagged pill background"
},
"$:/language/Docs/PaletteColours/very-muted-foreground": {
"title": "$:/language/Docs/PaletteColours/very-muted-foreground",
"text": "Very muted foreground"
},
"$:/language/EditTemplate/Body/External/Hint": {
"title": "$:/language/EditTemplate/Body/External/Hint",
"text": "This is an external tiddler stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself"
},
"$:/language/EditTemplate/Body/Hint": {
"title": "$:/language/EditTemplate/Body/Hint",
"text": "Use [[wiki text|http://tiddlywiki.com/static/WikiText.html]] to add formatting, images, and dynamic features"
},
"$:/language/EditTemplate/Body/Placeholder": {
"title": "$:/language/EditTemplate/Body/Placeholder",
"text": "Type the text for this tiddler"
},
"$:/language/EditTemplate/Body/Preview/Button/Hide": {
"title": "$:/language/EditTemplate/Body/Preview/Button/Hide",
"text": "hide preview"
},
"$:/language/EditTemplate/Body/Preview/Button/Show": {
"title": "$:/language/EditTemplate/Body/Preview/Button/Show",
"text": "show preview"
},
"$:/language/EditTemplate/Field/Remove/Caption": {
"title": "$:/language/EditTemplate/Field/Remove/Caption",
"text": "remove field"
},
"$:/language/EditTemplate/Field/Remove/Hint": {
"title": "$:/language/EditTemplate/Field/Remove/Hint",
"text": "Remove field"
},
"$:/language/EditTemplate/Fields/Add/Button": {
"title": "$:/language/EditTemplate/Fields/Add/Button",
"text": "add"
},
"$:/language/EditTemplate/Fields/Add/Name/Placeholder": {
"title": "$:/language/EditTemplate/Fields/Add/Name/Placeholder",
"text": "field name"
},
"$:/language/EditTemplate/Fields/Add/Prompt": {
"title": "$:/language/EditTemplate/Fields/Add/Prompt",
"text": "Add a new field:"
},
"$:/language/EditTemplate/Fields/Add/Value/Placeholder": {
"title": "$:/language/EditTemplate/Fields/Add/Value/Placeholder",
"text": "field value"
},
"$:/language/EditTemplate/Shadow/Warning": {
"title": "$:/language/EditTemplate/Shadow/Warning",
"text": "This is a shadow tiddler. Any changes will override the default version"
},
"$:/language/EditTemplate/Shadow/OverriddenWarning": {
"title": "$:/language/EditTemplate/Shadow/OverriddenWarning",
"text": "This is a modified shadow tiddler. You can revert to the default version by deleting this tiddler"
},
"$:/language/EditTemplate/Tags/Add/Button": {
"title": "$:/language/EditTemplate/Tags/Add/Button",
"text": "add"
},
"$:/language/EditTemplate/Tags/Add/Placeholder": {
"title": "$:/language/EditTemplate/Tags/Add/Placeholder",
"text": "tag name"
},
"$:/language/EditTemplate/Tags/Dropdown/Caption": {
"title": "$:/language/EditTemplate/Tags/Dropdown/Caption",
"text": "tag list"
},
"$:/language/EditTemplate/Tags/Dropdown/Hint": {
"title": "$:/language/EditTemplate/Tags/Dropdown/Hint",
"text": "Show tag list"
},
"$:/language/EditTemplate/Type/Dropdown/Caption": {
"title": "$:/language/EditTemplate/Type/Dropdown/Caption",
"text": "content type list"
},
"$:/language/EditTemplate/Type/Dropdown/Hint": {
"title": "$:/language/EditTemplate/Type/Dropdown/Hint",
"text": "Show content type list"
},
"$:/language/EditTemplate/Type/Delete/Caption": {
"title": "$:/language/EditTemplate/Type/Delete/Caption",
"text": "delete content type"
},
"$:/language/EditTemplate/Type/Delete/Hint": {
"title": "$:/language/EditTemplate/Type/Delete/Hint",
"text": "Delete content type"
},
"$:/language/EditTemplate/Type/Placeholder": {
"title": "$:/language/EditTemplate/Type/Placeholder",
"text": "content type"
},
"$:/language/EditTemplate/Type/Prompt": {
"title": "$:/language/EditTemplate/Type/Prompt",
"text": "Type:"
},
"$:/language/Exporters/StaticRiver": {
"title": "$:/language/Exporters/StaticRiver",
"text": "River of tiddlers as static HTML file"
},
"$:/language/Exporters/JsonFile": {
"title": "$:/language/Exporters/JsonFile",
"text": "JSON tiddlers file"
},
"$:/language/Exporters/CsvFile": {
"title": "$:/language/Exporters/CsvFile",
"text": "CSV tiddlers file"
},
"$:/language/Exporters/TidFile": {
"title": "$:/language/Exporters/TidFile",
"text": "Single tiddler \".tid\" file"
},
"$:/language/Docs/Fields/_canonical_uri": {
"title": "$:/language/Docs/Fields/_canonical_uri",
"text": "The full URI of an external image tiddler"
},
"$:/language/Docs/Fields/bag": {
"title": "$:/language/Docs/Fields/bag",
"text": "The name of the bag from which a tiddler came"
},
"$:/language/Docs/Fields/caption": {
"title": "$:/language/Docs/Fields/caption",
"text": "The text to be displayed on a tab or button"
},
"$:/language/Docs/Fields/color": {
"title": "$:/language/Docs/Fields/color",
"text": "The CSS color value associated with a tiddler"
},
"$:/language/Docs/Fields/component": {
"title": "$:/language/Docs/Fields/component",
"text": "The name of the component responsible for an [[alert tiddler|AlertMechanism]]"
},
"$:/language/Docs/Fields/current-tiddler": {
"title": "$:/language/Docs/Fields/current-tiddler",
"text": "Used to cache the top tiddler in a [[history list|HistoryMechanism]]"
},
"$:/language/Docs/Fields/created": {
"title": "$:/language/Docs/Fields/created",
"text": "The date a tiddler was created"
},
"$:/language/Docs/Fields/creator": {
"title": "$:/language/Docs/Fields/creator",
"text": "The name of the person who created a tiddler"
},
"$:/language/Docs/Fields/dependents": {
"title": "$:/language/Docs/Fields/dependents",
"text": "For a plugin, lists the dependent plugin titles"
},
"$:/language/Docs/Fields/description": {
"title": "$:/language/Docs/Fields/description",
"text": "The descriptive text for a plugin, or a modal dialogue"
},
"$:/language/Docs/Fields/draft.of": {
"title": "$:/language/Docs/Fields/draft.of",
"text": "For draft tiddlers, contains the title of the tiddler of which this is a draft"
},
"$:/language/Docs/Fields/draft.title": {
"title": "$:/language/Docs/Fields/draft.title",
"text": "For draft tiddlers, contains the proposed new title of the tiddler"
},
"$:/language/Docs/Fields/footer": {
"title": "$:/language/Docs/Fields/footer",
"text": "The footer text for a wizard"
},
"$:/language/Docs/Fields/hack-to-give-us-something-to-compare-against": {
"title": "$:/language/Docs/Fields/hack-to-give-us-something-to-compare-against",
"text": "A temporary storage field used in [[$:/core/templates/static.content]]"
},
"$:/language/Docs/Fields/icon": {
"title": "$:/language/Docs/Fields/icon",
"text": "The title of the tiddler containing the icon associated with a tiddler"
},
"$:/language/Docs/Fields/library": {
"title": "$:/language/Docs/Fields/library",
"text": "If set to \"yes\" indicates that a tiddler should be saved as a JavaScript library"
},
"$:/language/Docs/Fields/list": {
"title": "$:/language/Docs/Fields/list",
"text": "An ordered list of tiddler titles associated with a tiddler"
},
"$:/language/Docs/Fields/list-before": {
"title": "$:/language/Docs/Fields/list-before",
"text": "If set, the title of a tiddler before which this tiddler should be added to the ordered list of tiddler titles, or at the start of the list if this field is present but empty"
},
"$:/language/Docs/Fields/list-after": {
"title": "$:/language/Docs/Fields/list-after",
"text": "If set, the title of the tiddler after which this tiddler should be added to the ordered list of tiddler titles"
},
"$:/language/Docs/Fields/modified": {
"title": "$:/language/Docs/Fields/modified",
"text": "The date and time at which a tiddler was last modified"
},
"$:/language/Docs/Fields/modifier": {
"title": "$:/language/Docs/Fields/modifier",
"text": "The tiddler title associated with the person who last modified a tiddler"
},
"$:/language/Docs/Fields/name": {
"title": "$:/language/Docs/Fields/name",
"text": "The human readable name associated with a plugin tiddler"
},
"$:/language/Docs/Fields/plugin-priority": {
"title": "$:/language/Docs/Fields/plugin-priority",
"text": "A numerical value indicating the priority of a plugin tiddler"
},
"$:/language/Docs/Fields/plugin-type": {
"title": "$:/language/Docs/Fields/plugin-type",
"text": "The type of plugin in a plugin tiddler"
},
"$:/language/Docs/Fields/revision": {
"title": "$:/language/Docs/Fields/revision",
"text": "The revision of the tiddler held at the server"
},
"$:/language/Docs/Fields/released": {
"title": "$:/language/Docs/Fields/released",
"text": "Date of a TiddlyWiki release"
},
"$:/language/Docs/Fields/source": {
"title": "$:/language/Docs/Fields/source",
"text": "The source URL associated with a tiddler"
},
"$:/language/Docs/Fields/subtitle": {
"title": "$:/language/Docs/Fields/subtitle",
"text": "The subtitle text for a wizard"
},
"$:/language/Docs/Fields/tags": {
"title": "$:/language/Docs/Fields/tags",
"text": "A list of tags associated with a tiddler"
},
"$:/language/Docs/Fields/text": {
"title": "$:/language/Docs/Fields/text",
"text": "The body text of a tiddler"
},
"$:/language/Docs/Fields/title": {
"title": "$:/language/Docs/Fields/title",
"text": "The unique name of a tiddler"
},
"$:/language/Docs/Fields/type": {
"title": "$:/language/Docs/Fields/type",
"text": "The content type of a tiddler"
},
"$:/language/Docs/Fields/version": {
"title": "$:/language/Docs/Fields/version",
"text": "Version information for a plugin"
},
"$:/language/Filters/AllTiddlers": {
"title": "$:/language/Filters/AllTiddlers",
"text": "All tiddlers except system tiddlers"
},
"$:/language/Filters/RecentSystemTiddlers": {
"title": "$:/language/Filters/RecentSystemTiddlers",
"text": "Recently modified tiddlers, including system tiddlers"
},
"$:/language/Filters/RecentTiddlers": {
"title": "$:/language/Filters/RecentTiddlers",
"text": "Recently modified tiddlers"
},
"$:/language/Filters/AllTags": {
"title": "$:/language/Filters/AllTags",
"text": "All tags except system tags"
},
"$:/language/Filters/Missing": {
"title": "$:/language/Filters/Missing",
"text": "Missing tiddlers"
},
"$:/language/Filters/Drafts": {
"title": "$:/language/Filters/Drafts",
"text": "Draft tiddlers"
},
"$:/language/Filters/Orphans": {
"title": "$:/language/Filters/Orphans",
"text": "Orphan tiddlers"
},
"$:/language/Filters/SystemTiddlers": {
"title": "$:/language/Filters/SystemTiddlers",
"text": "System tiddlers"
},
"$:/language/Filters/ShadowTiddlers": {
"title": "$:/language/Filters/ShadowTiddlers",
"text": "Shadow tiddlers"
},
"$:/language/Filters/OverriddenShadowTiddlers": {
"title": "$:/language/Filters/OverriddenShadowTiddlers",
"text": "Overridden shadow tiddlers"
},
"$:/language/Filters/SystemTags": {
"title": "$:/language/Filters/SystemTags",
"text": "System tags"
},
"GettingStarted": {
"title": "GettingStarted",
"text": "\\define lingo-base() $:/language/ControlPanel/Basics/\nWelcome to ~TiddlyWiki and the ~TiddlyWiki community\n\nBefore you start storing important information in ~TiddlyWiki it is important to make sure that you can reliably save changes. See http://tiddlywiki.com/#GettingStarted for details\n\n!! Set up this ~TiddlyWiki\n\n|<$link to=\"$:/SiteTitle\"><<lingo Title/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteTitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/SiteSubtitle\"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteSubtitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/DefaultTiddlers\"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit-text tag=\"textarea\" tiddler=\"$:/DefaultTiddlers\"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |\n\nSee the [[control panel|$:/ControlPanel]] for more options.\n"
},
"$:/language/Help/build": {
"title": "$:/language/Help/build",
"description": "Automatically run configured commands",
"text": "Build the specified build targets for the current wiki. If no build targets are specified then all available targets will be built.\n\n```\n--build <target> [<target> ...]\n```\n\nBuild targets are defined in the `tiddlywiki.info` file of a wiki folder.\n\n"
},
"$:/language/Help/clearpassword": {
"title": "$:/language/Help/clearpassword",
"description": "Clear a password for subsequent crypto operations",
"text": "Clear the password for subsequent crypto operations\n\n```\n--clearpassword\n```\n"
},
"$:/language/Help/default": {
"title": "$:/language/Help/default",
"text": "\\define commandTitle()\n$:/language/Help/$(command)$\n\\end\n```\nusage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]\n```\n\nAvailable commands:\n\n<ul>\n<$list filter=\"[commands[]sort[title]]\" variable=\"command\">\n<li><$link to=<<commandTitle>>><$macrocall $name=\"command\" $type=\"text/plain\" $output=\"text/plain\"/></$link>: <$transclude tiddler=<<commandTitle>> field=\"description\"/></li>\n</$list>\n</ul>\n\nTo get detailed help on a command:\n\n```\ntiddlywiki --help <command>\n```\n"
},
"$:/language/Help/editions": {
"title": "$:/language/Help/editions",
"description": "Lists the available editions of TiddlyWiki",
"text": "Lists the names and descriptions of the available editions. You can create a new wiki of a specified edition with the `--init` command.\n\n```\n--editions\n```\n"
},
"$:/language/Help/help": {
"title": "$:/language/Help/help",
"description": "Display help for TiddlyWiki commands",
"text": "Displays help text for a command:\n\n```\n--help [<command>]\n```\n\nIf the command name is omitted then a list of available commands is displayed.\n"
},
"$:/language/Help/init": {
"title": "$:/language/Help/init",
"description": "Initialise a new wiki folder",
"text": "Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition.\n\n```\n--init <edition> [<edition> ...]\n```\n\nFor example:\n\n```\ntiddlywiki ./MyWikiFolder --init empty\n```\n\nNote:\n\n* The wiki folder directory will be created if necessary\n* The \"edition\" defaults to ''empty''\n* The init command will fail if the wiki folder is not empty\n* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file\n* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition)\n* `--editions` returns a list of available editions\n"
},
"$:/language/Help/load": {
"title": "$:/language/Help/load",
"description": "Load tiddlers from a file",
"text": "Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files \n\n```\n--load <filepath>\n```\n\nTo load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example:\n\n```\ntiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html\n```\n\nNote that TiddlyWiki will not load an older version of an already loaded plugin.\n"
},
"$:/language/Help/makelibrary": {
"title": "$:/language/Help/makelibrary",
"description": "Construct library plugin required by upgrade process",
"text": "Constructs the `$:/UpgradeLibrary` tiddler for the upgrade process.\n\nThe upgrade library is formatted as an ordinary plugin tiddler with the plugin type `library`. It contains a copy of each of the plugins, themes and language packs available within the TiddlyWiki5 repository.\n\nThis command is intended for internal use; it is only relevant to users constructing a custom upgrade procedure.\n\n```\n--makelibrary <title>\n```\n\nThe title argument defaults to `$:/UpgradeLibrary`.\n"
},
"$:/language/Help/notfound": {
"title": "$:/language/Help/notfound",
"text": "No such help item"
},
"$:/language/Help/output": {
"title": "$:/language/Help/output",
"description": "Set the base output directory for subsequent commands",
"text": "Sets the base output directory for subsequent commands. The default output directory is the `output` subdirectory of the edition directory.\n\n```\n--output <pathname>\n```\n\nIf the specified pathname is relative then it is resolved relative to the current working directory. For example `--output .` sets the output directory to the current working directory.\n\n"
},
"$:/language/Help/password": {
"title": "$:/language/Help/password",
"description": "Set a password for subsequent crypto operations",
"text": "Set a password for subsequent crypto operations\n\n```\n--password <password>\n```\n\n"
},
"$:/language/Help/rendertiddler": {
"title": "$:/language/Help/rendertiddler",
"description": "Render an individual tiddler as a specified ContentType",
"text": "Render an individual tiddler as a specified ContentType, defaults to `text/html` and save it to the specified filename:\n\n```\n--rendertiddler <title> <filename> [<type>]\n```\n\nBy default, the filename is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny missing directories in the path to the filename are automatically created.\n"
},
"$:/language/Help/rendertiddlers": {
"title": "$:/language/Help/rendertiddlers",
"description": "Render tiddlers matching a filter to a specified ContentType",
"text": "Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`).\n\n```\n--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>] [\"noclean\"]\n```\n\nFor example:\n\n```\n--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain\n```\n\nBy default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny files in the target directory are deleted unless the \"noclean\" parameter is specified. The target directory is recursively created if it is missing.\n"
},
"$:/language/Help/savetiddler": {
"title": "$:/language/Help/savetiddler",
"description": "Saves a raw tiddler to a file",
"text": "Saves an individual tiddler in its raw text or binary format to the specified filename. \n\n```\n--savetiddler <title> <filename>\n```\n\nBy default, the filename is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny missing directories in the path to the filename are automatically created.\n"
},
"$:/language/Help/savetiddlers": {
"title": "$:/language/Help/savetiddlers",
"description": "Saves a group of raw tiddlers to a directory",
"text": "Saves a group of tiddlers in their raw text or binary format to the specified directory. \n\n```\n--savetiddlers <filter> <pathname>\n```\n\nBy default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.\n\nAny missing directories in the pathname are automatically created.\n"
},
"$:/language/Help/server": {
"title": "$:/language/Help/server",
"description": "Provides an HTTP server interface to TiddlyWiki",
"text": "The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.\n\nAt the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.\n\n```\n--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host> <pathprefix>\n```\n\nThe parameters are:\n\n* ''port'' - port number to serve from (defaults to \"8080\")\n* ''roottiddler'' - the tiddler to serve at the root (defaults to \"$:/core/save/all\") \n* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to \"text/plain\")\n* ''servetype'' - the content type with which the root tiddler should be served (defaults to \"text/html\")\n* ''username'' - the default username for signing edits\n* ''password'' - optional password for basic authentication\n* ''host'' - optional hostname to serve from (defaults to \"127.0.0.1\" aka \"localhost\")\n* ''pathprefix'' - optional prefix for paths\n\nIf the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.\n\nFor example:\n\n```\n--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd\n```\n\nThe username and password can be specified as empty strings if you need to set the hostname or pathprefix and don't want to require a password:\n\n```\n--server 8080 $:/core/save/all text/plain text/html \"\" \"\" 192.168.0.245\n```\n\nTo run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.\n"
},
"$:/language/Help/setfield": {
"title": "$:/language/Help/setfield",
"description": "Prepares external tiddlers for use",
"text": "//Note that this command is experimental and may change or be replaced before being finalised//\n\nSets the specified field of a group of tiddlers to the result of wikifying a template tiddler with the `currentTiddler` variable set to the tiddler.\n\n```\n--setfield <filter> <fieldname> <templatetitle> <rendertype>\n```\n\nThe parameters are:\n\n* ''filter'' - filter identifying the tiddlers to be affected\n* ''fieldname'' - the field to modify (defaults to \"text\")\n* ''templatetitle'' - the tiddler to wikify into the specified field. If blank or missing then the specified field is deleted\n* ''type'' - the text type to render (defaults to \"text/plain\"; \"text/html\" can be used to include HTML tags)\n\n"
},
"$:/language/Help/unpackplugin": {
"title": "$:/language/Help/unpackplugin",
"description": "Unpack the payload tiddlers from a plugin",
"text": "Extract the payload tiddlers from a plugin, creating them as ordinary tiddlers:\n\n```\n--unpackplugin <title>\n```\n"
},
"$:/language/Help/verbose": {
"title": "$:/language/Help/verbose",
"description": "Triggers verbose output mode",
"text": "Triggers verbose output, useful for debugging \n\n```\n--verbose\n```\n"
},
"$:/language/Help/version": {
"title": "$:/language/Help/version",
"description": "Displays the version number of TiddlyWiki",
"text": "Displays the version number of TiddlyWiki.\n\n```\n--version\n```\n"
},
"$:/language/Import/Listing/Cancel/Caption": {
"title": "$:/language/Import/Listing/Cancel/Caption",
"text": "Cancel"
},
"$:/language/Import/Listing/Hint": {
"title": "$:/language/Import/Listing/Hint",
"text": "These tiddlers are ready to import:"
},
"$:/language/Import/Listing/Import/Caption": {
"title": "$:/language/Import/Listing/Import/Caption",
"text": "Import"
},
"$:/language/Import/Listing/Select/Caption": {
"title": "$:/language/Import/Listing/Select/Caption",
"text": "Select"
},
"$:/language/Import/Listing/Status/Caption": {
"title": "$:/language/Import/Listing/Status/Caption",
"text": "Status"
},
"$:/language/Import/Listing/Title/Caption": {
"title": "$:/language/Import/Listing/Title/Caption",
"text": "Title"
},
"$:/language/Import/Upgrader/Plugins/Suppressed/Incompatible": {
"title": "$:/language/Import/Upgrader/Plugins/Suppressed/Incompatible",
"text": "Blocked incompatible or obsolete plugin "
},
"$:/language/Import/Upgrader/Plugins/Suppressed/Version": {
"title": "$:/language/Import/Upgrader/Plugins/Suppressed/Version",
"text": "Blocked plugin (due to incoming <<incoming>> being older than existing <<existing>>)"
},
"$:/language/Import/Upgrader/Plugins/Upgraded": {
"title": "$:/language/Import/Upgrader/Plugins/Upgraded",
"text": "Upgraded plugin from <<incoming>> to <<upgraded>>"
},
"$:/language/Import/Upgrader/State/Suppressed": {
"title": "$:/language/Import/Upgrader/State/Suppressed",
"text": "Blocked temporary state tiddler"
},
"$:/language/Import/Upgrader/System/Suppressed": {
"title": "$:/language/Import/Upgrader/System/Suppressed",
"text": "Blocked system tiddler"
},
"$:/language/Import/Upgrader/ThemeTweaks/Created": {
"title": "$:/language/Import/Upgrader/ThemeTweaks/Created",
"text": "Migrated theme tweak from <$text text=<<from>>/>"
},
"$:/language/BinaryWarning/Prompt": {
"title": "$:/language/BinaryWarning/Prompt",
"text": "This tiddler contains binary data"
},
"$:/language/ClassicWarning/Hint": {
"title": "$:/language/ClassicWarning/Hint",
"text": "This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See http://tiddlywiki.com/static/Upgrading.html for more details. "
},
"$:/language/ClassicWarning/Upgrade/Caption": {
"title": "$:/language/ClassicWarning/Upgrade/Caption",
"text": "upgrade"
},
"$:/language/CloseAll/Button": {
"title": "$:/language/CloseAll/Button",
"text": "close all"
},
"$:/language/ConfirmCancelTiddler": {
"title": "$:/language/ConfirmCancelTiddler",
"text": "Do you wish to discard changes to the tiddler \"<$text text=<<title>>/>\"?"
},
"$:/language/ConfirmDeleteTiddler": {
"title": "$:/language/ConfirmDeleteTiddler",
"text": "Do you wish to delete the tiddler \"<$text text=<<title>>/>\"?"
},
"$:/language/ConfirmOverwriteTiddler": {
"title": "$:/language/ConfirmOverwriteTiddler",
"text": "Do you wish to overwrite the tiddler \"<$text text=<<title>>/>\"?"
},
"$:/language/ConfirmEditShadowTiddler": {
"title": "$:/language/ConfirmEditShadowTiddler",
"text": "You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit \"<$text text=<<title>>/>\"?"
},
"$:/language/DefaultNewTiddlerTitle": {
"title": "$:/language/DefaultNewTiddlerTitle",
"text": "New Tiddler"
},
"$:/language/DropMessage": {
"title": "$:/language/DropMessage",
"text": "Drop here (or click escape to cancel)"
},
"$:/language/Encryption/ConfirmClearPassword": {
"title": "$:/language/Encryption/ConfirmClearPassword",
"text": "Do you wish to clear the password? This will remove the encryption applied when saving this wiki"
},
"$:/language/Encryption/PromptSetPassword": {
"title": "$:/language/Encryption/PromptSetPassword",
"text": "Set a new password for this TiddlyWiki"
},
"$:/language/InvalidFieldName": {
"title": "$:/language/InvalidFieldName",
"text": "Illegal characters in field name \"<$text text=<<fieldName>>/>\". Fields can only contain lowercase letters, digits and the characters underscore (`_`), hyphen (`-`) and period (`.`)"
},
"$:/language/MissingTiddler/Hint": {
"title": "$:/language/MissingTiddler/Hint",
"text": "Missing tiddler \"<$text text=<<currentTiddler>>/>\" - click {{$:/core/images/edit-button}} to create"
},
"$:/language/RecentChanges/DateFormat": {
"title": "$:/language/RecentChanges/DateFormat",
"text": "DDth MMM YYYY"
},
"$:/language/SystemTiddler/Tooltip": {
"title": "$:/language/SystemTiddler/Tooltip",
"text": "This is a system tiddler"
},
"$:/language/TagManager/Colour/Heading": {
"title": "$:/language/TagManager/Colour/Heading",
"text": "Colour"
},
"$:/language/TagManager/Icon/Heading": {
"title": "$:/language/TagManager/Icon/Heading",
"text": "Icon"
},
"$:/language/TagManager/Info/Heading": {
"title": "$:/language/TagManager/Info/Heading",
"text": "Info"
},
"$:/language/TagManager/Tag/Heading": {
"title": "$:/language/TagManager/Tag/Heading",
"text": "Tag"
},
"$:/language/UnsavedChangesWarning": {
"title": "$:/language/UnsavedChangesWarning",
"text": "You have unsaved changes in TiddlyWiki"
},
"$:/language/Modals/Download": {
"title": "$:/language/Modals/Download",
"type": "text/vnd.tiddlywiki",
"subtitle": "Download changes",
"footer": "<$button message=\"tm-close-tiddler\">Close</$button>",
"help": "http://tiddlywiki.com/static/DownloadingChanges.html",
"text": "Your browser only supports manual saving.\n\nTo save your modified wiki, right click on the download link below and select \"Download file\" or \"Save file\", and then choose the folder and filename.\n\n//You can marginally speed things up by clicking the link with the control key (Windows) or the options/alt key (Mac OS X). You will not be prompted for the folder or filename, but your browser is likely to give it an unrecognisable name -- you may need to rename the file to include an `.html` extension before you can do anything useful with it.//\n\nOn smartphones that do not allow files to be downloaded you can instead bookmark the link, and then sync your bookmarks to a desktop computer from where the wiki can be saved normally.\n"
},
"$:/language/Modals/SaveInstructions": {
"title": "$:/language/Modals/SaveInstructions",
"type": "text/vnd.tiddlywiki",
"subtitle": "Save your work",
"footer": "<$button message=\"tm-close-tiddler\">Close</$button>",
"help": "http://tiddlywiki.com/static/SavingChanges.html",
"text": "Your changes to this wiki need to be saved as a ~TiddlyWiki HTML file.\n\n!!! Desktop browsers\n\n# Select ''Save As'' from the ''File'' menu\n# Choose a filename and location\n#* Some browsers also require you to explicitly specify the file saving format as ''Webpage, HTML only'' or similar\n# Close this tab\n\n!!! Smartphone browsers\n\n# Create a bookmark to this page\n#* If you've got iCloud or Google Sync set up then the bookmark will automatically sync to your desktop where you can open it and save it as above\n# Close this tab\n\n//If you open the bookmark again in Mobile Safari you will see this message again. If you want to go ahead and use the file, just click the ''close'' button below//\n"
},
"$:/config/NewJournal/Title": {
"title": "$:/config/NewJournal/Title",
"text": "DDth MMM YYYY"
},
"$:/config/NewJournal/Tags": {
"title": "$:/config/NewJournal/Tags",
"text": "Journal"
},
"$:/language/Notifications/Save/Done": {
"title": "$:/language/Notifications/Save/Done",
"text": "Saved wiki"
},
"$:/language/Notifications/Save/Starting": {
"title": "$:/language/Notifications/Save/Starting",
"text": "Starting to save wiki"
},
"$:/language/Search/DefaultResults/Caption": {
"title": "$:/language/Search/DefaultResults/Caption",
"text": "List"
},
"$:/language/Search/Filter/Caption": {
"title": "$:/language/Search/Filter/Caption",
"text": "Filter"
},
"$:/language/Search/Filter/Hint": {
"title": "$:/language/Search/Filter/Hint",
"text": "Search via a [[filter expression|http://tiddlywiki.com/static/Filters.html]]"
},
"$:/language/Search/Filter/Matches": {
"title": "$:/language/Search/Filter/Matches",
"text": "//<small><<resultCount>> matches</small>//"
},
"$:/language/Search/Matches": {
"title": "$:/language/Search/Matches",
"text": "//<small><<resultCount>> matches</small>//"
},
"$:/language/Search/Shadows/Caption": {
"title": "$:/language/Search/Shadows/Caption",
"text": "Shadows"
},
"$:/language/Search/Shadows/Hint": {
"title": "$:/language/Search/Shadows/Hint",
"text": "Search for shadow tiddlers"
},
"$:/language/Search/Shadows/Matches": {
"title": "$:/language/Search/Shadows/Matches",
"text": "//<small><<resultCount>> matches</small>//"
},
"$:/language/Search/Standard/Caption": {
"title": "$:/language/Search/Standard/Caption",
"text": "Standard"
},
"$:/language/Search/Standard/Hint": {
"title": "$:/language/Search/Standard/Hint",
"text": "Search for standard tiddlers"
},
"$:/language/Search/Standard/Matches": {
"title": "$:/language/Search/Standard/Matches",
"text": "//<small><<resultCount>> matches</small>//"
},
"$:/language/Search/System/Caption": {
"title": "$:/language/Search/System/Caption",
"text": "System"
},
"$:/language/Search/System/Hint": {
"title": "$:/language/Search/System/Hint",
"text": "Search for system tiddlers"
},
"$:/language/Search/System/Matches": {
"title": "$:/language/Search/System/Matches",
"text": "//<small><<resultCount>> matches</small>//"
},
"$:/language/SideBar/All/Caption": {
"title": "$:/language/SideBar/All/Caption",
"text": "All"
},
"$:/language/SideBar/Contents/Caption": {
"title": "$:/language/SideBar/Contents/Caption",
"text": "Contents"
},
"$:/language/SideBar/Drafts/Caption": {
"title": "$:/language/SideBar/Drafts/Caption",
"text": "Drafts"
},
"$:/language/SideBar/Missing/Caption": {
"title": "$:/language/SideBar/Missing/Caption",
"text": "Missing"
},
"$:/language/SideBar/More/Caption": {
"title": "$:/language/SideBar/More/Caption",
"text": "More"
},
"$:/language/SideBar/Open/Caption": {
"title": "$:/language/SideBar/Open/Caption",
"text": "Open"
},
"$:/language/SideBar/Orphans/Caption": {
"title": "$:/language/SideBar/Orphans/Caption",
"text": "Orphans"
},
"$:/language/SideBar/Recent/Caption": {
"title": "$:/language/SideBar/Recent/Caption",
"text": "Recent"
},
"$:/language/SideBar/Shadows/Caption": {
"title": "$:/language/SideBar/Shadows/Caption",
"text": "Shadows"
},
"$:/language/SideBar/System/Caption": {
"title": "$:/language/SideBar/System/Caption",
"text": "System"
},
"$:/language/SideBar/Tags/Caption": {
"title": "$:/language/SideBar/Tags/Caption",
"text": "Tags"
},
"$:/language/SideBar/Tags/Untagged/Caption": {
"title": "$:/language/SideBar/Tags/Untagged/Caption",
"text": "untagged"
},
"$:/language/SideBar/Tools/Caption": {
"title": "$:/language/SideBar/Tools/Caption",
"text": "Tools"
},
"$:/language/SideBar/Types/Caption": {
"title": "$:/language/SideBar/Types/Caption",
"text": "Types"
},
"$:/SiteSubtitle": {
"title": "$:/SiteSubtitle",
"text": "a non-linear personal web notebook"
},
"$:/SiteTitle": {
"title": "$:/SiteTitle",
"text": "My ~TiddlyWiki"
},
"$:/language/TiddlerInfo/Advanced/Caption": {
"title": "$:/language/TiddlerInfo/Advanced/Caption",
"text": "Advanced"
},
"$:/language/TiddlerInfo/Advanced/PluginInfo/Empty/Hint": {
"title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Empty/Hint",
"text": "none"
},
"$:/language/TiddlerInfo/Advanced/PluginInfo/Heading": {
"title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Heading",
"text": "Plugin Details"
},
"$:/language/TiddlerInfo/Advanced/PluginInfo/Hint": {
"title": "$:/language/TiddlerInfo/Advanced/PluginInfo/Hint",
"text": "This plugin contains the following shadow tiddlers:"
},
"$:/language/TiddlerInfo/Advanced/ShadowInfo/Heading": {
"title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Heading",
"text": "Shadow Status"
},
"$:/language/TiddlerInfo/Advanced/ShadowInfo/NotShadow/Hint": {
"title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/NotShadow/Hint",
"text": "The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is not a shadow tiddler"
},
"$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Hint": {
"title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Hint",
"text": "The tiddler <$link to=<<infoTiddler>>><$text text=<<infoTiddler>>/></$link> is a shadow tiddler"
},
"$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Source": {
"title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/Shadow/Source",
"text": "It is defined in the plugin <$link to=<<pluginTiddler>>><$text text=<<pluginTiddler>>/></$link>"
},
"$:/language/TiddlerInfo/Advanced/ShadowInfo/OverriddenShadow/Hint": {
"title": "$:/language/TiddlerInfo/Advanced/ShadowInfo/OverriddenShadow/Hint",
"text": "It is overridden by an ordinary tiddler"
},
"$:/language/TiddlerInfo/Fields/Caption": {
"title": "$:/language/TiddlerInfo/Fields/Caption",
"text": "Fields"
},
"$:/language/TiddlerInfo/List/Caption": {
"title": "$:/language/TiddlerInfo/List/Caption",
"text": "List"
},
"$:/language/TiddlerInfo/List/Empty": {
"title": "$:/language/TiddlerInfo/List/Empty",
"text": "This tiddler does not have a list"
},
"$:/language/TiddlerInfo/Listed/Caption": {
"title": "$:/language/TiddlerInfo/Listed/Caption",
"text": "Listed"
},
"$:/language/TiddlerInfo/Listed/Empty": {
"title": "$:/language/TiddlerInfo/Listed/Empty",
"text": "This tiddler is not listed by any others"
},
"$:/language/TiddlerInfo/References/Caption": {
"title": "$:/language/TiddlerInfo/References/Caption",
"text": "References"
},
"$:/language/TiddlerInfo/References/Empty": {
"title": "$:/language/TiddlerInfo/References/Empty",
"text": "No tiddlers link to this one"
},
"$:/language/TiddlerInfo/Tagging/Caption": {
"title": "$:/language/TiddlerInfo/Tagging/Caption",
"text": "Tagging"
},
"$:/language/TiddlerInfo/Tagging/Empty": {
"title": "$:/language/TiddlerInfo/Tagging/Empty",
"text": "No tiddlers are tagged with this one"
},
"$:/language/TiddlerInfo/Tools/Caption": {
"title": "$:/language/TiddlerInfo/Tools/Caption",
"text": "Tools"
},
"$:/language/Docs/Types/application/javascript": {
"title": "$:/language/Docs/Types/application/javascript",
"description": "JavaScript code",
"name": "application/javascript",
"group": "Developer"
},
"$:/language/Docs/Types/application/json": {
"title": "$:/language/Docs/Types/application/json",
"description": "JSON data",
"name": "application/json",
"group": "Developer"
},
"$:/language/Docs/Types/application/x-tiddler-dictionary": {
"title": "$:/language/Docs/Types/application/x-tiddler-dictionary",
"description": "Data dictionary",
"name": "application/x-tiddler-dictionary",
"group": "Developer"
},
"$:/language/Docs/Types/image/gif": {
"title": "$:/language/Docs/Types/image/gif",
"description": "GIF image",
"name": "image/gif",
"group": "Image"
},
"$:/language/Docs/Types/image/jpeg": {
"title": "$:/language/Docs/Types/image/jpeg",
"description": "JPEG image",
"name": "image/jpeg",
"group": "Image"
},
"$:/language/Docs/Types/image/png": {
"title": "$:/language/Docs/Types/image/png",
"description": "PNG image",
"name": "image/png",
"group": "Image"
},
"$:/language/Docs/Types/image/svg+xml": {
"title": "$:/language/Docs/Types/image/svg+xml",
"description": "Structured Vector Graphics image",
"name": "image/svg+xml",
"group": "Image"
},
"$:/language/Docs/Types/image/x-icon": {
"title": "$:/language/Docs/Types/image/x-icon",
"description": "ICO format icon file",
"name": "image/x-icon",
"group": "Image"
},
"$:/language/Docs/Types/text/css": {
"title": "$:/language/Docs/Types/text/css",
"description": "Static stylesheet",
"name": "text/css",
"group": "Developer"
},
"$:/language/Docs/Types/text/html": {
"title": "$:/language/Docs/Types/text/html",
"description": "HTML markup",
"name": "text/html",
"group": "Text"
},
"$:/language/Docs/Types/text/plain": {
"title": "$:/language/Docs/Types/text/plain",
"description": "Plain text",
"name": "text/plain",
"group": "Text"
},
"$:/language/Docs/Types/text/vnd.tiddlywiki": {
"title": "$:/language/Docs/Types/text/vnd.tiddlywiki",
"description": "TiddlyWiki 5",
"name": "text/vnd.tiddlywiki",
"group": "Text"
},
"$:/language/Docs/Types/text/x-tiddlywiki": {
"title": "$:/language/Docs/Types/text/x-tiddlywiki",
"description": "TiddlyWiki Classic",
"name": "text/x-tiddlywiki",
"group": "Text"
},
"$:/languages/en-GB/icon": {
"title": "$:/languages/en-GB/icon",
"type": "image/svg+xml",
"text": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 30\" width=\"1200\" height=\"600\">\n<clipPath id=\"t\">\n\t<path d=\"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z\"/>\n</clipPath>\n<path d=\"M0,0 v30 h60 v-30 z\" fill=\"#00247d\"/>\n<path d=\"M0,0 L60,30 M60,0 L0,30\" stroke=\"#fff\" stroke-width=\"6\"/>\n<path d=\"M0,0 L60,30 M60,0 L0,30\" clip-path=\"url(#t)\" stroke=\"#cf142b\" stroke-width=\"4\"/>\n<path d=\"M30,0 v30 M0,15 h60\" stroke=\"#fff\" stroke-width=\"10\"/>\n<path d=\"M30,0 v30 M0,15 h60\" stroke=\"#cf142b\" stroke-width=\"6\"/>\n</svg>\n"
},
"$:/languages/en-GB": {
"title": "$:/languages/en-GB",
"name": "en-GB",
"description": "English (British)",
"author": "JeremyRuston",
"core-version": ">=5.0.0\"",
"text": "Stub pseudo-plugin for the default language"
},
"$:/core/modules/commander.js": {
"text": "/*\\\ntitle: $:/core/modules/commander.js\ntype: application/javascript\nmodule-type: global\n\nThe $tw.Commander class is a command interpreter\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nParse a sequence of commands\n\tcommandTokens: an array of command string tokens\n\twiki: reference to the wiki store object\n\tstreams: {output:, error:}, each of which has a write(string) method\n\tcallback: a callback invoked as callback(err) where err is null if there was no error\n*/\nvar Commander = function(commandTokens,callback,wiki,streams) {\n\tvar path = require(\"path\");\n\tthis.commandTokens = commandTokens;\n\tthis.nextToken = 0;\n\tthis.callback = callback;\n\tthis.wiki = wiki;\n\tthis.streams = streams;\n\tthis.outputPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiOutputSubDir);\n};\n\n/*\nAdd a string of tokens to the command queue\n*/\nCommander.prototype.addCommandTokens = function(commandTokens) {\n\tvar params = commandTokens.slice(0);\n\tparams.unshift(0);\n\tparams.unshift(this.nextToken);\n\tArray.prototype.splice.apply(this.commandTokens,params);\n};\n\n/*\nExecute the sequence of commands and invoke a callback on completion\n*/\nCommander.prototype.execute = function() {\n\tthis.executeNextCommand();\n};\n\n/*\nExecute the next command in the sequence\n*/\nCommander.prototype.executeNextCommand = function() {\n\tvar self = this;\n\t// Invoke the callback if there are no more commands\n\tif(this.nextToken >= this.commandTokens.length) {\n\t\tthis.callback(null);\n\t} else {\n\t\t// Get and check the command token\n\t\tvar commandName = this.commandTokens[this.nextToken++];\n\t\tif(commandName.substr(0,2) !== \"--\") {\n\t\t\tthis.callback(\"Missing command: \" + commandName);\n\t\t} else {\n\t\t\tcommandName = commandName.substr(2); // Trim off the --\n\t\t\t// Accumulate the parameters to the command\n\t\t\tvar params = [];\n\t\t\twhile(this.nextToken < this.commandTokens.length && \n\t\t\t\tthis.commandTokens[this.nextToken].substr(0,2) !== \"--\") {\n\t\t\t\tparams.push(this.commandTokens[this.nextToken++]);\n\t\t\t}\n\t\t\t// Get the command info\n\t\t\tvar command = $tw.commands[commandName],\n\t\t\t\tc,err;\n\t\t\tif(!command) {\n\t\t\t\tthis.callback(\"Unknown command: \" + commandName);\n\t\t\t} else {\n\t\t\t\tif(this.verbose) {\n\t\t\t\t\tthis.streams.output.write(\"Executing command: \" + commandName + \" \" + params.join(\" \") + \"\\n\");\n\t\t\t\t}\n\t\t\t\tif(command.info.synchronous) {\n\t\t\t\t\t// Synchronous command\n\t\t\t\t\tc = new command.Command(params,this);\n\t\t\t\t\terr = c.execute();\n\t\t\t\t\tif(err) {\n\t\t\t\t\t\tthis.callback(err);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.executeNextCommand();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Asynchronous command\n\t\t\t\t\tc = new command.Command(params,this,function(err) {\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\tself.callback(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tself.executeNextCommand();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\terr = c.execute();\n\t\t\t\t\tif(err) {\n\t\t\t\t\t\tthis.callback(err);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nCommander.initCommands = function(moduleType) {\n\tmoduleType = moduleType || \"command\";\n\t$tw.commands = {};\n\t$tw.modules.forEachModuleOfType(moduleType,function(title,module) {\n\t\tvar c = $tw.commands[module.info.name] = {};\n\t\t// Add the methods defined by the module\n\t\tfor(var f in module) {\n\t\t\tif($tw.utils.hop(module,f)) {\n\t\t\t\tc[f] = module[f];\n\t\t\t}\n\t\t}\n\t});\n};\n\nexports.Commander = Commander;\n\n})();\n",
"title": "$:/core/modules/commander.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/commands/build.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/build.js\ntype: application/javascript\nmodule-type: command\n\nCommand to build a build target\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"build\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\t// Get the build targets defined in the wiki\n\tvar buildTargets = $tw.boot.wikiInfo.build;\n\tif(!buildTargets) {\n\t\treturn \"No build targets defined\";\n\t}\n\t// Loop through each of the specified targets\n\tvar targets;\n\tif(this.params.length > 0) {\n\t\ttargets = this.params;\n\t} else {\n\t\ttargets = Object.keys(buildTargets);\n\t}\n\tfor(var targetIndex=0; targetIndex<targets.length; targetIndex++) {\n\t\tvar target = targets[targetIndex],\n\t\t\tcommands = buildTargets[target];\n\t\tif(!commands) {\n\t\t\treturn \"Build target '\" + target + \"' not found\";\n\t\t}\n\t\t// Add the commands to the queue\n\t\tthis.commander.addCommandTokens(commands);\n\t}\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/build.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/clearpassword.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/clearpassword.js\ntype: application/javascript\nmodule-type: command\n\nClear password for crypto operations\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"clearpassword\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\t$tw.crypto.setPassword(null);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/clearpassword.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/editions.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/editions.js\ntype: application/javascript\nmodule-type: command\n\nCommand to list the available editions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"editions\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar self = this;\n\t// Output the list\n\tthis.commander.streams.output.write(\"Available editions:\\n\\n\");\n\tvar editionInfo = $tw.utils.getEditionInfo();\n\t$tw.utils.each(editionInfo,function(info,name) {\n\t\tself.commander.streams.output.write(\" \" + name + \": \" + info.description + \"\\n\");\n\t});\n\tthis.commander.streams.output.write(\"\\n\");\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/editions.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/help.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/help.js\ntype: application/javascript\nmodule-type: command\n\nHelp command\n\n\\*/\n(function(){\n\n/*jshint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"help\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar subhelp = this.params[0] || \"default\",\n\t\thelpBase = \"$:/language/Help/\",\n\t\ttext;\n\tif(!this.commander.wiki.getTiddler(helpBase + subhelp)) {\n\t\tsubhelp = \"notfound\";\n\t}\n\t// Wikify the help as formatted text (ie block elements generate newlines)\n\ttext = this.commander.wiki.renderTiddler(\"text/plain-formatted\",helpBase + subhelp);\n\t// Remove any leading linebreaks\n\ttext = text.replace(/^(\\r?\\n)*/g,\"\");\n\tthis.commander.streams.output.write(text);\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/help.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/init.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/init.js\ntype: application/javascript\nmodule-type: command\n\nCommand to initialise an empty wiki folder\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"init\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tvar fs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\t// Check that we don't already have a valid wiki folder\n\tif($tw.boot.wikiTiddlersPath || ($tw.utils.isDirectory($tw.boot.wikiPath) && !$tw.utils.isDirectoryEmpty($tw.boot.wikiPath))) {\n\t\treturn \"Wiki folder is not empty\";\n\t}\n\t// Loop through each of the specified editions\n\tvar editions = this.params.length > 0 ? this.params : [\"empty\"];\n\tfor(var editionIndex=0; editionIndex<editions.length; editionIndex++) {\n\t\tvar editionName = editions[editionIndex];\n\t\t// Check the edition exists\n\t\tvar editionPath = $tw.findLibraryItem(editionName,$tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar));\n\t\tif(!$tw.utils.isDirectory(editionPath)) {\n\t\t\treturn \"Edition '\" + editionName + \"' not found\";\n\t\t}\n\t\t// Copy the edition content\n\t\tvar err = $tw.utils.copyDirectory(editionPath,$tw.boot.wikiPath);\n\t\tif(!err) {\n\t\t\tthis.commander.streams.output.write(\"Copied edition '\" + editionName + \"' to \" + $tw.boot.wikiPath + \"\\n\");\n\t\t} else {\n\t\t\treturn err;\n\t\t}\n\t}\n\t// Tweak the tiddlywiki.info to remove any included wikis\n\tvar packagePath = $tw.boot.wikiPath + \"/tiddlywiki.info\",\n\t\tpackageJson = JSON.parse(fs.readFileSync(packagePath));\n\tdelete packageJson.includeWikis;\n\tfs.writeFileSync(packagePath,JSON.stringify(packageJson,null,$tw.config.preferences.jsonSpaces));\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/init.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/load.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/load.js\ntype: application/javascript\nmodule-type: command\n\nCommand to load tiddlers from a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"load\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\tif(this.params.length < 1) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar ext = path.extname(self.params[0]);\n\tfs.readFile(this.params[0],$tw.utils.getTypeEncoding(ext),function(err,data) {\n\t\tif (err) {\n\t\t\tself.callback(err);\n\t\t} else {\n\t\t\tvar fields = {title: self.params[0]},\n\t\t\t\ttype = path.extname(self.params[0]);\n\t\t\tvar tiddlers = self.commander.wiki.deserializeTiddlers(type,data,fields);\n\t\t\tif(!tiddlers) {\n\t\t\t\tself.callback(\"No tiddlers found in file \\\"\" + self.params[0] + \"\\\"\");\n\t\t\t} else {\n\t\t\t\tfor(var t=0; t<tiddlers.length; t++) {\n\t\t\t\t\tself.commander.wiki.importTiddler(new $tw.Tiddler(tiddlers[t]));\n\t\t\t\t}\n\t\t\t\tself.callback(null);\t\n\t\t\t}\n\t\t}\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/load.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/makelibrary.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/makelibrary.js\ntype: application/javascript\nmodule-type: command\n\nCommand to pack all of the plugins in the library into a plugin tiddler of type \"library\"\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"makelibrary\",\n\tsynchronous: true\n};\n\nvar UPGRADE_LIBRARY_TITLE = \"$:/UpgradeLibrary\";\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar wiki = this.commander.wiki,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\tupgradeLibraryTitle = this.params[0] || UPGRADE_LIBRARY_TITLE,\n\t\ttiddlers = {};\n\t// Collect up the library plugins\n\tvar collectPlugins = function(folder) {\n\t\t\tvar pluginFolders = fs.readdirSync(folder);\n\t\t\tfor(var p=0; p<pluginFolders.length; p++) {\n\t\t\t\tif(!$tw.boot.excludeRegExp.test(pluginFolders[p])) {\n\t\t\t\t\tpluginFields = $tw.loadPluginFolder(path.resolve(folder,\"./\" + pluginFolders[p]));\n\t\t\t\t\tif(pluginFields && pluginFields.title) {\n\t\t\t\t\t\ttiddlers[pluginFields.title] = pluginFields;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tcollectPublisherPlugins = function(folder) {\n\t\t\tvar publisherFolders = fs.readdirSync(folder);\n\t\t\tfor(var t=0; t<publisherFolders.length; t++) {\n\t\t\t\tif(!$tw.boot.excludeRegExp.test(publisherFolders[t])) {\n\t\t\t\t\tcollectPlugins(path.resolve(folder,\"./\" + publisherFolders[t]));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\tcollectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.pluginsPath));\n\tcollectPublisherPlugins(path.resolve($tw.boot.corePath,$tw.config.themesPath));\n\tcollectPlugins(path.resolve($tw.boot.corePath,$tw.config.languagesPath));\n\t// Save the upgrade library tiddler\n\tvar pluginFields = {\n\t\ttitle: upgradeLibraryTitle,\n\t\ttype: \"application/json\",\n\t\t\"plugin-type\": \"library\",\n\t\t\"text\": JSON.stringify({tiddlers: tiddlers},null,$tw.config.preferences.jsonSpaces)\n\t};\n\twiki.addTiddler(new $tw.Tiddler(pluginFields));\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/makelibrary.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/output.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/output.js\ntype: application/javascript\nmodule-type: command\n\nCommand to set the default output location (defaults to current working directory)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"output\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tvar fs = require(\"fs\"),\n\t\tpath = require(\"path\");\n\tif(this.params.length < 1) {\n\t\treturn \"Missing output path\";\n\t}\n\tthis.commander.outputPath = path.resolve(process.cwd(),this.params[0]);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/output.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/password.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/password.js\ntype: application/javascript\nmodule-type: command\n\nSave password for crypto operations\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"password\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing password\";\n\t}\n\t$tw.crypto.setPassword(this.params[0]);\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/password.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/rendertiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/rendertiddler.js\ntype: application/javascript\nmodule-type: command\n\nCommand to render a tiddler and save it to a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"rendertiddler\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\ttitle = this.params[0],\n\t\tfilename = path.resolve(this.commander.outputPath,this.params[1]),\n\t\ttype = this.params[2] || \"text/html\";\n\t$tw.utils.createFileDirectories(filename);\n\tfs.writeFile(filename,this.commander.wiki.renderTiddler(type,title),\"utf8\",function(err) {\n\t\tself.callback(err);\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/rendertiddler.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/rendertiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/rendertiddlers.js\ntype: application/javascript\nmodule-type: command\n\nCommand to render several tiddlers to a folder of files\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"rendertiddlers\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\ttemplate = this.params[1],\n\t\tpathname = path.resolve(this.commander.outputPath,this.params[2]),\n\t\ttype = this.params[3] || \"text/html\",\n\t\textension = this.params[4] || \".html\",\n\t\tdeleteDirectory = (this.params[5] || \"\") != \"noclean\",\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\tif(deleteDirectory){\n\t\t$tw.utils.deleteDirectory(pathname);\n\t}\n\t$tw.utils.createDirectory(pathname);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar parser = wiki.parseTiddler(template),\n\t\t\twidgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});\n\t\tvar container = $tw.fakeDocument.createElement(\"div\");\n\t\twidgetNode.render(container,null);\n\t\tvar text = type === \"text/html\" ? container.innerHTML : container.textContent;\n\t\tfs.writeFileSync(path.resolve(pathname,encodeURIComponent(title) + extension),text,\"utf8\");\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/rendertiddlers.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/savetiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/savetiddler.js\ntype: application/javascript\nmodule-type: command\n\nCommand to save the content of a tiddler to a file\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"savetiddler\",\n\tsynchronous: false\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 2) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\ttitle = this.params[0],\n\t\tfilename = path.resolve(this.commander.outputPath,this.params[1]),\n\t\ttiddler = this.commander.wiki.getTiddler(title),\n\t\ttype = tiddler.fields.type || \"text/vnd.tiddlywiki\",\n\t\tcontentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: \"utf8\"};\n\t$tw.utils.createFileDirectories(filename);\n\tfs.writeFile(filename,tiddler.fields.text,contentTypeInfo.encoding,function(err) {\n\t\tself.callback(err);\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/savetiddler.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/savetiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/savetiddlers.js\ntype: application/javascript\nmodule-type: command\n\nCommand to save several tiddlers to a folder of files\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"savetiddlers\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing filename\";\n\t}\n\tvar self = this,\n\t\tfs = require(\"fs\"),\n\t\tpath = require(\"path\"),\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\tpathname = path.resolve(this.commander.outputPath,this.params[1]),\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\t$tw.utils.deleteDirectory(pathname);\n\t$tw.utils.createDirectory(pathname);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.commander.wiki.getTiddler(title),\n\t\t\ttype = tiddler.fields.type || \"text/vnd.tiddlywiki\",\n\t\t\tcontentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: \"utf8\"},\n\t\t\tfilename = path.resolve(pathname,encodeURIComponent(title));\n\t\tfs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/savetiddlers.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/server.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/server.js\ntype: application/javascript\nmodule-type: command\n\nServe tiddlers over http\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nif(!$tw.browser) {\n\tvar util = require(\"util\"),\n\t\tfs = require(\"fs\"),\n\t\turl = require(\"url\"),\n\t\tpath = require(\"path\"),\n\t\thttp = require(\"http\");\n}\n\nexports.info = {\n\tname: \"server\",\n\tsynchronous: true\n};\n\n/*\nA simple HTTP server with regexp-based routes\n*/\nfunction SimpleServer(options) {\n\tthis.routes = options.routes || [];\n\tthis.wiki = options.wiki;\n\tthis.variables = options.variables || {};\n}\n\nSimpleServer.prototype.set = function(obj) {\n\tvar self = this;\n\t$tw.utils.each(obj,function(value,name) {\n\t\tself.variables[name] = value;\n\t});\n};\n\nSimpleServer.prototype.get = function(name) {\n\treturn this.variables[name];\n};\n\nSimpleServer.prototype.addRoute = function(route) {\n\tthis.routes.push(route);\n};\n\nSimpleServer.prototype.findMatchingRoute = function(request,state) {\n\tvar pathprefix = this.get(\"pathprefix\") || \"\";\n\tfor(var t=0; t<this.routes.length; t++) {\n\t\tvar potentialRoute = this.routes[t],\n\t\t\tpathRegExp = potentialRoute.path,\n\t\t\tpathname = state.urlInfo.pathname,\n\t\t\tmatch;\n\t\tif(pathprefix) {\n\t\t\tif(pathname.substr(0,pathprefix.length) === pathprefix) {\n\t\t\t\tpathname = pathname.substr(pathprefix.length);\n\t\t\t\tmatch = potentialRoute.path.exec(pathname);\n\t\t\t} else {\n\t\t\t\tmatch = false;\n\t\t\t}\n\t\t} else {\n\t\t\tmatch = potentialRoute.path.exec(pathname);\n\t\t}\n\t\tif(match && request.method === potentialRoute.method) {\n\t\t\tstate.params = [];\n\t\t\tfor(var p=1; p<match.length; p++) {\n\t\t\t\tstate.params.push(match[p]);\n\t\t\t}\n\t\t\treturn potentialRoute;\n\t\t}\n\t}\n\treturn null;\n};\n\nSimpleServer.prototype.checkCredentials = function(request,incomingUsername,incomingPassword) {\n\tvar header = request.headers.authorization || \"\",\n\t\ttoken = header.split(/\\s+/).pop() || \"\",\n\t\tauth = $tw.utils.base64Decode(token),\n\t\tparts = auth.split(/:/),\n\t\tusername = parts[0],\n\t\tpassword = parts[1];\n\tif(incomingUsername === username && incomingPassword === password) {\n\t\treturn \"ALLOWED\";\n\t} else {\n\t\treturn \"DENIED\";\n\t}\n};\n\nSimpleServer.prototype.listen = function(port,host) {\n\tvar self = this;\n\thttp.createServer(function(request,response) {\n\t\t// Compose the state object\n\t\tvar state = {};\n\t\tstate.wiki = self.wiki;\n\t\tstate.server = self;\n\t\tstate.urlInfo = url.parse(request.url);\n\t\t// Find the route that matches this path\n\t\tvar route = self.findMatchingRoute(request,state);\n\t\t// Check for the username and password if we've got one\n\t\tvar username = self.get(\"username\"),\n\t\t\tpassword = self.get(\"password\");\n\t\tif(username && password) {\n\t\t\t// Check they match\n\t\t\tif(self.checkCredentials(request,username,password) !== \"ALLOWED\") {\n\t\t\t\tvar servername = state.wiki.getTiddlerText(\"$:/SiteTitle\") || \"TiddlyWiki5\";\n\t\t\t\tresponse.writeHead(401,\"Authentication required\",{\n\t\t\t\t\t\"WWW-Authenticate\": 'Basic realm=\"Please provide your username and password to login to ' + servername + '\"'\n\t\t\t\t});\n\t\t\t\tresponse.end();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// Return a 404 if we didn't find a route\n\t\tif(!route) {\n\t\t\tresponse.writeHead(404);\n\t\t\tresponse.end();\n\t\t\treturn;\n\t\t}\n\t\t// Set the encoding for the incoming request\n\t\t// TODO: Presumably this would need tweaking if we supported PUTting binary tiddlers\n\t\trequest.setEncoding(\"utf8\");\n\t\t// Dispatch the appropriate method\n\t\tswitch(request.method) {\n\t\t\tcase \"GET\": // Intentional fall-through\n\t\t\tcase \"DELETE\":\n\t\t\t\troute.handler(request,response,state);\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\tvar data = \"\";\n\t\t\t\trequest.on(\"data\",function(chunk) {\n\t\t\t\t\tdata += chunk.toString();\n\t\t\t\t});\n\t\t\t\trequest.on(\"end\",function() {\n\t\t\t\t\tstate.data = data;\n\t\t\t\t\troute.handler(request,response,state);\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t}\n\t}).listen(port,host);\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n\t// Set up server\n\tthis.server = new SimpleServer({\n\t\twiki: this.commander.wiki\n\t});\n\t// Add route handlers\n\tthis.server.addRoute({\n\t\tmethod: \"PUT\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]),\n\t\t\t\tfields = JSON.parse(state.data);\n\t\t\t// Pull up any subfields in the `fields` object\n\t\t\tif(fields.fields) {\n\t\t\t\t$tw.utils.each(fields.fields,function(field,name) {\n\t\t\t\t\tfields[name] = field;\n\t\t\t\t});\n\t\t\t\tdelete fields.fields;\n\t\t\t}\n\t\t\t// Remove any revision field\n\t\t\tif(fields.revision) {\n\t\t\t\tdelete fields.revision;\n\t\t\t}\n\t\t\tstate.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));\n\t\t\tvar changeCount = state.wiki.getChangeCount(title).toString();\n\t\t\tresponse.writeHead(204, \"OK\",{\n\t\t\t\tEtag: \"\\\"default/\" + encodeURIComponent(title) + \"/\" + changeCount + \":\\\"\",\n\t\t\t\t\"Content-Type\": \"text/plain\"\n\t\t\t});\n\t\t\tresponse.end();\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"DELETE\",\n\t\tpath: /^\\/bags\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]);\n\t\t\tstate.wiki.deleteTiddler(title);\n\t\t\tresponse.writeHead(204, \"OK\", {\n\t\t\t\t\"Content-Type\": \"text/plain\"\n\t\t\t});\n\t\t\tresponse.end();\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": state.server.get(\"serveType\")});\n\t\t\tvar text = state.wiki.renderTiddler(state.server.get(\"renderType\"),state.server.get(\"rootTiddler\"));\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/status$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\tvar text = JSON.stringify({\n\t\t\t\tusername: state.server.get(\"username\"),\n\t\t\t\tspace: {\n\t\t\t\t\trecipe: \"default\"\n\t\t\t\t},\n\t\t\t\ttiddlywiki_version: $tw.version\n\t\t\t});\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/favicon.ico$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"image/x-icon\"});\n\t\t\tvar buffer = state.wiki.getTiddlerText(\"$:/favicon.ico\",\"\");\n\t\t\tresponse.end(buffer,\"base64\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers.json$/,\n\t\thandler: function(request,response,state) {\n\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\tvar tiddlers = [];\n\t\t\tstate.wiki.forEachTiddler({sortField: \"title\"},function(title,tiddler) {\n\t\t\t\tvar tiddlerFields = {};\n\t\t\t\t$tw.utils.each(tiddler.fields,function(field,name) {\n\t\t\t\t\tif(name !== \"text\") {\n\t\t\t\t\t\ttiddlerFields[name] = tiddler.getFieldString(name);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttiddlerFields.revision = state.wiki.getChangeCount(title);\n\t\t\t\ttiddlerFields.type = tiddlerFields.type || \"text/vnd.tiddlywiki\";\n\t\t\t\ttiddlers.push(tiddlerFields);\n\t\t\t});\n\t\t\tvar text = JSON.stringify(tiddlers);\n\t\t\tresponse.end(text,\"utf8\");\n\t\t}\n\t});\n\tthis.server.addRoute({\n\t\tmethod: \"GET\",\n\t\tpath: /^\\/recipes\\/default\\/tiddlers\\/(.+)$/,\n\t\thandler: function(request,response,state) {\n\t\t\tvar title = decodeURIComponent(state.params[0]),\n\t\t\t\ttiddler = state.wiki.getTiddler(title),\n\t\t\t\ttiddlerFields = {},\n\t\t\t\tknownFields = [\n\t\t\t\t\t\"bag\", \"created\", \"creator\", \"modified\", \"modifier\", \"permissions\", \"recipe\", \"revision\", \"tags\", \"text\", \"title\", \"type\", \"uri\"\n\t\t\t\t];\n\t\t\tif(tiddler) {\n\t\t\t\t$tw.utils.each(tiddler.fields,function(field,name) {\n\t\t\t\t\tvar value = tiddler.getFieldString(name);\n\t\t\t\t\tif(knownFields.indexOf(name) !== -1) {\n\t\t\t\t\t\ttiddlerFields[name] = value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttiddlerFields.fields = tiddlerFields.fields || {};\n\t\t\t\t\t\ttiddlerFields.fields[name] = value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttiddlerFields.revision = state.wiki.getChangeCount(title);\n\t\t\t\ttiddlerFields.type = tiddlerFields.type || \"text/vnd.tiddlywiki\";\n\t\t\t\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t\t\t\tresponse.end(JSON.stringify(tiddlerFields),\"utf8\");\n\t\t\t} else {\n\t\t\t\tresponse.writeHead(404);\n\t\t\t\tresponse.end();\n\t\t\t}\n\t\t}\n\t});\n};\n\nCommand.prototype.execute = function() {\n\tif(!$tw.boot.wikiTiddlersPath) {\n\t\t$tw.utils.warning(\"Warning: Wiki folder '\" + $tw.boot.wikiPath + \"' does not exist or is missing a tiddlywiki.info file\");\n\t}\n\tvar port = this.params[0] || \"8080\",\n\t\trootTiddler = this.params[1] || \"$:/core/save/all\",\n\t\trenderType = this.params[2] || \"text/plain\",\n\t\tserveType = this.params[3] || \"text/html\",\n\t\tusername = this.params[4],\n\t\tpassword = this.params[5],\n\t\thost = this.params[6] || \"127.0.0.1\",\n\t\tpathprefix = this.params[7];\n\tthis.server.set({\n\t\trootTiddler: rootTiddler,\n\t\trenderType: renderType,\n\t\tserveType: serveType,\n\t\tusername: username,\n\t\tpassword: password,\n\t\tpathprefix: pathprefix\n\t});\n\tthis.server.listen(port,host);\n\tconsole.log(\"Serving on \" + host + \":\" + port);\n\tconsole.log(\"(press ctrl-C to exit)\");\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/server.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/setfield.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/setfield.js\ntype: application/javascript\nmodule-type: command\n\nCommand to modify selected tiddlers to set a field to the text of a template tiddler that has been wikified with the selected tiddler as the current tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.info = {\n\tname: \"setfield\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 4) {\n\t\treturn \"Missing parameters\";\n\t}\n\tvar self = this,\n\t\twiki = this.commander.wiki,\n\t\tfilter = this.params[0],\n\t\tfieldname = this.params[1] || \"text\",\n\t\ttemplatetitle = this.params[2],\n\t\trendertype = this.params[3] || \"text/plain\",\n\t\ttiddlers = wiki.filterTiddlers(filter);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar parser = wiki.parseTiddler(templatetitle),\n\t\t\tnewFields = {},\n\t\t\ttiddler = wiki.getTiddler(title);\n\t\tif(parser) {\n\t\t\tvar widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});\n\t\t\tvar container = $tw.fakeDocument.createElement(\"div\");\n\t\t\twidgetNode.render(container,null);\n\t\t\tnewFields[fieldname] = rendertype === \"text/html\" ? container.innerHTML : container.textContent;\n\t\t} else {\n\t\t\tnewFields[fieldname] = undefined;\n\t\t}\n\t\twiki.addTiddler(new $tw.Tiddler(tiddler,newFields));\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/setfield.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/unpackplugin.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/unpackplugin.js\ntype: application/javascript\nmodule-type: command\n\nCommand to extract the shadow tiddlers from within a plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"unpackplugin\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander,callback) {\n\tthis.params = params;\n\tthis.commander = commander;\n\tthis.callback = callback;\n};\n\nCommand.prototype.execute = function() {\n\tif(this.params.length < 1) {\n\t\treturn \"Missing plugin name\";\n\t}\n\tvar self = this,\n\t\ttitle = this.params[0],\n\t\tpluginData = this.commander.wiki.getTiddlerData(title);\n\tif(!pluginData) {\n\t\treturn \"Plugin '\" + title + \"' not found\";\n\t}\n\t$tw.utils.each(pluginData.tiddlers,function(tiddler) {\n\t\tself.commander.wiki.addTiddler(new $tw.Tiddler(tiddler));\n\t});\n\treturn null;\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/unpackplugin.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/verbose.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/verbose.js\ntype: application/javascript\nmodule-type: command\n\nVerbose command\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"verbose\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tthis.commander.verbose = true;\n\t// Output the boot message log\n\tthis.commander.streams.output.write(\"Boot log:\\n \" + $tw.boot.logMessages.join(\"\\n \") + \"\\n\");\n\treturn null; // No error\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/verbose.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/commands/version.js": {
"text": "/*\\\ntitle: $:/core/modules/commands/version.js\ntype: application/javascript\nmodule-type: command\n\nVersion command\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.info = {\n\tname: \"version\",\n\tsynchronous: true\n};\n\nvar Command = function(params,commander) {\n\tthis.params = params;\n\tthis.commander = commander;\n};\n\nCommand.prototype.execute = function() {\n\tthis.commander.streams.output.write($tw.version + \"\\n\");\n\treturn null; // No error\n};\n\nexports.Command = Command;\n\n})();\n",
"title": "$:/core/modules/commands/version.js",
"type": "application/javascript",
"module-type": "command"
},
"$:/core/modules/config.js": {
"text": "/*\\\ntitle: $:/core/modules/config.js\ntype: application/javascript\nmodule-type: config\n\nCore configuration constants\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.preferences = {};\n\nexports.preferences.notificationDuration = 3 * 1000;\nexports.preferences.jsonSpaces = 4;\n\nexports.textPrimitives = {\n\tupperLetter: \"[A-Z\\u00c0-\\u00d6\\u00d8-\\u00de\\u0150\\u0170]\",\n\tlowerLetter: \"[a-z\\u00df-\\u00f6\\u00f8-\\u00ff\\u0151\\u0171]\",\n\tanyLetter: \"[A-Za-z0-9\\u00c0-\\u00d6\\u00d8-\\u00de\\u00df-\\u00f6\\u00f8-\\u00ff\\u0150\\u0170\\u0151\\u0171]\",\n\tblockPrefixLetters:\t\"[A-Za-z0-9-_\\u00c0-\\u00d6\\u00d8-\\u00de\\u00df-\\u00f6\\u00f8-\\u00ff\\u0150\\u0170\\u0151\\u0171]\"\n};\n\nexports.textPrimitives.unWikiLink = \"~\";\nexports.textPrimitives.wikiLink = exports.textPrimitives.upperLetter + \"+\" +\n\texports.textPrimitives.lowerLetter + \"+\" +\n\texports.textPrimitives.upperLetter +\n\texports.textPrimitives.anyLetter + \"*\";\n\nexports.htmlEntities = {quot:34, amp:38, apos:39, lt:60, gt:62, nbsp:160, iexcl:161, cent:162, pound:163, curren:164, yen:165, brvbar:166, sect:167, uml:168, copy:169, ordf:170, laquo:171, not:172, shy:173, reg:174, macr:175, deg:176, plusmn:177, sup2:178, sup3:179, acute:180, micro:181, para:182, middot:183, cedil:184, sup1:185, ordm:186, raquo:187, frac14:188, frac12:189, frac34:190, iquest:191, Agrave:192, Aacute:193, Acirc:194, Atilde:195, Auml:196, Aring:197, AElig:198, Ccedil:199, Egrave:200, Eacute:201, Ecirc:202, Euml:203, Igrave:204, Iacute:205, Icirc:206, Iuml:207, ETH:208, Ntilde:209, Ograve:210, Oacute:211, Ocirc:212, Otilde:213, Ouml:214, times:215, Oslash:216, Ugrave:217, Uacute:218, Ucirc:219, Uuml:220, Yacute:221, THORN:222, szlig:223, agrave:224, aacute:225, acirc:226, atilde:227, auml:228, aring:229, aelig:230, ccedil:231, egrave:232, eacute:233, ecirc:234, euml:235, igrave:236, iacute:237, icirc:238, iuml:239, eth:240, ntilde:241, ograve:242, oacute:243, ocirc:244, otilde:245, ouml:246, divide:247, oslash:248, ugrave:249, uacute:250, ucirc:251, uuml:252, yacute:253, thorn:254, yuml:255, OElig:338, oelig:339, Scaron:352, scaron:353, Yuml:376, fnof:402, circ:710, tilde:732, Alpha:913, Beta:914, Gamma:915, Delta:916, Epsilon:917, Zeta:918, Eta:919, Theta:920, Iota:921, Kappa:922, Lambda:923, Mu:924, Nu:925, Xi:926, Omicron:927, Pi:928, Rho:929, Sigma:931, Tau:932, Upsilon:933, Phi:934, Chi:935, Psi:936, Omega:937, alpha:945, beta:946, gamma:947, delta:948, epsilon:949, zeta:950, eta:951, theta:952, iota:953, kappa:954, lambda:955, mu:956, nu:957, xi:958, omicron:959, pi:960, rho:961, sigmaf:962, sigma:963, tau:964, upsilon:965, phi:966, chi:967, psi:968, omega:969, thetasym:977, upsih:978, piv:982, ensp:8194, emsp:8195, thinsp:8201, zwnj:8204, zwj:8205, lrm:8206, rlm:8207, ndash:8211, mdash:8212, lsquo:8216, rsquo:8217, sbquo:8218, ldquo:8220, rdquo:8221, bdquo:8222, dagger:8224, Dagger:8225, bull:8226, hellip:8230, permil:8240, prime:8242, Prime:8243, lsaquo:8249, rsaquo:8250, oline:8254, frasl:8260, euro:8364, image:8465, weierp:8472, real:8476, trade:8482, alefsym:8501, larr:8592, uarr:8593, rarr:8594, darr:8595, harr:8596, crarr:8629, lArr:8656, uArr:8657, rArr:8658, dArr:8659, hArr:8660, forall:8704, part:8706, exist:8707, empty:8709, nabla:8711, isin:8712, notin:8713, ni:8715, prod:8719, sum:8721, minus:8722, lowast:8727, radic:8730, prop:8733, infin:8734, ang:8736, and:8743, or:8744, cap:8745, cup:8746, int:8747, there4:8756, sim:8764, cong:8773, asymp:8776, ne:8800, equiv:8801, le:8804, ge:8805, sub:8834, sup:8835, nsub:8836, sube:8838, supe:8839, oplus:8853, otimes:8855, perp:8869, sdot:8901, lceil:8968, rceil:8969, lfloor:8970, rfloor:8971, lang:9001, rang:9002, loz:9674, spades:9824, clubs:9827, hearts:9829, diams:9830 };\n\nexports.htmlVoidElements = \"area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr\".split(\",\");\n\nexports.htmlBlockElements = \"address,article,aside,audio,blockquote,canvas,dd,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,noscript,ol,output,p,pre,section,table,tfoot,ul,video\".split(\",\");\n\nexports.htmlUnsafeElements = \"script\".split(\",\");\n\n})();\n",
"title": "$:/core/modules/config.js",
"type": "application/javascript",
"module-type": "config"
},
"$:/core/modules/deserializers.js": {
"text": "/*\\\ntitle: $:/core/modules/deserializers.js\ntype: application/javascript\nmodule-type: tiddlerdeserializer\n\nFunctions to deserialise tiddlers from a block of text\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nUtility function to parse an old-style tiddler DIV in a *.tid file. It looks like this:\n\n<div title=\"Title\" creator=\"JoeBloggs\" modifier=\"JoeBloggs\" created=\"201102111106\" modified=\"201102111310\" tags=\"myTag [[my long tag]]\">\n<pre>The text of the tiddler (without the expected HTML encoding).\n</pre>\n</div>\n\nNote that the field attributes are HTML encoded, but that the body of the <PRE> tag is not encoded.\n\nWhen these tiddler DIVs are encountered within a TiddlyWiki HTML file then the body is encoded in the usual way.\n*/\nvar parseTiddlerDiv = function(text /* [,fields] */) {\n\t// Slot together the default results\n\tvar result = {};\n\tif(arguments.length > 1) {\n\t\tfor(var f=1; f<arguments.length; f++) {\n\t\t\tvar fields = arguments[f];\n\t\t\tfor(var t in fields) {\n\t\t\t\tresult[t] = fields[t];\t\t\n\t\t\t}\n\t\t}\n\t}\n\t// Parse the DIV body\n\tvar startRegExp = /^\\s*<div\\s+([^>]*)>(\\s*<pre>)?/gi,\n\t\tendRegExp,\n\t\tmatch = startRegExp.exec(text);\n\tif(match) {\n\t\t// Old-style DIVs don't have the <pre> tag\n\t\tif(match[2]) {\n\t\t\tendRegExp = /<\\/pre>\\s*<\\/div>\\s*$/gi;\n\t\t} else {\n\t\t\tendRegExp = /<\\/div>\\s*$/gi;\n\t\t}\n\t\tvar endMatch = endRegExp.exec(text);\n\t\tif(endMatch) {\n\t\t\t// Extract the text\n\t\t\tresult.text = text.substring(match.index + match[0].length,endMatch.index);\n\t\t\t// Process the attributes\n\t\t\tvar attrRegExp = /\\s*([^=\\s]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/gi,\n\t\t\t\tattrMatch;\n\t\t\tdo {\n\t\t\t\tattrMatch = attrRegExp.exec(match[1]);\n\t\t\t\tif(attrMatch) {\n\t\t\t\t\tvar name = attrMatch[1];\n\t\t\t\t\tvar value = attrMatch[2] !== undefined ? attrMatch[2] : attrMatch[3];\n\t\t\t\t\tresult[name] = value;\n\t\t\t\t}\n\t\t\t} while(attrMatch);\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports[\"application/x-tiddler-html-div\"] = function(text,fields) {\n\treturn [parseTiddlerDiv(text,fields)];\n};\n\nexports[\"application/json\"] = function(text,fields) {\n\tvar incoming = JSON.parse(text),\n\t\tresults = [];\n\tif($tw.utils.isArray(incoming)) {\n\t\tfor(var t=0; t<incoming.length; t++) {\n\t\t\tvar incomingFields = incoming[t],\n\t\t\t\tfields = {};\n\t\t\tfor(var f in incomingFields) {\n\t\t\t\tif(typeof incomingFields[f] === \"string\") {\n\t\t\t\t\tfields[f] = incomingFields[f];\n\t\t\t\t}\n\t\t\t}\n\t\t\tresults.push(fields);\n\t\t}\n\t}\n\treturn results;\n};\n\n/*\nParse an HTML file into tiddlers. There are three possibilities:\n# A TiddlyWiki classic HTML file containing `text/x-tiddlywiki` tiddlers\n# A TiddlyWiki5 HTML file containing `text/vnd.tiddlywiki` tiddlers\n# An ordinary HTML file\n*/\nexports[\"text/html\"] = function(text,fields) {\n\t// Check if we've got a store area\n\tvar storeAreaMarkerRegExp = /<div id=[\"']?storeArea['\"]?( style=[\"']?display:none;[\"']?)?>/gi,\n\t\tmatch = storeAreaMarkerRegExp.exec(text);\n\tif(match) {\n\t\t// If so, it's either a classic TiddlyWiki file or an unencrypted TW5 file\n\t\t// First read the normal tiddlers\n\t\tvar results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);\n\t\t// Then any system tiddlers\n\t\tvar systemAreaMarkerRegExp = /<div id=[\"']?systemArea['\"]?( style=[\"']?display:none;[\"']?)?>/gi,\n\t\t\tsysMatch = systemAreaMarkerRegExp.exec(text);\n\t\tif(sysMatch) {\n\t\t\tresults.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields));\n\t\t}\n\t\treturn results;\n\t} else {\n\t\t// Check whether we've got an encrypted file\n\t\tvar encryptedStoreArea = $tw.utils.extractEncryptedStoreArea(text);\n\t\tif(encryptedStoreArea) {\n\t\t\t// If so, attempt to decrypt it using the current password\n\t\t\treturn $tw.utils.decryptStoreArea(encryptedStoreArea);\n\t\t} else {\n\t\t\t// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler\n\t\t\treturn deserializeHtmlFile(text,fields);\n\t\t}\n\t}\n};\n\nfunction deserializeHtmlFile(text,fields) {\n\tvar result = {};\n\t$tw.utils.each(fields,function(value,name) {\n\t\tresult[name] = value;\n\t});\n\tresult.text = text;\n\tresult.type = \"text/html\";\n\treturn [result];\n}\n\nfunction deserializeTiddlyWikiFile(text,storeAreaEnd,isTiddlyWiki5,fields) {\n\tvar results = [],\n\t\tendOfDivRegExp = /(<\\/div>\\s*)/gi,\n\t\tstartPos = storeAreaEnd,\n\t\tdefaultType = isTiddlyWiki5 ? undefined : \"text/x-tiddlywiki\";\n\tendOfDivRegExp.lastIndex = startPos;\n\tvar match = endOfDivRegExp.exec(text);\n\twhile(match) {\n\t\tvar endPos = endOfDivRegExp.lastIndex,\n\t\t\ttiddlerFields = parseTiddlerDiv(text.substring(startPos,endPos),fields,{type: defaultType});\n\t\tif(!tiddlerFields) {\n\t\t\tbreak;\n\t\t}\n\t\t$tw.utils.each(tiddlerFields,function(value,name) {\n\t\t\tif(typeof value === \"string\") {\n\t\t\t\ttiddlerFields[name] = $tw.utils.htmlDecode(value);\n\t\t\t}\n\t\t});\n\t\tif(tiddlerFields.text !== null) {\n\t\t\tresults.push(tiddlerFields);\n\t\t}\n\t\tstartPos = endPos;\n\t\tmatch = endOfDivRegExp.exec(text);\n\t}\n\treturn results;\n}\n\n})();\n",
"title": "$:/core/modules/deserializers.js",
"type": "application/javascript",
"module-type": "tiddlerdeserializer"
},
"$:/core/modules/filters/addprefix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/addprefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for adding a prefix to each title in the list. This is\nespecially useful in contexts where only a filter expression is allowed\nand macro substitution isn't available.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.addprefix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(operator.operand + title);\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/addprefix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/addsuffix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/addsuffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for adding a suffix to each title in the list. This is\nespecially useful in contexts where only a filter expression is allowed\nand macro substitution isn't available.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.addsuffix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title + operator.operand);\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/addsuffix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/after.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/after.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler from the current list that is after the tiddler named in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.after = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\tvar index = results.indexOf(operator.operand);\n\tif(index === -1 || index > (results.length - 2)) {\n\t\treturn [];\n\t} else {\n\t\treturn [results[index + 1]];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/filters/after.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/all/current.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all/current.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[current]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.current = function(source,prefix,options) {\n\tvar currTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\");\n\tif(currTiddlerTitle) {\n\t\treturn [currTiddlerTitle];\n\t} else {\n\t\treturn [];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/filters/all/current.js",
"type": "application/javascript",
"module-type": "allfilteroperator"
},
"$:/core/modules/filters/all/missing.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all/missing.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[missing]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.missing = function(source,prefix,options) {\n\treturn options.wiki.getMissingTitles();\n};\n\n})();\n",
"title": "$:/core/modules/filters/all/missing.js",
"type": "application/javascript",
"module-type": "allfilteroperator"
},
"$:/core/modules/filters/all/orphans.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all/orphans.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[orphans]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.orphans = function(source,prefix,options) {\n\treturn options.wiki.getOrphanTitles();\n};\n\n})();\n",
"title": "$:/core/modules/filters/all/orphans.js",
"type": "application/javascript",
"module-type": "allfilteroperator"
},
"$:/core/modules/filters/all/shadows.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all/shadows.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[shadows]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadows = function(source,prefix,options) {\n\treturn options.wiki.allShadowTitles();\n};\n\n})();\n",
"title": "$:/core/modules/filters/all/shadows.js",
"type": "application/javascript",
"module-type": "allfilteroperator"
},
"$:/core/modules/filters/all/tiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all/tiddlers.js\ntype: application/javascript\nmodule-type: allfilteroperator\n\nFilter function for [all[tiddlers]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tiddlers = function(source,prefix,options) {\n\treturn options.wiki.allTitles();\n};\n\n})();\n",
"title": "$:/core/modules/filters/all/tiddlers.js",
"type": "application/javascript",
"module-type": "allfilteroperator"
},
"$:/core/modules/filters/all.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/all.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for selecting tiddlers\n\n[all[shadows+tiddlers]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar allFilterOperators;\n\nfunction getAllFilterOperators() {\n\tif(!allFilterOperators) {\n\t\tallFilterOperators = {};\n\t\t$tw.modules.applyMethods(\"allfilteroperator\",allFilterOperators);\n\t}\n\treturn allFilterOperators;\n}\n\n/*\nExport our filter function\n*/\nexports.all = function(source,operator,options) {\n\t// Get our suboperators\n\tvar allFilterOperators = getAllFilterOperators();\n\t// Cycle through the suboperators accumulating their results\n\tvar results = [],\n\t\tsubops = operator.operand.split(\"+\");\n\t// Check for common optimisations\n\tif(subops.length === 1 && subops[0] === \"\") {\n\t\treturn source;\n\t} else if(subops.length === 1 && subops[0] === \"tiddlers\") {\n\t\treturn options.wiki.each;\n\t} else if(subops.length === 1 && subops[0] === \"shadows\") {\n\t\treturn options.wiki.eachShadow;\n\t} else if(subops.length === 2 && subops[0] === \"tiddlers\" && subops[1] === \"shadows\") {\n\t\treturn options.wiki.eachTiddlerPlusShadows;\n\t} else if(subops.length === 2 && subops[0] === \"shadows\" && subops[1] === \"tiddlers\") {\n\t\treturn options.wiki.eachShadowPlusTiddlers;\n\t}\n\t// Do it the hard way\n\tfor(var t=0; t<subops.length; t++) {\n\t\tvar subop = allFilterOperators[subops[t]];\n\t\tif(subop) {\n\t\t\t$tw.utils.pushTop(results,subop(source,operator.prefix,options));\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/all.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/backlinks.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/backlinks.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning all the backlinks from a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.backlinks = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title));\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/backlinks.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/before.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/before.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler from the current list that is before the tiddler named in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.before = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\tvar index = results.indexOf(operator.operand);\n\tif(index <= 0) {\n\t\treturn [];\n\t} else {\n\t\treturn [results[index - 1]];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/filters/before.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/commands.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/commands.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the commands available in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.commands = function(source,operator,options) {\n\tvar results = [];\n\t$tw.utils.each($tw.commands,function(commandInfo,name) {\n\t\tresults.push(name);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/commands.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/each.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/each.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects one tiddler for each unique value of the specified field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.each = function(source,operator,options) {\n\tvar results = [],\n\t\tvalues = {};\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tvar value;\n\t\t\tif((operator.operand === \"\") || (operator.operand === \"title\")) {\n\t\t\t\tvalue = title;\n\t\t\t} else {\n\t\t\t\tvalue = tiddler.getFieldString(operator.operand);\n\t\t\t}\n\t\t\tif(!$tw.utils.hop(values,value)) {\n\t\t\t\tvalues[value] = true;\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/each.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/eachday.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/eachday.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects one tiddler for each unique day covered by the specified date field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.eachday = function(source,operator,options) {\n\tvar results = [],\n\t\tvalues = [];\n\t// Function to convert a date/time to a date integer\n\tvar toDate = function(value) {\n\t\tvalue = (new Date(value)).setHours(0,0,0,0);\n\t\treturn value+0;\n\t};\n\tsource(function(tiddler,title) {\n\t\tif(tiddler && tiddler.fields[operator.operand]) {\n\t\t\tvar value = toDate(tiddler.fields[operator.operand]);\n\t\t\tif(values.indexOf(value) === -1) {\n\t\t\t\tvalues.push(value);\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/eachday.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/editiondescription.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/editiondescription.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the descriptions of the specified edition names\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.editiondescription = function(source,operator,options) {\n\tvar results = [],\n\t\teditionInfo = $tw.utils.getEditionInfo();\n\tif(editionInfo) {\n\t\tsource(function(tiddler,title) {\n\t\t\tif($tw.utils.hop(editionInfo,title)) {\n\t\t\t\tresults.push(editionInfo[title].description || \"\");\t\t\t\t\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/editiondescription.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/editions.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/editions.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the available editions in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.editions = function(source,operator,options) {\n\tvar results = [],\n\t\teditionInfo = $tw.utils.getEditionInfo();\n\tif(editionInfo) {\n\t\t$tw.utils.each(editionInfo,function(info,name) {\n\t\t\tresults.push(name);\n\t\t});\n\t}\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/editions.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/field.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/field.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for comparing fields for equality\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.field = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldname = (operator.suffix || operator.operator || \"title\").toLowerCase();\n\tif(operator.prefix === \"!\") {\n\t\tif(operator.regexp) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && !operator.regexp.exec(text)) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && text !== operator.operand) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} else {\n\t\tif(operator.regexp) {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && !!operator.regexp.exec(text)) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tsource(function(tiddler,title) {\n\t\t\t\tif(tiddler) {\n\t\t\t\t\tvar text = tiddler.getFieldString(fieldname);\n\t\t\t\t\tif(text !== null && text === operator.operand) {\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/field.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/fields.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/fields.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the fields on the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.fields = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tfor(var fieldName in tiddler.fields) {\n\t\t\t\t$tw.utils.pushTop(results,fieldName);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/fields.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/get.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/get.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for replacing tiddler titles by the value of the field specified in the operand.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.get = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(tiddler) {\n\t\t\tvar value = tiddler.getFieldString(operator.operand);\n\t\t\tif(value) {\n\t\t\t\tresults.push(value);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/get.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/has.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/has.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a tiddler has the specified field\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.has = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!tiddler || (tiddler && (!$tw.utils.hop(tiddler.fields,operator.operand) || tiddler.fields[operator.operand] === \"\"))) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== \"\") {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/has.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/indexes.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/indexes.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the indexes of a data tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.indexes = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar data = options.wiki.getTiddlerData(title);\n\t\tif(data) {\n\t\t\t$tw.utils.pushTop(results,Object.keys(data));\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/indexes.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/is/current.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/current.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[current]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.current = function(source,prefix,options) {\n\tvar results = [],\n\t\tcurrTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\");\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title !== currTiddlerTitle) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title === currTiddlerTitle) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/current.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/image.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/image.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[image]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.image = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isImageTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isImageTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/image.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/missing.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/missing.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[missing]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.missing = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/missing.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/orphan.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/orphan.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[orphan]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.orphan = function(source,prefix,options) {\n\tvar results = [],\n\t\torphanTitles = options.wiki.getOrphanTitles();\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(orphanTitles.indexOf(title) === -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(orphanTitles.indexOf(title) !== -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/orphan.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/shadow.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/shadow.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[shadow]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadow = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isShadowTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isShadowTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/shadow.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/system.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/system.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[system]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.system = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.isSystemTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.isSystemTiddler(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/system.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/tag.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/tag.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[tag]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tag = function(source,prefix,options) {\n\tvar results = [],\n\t\ttagMap = options.wiki.getTagMap();\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!$tw.utils.hop(tagMap,title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif($tw.utils.hop(tagMap,title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/tag.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is/tiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is/tiddler.js\ntype: application/javascript\nmodule-type: isfilteroperator\n\nFilter function for [is[tiddler]]\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tiddler = function(source,prefix,options) {\n\tvar results = [];\n\tif(prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(options.wiki.tiddlerExists(title)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/is/tiddler.js",
"type": "application/javascript",
"module-type": "isfilteroperator"
},
"$:/core/modules/filters/is.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/is.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking tiddler properties\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar isFilterOperators;\n\nfunction getIsFilterOperators() {\n\tif(!isFilterOperators) {\n\t\tisFilterOperators = {};\n\t\t$tw.modules.applyMethods(\"isfilteroperator\",isFilterOperators);\n\t}\n\treturn isFilterOperators;\n}\n\n/*\nExport our filter function\n*/\nexports.is = function(source,operator,options) {\n\t// Dispatch to the correct isfilteroperator\n\tvar isFilterOperators = getIsFilterOperators();\n\tvar isFilterOperator = isFilterOperators[operator.operand];\n\tif(isFilterOperator) {\n\t\treturn isFilterOperator(source,operator.prefix,options);\n\t} else {\n\t\treturn [\"Filter Error: Unknown operand for the 'is' filter operator\"];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/filters/is.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/limit.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/limit.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for chopping the results to a specified maximum number of entries\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.limit = function(source,operator,options) {\n\tvar results = [];\n\t// Convert to an array\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\t// Slice the array if necessary\n\tvar limit = Math.min(results.length,parseInt(operator.operand,10));\n\tif(operator.prefix === \"!\") {\n\t\tresults = results.slice(-limit);\n\t} else {\n\t\tresults = results.slice(0,limit);\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/limit.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/links.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/links.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning all the links from a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.links = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title));\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/links.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/list.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/list.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddlers whose title is listed in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.list = function(source,operator,options) {\n\tvar results = [],\n\t\ttr = $tw.utils.parseTextReference(operator.operand),\n\t\tcurrTiddlerTitle = options.widget && options.widget.getVariable(\"currentTiddler\"),\n\t\tlist = options.wiki.getTiddlerList(tr.title || currTiddlerTitle,tr.field,tr.index);\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(list.indexOf(title) === -1) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tresults = list;\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/list.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/listed.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/listed.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all tiddlers that have the selected tiddlers in a list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.listed = function(source,operator,options) {\n\tvar field = operator.operand || \"list\",\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title,field));\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/listed.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/listops.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/listops.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operators for manipulating the current selection list\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nReverse list\n*/\nexports.reverse = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.unshift(title);\n\t});\n\treturn results;\n};\n\n/*\nFirst entry/entries in list\n*/\nexports.first = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(0,count);\n};\n\n/*\nLast entry/entries in list\n*/\nexports.last = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(-count);\n};\n\n/*\nAll but the first entry/entries of the list\n*/\nexports.rest = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(count);\n};\nexports.butfirst = exports.rest;\nexports.bf = exports.rest;\n\n/*\nAll but the last entry/entries of the list\n*/\nexports.butlast = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(0,-count);\n};\nexports.bl = exports.butlast;\n\n/*\nThe nth member of the list\n*/\nexports.nth = function(source,operator,options) {\n\tvar count = parseInt(operator.operand) || 1,\n\t\tresults = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results.slice(count - 1,count);\n};\n\n})();\n",
"title": "$:/core/modules/filters/listops.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/modules.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/modules.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the titles of the modules of a given type in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.modules = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.each($tw.modules.types[title],function(moduleInfo,moduleName) {\n\t\t\tresults.push(moduleName);\n\t\t});\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/modules.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/moduletypes.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/moduletypes.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the module types in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.moduletypes = function(source,operator,options) {\n\tvar results = [];\n\t$tw.utils.each($tw.modules.types,function(moduleInfo,type) {\n\t\tresults.push(type);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/moduletypes.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/next.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/next.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler whose title occurs next in the list supplied in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.next = function(source,operator,options) {\n\tvar results = [],\n\t\tlist = options.wiki.getTiddlerList(operator.operand);\n\tsource(function(tiddler,title) {\n\t\tvar match = list.indexOf(title);\n\t\t// increment match and then test if result is in range\n\t\tmatch++;\n\t\tif(match > 0 && match < list.length) {\n\t\t\tresults.push(list[match]);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/next.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/plugintiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/plugintiddlers.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the titles of the shadow tiddlers within a plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.plugintiddlers = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerData(title,{tiddlers:[]});\n\t\tif(pluginInfo && pluginInfo.tiddlers) {\n\t\t\t$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {\n\t\t\t\tresults.push(title);\n\t\t\t});\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/plugintiddlers.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/prefix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/prefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a title starts with a prefix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.prefix = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(0,operator.operand.length) !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(0,operator.operand.length) === operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/prefix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/previous.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/previous.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning the tiddler whose title occurs immediately prior in the list supplied in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.previous = function(source,operator,options) {\n\tvar results = [],\n\t\tlist = options.wiki.getTiddlerList(operator.operand);\n\tsource(function(tiddler,title) {\n\t\tvar match = list.indexOf(title);\n\t\t// increment match and then test if result is in range\n\t\tmatch--;\n\t\tif(match >= 0) {\n\t\t\tresults.push(list[match]);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/previous.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/regexp.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/regexp.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for regexp matching\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.regexp = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldname = (operator.suffix || \"title\").toLowerCase(),\n\t\tregexpString, regexp, flags = \"\", match,\n\t\tgetFieldString = function(tiddler,title) {\n\t\t\tif(tiddler) {\n\t\t\t\treturn tiddler.getFieldString(fieldname);\n\t\t\t} else if(fieldname === \"title\") {\n\t\t\t\treturn title;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t// Process flags and construct regexp\n\tregexpString = operator.operand;\n\tmatch = /^\\(\\?([gim]+)\\)/.exec(regexpString);\n\tif(match) {\n\t\tflags = match[1];\n\t\tregexpString = regexpString.substr(match[0].length);\n\t} else {\n\t\tmatch = /\\(\\?([gim]+)\\)$/.exec(regexpString);\n\t\tif(match) {\n\t\t\tflags = match[1];\n\t\t\tregexpString = regexpString.substr(0,regexpString.length - match[0].length);\n\t\t}\n\t}\n\tregexp = new RegExp(regexpString,flags);\n\t// Process the incoming tiddlers\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = getFieldString(tiddler,title);\n\t\t\tif(text !== null) {\n\t\t\t\tif(!regexp.exec(text)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = getFieldString(tiddler,title);\n\t\t\tif(text !== null) {\n\t\t\t\tif(!!regexp.exec(text)) {\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/regexp.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/removeprefix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/removeprefix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for removing a prefix from each title in the list. Titles that do not start with the prefix are removed.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.removeprefix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(title.substr(0,operator.operand.length) === operator.operand) {\n\t\t\tresults.push(title.substr(operator.operand.length));\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/removeprefix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/removesuffix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/removesuffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for removing a suffix from each title in the list. Titles that do not end with the suffix are removed.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.removesuffix = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(title.substr(-operator.operand.length) === operator.operand) {\n\t\t\tresults.push(title.substr(0,title.length - operator.operand.length));\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/removesuffix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/sameday.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/sameday.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that selects tiddlers with a modified date field on the same day as the provided value.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.sameday = function(source,operator,options) {\n\tvar results = [],\n\t\tfieldName = operator.suffix || \"modified\",\n\t\ttargetDate = (new Date($tw.utils.parseDate(operator.operand))).setHours(0,0,0,0);\n\t// Function to convert a date/time to a date integer\n\tvar isSameDay = function(dateField) {\n\t\t\treturn (new Date(dateField)).setHours(0,0,0,0) === targetDate;\n\t\t};\n\tsource(function(tiddler,title) {\n\t\tif(tiddler && tiddler.fields[fieldName]) {\n\t\t\tif(isSameDay(tiddler.fields[fieldName])) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/sameday.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/search.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/search.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for searching for the text in the operand tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.search = function(source,operator,options) {\n\tvar invert = operator.prefix === \"!\";\n\tif(operator.suffix) {\n\t\treturn options.wiki.search(operator.operand,{\n\t\t\tsource: source,\n\t\t\tinvert: invert,\n\t\t\tfield: operator.suffix\n\t\t});\n\t} else {\n\t\treturn options.wiki.search(operator.operand,{\n\t\t\tsource: source,\n\t\t\tinvert: invert\n\t\t});\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/filters/search.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/shadowsource.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/shadowsource.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the source plugins for shadow tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.shadowsource = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar source = options.wiki.getShadowSource(title);\n\t\tif(source) {\n\t\t\t$tw.utils.pushTop(results,source);\n\t\t}\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/shadowsource.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/sort.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/sort.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for sorting\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.sort = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",false,false);\n\treturn results;\n};\n\nexports.nsort = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",false,true);\n\treturn results;\n};\n\nexports.sortcs = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",true,false);\n\treturn results;\n};\n\nexports.nsortcs = function(source,operator,options) {\n\tvar results = prepare_results(source);\n\toptions.wiki.sortTiddlers(results,operator.operand || \"title\",operator.prefix === \"!\",true,true);\n\treturn results;\n};\n\nvar prepare_results = function (source) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tresults.push(title);\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/sort.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/splitbefore.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/splitbefore.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator that splits each result on the first occurance of the specified separator and returns the unique values.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.splitbefore = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tvar parts = title.split(operator.operand);\n\t\tif(parts.length === 1) {\n\t\t\t$tw.utils.pushTop(results,parts[0]);\n\t\t} else {\n\t\t\t$tw.utils.pushTop(results,parts[0] + operator.operand);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/splitbefore.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/storyviews.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/storyviews.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for returning the names of the story views in this wiki\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.storyviews = function(source,operator,options) {\n\tvar results = [],\n\t\tstoryviews = {};\n\t$tw.modules.applyMethods(\"storyview\",storyviews);\n\t$tw.utils.each(storyviews,function(info,name) {\n\t\tresults.push(name);\n\t});\n\tresults.sort();\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/storyviews.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/suffix.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/suffix.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking if a title ends with a suffix\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.suffix = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(-operator.operand.length) !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(title.substr(-operator.operand.length) === operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/suffix.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/tag.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/tag.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for checking for the presence of a tag\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tag = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && !tiddler.hasTag(operator.operand)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && tiddler.hasTag(operator.operand)) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t\tresults = options.wiki.sortByList(results,operator.operand);\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/tag.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/tagging.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/tagging.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all tiddlers that are tagged with the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tagging = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\t$tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title));\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/tagging.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/tags.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/tags.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all the tags of the selected tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.tags = function(source,operator,options) {\n\tvar results = [];\n\tsource(function(tiddler,title) {\n\t\tif(tiddler && tiddler.fields.tags) {\n\t\t\t$tw.utils.pushTop(results,tiddler.fields.tags);\n\t\t}\n\t});\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/tags.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/title.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/title.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator for comparing title fields for equality\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.title = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && tiddler.fields.title !== operator.operand) {\n\t\t\t\tresults.push(title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tresults.push(operator.operand);\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/title.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters/untagged.js": {
"text": "/*\\\ntitle: $:/core/modules/filters/untagged.js\ntype: application/javascript\nmodule-type: filteroperator\n\nFilter operator returning all the selected tiddlers that are untagged\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter function\n*/\nexports.untagged = function(source,operator,options) {\n\tvar results = [];\n\tif(operator.prefix === \"!\") {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) {\n\t\t\t\t$tw.utils.pushTop(results,title);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsource(function(tiddler,title) {\n\t\t\tif(!tiddler || !tiddler.hasField(\"tags\") || ($tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length === 0)) {\n\t\t\t\t$tw.utils.pushTop(results,title);\n\t\t\t}\n\t\t});\n\t}\n\treturn results;\n};\n\n})();\n",
"title": "$:/core/modules/filters/untagged.js",
"type": "application/javascript",
"module-type": "filteroperator"
},
"$:/core/modules/filters.js": {
"text": "/*\\\ntitle: $:/core/modules/filters.js\ntype: application/javascript\nmodule-type: wikimethod\n\nAdds tiddler filtering methods to the $tw.Wiki object.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nParses an operation within a filter string\n\tresults: Array of array of operator nodes into which results should be inserted\n\tfilterString: filter string\n\tp: start position within the string\nReturns the new start position, after the parsed operation\n*/\nfunction parseFilterOperation(operators,filterString,p) {\n\tvar operator, operand, bracketPos, curlyBracketPos;\n\t// Skip the starting square bracket\n\tif(filterString.charAt(p++) !== \"[\") {\n\t\tthrow \"Missing [ in filter expression\";\n\t}\n\t// Process each operator in turn\n\tdo {\n\t\toperator = {};\n\t\t// Check for an operator prefix\n\t\tif(filterString.charAt(p) === \"!\") {\n\t\t\toperator.prefix = filterString.charAt(p++);\n\t\t}\n\t\t// Get the operator name\n\t\tvar nextBracketPos = filterString.substring(p).search(/[\\[\\{<\\/]/);\n\t\tif(nextBracketPos === -1) {\n\t\t\tthrow \"Missing [ in filter expression\";\n\t\t}\n\t\tnextBracketPos += p;\n\t\tvar bracket = filterString.charAt(nextBracketPos);\n\t\toperator.operator = filterString.substring(p,nextBracketPos);\n\t\t\n\t\t// Any suffix?\n\t\tvar colon = operator.operator.indexOf(':');\n\t\tif(colon > -1) {\n\t\t\toperator.suffix = operator.operator.substring(colon + 1);\n\t\t\toperator.operator = operator.operator.substring(0,colon) || \"field\";\n\t\t}\n\t\t// Empty operator means: title\n\t\telse if(operator.operator === \"\") {\n\t\t\toperator.operator = \"title\";\n\t\t}\n\n\t\tp = nextBracketPos + 1;\n\t\tswitch (bracket) {\n\t\t\tcase \"{\": // Curly brackets\n\t\t\t\toperator.indirect = true;\n\t\t\t\tnextBracketPos = filterString.indexOf(\"}\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"[\": // Square brackets\n\t\t\t\tnextBracketPos = filterString.indexOf(\"]\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"<\": // Angle brackets\n\t\t\t\toperator.variable = true;\n\t\t\t\tnextBracketPos = filterString.indexOf(\">\",p);\n\t\t\t\tbreak;\n\t\t\tcase \"/\": // regexp brackets\n\t\t\t\tvar rex = /^((?:[^\\\\\\/]*|\\\\.)*)\\/(?:\\(([mygi]+)\\))?/g,\n\t\t\t\t\trexMatch = rex.exec(filterString.substring(p));\n\t\t\t\tif(rexMatch) {\n\t\t\t\t\toperator.regexp = new RegExp(rexMatch[1], rexMatch[2]);\n// DEPRECATION WARNING\nconsole.log(\"WARNING: Filter\",operator.operator,\"has a deprecated regexp operand\",operator.regexp);\n\t\t\t\t\tnextBracketPos = p + rex.lastIndex - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow \"Unterminated regular expression in filter expression\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif(nextBracketPos === -1) {\n\t\t\tthrow \"Missing closing bracket in filter expression\";\n\t\t}\n\t\tif(!operator.regexp) {\n\t\t\toperator.operand = filterString.substring(p,nextBracketPos);\n\t\t}\n\t\tp = nextBracketPos + 1;\n\t\t\t\n\t\t// Push this operator\n\t\toperators.push(operator);\n\t} while(filterString.charAt(p) !== \"]\");\n\t// Skip the ending square bracket\n\tif(filterString.charAt(p++) !== \"]\") {\n\t\tthrow \"Missing ] in filter expression\";\n\t}\n\t// Return the parsing position\n\treturn p;\n}\n\n/*\nParse a filter string\n*/\nexports.parseFilter = function(filterString) {\n\tfilterString = filterString || \"\";\n\tvar results = [], // Array of arrays of operator nodes {operator:,operand:}\n\t\tp = 0, // Current position in the filter string\n\t\tmatch;\n\tvar whitespaceRegExp = /(\\s+)/mg,\n\t\toperandRegExp = /((?:\\+|\\-)?)(?:(\\[)|(\"(?:[^\"])*\")|('(?:[^'])*')|([^\\s\\[\\]]+))/mg;\n\twhile(p < filterString.length) {\n\t\t// Skip any whitespace\n\t\twhitespaceRegExp.lastIndex = p;\n\t\tmatch = whitespaceRegExp.exec(filterString);\n\t\tif(match && match.index === p) {\n\t\t\tp = p + match[0].length;\n\t\t}\n\t\t// Match the start of the operation\n\t\tif(p < filterString.length) {\n\t\t\toperandRegExp.lastIndex = p;\n\t\t\tmatch = operandRegExp.exec(filterString);\n\t\t\tif(!match || match.index !== p) {\n\t\t\t\tthrow \"Syntax error in filter expression\";\n\t\t\t}\n\t\t\tvar operation = {\n\t\t\t\tprefix: \"\",\n\t\t\t\toperators: []\n\t\t\t};\n\t\t\tif(match[1]) {\n\t\t\t\toperation.prefix = match[1];\n\t\t\t\tp++;\n\t\t\t}\n\t\t\tif(match[2]) { // Opening square bracket\n\t\t\t\tp = parseFilterOperation(operation.operators,filterString,p);\n\t\t\t} else {\n\t\t\t\tp = match.index + match[0].length;\n\t\t\t}\n\t\t\tif(match[3] || match[4] || match[5]) { // Double quoted string, single quoted string or unquoted title\n\t\t\t\toperation.operators.push(\n\t\t\t\t\t{operator: \"title\", operand: match[3] || match[4] || match[5]}\n\t\t\t\t);\n\t\t\t}\n\t\t\tresults.push(operation);\n\t\t}\n\t}\n\treturn results;\n};\n\nexports.getFilterOperators = function() {\n\tif(!this.filterOperators) {\n\t\t$tw.Wiki.prototype.filterOperators = {};\n\t\t$tw.modules.applyMethods(\"filteroperator\",this.filterOperators);\n\t}\n\treturn this.filterOperators;\n};\n\nexports.filterTiddlers = function(filterString,widget,source) {\n\tvar fn = this.compileFilter(filterString);\n\treturn fn.call(this,source,widget);\n};\n\n/*\nCompile a filter into a function with the signature fn(source,widget) where:\nsource: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)\nwidget: an optional widget node for retrieving the current tiddler etc.\n*/\nexports.compileFilter = function(filterString) {\n\tvar filterParseTree;\n\ttry {\n\t\tfilterParseTree = this.parseFilter(filterString);\n\t} catch(e) {\n\t\treturn function(source,widget) {\n\t\t\treturn [\"Filter error: \" + e];\n\t\t};\n\t}\n\t// Get the hashmap of filter operator functions\n\tvar filterOperators = this.getFilterOperators();\n\t// Assemble array of functions, one for each operation\n\tvar operationFunctions = [];\n\t// Step through the operations\n\tvar self = this;\n\t$tw.utils.each(filterParseTree,function(operation) {\n\t\t// Create a function for the chain of operators in the operation\n\t\tvar operationSubFunction = function(source,widget) {\n\t\t\tvar accumulator = source,\n\t\t\t\tresults = [],\n\t\t\t\tcurrTiddlerTitle = widget && widget.getVariable(\"currentTiddler\");\n\t\t\t$tw.utils.each(operation.operators,function(operator) {\n\t\t\t\tvar operand = operator.operand,\n\t\t\t\t\toperatorFunction;\n\t\t\t\tif(!operator.operator) {\n\t\t\t\t\toperatorFunction = filterOperators.title;\n\t\t\t\t} else if(!filterOperators[operator.operator]) {\n\t\t\t\t\toperatorFunction = filterOperators.field;\n\t\t\t\t} else {\n\t\t\t\t\toperatorFunction = filterOperators[operator.operator];\n\t\t\t\t}\n\t\t\t\tif(operator.indirect) {\n\t\t\t\t\toperand = self.getTextReference(operator.operand,\"\",currTiddlerTitle);\n\t\t\t\t}\n\t\t\t\tif(operator.variable) {\n\t\t\t\t\toperand = widget.getVariable(operator.operand,{defaultValue: \"\"});\n\t\t\t\t}\n\t\t\t\tresults = operatorFunction(accumulator,{\n\t\t\t\t\t\t\toperator: operator.operator,\n\t\t\t\t\t\t\toperand: operand,\n\t\t\t\t\t\t\tprefix: operator.prefix,\n\t\t\t\t\t\t\tsuffix: operator.suffix,\n\t\t\t\t\t\t\tregexp: operator.regexp\n\t\t\t\t\t\t},{\n\t\t\t\t\t\t\twiki: self,\n\t\t\t\t\t\t\twidget: widget\n\t\t\t\t\t\t});\n\t\t\t\tif($tw.utils.isArray(results)) {\n\t\t\t\t\taccumulator = self.makeTiddlerIterator(results);\n\t\t\t\t} else {\n\t\t\t\t\taccumulator = results;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif($tw.utils.isArray(results)) {\n\t\t\t\treturn results;\n\t\t\t} else {\n\t\t\t\tvar resultArray = [];\n\t\t\t\tresults(function(tiddler,title) {\n\t\t\t\t\tresultArray.push(title);\n\t\t\t\t});\n\t\t\t\treturn resultArray;\n\t\t\t}\n\t\t};\n\t\t// Wrap the operator functions in a wrapper function that depends on the prefix\n\t\toperationFunctions.push((function() {\n\t\t\tswitch(operation.prefix || \"\") {\n\t\t\t\tcase \"\": // No prefix means that the operation is unioned into the result\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t$tw.utils.pushTop(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t\tcase \"-\": // The results of this operation are removed from the main result\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t$tw.utils.removeArrayEntries(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t\tcase \"+\": // This operation is applied to the main results so far\n\t\t\t\t\treturn function(results,source,widget) {\n\t\t\t\t\t\t// This replaces all the elements of the array, but keeps the actual array so that references to it are preserved\n\t\t\t\t\t\tsource = self.makeTiddlerIterator(results);\n\t\t\t\t\t\tresults.splice(0,results.length);\n\t\t\t\t\t\t$tw.utils.pushTop(results,operationSubFunction(source,widget));\n\t\t\t\t\t};\n\t\t\t}\n\t\t})());\n\t});\n\t// Return a function that applies the operations to a source iterator of tiddler titles\n\treturn $tw.perf.measure(\"filter\",function filterFunction(source,widget) {\n\t\tif(!source) {\n\t\t\tsource = self.each;\n\t\t} else if(typeof source === \"object\") { // Array or hashmap\n\t\t\tsource = self.makeTiddlerIterator(source);\n\t\t}\n\t\tvar results = [];\n\t\t$tw.utils.each(operationFunctions,function(operationFunction) {\n\t\t\toperationFunction(results,source,widget);\n\t\t});\n\t\treturn results;\n\t});\n};\n\n})();\n",
"title": "$:/core/modules/filters.js",
"type": "application/javascript",
"module-type": "wikimethod"
},
"$:/core/modules/info/platform.js": {
"text": "/*\\\ntitle: $:/core/modules/info/platform.js\ntype: application/javascript\nmodule-type: info\n\nInitialise basic platform $:/info/ tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.getInfoTiddlerFields = function() {\n\tvar mapBoolean = function(value) {return value ? \"yes\" : \"no\";},\n\t\tinfoTiddlerFields = [];\n\t// Basics\n\tinfoTiddlerFields.push({title: \"$:/info/browser\", text: mapBoolean(!!$tw.browser)});\n\tinfoTiddlerFields.push({title: \"$:/info/node\", text: mapBoolean(!!$tw.node)});\n\treturn infoTiddlerFields;\n};\n\n})();\n",
"title": "$:/core/modules/info/platform.js",
"type": "application/javascript",
"module-type": "info"
},
"$:/core/modules/language.js": {
"text": "/*\\\ntitle: $:/core/modules/language.js\ntype: application/javascript\nmodule-type: global\n\nThe $tw.Language() manages translateable strings\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreate an instance of the language manager. Options include:\nwiki: wiki from which to retrieve translation tiddlers\n*/\nfunction Language(options) {\n\toptions = options || \"\";\n\tthis.wiki = options.wiki || $tw.wiki;\n}\n\n/*\nReturn a single translateable string. The title is automatically prefixed with \"$:/language/\"\nOptions include:\nvariables: optional hashmap of variables to supply to the language wikification\n*/\nLanguage.prototype.getString = function(title,options) {\n\toptions = options || {};\n\ttitle = \"$:/language/\" + title;\n\treturn this.wiki.renderTiddler(\"text/plain\",title,{variables: options.variables});\n};\n\nexports.Language = Language;\n\n})();\n",
"title": "$:/core/modules/language.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/macros/changecount.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/changecount.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return the changecount for the current tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"changecount\";\n\nexports.params = [];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\treturn this.wiki.getChangeCount(this.getVariable(\"currentTiddler\")) + \"\";\n};\n\n})();\n",
"title": "$:/core/modules/macros/changecount.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/contrastcolour.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/contrastcolour.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to choose which of two colours has the highest contrast with a base colour\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"contrastcolour\";\n\nexports.params = [\n\t{name: \"target\"},\n\t{name: \"fallbackTarget\"},\n\t{name: \"colourA\"},\n\t{name: \"colourB\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(target,fallbackTarget,colourA,colourB) {\n\tvar rgbTarget = $tw.utils.parseCSSColor(target) || $tw.utils.parseCSSColor(fallbackTarget);\n\tif(!rgbTarget) {\n\t\treturn colourA;\n\t}\n\t// Colour brightness formula derived from http://www.w3.org/WAI/ER/WD-AERT/#color-contrast\n\tvar rgbColourA = $tw.utils.parseCSSColor(colourA),\n\t\trgbColourB = $tw.utils.parseCSSColor(colourB),\n\t\tbrightnessTarget = rgbTarget[0] * 0.299 + rgbTarget[1] * 0.587 + rgbTarget[2] * 0.114,\n\t\tbrightnessA = rgbColourA[0] * 0.299 + rgbColourA[1] * 0.587 + rgbColourA[2] * 0.114,\n\t\tbrightnessB = rgbColourB[0] * 0.299 + rgbColourB[1] * 0.587 + rgbColourB[2] * 0.114;\n\treturn Math.abs(brightnessTarget - brightnessA) > Math.abs(brightnessTarget - brightnessB) ? colourA : colourB;\n};\n\n})();\n",
"title": "$:/core/modules/macros/contrastcolour.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/csvtiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/csvtiddlers.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to output tiddlers matching a filter to CSV\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"csvtiddlers\";\n\nexports.params = [\n\t{name: \"filter\"},\n\t{name: \"format\"},\n];\n\n/*\nRun the macro\n*/\nexports.run = function(filter,format) {\n\tvar self = this,\n\t\ttiddlers = this.wiki.filterTiddlers(filter),\n\t\ttiddler,\n\t\tfields = [],\n\t\tt,f;\n\t// Collect all the fields\n\tfor(t=0;t<tiddlers.length; t++) {\n\t\ttiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\tfor(f in tiddler.fields) {\n\t\t\tif(fields.indexOf(f) === -1) {\n\t\t\t\tfields.push(f);\n\t\t\t}\n\t\t}\n\t}\n\t// Sort the fields and bring the standard ones to the front\n\tfields.sort();\n\t\"title text modified modifier created creator\".split(\" \").reverse().forEach(function(value,index) {\n\t\tvar p = fields.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tfields.splice(p,1);\n\t\t\tfields.unshift(value)\n\t\t}\n\t});\n\t// Output the column headings\n\tvar output = [], row = [];\n\tfields.forEach(function(value) {\n\t\trow.push(quoteAndEscape(value))\n\t});\n\toutput.push(row.join(\",\"));\n\t// Output each tiddler\n\tfor(var t=0;t<tiddlers.length; t++) {\n\t\trow = [];\n\t\ttiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\t\tfor(f=0; f<fields.length; f++) {\n\t\t\t\trow.push(quoteAndEscape(tiddler ? tiddler.getFieldString(fields[f]) || \"\" : \"\"));\n\t\t\t}\n\t\toutput.push(row.join(\",\"));\n\t}\n\treturn output.join(\"\\n\");\n};\n\nfunction quoteAndEscape(value) {\n\treturn \"\\\"\" + value.replace(/\"/mg,\"\\\"\\\"\") + \"\\\"\";\n}\n\n})();\n",
"title": "$:/core/modules/macros/csvtiddlers.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/dumpvariables.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/dumpvariables.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to dump all active variable values\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"dumpvariables\";\n\nexports.params = [\n];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\tvar output = [\"|!Variable |!Value |\"],\n\t\tvariables = [], variable;\n\tfor(variable in this.variables) {\n\t\tvariables.push(variable);\n\t}\n\tvariables.sort();\n\tfor(var index=0; index<variables.length; index++) {\n\t\tvar variable = variables[index];\n\t\toutput.push(\"|\" + variable + \" |<input size=50 value=<<\" + variable + \">>/> |\")\n\t}\n\treturn output.join(\"\\n\");\n};\n\n})();\n",
"title": "$:/core/modules/macros/dumpvariables.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/jsontiddlers.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/jsontiddlers.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to output tiddlers matching a filter to JSON\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"jsontiddlers\";\n\nexports.params = [\n\t{name: \"filter\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(filter) {\n\tvar tiddlers = this.wiki.filterTiddlers(filter),\n\t\tdata = [];\n\tfor(var t=0;t<tiddlers.length; t++) {\n\t\tvar tiddler = this.wiki.getTiddler(tiddlers[t]);\n\t\tif(tiddler) {\n\t\t\tvar fields = new Object();\n\t\t\tfor(var field in tiddler.fields) {\n\t\t\t\tfields[field] = tiddler.getFieldString(field);\n\t\t\t}\n\t\t\tdata.push(fields);\n\t\t}\n\t}\n\treturn JSON.stringify(data,null,$tw.config.preferences.jsonSpaces);\n};\n\n})();\n",
"title": "$:/core/modules/macros/jsontiddlers.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/makedatauri.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/makedatauri.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to convert the content of a tiddler to a data URI\n\n<<makedatauri text:\"Text to be converted\" type:\"text/vnd.tiddlywiki\">>\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"makedatauri\";\n\nexports.params = [\n\t{name: \"text\"},\n\t{name: \"type\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(text,type) {\n\ttype = type || \"text/vnd.tiddlywiki\";\n\tvar typeInfo = $tw.config.contentTypeInfo[type] || $tw.config.contentTypeInfo[\"text/plain\"],\n\t\tisBase64 = typeInfo.encoding === \"base64\",\n\t\tparts = [];\n\tparts.push(\"data:\");\n\tparts.push(type);\n\tparts.push(isBase64 ? \";base64\" : \"\");\n\tparts.push(\",\");\n\tparts.push(isBase64 ? text : encodeURIComponent(text));\n\treturn parts.join(\"\");\n};\n\n})();\n",
"title": "$:/core/modules/macros/makedatauri.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/now.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/now.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return a formatted version of the current time\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"now\";\n\nexports.params = [\n\t{name: \"format\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(format) {\n\treturn $tw.utils.formatDateString(new Date(),format || \"0hh:0mm, DDth MMM YYYY\");\n};\n\n})();\n",
"title": "$:/core/modules/macros/now.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/qualify.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/qualify.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to qualify a state tiddler title according\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"qualify\";\n\nexports.params = [\n\t{name: \"title\"}\n];\n\n/*\nRun the macro\n*/\nexports.run = function(title) {\n\treturn title + \"-\" + this.getStateQualifier();\n};\n\n})();\n",
"title": "$:/core/modules/macros/qualify.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/macros/version.js": {
"text": "/*\\\ntitle: $:/core/modules/macros/version.js\ntype: application/javascript\nmodule-type: macro\n\nMacro to return the TiddlyWiki core version number\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInformation about this macro\n*/\n\nexports.name = \"version\";\n\nexports.params = [];\n\n/*\nRun the macro\n*/\nexports.run = function() {\n\treturn $tw.version;\n};\n\n})();\n",
"title": "$:/core/modules/macros/version.js",
"type": "application/javascript",
"module-type": "macro"
},
"$:/core/modules/parsers/audioparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/audioparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe audio parser parses an audio tiddler into an embeddable HTML element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar AudioParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"audio\",\n\t\t\tattributes: {\n\t\t\t\tcontrols: {type: \"string\", value: \"controls\"}\n\t\t\t}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t} else if(text) {\n\t\telement.attributes.src = {type: \"string\", value: \"data:\" + type + \";base64,\" + text};\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"audio/ogg\"] = AudioParser;\nexports[\"audio/mpeg\"] = AudioParser;\nexports[\"audio/mp3\"] = AudioParser;\nexports[\"audio/mp4\"] = AudioParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/audioparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/parsers/csvparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/csvparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe CSV text parser processes CSV files into a table wrapped in a scrollable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CsvParser = function(type,text,options) {\n\t// Table framework\n\tthis.tree = [{\n\t\t\"type\": \"scrollable\", \"children\": [{\n\t\t\t\"type\": \"element\", \"tag\": \"table\", \"children\": [{\n\t\t\t\t\"type\": \"element\", \"tag\": \"tbody\", \"children\": []\n\t\t\t}], \"attributes\": {\n\t\t\t\t\"class\": {\"type\": \"string\", \"value\": \"tc-csv-table\"}\n\t\t\t}\n\t\t}]\n\t}];\n\t// Split the text into lines\n\tvar lines = text.split(/\\r?\\n/mg),\n\t\ttag = \"th\";\n\tfor(var line=0; line<lines.length; line++) {\n\t\tvar lineText = lines[line];\n\t\tif(lineText) {\n\t\t\tvar row = {\n\t\t\t\t\t\"type\": \"element\", \"tag\": \"tr\", \"children\": []\n\t\t\t\t};\n\t\t\tvar columns = lineText.split(\",\");\n\t\t\tfor(var column=0; column<columns.length; column++) {\n\t\t\t\trow.children.push({\n\t\t\t\t\t\t\"type\": \"element\", \"tag\": tag, \"children\": [{\n\t\t\t\t\t\t\t\"type\": \"text\",\n\t\t\t\t\t\t\t\"text\": columns[column]\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t}\n\t\t\ttag = \"td\";\n\t\t\tthis.tree[0].children[0].children[0].children.push(row);\n\t\t}\n\t}\n};\n\nexports[\"text/csv\"] = CsvParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/csvparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/parsers/htmlparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/htmlparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe HTML parser displays text as raw HTML\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar HtmlParser = function(type,text,options) {\n\tvar src;\n\tif(options._canonical_uri) {\n\t\tsrc = options._canonical_uri;\n\t} else if(text) {\n\t\tsrc = \"data:text/html;charset=utf-8,\" + encodeURIComponent(text);\n\t}\n\tthis.tree = [{\n\t\ttype: \"element\",\n\t\ttag: \"iframe\",\n\t\tattributes: {\n\t\t\tsrc: {type: \"string\", value: src}\n\t\t}\n\t}];\n};\n\nexports[\"text/html\"] = HtmlParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/htmlparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/parsers/imageparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/imageparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe image parser parses an image into an embeddable HTML element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar ImageParser = function(type,text,options) {\n\tvar element = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"img\",\n\t\t\tattributes: {}\n\t\t},\n\t\tsrc;\n\tif(options._canonical_uri) {\n\t\telement.attributes.src = {type: \"string\", value: options._canonical_uri};\n\t\tif(type === \"application/pdf\" || type === \".pdf\") {\n\t\t\telement.tag = \"embed\";\n\t\t}\n\t} else if(text) {\n\t\tif(type === \"application/pdf\" || type === \".pdf\") {\n\t\t\telement.attributes.src = {type: \"string\", value: \"data:application/pdf;base64,\" + text};\n\t\t\telement.tag = \"embed\";\n\t\t} else if(type === \"image/svg+xml\" || type === \".svg\") {\n\t\t\telement.attributes.src = {type: \"string\", value: \"data:image/svg+xml,\" + encodeURIComponent(text)};\n\t\t} else {\n\t\t\telement.attributes.src = {type: \"string\", value: \"data:\" + type + \";base64,\" + text};\n\t\t}\n\t}\n\tthis.tree = [element];\n};\n\nexports[\"image/svg+xml\"] = ImageParser;\nexports[\"image/jpg\"] = ImageParser;\nexports[\"image/jpeg\"] = ImageParser;\nexports[\"image/png\"] = ImageParser;\nexports[\"image/gif\"] = ImageParser;\nexports[\"application/pdf\"] = ImageParser;\nexports[\"image/x-icon\"] = ImageParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/imageparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/utils/parseutils.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/parseutils.js\ntype: application/javascript\nmodule-type: utils\n\nUtility functions concerned with parsing text into tokens.\n\nMost functions have the following pattern:\n\n* The parameters are:\n** `source`: the source string being parsed\n** `pos`: the current parse position within the string\n** Any further parameters are used to identify the token that is being parsed\n* The return value is:\n** null if the token was not found at the specified position\n** an object representing the token with the following standard fields:\n*** `type`: string indicating the type of the token\n*** `start`: start position of the token in the source string\n*** `end`: end position of the token in the source string\n*** Any further fields required to describe the token\n\nThe exception is `skipWhiteSpace`, which just returns the position after the whitespace.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nLook for a whitespace token. Returns null if not found, otherwise returns {type: \"whitespace\", start:, end:,}\n*/\nexports.parseWhiteSpace = function(source,pos) {\n\tvar node = {\n\t\ttype: \"whitespace\",\n\t\tstart: pos\n\t};\n\tvar re = /(\\s)+/g;\n\tre.lastIndex = pos;\n\tvar match = re.exec(source);\n\tif(match && match.index === pos) {\n\t\tnode.end = pos + match[0].length;\n\t\treturn node;\n\t}\n\treturn null;\n};\n\n/*\nConvenience wrapper for parseWhiteSpace. Returns the position after the whitespace\n*/\nexports.skipWhiteSpace = function(source,pos) {\n\tvar whitespace = $tw.utils.parseWhiteSpace(source,pos);\n\tif(whitespace) {\n\t\treturn whitespace.end;\n\t}\n\treturn pos;\n};\n\n/*\nLook for a given string token. Returns null if not found, otherwise returns {type: \"token\", value:, start:, end:,}\n*/\nexports.parseTokenString = function(source,pos,token) {\n\tvar match = source.indexOf(token,pos) === pos;\n\tif(match) {\n\t\treturn {\n\t\t\ttype: \"token\",\n\t\t\tvalue: token,\n\t\t\tstart: pos,\n\t\t\tend: pos + token.length\n\t\t};\n\t}\n\treturn null;\n};\n\n/*\nLook for a token matching a regex. Returns null if not found, otherwise returns {type: \"regexp\", match:, start:, end:,}\n*/\nexports.parseTokenRegExp = function(source,pos,reToken) {\n\tvar node = {\n\t\ttype: \"regexp\",\n\t\tstart: pos\n\t};\n\treToken.lastIndex = pos;\n\tnode.match = reToken.exec(source);\n\tif(node.match && node.match.index === pos) {\n\t\tnode.end = pos + node.match[0].length;\n\t\treturn node;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLook for a string literal. Returns null if not found, otherwise returns {type: \"string\", value:, start:, end:,}\n*/\nexports.parseStringLiteral = function(source,pos) {\n\tvar node = {\n\t\ttype: \"string\",\n\t\tstart: pos\n\t};\n\tvar reString = /(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\")|(?:'([^']*)')/g;\n\treString.lastIndex = pos;\n\tvar match = reString.exec(source);\n\tif(match && match.index === pos) {\n\t\tnode.value = match[1] !== undefined ? match[1] :(\n\t\t\tmatch[2] !== undefined ? match[2] : match[3] \n\t\t\t\t\t);\n\t\tnode.end = pos + match[0].length;\n\t\treturn node;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLook for a macro invocation parameter. Returns null if not found, or {type: \"macro-parameter\", name:, value:, start:, end:}\n*/\nexports.parseMacroParameter = function(source,pos) {\n\tvar node = {\n\t\ttype: \"macro-parameter\",\n\t\tstart: pos\n\t};\n\t// Define our regexp\n\tvar reMacroParameter = /(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\\s>\"'=]+)))/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the parameter\n\tvar token = $tw.utils.parseTokenRegExp(source,pos,reMacroParameter);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the parameter details\n\tnode.value = token.match[2] !== undefined ? token.match[2] : (\n\t\t\t\t\ttoken.match[3] !== undefined ? token.match[3] : (\n\t\t\t\t\t\ttoken.match[4] !== undefined ? token.match[4] : (\n\t\t\t\t\t\t\ttoken.match[5] !== undefined ? token.match[5] : (\n\t\t\t\t\t\t\t\ttoken.match[6] !== undefined ? token.match[6] : (\n\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\tif(token.match[1]) {\n\t\tnode.name = token.match[1];\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n/*\nLook for a macro invocation. Returns null if not found, or {type: \"macrocall\", name:, parameters:, start:, end:}\n*/\nexports.parseMacroInvocation = function(source,pos) {\n\tvar node = {\n\t\ttype: \"macrocall\",\n\t\tstart: pos,\n\t\tparams: []\n\t};\n\t// Define our regexps\n\tvar reMacroName = /([^\\s>\"'=]+)/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a double less than sign\n\tvar token = $tw.utils.parseTokenString(source,pos,\"<<\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the macro name\n\tvar name = $tw.utils.parseTokenRegExp(source,pos,reMacroName);\n\tif(!name) {\n\t\treturn null;\n\t}\n\tnode.name = name.match[1];\n\tpos = name.end;\n\t// Process parameters\n\tvar parameter = $tw.utils.parseMacroParameter(source,pos);\n\twhile(parameter) {\n\t\tnode.params.push(parameter);\n\t\tpos = parameter.end;\n\t\t// Get the next parameter\n\t\tparameter = $tw.utils.parseMacroParameter(source,pos);\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a double greater than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\">>\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n/*\nLook for an HTML attribute definition. Returns null if not found, otherwise returns {type: \"attribute\", name:, valueType: \"string|indirect|macro\", value:, start:, end:,}\n*/\nexports.parseAttribute = function(source,pos) {\n\tvar node = {\n\t\tstart: pos\n\t};\n\t// Define our regexps\n\tvar reAttributeName = /([^\\/\\s>\"'=]+)/g,\n\t\treUnquotedAttribute = /([^\\/\\s<>\"'=]+)/g,\n\t\treIndirectValue = /\\{\\{([^\\}]+)\\}\\}/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Get the attribute name\n\tvar name = $tw.utils.parseTokenRegExp(source,pos,reAttributeName);\n\tif(!name) {\n\t\treturn null;\n\t}\n\tnode.name = name.match[1];\n\tpos = name.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for an equals sign\n\tvar token = $tw.utils.parseTokenString(source,pos,\"=\");\n\tif(token) {\n\t\tpos = token.end;\n\t\t// Skip whitespace\n\t\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t\t// Look for a string literal\n\t\tvar stringLiteral = $tw.utils.parseStringLiteral(source,pos);\n\t\tif(stringLiteral) {\n\t\t\tpos = stringLiteral.end;\n\t\t\tnode.type = \"string\";\n\t\t\tnode.value = stringLiteral.value;\n\t\t} else {\n\t\t\t// Look for an indirect value\n\t\t\tvar indirectValue = $tw.utils.parseTokenRegExp(source,pos,reIndirectValue);\n\t\t\tif(indirectValue) {\n\t\t\t\tpos = indirectValue.end;\n\t\t\t\tnode.type = \"indirect\";\n\t\t\t\tnode.textReference = indirectValue.match[1];\n\t\t\t} else {\n\t\t\t\t// Look for a unquoted value\n\t\t\t\tvar unquotedValue = $tw.utils.parseTokenRegExp(source,pos,reUnquotedAttribute);\n\t\t\t\tif(unquotedValue) {\n\t\t\t\t\tpos = unquotedValue.end;\n\t\t\t\t\tnode.type = \"string\";\n\t\t\t\t\tnode.value = unquotedValue.match[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Look for a macro invocation value\n\t\t\t\t\tvar macroInvocation = $tw.utils.parseMacroInvocation(source,pos);\n\t\t\t\t\tif(macroInvocation) {\n\t\t\t\t\t\tpos = macroInvocation.end;\n\t\t\t\t\t\tnode.type = \"macro\";\n\t\t\t\t\t\tnode.value = macroInvocation;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.type = \"string\";\n\t\t\t\t\t\tnode.value = \"true\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tnode.type = \"string\";\n\t\tnode.value = \"true\";\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n})();\n",
"title": "$:/core/modules/utils/parseutils.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/parsers/textparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/textparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe plain text parser processes blocks of source text into a degenerate parse tree consisting of a single text node\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar TextParser = function(type,text,options) {\n\tthis.tree = [{\n\t\ttype: \"codeblock\",\n\t\tattributes: {\n\t\t\tcode: {type: \"string\", value: text},\n\t\t\tlanguage: {type: \"string\", value: type}\n\t\t}\n\t}];\n};\n\nexports[\"text/plain\"] = TextParser;\nexports[\"text/x-tiddlywiki\"] = TextParser;\nexports[\"application/javascript\"] = TextParser;\nexports[\"application/json\"] = TextParser;\nexports[\"text/css\"] = TextParser;\nexports[\"application/x-tiddler-dictionary\"] = TextParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/textparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/parsers/wikiparser/rules/codeblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/codeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for code blocks. For example:\n\n```\n\t```\n\tThis text will not be //wikified//\n\t```\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"codeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match and get language if defined\n\tthis.matchRegExp = /```([\\w-]*)\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /(\\r?\\n```$)/mg;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Look for the end of the block\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the block\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\t// Return the $codeblock widget\n\treturn [{\n\t\t\ttype: \"codeblock\",\n\t\t\tattributes: {\n\t\t\t\t\tcode: {type: \"string\", value: text},\n\t\t\t\t\tlanguage: {type: \"string\", value: this.match[1]}\n\t\t\t}\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/codeblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/codeinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/codeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for code runs. For example:\n\n```\n\tThis is a `code run`.\n\tThis is another ``code run``\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"codeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(``?)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar reEnd = new RegExp(this.match[1], \"mg\");\n\t// Look for the end marker\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the text\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"code\",\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: text\n\t\t}]\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/codeinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/commentblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/commentblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for HTML comments. For example:\n\n```\n<!-- This is a comment -->\n```\n\nNote that the syntax for comments is simplified to an opening \"<!--\" sequence and a closing \"-->\" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"commentblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\tthis.matchRegExp = /<!--/mg;\n\tthis.endMatchRegExp = /-->/mg;\n};\n\nexports.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\tif(this.match) {\n\t\tthis.endMatchRegExp.lastIndex = startPos + this.match[0].length;\n\t\tthis.endMatch = this.endMatchRegExp.exec(this.parser.source);\n\t\tif(this.endMatch) {\n\t\t\treturn this.match.index;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.endMatchRegExp.lastIndex;\n\t// Don't return any elements\n\treturn [];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/commentblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/commentinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/commentinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for HTML comments. For example:\n\n```\n<!-- This is a comment -->\n```\n\nNote that the syntax for comments is simplified to an opening \"<!--\" sequence and a closing \"-->\" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"commentinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\tthis.matchRegExp = /<!--/mg;\n\tthis.endMatchRegExp = /-->/mg;\n};\n\nexports.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\tif(this.match) {\n\t\tthis.endMatchRegExp.lastIndex = startPos + this.match[0].length;\n\t\tthis.endMatch = this.endMatchRegExp.exec(this.parser.source);\n\t\tif(this.endMatch) {\n\t\t\treturn this.match.index;\n\t\t}\n\t}\n\treturn undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.endMatchRegExp.lastIndex;\n\t// Don't return any elements\n\treturn [];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/commentinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/dash.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/dash.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for dashes. For example:\n\n```\nThis is an en-dash: --\n\nThis is an em-dash: ---\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"dash\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /-{2,3}(?!-)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar dash = this.match[0].length === 2 ? \"–\" : \"—\";\n\treturn [{\n\t\ttype: \"entity\",\n\t\tentity: dash\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/dash.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/bold.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/bold.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - bold. For example:\n\n```\n\tThis is ''bold'' text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except bold \n\\rules only bold \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"bold\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /''/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/''/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"strong\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/bold.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/italic.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/italic.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - italic. For example:\n\n```\n\tThis is //italic// text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except italic\n\\rules only italic\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"italic\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\/\\//mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/\\/\\//mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"em\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/italic.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - strikethrough. For example:\n\n```\n\tThis is ~~strikethrough~~ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except strikethrough \n\\rules only strikethrough \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"strikethrough\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /~~/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/~~/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"strike\",\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/strikethrough.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - subscript. For example:\n\n```\n\tThis is ,,subscript,, text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except subscript \n\\rules only subscript \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"subscript\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /,,/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/,,/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"sub\",\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/subscript.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - superscript. For example:\n\n```\n\tThis is ^^superscript^^ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except superscript \n\\rules only superscript \n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"superscript\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\^\\^/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/\\^\\^/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"sup\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/superscript.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for emphasis - underscore. For example:\n\n```\n\tThis is __underscore__ text\n```\n\nThis wikiparser can be modified using the rules eg:\n\n```\n\\rules except underscore \n\\rules only underscore\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"underscore\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /__/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\n\t// Parse the run including the terminator\n\tvar tree = this.parser.parseInlineRun(/__/mg,{eatTerminator: true});\n\n\t// Return the classed span\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"u\",\n\t\tchildren: tree\n\t}];\n};\n\n})();",
"title": "$:/core/modules/parsers/wikiparser/rules/emphasis/underscore.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/entity.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/entity.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for HTML entities. For example:\n\n```\n\tThis is a copyright symbol: ©\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"entity\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(&#?[a-zA-Z0-9]{2,8};)/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar entityString = this.match[1];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Return the entity\n\treturn [{type: \"entity\", entity: this.match[0]}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/entity.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/extlink.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/extlink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for external links. For example:\n\n```\nAn external link: http://www.tiddlywiki.com/\n\nA suppressed external link: ~http://www.tiddlyspace.com/\n```\n\nExternal links can be suppressed by preceding them with `~`.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"extlink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /~?(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\\s<>{}\\[\\]`|'\"\\\\^~]+(?:\\/|\\b)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Create the link unless it is suppressed\n\tif(this.match[0].substr(0,1) === \"~\") {\n\t\treturn [{type: \"text\", text: this.match[0].substr(1)}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tattributes: {\n\t\t\t\thref: {type: \"string\", value: this.match[0]},\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t\ttarget: {type: \"string\", value: \"_blank\"}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: this.match[0]\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/extlink.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for block-level filtered transclusion. For example:\n\n```\n{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"filteredtranscludeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{\\{([^\\|]+?)(?:\\|([^\\|\\{\\}]+))?(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}([^\\}]*)\\}(?:\\.(\\S+))?(?:\\r?\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar filter = this.match[1],\n\t\ttooltip = this.match[2],\n\t\ttemplate = $tw.utils.trim(this.match[3]),\n\t\tstyle = this.match[4],\n\t\tclasses = this.match[5];\n\t// Return the list widget\n\tvar node = {\n\t\ttype: \"list\",\n\t\tattributes: {\n\t\t\tfilter: {type: \"string\", value: filter}\n\t\t},\n\t\tisBlock: true\n\t};\n\tif(tooltip) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: tooltip};\n\t}\n\tif(template) {\n\t\tnode.attributes.template = {type: \"string\", value: template};\n\t}\n\tif(style) {\n\t\tnode.attributes.style = {type: \"string\", value: style};\n\t}\n\tif(classes) {\n\t\tnode.attributes.itemClass = {type: \"string\", value: classes.split(\".\").join(\" \")};\n\t}\n\treturn [node];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for inline filtered transclusion. For example:\n\n```\n{{{ [tag[docs]] }}}\n{{{ [tag[docs]] |tooltip}}}\n{{{ [tag[docs]] ||TemplateTitle}}}\n{{{ [tag[docs]] |tooltip||TemplateTitle}}}\n{{{ [tag[docs]] }}width:40;height:50;}.class.class\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"filteredtranscludeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{\\{([^\\|]+?)(?:\\|([^\\|\\{\\}]+))?(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}([^\\}]*)\\}(?:\\.(\\S+))?/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar filter = this.match[1],\n\t\ttooltip = this.match[2],\n\t\ttemplate = $tw.utils.trim(this.match[3]),\n\t\tstyle = this.match[4],\n\t\tclasses = this.match[5];\n\t// Return the list widget\n\tvar node = {\n\t\ttype: \"list\",\n\t\tattributes: {\n\t\t\tfilter: {type: \"string\", value: filter}\n\t\t}\n\t};\n\tif(tooltip) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: tooltip};\n\t}\n\tif(template) {\n\t\tnode.attributes.template = {type: \"string\", value: template};\n\t}\n\tif(style) {\n\t\tnode.attributes.style = {type: \"string\", value: style};\n\t}\n\tif(classes) {\n\t\tnode.attributes.itemClass = {type: \"string\", value: classes.split(\".\").join(\" \")};\n\t}\n\treturn [node];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/filteredtranscludeinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for marking areas with hard line breaks. For example:\n\n```\n\"\"\"\nThis is some text\nThat is set like\nIt is a Poem\nWhen it is\nClearly\nNot\n\"\"\"\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"hardlinebreaks\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\"\"\"(?:\\r?\\n)?/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /(\"\"\")|(\\r?\\n)/mg,\n\t\ttree = [],\n\t\tmatch;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tdo {\n\t\t// Parse the run up to the terminator\n\t\ttree.push.apply(tree,this.parser.parseInlineRun(reEnd,{eatTerminator: false}));\n\t\t// Redo the terminator match\n\t\treEnd.lastIndex = this.parser.pos;\n\t\tmatch = reEnd.exec(this.parser.source);\n\t\tif(match) {\n\t\t\tthis.parser.pos = reEnd.lastIndex;\n\t\t\t// Add a line break if the terminator was a line break\n\t\t\tif(match[2]) {\n\t\t\t\ttree.push({type: \"element\", tag: \"br\"});\n\t\t\t}\n\t\t}\n\t} while(match && !match[1]);\n\t// Return the nodes\n\treturn tree;\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/heading.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/heading.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for headings\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"heading\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(!{1,6})/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar headingLevel = this.match[1].length;\n\t// Move past the !s\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse any classes, whitespace and then the heading itself\n\tvar classes = this.parser.parseClasses();\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tvar tree = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// Return the heading\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"h\" + headingLevel, \n\t\tattributes: {\n\t\t\t\"class\": {type: \"string\", value: classes.join(\" \")}\n\t\t},\n\t\tchildren: tree\n\t}];\n};\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/heading.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/horizrule.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/horizrule.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for rules. For example:\n\n```\n---\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"horizrule\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /-{3,}\\r?(?:\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\treturn [{type: \"element\", tag: \"hr\"}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/horizrule.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/html.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/html.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for HTML elements and widgets. For example:\n\n{{{\n<aside>\nThis is an HTML5 aside element\n</aside>\n\n<$slider target=\"MyTiddler\">\nThis is a widget invocation\n</$slider>\n\n}}}\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"html\";\nexports.types = {inline: true, block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextTag = this.findNextTag(this.parser.source,startPos,{\n\t\trequireLineBreak: this.is.block\n\t});\n\treturn this.nextTag ? this.nextTag.start : undefined;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Retrieve the most recent match so that recursive calls don't overwrite it\n\tvar tag = this.nextTag;\n\tthis.nextTag = null;\n\t// Advance the parser position to past the tag\n\tthis.parser.pos = tag.end;\n\t// Check for an immediately following double linebreak\n\tvar hasLineBreak = !tag.isSelfClosing && !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\\S\\n\\r]*\\r?\\n(?:[^\\S\\n\\r]*\\r?\\n|$))/g);\n\t// Set whether we're in block mode\n\ttag.isBlock = this.is.block || hasLineBreak;\n\t// Parse the body if we need to\n\tif(!tag.isSelfClosing && $tw.config.htmlVoidElements.indexOf(tag.tag) === -1) {\n\t\t\tvar reEndString = \"</\" + $tw.utils.escapeRegExp(tag.tag) + \">\",\n\t\t\t\treEnd = new RegExp(\"(\" + reEndString + \")\",\"mg\");\n\t\tif(hasLineBreak) {\n\t\t\ttag.children = this.parser.parseBlocks(reEndString);\n\t\t} else {\n\t\t\ttag.children = this.parser.parseInlineRun(reEnd);\n\t\t}\n\t\treEnd.lastIndex = this.parser.pos;\n\t\tvar endMatch = reEnd.exec(this.parser.source);\n\t\tif(endMatch && endMatch.index === this.parser.pos) {\n\t\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t\t}\n\t}\n\t// Return the tag\n\treturn [tag];\n};\n\n/*\nLook for an HTML tag. Returns null if not found, otherwise returns {type: \"element\", name:, attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseTag = function(source,pos,options) {\n\toptions = options || {};\n\tvar token,\n\t\tnode = {\n\t\t\ttype: \"element\",\n\t\t\tstart: pos,\n\t\t\tattributes: {}\n\t\t};\n\t// Define our regexps\n\tvar reTagName = /([a-zA-Z0-9\\-\\$]+)/g;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a less than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\"<\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Get the tag name\n\ttoken = $tw.utils.parseTokenRegExp(source,pos,reTagName);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tnode.tag = token.match[1];\n\tif(node.tag.charAt(0) === \"$\") {\n\t\tnode.type = node.tag.substr(1);\n\t}\n\tpos = token.end;\n\t// Process attributes\n\tvar attribute = $tw.utils.parseAttribute(source,pos);\n\twhile(attribute) {\n\t\tnode.attributes[attribute.name] = attribute;\n\t\tpos = attribute.end;\n\t\t// Get the next attribute\n\t\tattribute = $tw.utils.parseAttribute(source,pos);\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for a closing slash\n\ttoken = $tw.utils.parseTokenString(source,pos,\"/\");\n\tif(token) {\n\t\tpos = token.end;\n\t\tnode.isSelfClosing = true;\n\t}\n\t// Look for a greater than sign\n\ttoken = $tw.utils.parseTokenString(source,pos,\">\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Check for a required line break\n\tif(options.requireLineBreak) {\n\t\ttoken = $tw.utils.parseTokenRegExp(source,pos,/([^\\S\\n\\r]*\\r?\\n(?:[^\\S\\n\\r]*\\r?\\n|$))/g);\n\t\tif(!token) {\n\t\t\treturn null;\n\t\t}\n\t}\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\nexports.findNextTag = function(source,pos,options) {\n\t// A regexp for finding candidate HTML tags\n\tvar reLookahead = /<([a-zA-Z\\-\\$]+)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a tag\n\t\tvar tag = this.parseTag(source,match.index,options);\n\t\t// Return success\n\t\tif(tag && this.isLegalTag(tag)) {\n\t\t\treturn tag;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\nexports.isLegalTag = function(tag) {\n\t// Widgets are always OK\n\tif(tag.type !== \"element\") {\n\t\treturn true;\n\t// If it's an HTML tag that starts with a dash then it's not legal\n\t} else if(tag.tag.charAt(0) === \"-\") {\n\t\treturn false;\n\t} else {\n\t\t// Otherwise it's OK\n\t\treturn true;\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/html.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/image.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/image.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for embedding images. For example:\n\n```\n[img[http://tiddlywiki.com/fractalveg.jpg]]\n[img width=23 height=24 [http://tiddlywiki.com/fractalveg.jpg]]\n[img width={{!!width}} height={{!!height}} [http://tiddlywiki.com/fractalveg.jpg]]\n[img[Description of image|http://tiddlywiki.com/fractalveg.jpg]]\n[img[TiddlerTitle]]\n[img[Description of image|TiddlerTitle]]\n```\n\nGenerates the `<$image>` widget.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"image\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextImage = this.findNextImage(this.parser.source,startPos);\n\treturn this.nextImage ? this.nextImage.start : undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.nextImage.end;\n\tvar node = {\n\t\ttype: \"image\",\n\t\tattributes: this.nextImage.attributes\n\t};\n\treturn [node];\n};\n\n/*\nFind the next image from the current position\n*/\nexports.findNextImage = function(source,pos) {\n\t// A regexp for finding candidate HTML tags\n\tvar reLookahead = /(\\[img)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a tag\n\t\tvar tag = this.parseImage(source,match.index);\n\t\t// Return success\n\t\tif(tag) {\n\t\t\treturn tag;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\n/*\nLook for an image at the specified position. Returns null if not found, otherwise returns {type: \"image\", attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseImage = function(source,pos) {\n\tvar token,\n\t\tnode = {\n\t\t\ttype: \"image\",\n\t\t\tstart: pos,\n\t\t\tattributes: {}\n\t\t};\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[img`\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[img\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Process attributes\n\tif(source.charAt(pos) !== \"[\") {\n\t\tvar attribute = $tw.utils.parseAttribute(source,pos);\n\t\twhile(attribute) {\n\t\t\tnode.attributes[attribute.name] = attribute;\n\t\t\tpos = attribute.end;\n\t\t\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t\t\tif(source.charAt(pos) !== \"[\") {\n\t\t\t\t// Get the next attribute\n\t\t\t\tattribute = $tw.utils.parseAttribute(source,pos);\n\t\t\t} else {\n\t\t\t\tattribute = null;\n\t\t\t}\n\t\t}\n\t}\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[` after the attributes\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Get the source up to the terminating `]]`\n\ttoken = $tw.utils.parseTokenRegExp(source,pos,/(?:([^|\\]]*?)\\|)?([^\\]]+?)\\]\\]/g);\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\tif(token.match[1]) {\n\t\tnode.attributes.tooltip = {type: \"string\", value: token.match[1].trim()};\n\t}\n\tnode.attributes.source = {type: \"string\", value: (token.match[2] || \"\").trim()};\n\t// Update the end position\n\tnode.end = pos;\n\treturn node;\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/image.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/list.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/list.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for lists. For example:\n\n```\n* This is an unordered list\n* It has two items\n\n# This is a numbered list\n## With a subitem\n# And a third item\n\n; This is a term that is being defined\n: This is the definition of that term\n```\n\nNote that lists can be nested arbitrarily:\n\n```\n#** One\n#* Two\n#** Three\n#**** Four\n#**# Five\n#**## Six\n## Seven\n### Eight\n## Nine\n```\n\nA CSS class can be applied to a list item as follows:\n\n```\n* List item one\n*.active List item two has the class `active`\n* List item three\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"list\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /([\\*#;:>]+)/mg;\n};\n\nvar listTypes = {\n\t\"*\": {listTag: \"ul\", itemTag: \"li\"},\n\t\"#\": {listTag: \"ol\", itemTag: \"li\"},\n\t\";\": {listTag: \"dl\", itemTag: \"dt\"},\n\t\":\": {listTag: \"dl\", itemTag: \"dd\"},\n\t\">\": {listTag: \"blockquote\", itemTag: \"p\"}\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Array of parse tree nodes for the previous row of the list\n\tvar listStack = [];\n\t// Cycle through the items in the list\n\twhile(true) {\n\t\t// Match the list marker\n\t\tvar reMatch = /([\\*#;:>]+)/mg;\n\t\treMatch.lastIndex = this.parser.pos;\n\t\tvar match = reMatch.exec(this.parser.source);\n\t\tif(!match || match.index !== this.parser.pos) {\n\t\t\tbreak;\n\t\t}\n\t\t// Check whether the list type of the top level matches\n\t\tvar listInfo = listTypes[match[0].charAt(0)];\n\t\tif(listStack.length > 0 && listStack[0].tag !== listInfo.listTag) {\n\t\t\tbreak;\n\t\t}\n\t\t// Move past the list marker\n\t\tthis.parser.pos = match.index + match[0].length;\n\t\t// Walk through the list markers for the current row\n\t\tfor(var t=0; t<match[0].length; t++) {\n\t\t\tlistInfo = listTypes[match[0].charAt(t)];\n\t\t\t// Remove any stacked up element if we can't re-use it because the list type doesn't match\n\t\t\tif(listStack.length > t && listStack[t].tag !== listInfo.listTag) {\n\t\t\t\tlistStack.splice(t,listStack.length - t);\n\t\t\t}\n\t\t\t// Construct the list element or reuse the previous one at this level\n\t\t\tif(listStack.length <= t) {\n\t\t\t\tvar listElement = {type: \"element\", tag: listInfo.listTag, children: [\n\t\t\t\t\t{type: \"element\", tag: listInfo.itemTag, children: []}\n\t\t\t\t]};\n\t\t\t\t// Link this list element into the last child item of the parent list item\n\t\t\t\tif(t) {\n\t\t\t\t\tvar prevListItem = listStack[t-1].children[listStack[t-1].children.length-1];\n\t\t\t\t\tprevListItem.children.push(listElement);\n\t\t\t\t}\n\t\t\t\t// Save this element in the stack\n\t\t\t\tlistStack[t] = listElement;\n\t\t\t} else if(t === (match[0].length - 1)) {\n\t\t\t\tlistStack[t].children.push({type: \"element\", tag: listInfo.itemTag, children: []});\n\t\t\t}\n\t\t}\n\t\tif(listStack.length > match[0].length) {\n\t\t\tlistStack.splice(match[0].length,listStack.length - match[0].length);\n\t\t}\n\t\t// Process the body of the list item into the last list item\n\t\tvar lastListChildren = listStack[listStack.length-1].children,\n\t\t\tlastListItem = lastListChildren[lastListChildren.length-1],\n\t\t\tclasses = this.parser.parseClasses();\n\t\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\t\tvar tree = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t\tlastListItem.children.push.apply(lastListItem.children,tree);\n\t\tif(classes.length > 0) {\n\t\t\t$tw.utils.addClassToParseTreeNode(lastListItem,classes.join(\" \"));\n\t\t}\n\t\t// Consume any whitespace following the list item\n\t\tthis.parser.skipWhitespace();\n\t}\n\t// Return the root element of the list\n\treturn [listStack[0]];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/list.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/macrocallblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for block macro calls\n\n```\n<<name value value2>>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrocallblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /<<([^>\\s]+)(?:\\s*)((?:[^>]|(?:>(?!>)))*?)>>(?:\\r?\\n|$)/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar macroName = this.match[1],\n\t\tparamString = this.match[2];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar params = [],\n\t\treParam = /\\s*(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))/mg,\n\t\tparamMatch = reParam.exec(paramString);\n\twhile(paramMatch) {\n\t\t// Process this parameter\n\t\tvar paramInfo = {\n\t\t\tvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6]\n\t\t};\n\t\tif(paramMatch[1]) {\n\t\t\tparamInfo.name = paramMatch[1];\n\t\t}\n\t\tparams.push(paramInfo);\n\t\t// Find the next match\n\t\tparamMatch = reParam.exec(paramString);\n\t}\n\treturn [{\n\t\ttype: \"macrocall\",\n\t\tname: macroName,\n\t\tparams: params,\n\t\tisBlock: true\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/macrocallblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/macrocallinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrocallinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki rule for macro calls\n\n```\n<<name value value2>>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrocallinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /<<([^\\s>]+)\\s*([\\s\\S]*?)>>/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get all the details of the match\n\tvar macroName = this.match[1],\n\t\tparamString = this.match[2];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\tvar params = [],\n\t\treParam = /\\s*(?:([A-Za-z0-9\\-_]+)\\s*:)?(?:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))/mg,\n\t\tparamMatch = reParam.exec(paramString);\n\twhile(paramMatch) {\n\t\t// Process this parameter\n\t\tvar paramInfo = {\n\t\t\tvalue: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]|| paramMatch[6]\n\t\t};\n\t\tif(paramMatch[1]) {\n\t\t\tparamInfo.name = paramMatch[1];\n\t\t}\n\t\tparams.push(paramInfo);\n\t\t// Find the next match\n\t\tparamMatch = reParam.exec(paramString);\n\t}\n\treturn [{\n\t\ttype: \"macrocall\",\n\t\tname: macroName,\n\t\tparams: params\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/macrocallinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/macrodef.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/macrodef.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki pragma rule for macro definitions\n\n```\n\\define name(param:defaultvalue,param2:defaultvalue)\ndefinition text, including $param$ markers\n\\end\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"macrodef\";\nexports.types = {pragma: true};\n\n/*\nInstantiate parse rule\n*/\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\\\define\\s+([^(\\s]+)\\(\\s*([^)]*)\\)(\\s*\\r?\\n)?/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Move past the macro name and parameters\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse the parameters\n\tvar paramString = this.match[2],\n\t\tparams = [];\n\tif(paramString !== \"\") {\n\t\tvar reParam = /\\s*([A-Za-z0-9\\-_]+)(?:\\s*:\\s*(?:\"\"\"([\\s\\S]*?)\"\"\"|\"([^\"]*)\"|'([^']*)'|\\[\\[([^\\]]*)\\]\\]|([^\"'\\s]+)))?/mg,\n\t\t\tparamMatch = reParam.exec(paramString);\n\t\twhile(paramMatch) {\n\t\t\t// Save the parameter details\n\t\t\tvar paramInfo = {name: paramMatch[1]},\n\t\t\t\tdefaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6];\n\t\t\tif(defaultValue) {\n\t\t\t\tparamInfo[\"default\"] = defaultValue;\n\t\t\t}\n\t\t\tparams.push(paramInfo);\n\t\t\t// Look for the next parameter\n\t\t\tparamMatch = reParam.exec(paramString);\n\t\t}\n\t}\n\t// Is this a multiline definition?\n\tvar reEnd;\n\tif(this.match[3]) {\n\t\t// If so, the end of the body is marked with \\end\n\t\treEnd = /(\\r?\\n\\\\end[^\\S\\n\\r]*(?:$|\\r?\\n))/mg;\n\t} else {\n\t\t// Otherwise, the end of the definition is marked by the end of the line\n\t\treEnd = /(\\r?\\n)/mg;\n\t\t// Move past any whitespace\n\t\tthis.parser.pos = $tw.utils.skipWhiteSpace(this.parser.source,this.parser.pos);\n\t}\n\t// Find the end of the definition\n\treEnd.lastIndex = this.parser.pos;\n\tvar text,\n\t\tendMatch = reEnd.exec(this.parser.source);\n\tif(endMatch) {\n\t\ttext = this.parser.source.substring(this.parser.pos,endMatch.index);\n\t\tthis.parser.pos = endMatch.index + endMatch[0].length;\n\t} else {\n\t\t// We didn't find the end of the definition, so we'll make it blank\n\t\ttext = \"\";\n\t}\n\t// Save the macro definition\n\treturn [{\n\t\ttype: \"macrodef\",\n\t\tname: this.match[1],\n\t\tparams: params,\n\t\ttext: text\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/macrodef.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/prettyextlink.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/prettyextlink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for external links. For example:\n\n```\n[ext[http://tiddlywiki.com/fractalveg.jpg]]\n[ext[Tooltip|http://tiddlywiki.com/fractalveg.jpg]]\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"prettyextlink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n};\n\nexports.findNextMatch = function(startPos) {\n\t// Find the next tag\n\tthis.nextLink = this.findNextLink(this.parser.source,startPos);\n\treturn this.nextLink ? this.nextLink.start : undefined;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.nextLink.end;\n\treturn [this.nextLink];\n};\n\n/*\nFind the next link from the current position\n*/\nexports.findNextLink = function(source,pos) {\n\t// A regexp for finding candidate links\n\tvar reLookahead = /(\\[ext\\[)/g;\n\t// Find the next candidate\n\treLookahead.lastIndex = pos;\n\tvar match = reLookahead.exec(source);\n\twhile(match) {\n\t\t// Try to parse the candidate as a link\n\t\tvar link = this.parseLink(source,match.index);\n\t\t// Return success\n\t\tif(link) {\n\t\t\treturn link;\n\t\t}\n\t\t// Look for the next match\n\t\treLookahead.lastIndex = match.index + 1;\n\t\tmatch = reLookahead.exec(source);\n\t}\n\t// Failed\n\treturn null;\n};\n\n/*\nLook for an link at the specified position. Returns null if not found, otherwise returns {type: \"element\", tag: \"a\", attributes: [], isSelfClosing:, start:, end:,}\n*/\nexports.parseLink = function(source,pos) {\n\tvar token,\n\t\ttextNode = {\n\t\t\ttype: \"text\"\n\t\t},\n\t\tnode = {\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tstart: pos,\n\t\t\tattributes: {\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t},\n\t\t\tchildren: [textNode]\n\t\t};\n\t// Skip whitespace\n\tpos = $tw.utils.skipWhiteSpace(source,pos);\n\t// Look for the `[ext[`\n\ttoken = $tw.utils.parseTokenString(source,pos,\"[ext[\");\n\tif(!token) {\n\t\treturn null;\n\t}\n\tpos = token.end;\n\t// Look ahead for the terminating `]]`\n\tvar closePos = source.indexOf(\"]]\",pos);\n\tif(closePos === -1) {\n\t\treturn null;\n\t}\n\t// Look for a `|` separating the tooltip\n\tvar splitPos = source.indexOf(\"|\",pos);\n\tif(splitPos === -1 || splitPos > closePos) {\n\t\tsplitPos = null;\n\t}\n\t// Pull out the tooltip and URL\n\tvar tooltip, URL;\n\tif(splitPos) {\n\t\tURL = source.substring(splitPos + 1,closePos).trim();\n\t\ttextNode.text = source.substring(pos,splitPos).trim();\n\t} else {\n\t\tURL = source.substring(pos,closePos).trim();\n\t\ttextNode.text = URL;\n\t}\n\tnode.attributes.href = {type: \"string\", value: URL};\n\tnode.attributes.target = {type: \"string\", value: \"_blank\"};\n\t// Update the end position\n\tnode.end = closePos + 2;\n\treturn node;\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/prettyextlink.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/prettylink.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/prettylink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for pretty links. For example:\n\n```\n[[Introduction]]\n\n[[Link description|TiddlerTitle]]\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"prettylink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\[\\[(.*?)(?:\\|(.*?))?\\]\\]/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Process the link\n\tvar text = this.match[1],\n\t\tlink = this.match[2] || text;\n\tif($tw.utils.isLinkExternal(link)) {\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"a\",\n\t\t\tattributes: {\n\t\t\t\thref: {type: \"string\", value: link},\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-tiddlylink-external\"},\n\t\t\t\ttarget: {type: \"string\", value: \"_blank\"}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: text\n\t\t\t}]\n\t\t}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"link\",\n\t\t\tattributes: {\n\t\t\t\tto: {type: \"string\", value: link}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\", text: text\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/prettylink.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/quoteblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/quoteblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for quote blocks. For example:\n\n```\n\t<<<.optionalClass(es) optional cited from\n\ta quote\n\t<<<\n\t\n\t<<<.optionalClass(es)\n\ta quote\n\t<<< optional cited from\n```\n\nQuotes can be quoted by putting more <s\n\n```\n\t<<<\n\tQuote Level 1\n\t\n\t<<<<\n\tQuoteLevel 2\n\t<<<<\n\t\n\t<<<\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"quoteblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /(<<<+)/mg;\n};\n\nexports.parse = function() {\n\tvar classes = [\"tc-quote\"];\n\t// Get all the details of the match\n\tvar reEndString = \"^\" + this.match[1] + \"(?!<)\";\n\t// Move past the <s\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t\n\t// Parse any classes, whitespace and then the optional cite itself\n\tclasses.push.apply(classes, this.parser.parseClasses());\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tvar cite = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// before handling the cite, parse the body of the quote\n\tvar tree= this.parser.parseBlocks(reEndString);\n\t// If we got a cite, put it before the text\n\tif(cite.length > 0) {\n\t\ttree.unshift({\n\t\t\ttype: \"element\",\n\t\t\ttag: \"cite\",\n\t\t\tchildren: cite\n\t\t});\n\t}\n\t// Parse any optional cite\n\tthis.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});\n\tcite = this.parser.parseInlineRun(/(\\r?\\n)/mg);\n\t// If we got a cite, push it\n\tif(cite.length > 0) {\n\t\ttree.push({\n\t\t\ttype: \"element\",\n\t\t\ttag: \"cite\",\n\t\t\tchildren: cite\n\t\t});\n\t}\n\t// Return the blockquote element\n\treturn [{\n\t\ttype: \"element\",\n\t\ttag: \"blockquote\",\n\t\tattributes: {\n\t\t\tclass: { type: \"string\", value: classes.join(\" \") },\n\t\t},\n\t\tchildren: tree\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/quoteblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/rules.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/rules.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki pragma rule for rules specifications\n\n```\n\\rules except ruleone ruletwo rulethree\n\\rules only ruleone ruletwo rulethree\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"rules\";\nexports.types = {pragma: true};\n\n/*\nInstantiate parse rule\n*/\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\\\rules[^\\S\\n]/mg;\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Move past the pragma invocation\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse whitespace delimited tokens terminated by a line break\n\tvar reMatch = /[^\\S\\n]*(\\S+)|(\\r?\\n)/mg,\n\t\ttokens = [];\n\treMatch.lastIndex = this.parser.pos;\n\tvar match = reMatch.exec(this.parser.source);\n\twhile(match && match.index === this.parser.pos) {\n\t\tthis.parser.pos = reMatch.lastIndex;\n\t\t// Exit if we've got the line break\n\t\tif(match[2]) {\n\t\t\tbreak;\n\t\t}\n\t\t// Process the token\n\t\tif(match[1]) {\n\t\t\ttokens.push(match[1]);\n\t\t}\n\t\t// Match the next token\n\t\tmatch = reMatch.exec(this.parser.source);\n\t}\n\t// Process the tokens\n\tif(tokens.length > 0) {\n\t\tthis.parser.amendRules(tokens[0],tokens.slice(1));\n\t}\n\t// No parse tree nodes to return\n\treturn [];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/rules.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/styleblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/styleblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for assigning styles and classes to paragraphs and other blocks. For example:\n\n```\n@@.myClass\n@@background-color:red;\nThis paragraph will have the CSS class `myClass`.\n\n* The `<ul>` around this list will also have the class `myClass`\n* List item 2\n\n@@\n```\n\nNote that classes and styles can be mixed subject to the rule that styles must precede classes. For example\n\n```\n@@.myFirstClass.mySecondClass\n@@width:100px;.myThirdClass\nThis is a paragraph\n@@\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"styleblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /@@((?:[^\\.\\r\\n\\s:]+:[^\\r\\n;]+;)+)?(?:\\.([^\\r\\n\\s]+))?\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEndString = \"^@@(?:\\\\r?\\\\n)?\";\n\tvar classes = [], styles = [];\n\tdo {\n\t\t// Get the class and style\n\t\tif(this.match[1]) {\n\t\t\tstyles.push(this.match[1]);\n\t\t}\n\t\tif(this.match[2]) {\n\t\t\tclasses.push(this.match[2].split(\".\").join(\" \"));\n\t\t}\n\t\t// Move past the match\n\t\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t\t// Look for another line of classes and styles\n\t\tthis.match = this.matchRegExp.exec(this.parser.source);\n\t} while(this.match && this.match.index === this.parser.pos);\n\t// Parse the body\n\tvar tree = this.parser.parseBlocks(reEndString);\n\tfor(var t=0; t<tree.length; t++) {\n\t\tif(classes.length > 0) {\n\t\t\t$tw.utils.addClassToParseTreeNode(tree[t],classes.join(\" \"));\n\t\t}\n\t\tif(styles.length > 0) {\n\t\t\t$tw.utils.addAttributeToParseTreeNode(tree[t],\"style\",styles.join(\"\"));\n\t\t}\n\t}\n\treturn tree;\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/styleblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/styleinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/styleinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for assigning styles and classes to inline runs. For example:\n\n```\n@@.myClass This is some text with a class@@\n@@background-color:red;This is some text with a background colour@@\n@@width:100px;.myClass This is some text with a class and a width@@\n```\n\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"styleinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /@@((?:[^\\.\\r\\n\\s:]+:[^\\r\\n;]+;)+)?(\\.(?:[^\\r\\n\\s]+)\\s+)?/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /@@/g;\n\t// Get the styles and class\n\tvar stylesString = this.match[1],\n\t\tclassString = this.match[2] ? this.match[2].split(\".\").join(\" \") : undefined;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Parse the run up to the terminator\n\tvar tree = this.parser.parseInlineRun(reEnd,{eatTerminator: true});\n\t// Return the classed span\n\tvar node = {\n\t\ttype: \"element\",\n\t\ttag: \"span\",\n\t\tattributes: {\n\t\t\t\"class\": {type: \"string\", value: \"tc-inline-style\"}\n\t\t},\n\t\tchildren: tree\n\t};\n\tif(classString) {\n\t\t$tw.utils.addClassToParseTreeNode(node,classString);\n\t}\n\tif(stylesString) {\n\t\t$tw.utils.addAttributeToParseTreeNode(node,\"style\",stylesString);\n\t}\n\treturn [node];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/styleinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/syslink.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/syslink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for system tiddler links.\nCan be suppressed preceding them with `~`.\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"syslink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /~?\\$:[^\\s<|]+(?:[^\\s<|])/mg;\n};\n\nexports.parse = function() {\n\tvar match = this.match[0];\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Create the link unless it is suppressed\n\tif(match.substr(0,1) === \"~\") {\n\t\treturn [{type: \"text\", text: match.substr(1)}];\n\t} else {\n\t\treturn [{\n\t\t\ttype: \"link\",\n\t\t\tattributes: {\n\t\t\t\tto: {type: \"string\", value: match}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: match\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();",
"title": "$:/core/modules/parsers/wikiparser/rules/syslink.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/table.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/table.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text block rule for tables.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"table\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /^\\|(?:[^\\n]*)\\|(?:[fhck]?)\\r?(?:\\n|$)/mg;\n};\n\nvar processRow = function(prevColumns) {\n\tvar cellRegExp = /(?:\\|([^\\n\\|]*)\\|)|(\\|[fhck]?\\r?(?:\\n|$))/mg,\n\t\tcellTermRegExp = /((?:\\x20*)\\|)/mg,\n\t\ttree = [],\n\t\tcol = 0,\n\t\tcolSpanCount = 1,\n\t\tprevCell,\n\t\tvAlign;\n\t// Match a single cell\n\tcellRegExp.lastIndex = this.parser.pos;\n\tvar cellMatch = cellRegExp.exec(this.parser.source);\n\twhile(cellMatch && cellMatch.index === this.parser.pos) {\n\t\tif(cellMatch[1] === \"~\") {\n\t\t\t// Rowspan\n\t\t\tvar last = prevColumns[col];\n\t\t\tif(last) {\n\t\t\t\tlast.rowSpanCount++;\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"rowspan\",last.rowSpanCount);\n\t\t\t\tvAlign = $tw.utils.getAttributeValueFromParseTreeNode(last.element,\"valign\",\"center\");\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"valign\",vAlign);\n\t\t\t\tif(colSpanCount > 1) {\n\t\t\t\t\t$tw.utils.addAttributeToParseTreeNode(last.element,\"colspan\",colSpanCount);\n\t\t\t\t\tcolSpanCount = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[1] === \">\") {\n\t\t\t// Colspan\n\t\t\tcolSpanCount++;\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[1] === \"<\" && prevCell) {\n\t\t\tcolSpanCount = 1 + $tw.utils.getAttributeValueFromParseTreeNode(prevCell,\"colspan\",1);\n\t\t\t$tw.utils.addAttributeToParseTreeNode(prevCell,\"colspan\",colSpanCount);\n\t\t\tcolSpanCount = 1;\n\t\t\t// Move to just before the `|` terminating the cell\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t} else if(cellMatch[2]) {\n\t\t\t// End of row\n\t\t\tif(prevCell && colSpanCount > 1) {\n\t\t\t\tif(prevCell.attributes && prevCell.attributes && prevCell.attributes.colspan) {\n\t\t\t\t\t\tcolSpanCount += prevCell.attributes.colspan.value;\n\t\t\t\t} else {\n\t\t\t\t\tcolSpanCount -= 1;\n\t\t\t\t}\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(prevCell,\"colspan\",colSpanCount);\n\t\t\t}\n\t\t\tthis.parser.pos = cellRegExp.lastIndex - 1;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t// For ordinary cells, step beyond the opening `|`\n\t\t\tthis.parser.pos++;\n\t\t\t// Look for a space at the start of the cell\n\t\t\tvar spaceLeft = false;\n\t\t\tvAlign = null;\n\t\t\tif(this.parser.source.substr(this.parser.pos).search(/^\\^([^\\^]|\\^\\^)/) === 0) {\n\t\t\t\tvAlign = \"top\";\n\t\t\t} else if(this.parser.source.substr(this.parser.pos).search(/^,([^,]|,,)/) === 0) {\n\t\t\t\tvAlign = \"bottom\";\n\t\t\t}\n\t\t\tif(vAlign) {\n\t\t\t\tthis.parser.pos++;\n\t\t\t}\n\t\t\tvar chr = this.parser.source.substr(this.parser.pos,1);\n\t\t\twhile(chr === \" \") {\n\t\t\t\tspaceLeft = true;\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tchr = this.parser.source.substr(this.parser.pos,1);\n\t\t\t}\n\t\t\t// Check whether this is a heading cell\n\t\t\tvar cell;\n\t\t\tif(chr === \"!\") {\n\t\t\t\tthis.parser.pos++;\n\t\t\t\tcell = {type: \"element\", tag: \"th\", children: []};\n\t\t\t} else {\n\t\t\t\tcell = {type: \"element\", tag: \"td\", children: []};\n\t\t\t}\n\t\t\ttree.push(cell);\n\t\t\t// Record information about this cell\n\t\t\tprevCell = cell;\n\t\t\tprevColumns[col] = {rowSpanCount:1,element:cell};\n\t\t\t// Check for a colspan\n\t\t\tif(colSpanCount > 1) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"colspan\",colSpanCount);\n\t\t\t\tcolSpanCount = 1;\n\t\t\t}\n\t\t\t// Parse the cell\n\t\t\tcell.children = this.parser.parseInlineRun(cellTermRegExp,{eatTerminator: true});\n\t\t\t// Set the alignment for the cell\n\t\t\tif(vAlign) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"valign\",vAlign);\n\t\t\t}\n\t\t\tif(this.parser.source.substr(this.parser.pos - 2,1) === \" \") { // spaceRight\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"align\",spaceLeft ? \"center\" : \"left\");\n\t\t\t} else if(spaceLeft) {\n\t\t\t\t$tw.utils.addAttributeToParseTreeNode(cell,\"align\",\"right\");\n\t\t\t}\n\t\t\t// Move back to the closing `|`\n\t\t\tthis.parser.pos--;\n\t\t}\n\t\tcol++;\n\t\tcellRegExp.lastIndex = this.parser.pos;\n\t\tcellMatch = cellRegExp.exec(this.parser.source);\n\t}\n\treturn tree;\n};\n\nexports.parse = function() {\n\tvar rowContainerTypes = {\"c\":\"caption\", \"h\":\"thead\", \"\":\"tbody\", \"f\":\"tfoot\"},\n\t\ttable = {type: \"element\", tag: \"table\", children: []},\n\t\trowRegExp = /^\\|([^\\n]*)\\|([fhck]?)\\r?(?:\\n|$)/mg,\n\t\trowTermRegExp = /(\\|(?:[fhck]?)\\r?(?:\\n|$))/mg,\n\t\tprevColumns = [],\n\t\tcurrRowType,\n\t\trowContainer,\n\t\trowCount = 0;\n\t// Match the row\n\trowRegExp.lastIndex = this.parser.pos;\n\tvar rowMatch = rowRegExp.exec(this.parser.source);\n\twhile(rowMatch && rowMatch.index === this.parser.pos) {\n\t\tvar rowType = rowMatch[2];\n\t\t// Check if it is a class assignment\n\t\tif(rowType === \"k\") {\n\t\t\t$tw.utils.addClassToParseTreeNode(table,rowMatch[1]);\n\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t} else {\n\t\t\t// Otherwise, create a new row if this one is of a different type\n\t\t\tif(rowType !== currRowType) {\n\t\t\t\trowContainer = {type: \"element\", tag: rowContainerTypes[rowType], children: []};\n\t\t\t\ttable.children.push(rowContainer);\n\t\t\t\tcurrRowType = rowType;\n\t\t\t}\n\t\t\t// Is this a caption row?\n\t\t\tif(currRowType === \"c\") {\n\t\t\t\t// If so, move past the opening `|` of the row\n\t\t\t\tthis.parser.pos++;\n\t\t\t\t// Move the caption to the first row if it isn't already\n\t\t\t\tif(table.children.length !== 1) {\n\t\t\t\t\ttable.children.pop(); // Take rowContainer out of the children array\n\t\t\t\t\ttable.children.splice(0,0,rowContainer); // Insert it at the bottom\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t// Set the alignment - TODO: figure out why TW did this\n//\t\t\t\trowContainer.attributes.align = rowCount === 0 ? \"top\" : \"bottom\";\n\t\t\t\t// Parse the caption\n\t\t\t\trowContainer.children = this.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});\n\t\t\t} else {\n\t\t\t\t// Create the row\n\t\t\t\tvar theRow = {type: \"element\", tag: \"tr\", children: []};\n\t\t\t\t$tw.utils.addClassToParseTreeNode(theRow,rowCount%2 ? \"oddRow\" : \"evenRow\");\n\t\t\t\trowContainer.children.push(theRow);\n\t\t\t\t// Process the row\n\t\t\t\ttheRow.children = processRow.call(this,prevColumns);\n\t\t\t\tthis.parser.pos = rowMatch.index + rowMatch[0].length;\n\t\t\t\t// Increment the row count\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\trowMatch = rowRegExp.exec(this.parser.source);\n\t}\n\treturn [table];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/table.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/transcludeblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for block-level transclusion. For example:\n\n```\n{{MyTiddler}}\n{{MyTiddler||TemplateTitle}}\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"transcludeblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{([^\\{\\}\\|]*)(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}(?:\\r?\\n|$)/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar template = $tw.utils.trim(this.match[2]),\n\t\ttextRef = $tw.utils.trim(this.match[1]);\n\t// Prepare the transclude widget\n\tvar transcludeNode = {\n\t\t\ttype: \"transclude\",\n\t\t\tattributes: {},\n\t\t\tisBlock: true\n\t\t};\n\t// Prepare the tiddler widget\n\tvar tr, targetTitle, targetField, targetIndex, tiddlerNode;\n\tif(textRef) {\n\t\ttr = $tw.utils.parseTextReference(textRef);\n\t\ttargetTitle = tr.title;\n\t\ttargetField = tr.field;\n\t\ttargetIndex = tr.index;\n\t\ttiddlerNode = {\n\t\t\ttype: \"tiddler\",\n\t\t\tattributes: {\n\t\t\t\ttiddler: {type: \"string\", value: targetTitle}\n\t\t\t},\n\t\t\tisBlock: true,\n\t\t\tchildren: [transcludeNode]\n\t\t};\n\t}\n\tif(template) {\n\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: template};\n\t\tif(textRef) {\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t} else {\n\t\tif(textRef) {\n\t\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: targetTitle};\n\t\t\tif(targetField) {\n\t\t\t\ttranscludeNode.attributes.field = {type: \"string\", value: targetField};\n\t\t\t}\n\t\t\tif(targetIndex) {\n\t\t\t\ttranscludeNode.attributes.index = {type: \"string\", value: targetIndex};\n\t\t\t}\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/transcludeblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/transcludeinline.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/transcludeinline.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for inline-level transclusion. For example:\n\n```\n{{MyTiddler}}\n{{MyTiddler||TemplateTitle}}\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"transcludeinline\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\{\\{([^\\{\\}\\|]*)(?:\\|\\|([^\\|\\{\\}]+))?\\}\\}/mg;\n};\n\nexports.parse = function() {\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Get the match details\n\tvar template = $tw.utils.trim(this.match[2]),\n\t\ttextRef = $tw.utils.trim(this.match[1]);\n\t// Prepare the transclude widget\n\tvar transcludeNode = {\n\t\t\ttype: \"transclude\",\n\t\t\tattributes: {}\n\t\t};\n\t// Prepare the tiddler widget\n\tvar tr, targetTitle, targetField, targetIndex, tiddlerNode;\n\tif(textRef) {\n\t\ttr = $tw.utils.parseTextReference(textRef);\n\t\ttargetTitle = tr.title;\n\t\ttargetField = tr.field;\n\t\ttargetIndex = tr.index;\n\t\ttiddlerNode = {\n\t\t\ttype: \"tiddler\",\n\t\t\tattributes: {\n\t\t\t\ttiddler: {type: \"string\", value: targetTitle}\n\t\t\t},\n\t\t\tchildren: [transcludeNode]\n\t\t};\n\t}\n\tif(template) {\n\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: template};\n\t\tif(textRef) {\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t} else {\n\t\tif(textRef) {\n\t\t\ttranscludeNode.attributes.tiddler = {type: \"string\", value: targetTitle};\n\t\t\tif(targetField) {\n\t\t\t\ttranscludeNode.attributes.field = {type: \"string\", value: targetField};\n\t\t\t}\n\t\t\tif(targetIndex) {\n\t\t\t\ttranscludeNode.attributes.index = {type: \"string\", value: targetIndex};\n\t\t\t}\n\t\t\treturn [tiddlerNode];\n\t\t} else {\n\t\t\treturn [transcludeNode];\n\t\t}\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/transcludeinline.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/typedblock.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/typedblock.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text rule for typed blocks. For example:\n\n```\n$$$.js\nThis will be rendered as JavaScript\n$$$\n\n$$$.svg\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"150\" height=\"100\">\n <circle cx=\"100\" cy=\"50\" r=\"40\" stroke=\"black\" stroke-width=\"2\" fill=\"red\" />\n</svg>\n$$$\n\n$$$text/vnd.tiddlywiki>text/html\nThis will be rendered as an //HTML representation// of WikiText\n$$$\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.name = \"typedblock\";\nexports.types = {block: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = /\\$\\$\\$([^ >\\r\\n]*)(?: *> *([^ \\r\\n]+))?\\r?\\n/mg;\n};\n\nexports.parse = function() {\n\tvar reEnd = /\\r?\\n\\$\\$\\$\\r?(?:\\n|$)/mg;\n\t// Save the type\n\tvar parseType = this.match[1],\n\t\trenderType = this.match[2];\n\t// Move past the match\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// Look for the end of the block\n\treEnd.lastIndex = this.parser.pos;\n\tvar match = reEnd.exec(this.parser.source),\n\t\ttext;\n\t// Process the block\n\tif(match) {\n\t\ttext = this.parser.source.substring(this.parser.pos,match.index);\n\t\tthis.parser.pos = match.index + match[0].length;\n\t} else {\n\t\ttext = this.parser.source.substr(this.parser.pos);\n\t\tthis.parser.pos = this.parser.sourceLength;\n\t}\n\t// Parse the block according to the specified type\n\tvar parser = this.parser.wiki.parseText(parseType,text,{defaultType: \"text/plain\"});\n\t// If there's no render type, just return the parse tree\n\tif(!renderType) {\n\t\treturn parser.tree;\n\t} else {\n\t\t// Otherwise, render to the rendertype and return in a <PRE> tag\n\t\tvar widgetNode = this.parser.wiki.makeWidget(parser),\n\t\t\tcontainer = $tw.fakeDocument.createElement(\"div\");\n\t\twidgetNode.render(container,null);\n\t\ttext = renderType === \"text/html\" ? container.innerHTML : container.textContent;\n\t\treturn [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"pre\",\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: text\n\t\t\t}]\n\t\t}];\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/typedblock.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/rules/wikilink.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/wikilink.js\ntype: application/javascript\nmodule-type: wikirule\n\nWiki text inline rule for wiki links. For example:\n\n```\nAWikiLink\nAnotherLink\n~SuppressedLink\n```\n\nPrecede a camel case word with `~` to prevent it from being recognised as a link.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.name = \"wikilink\";\nexports.types = {inline: true};\n\nexports.init = function(parser) {\n\tthis.parser = parser;\n\t// Regexp to match\n\tthis.matchRegExp = new RegExp($tw.config.textPrimitives.unWikiLink + \"?\" + $tw.config.textPrimitives.wikiLink,\"mg\");\n};\n\n/*\nParse the most recent match\n*/\nexports.parse = function() {\n\t// Get the details of the match\n\tvar linkText = this.match[0];\n\t// Move past the macro call\n\tthis.parser.pos = this.matchRegExp.lastIndex;\n\t// If the link starts with the unwikilink character then just output it as plain text\n\tif(linkText.substr(0,1) === $tw.config.textPrimitives.unWikiLink) {\n\t\treturn [{type: \"text\", text: linkText.substr(1)}];\n\t}\n\t// If the link has been preceded with a blocked letter then don't treat it as a link\n\tif(this.match.index > 0) {\n\t\tvar preRegExp = new RegExp($tw.config.textPrimitives.blockPrefixLetters,\"mg\");\n\t\tpreRegExp.lastIndex = this.match.index-1;\n\t\tvar preMatch = preRegExp.exec(this.parser.source);\n\t\tif(preMatch && preMatch.index === this.match.index-1) {\n\t\t\treturn [{type: \"text\", text: linkText}];\n\t\t}\n\t}\n\treturn [{\n\t\ttype: \"link\",\n\t\tattributes: {\n\t\t\tto: {type: \"string\", value: linkText}\n\t\t},\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: linkText\n\t\t}]\n\t}];\n};\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/wikilink.js",
"type": "application/javascript",
"module-type": "wikirule"
},
"$:/core/modules/parsers/wikiparser/wikiparser.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/wikiparser.js\ntype: application/javascript\nmodule-type: parser\n\nThe wiki text parser processes blocks of source text into a parse tree.\n\nThe parse tree is made up of nested arrays of these JavaScript objects:\n\n\t{type: \"element\", tag: <string>, attributes: {}, children: []} - an HTML element\n\t{type: \"text\", text: <string>} - a text node\n\t{type: \"entity\", value: <string>} - an entity\n\t{type: \"raw\", html: <string>} - raw HTML\n\nAttributes are stored as hashmaps of the following objects:\n\n\t{type: \"string\", value: <string>} - literal string\n\t{type: \"indirect\", textReference: <textReference>} - indirect through a text reference\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar WikiParser = function(type,text,options) {\n\tthis.wiki = options.wiki;\n\t// Initialise the classes if we don't have them already\n\tif(!this.pragmaRuleClasses) {\n\t\tWikiParser.prototype.pragmaRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"pragma\",$tw.WikiRuleBase);\n\t}\n\tif(!this.blockRuleClasses) {\n\t\tWikiParser.prototype.blockRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"block\",$tw.WikiRuleBase);\n\t}\n\tif(!this.inlineRuleClasses) {\n\t\tWikiParser.prototype.inlineRuleClasses = $tw.modules.createClassesFromModules(\"wikirule\",\"inline\",$tw.WikiRuleBase);\n\t}\n\t// Save the parse text\n\tthis.type = type || \"text/vnd.tiddlywiki\";\n\tthis.source = text || \"\";\n\tthis.sourceLength = this.source.length;\n\t// Set current parse position\n\tthis.pos = 0;\n\t// Instantiate the pragma parse rules\n\tthis.pragmaRules = this.instantiateRules(this.pragmaRuleClasses,\"pragma\",0);\n\t// Instantiate the parser block and inline rules\n\tthis.blockRules = this.instantiateRules(this.blockRuleClasses,\"block\",0);\n\tthis.inlineRules = this.instantiateRules(this.inlineRuleClasses,\"inline\",0);\n\t// Parse any pragmas\n\tthis.tree = this.parsePragmas();\n\t// Parse the text into inline runs or blocks\n\tif(options.parseAsInline) {\n\t\tthis.tree.push.apply(this.tree,this.parseInlineRun());\n\t} else {\n\t\tthis.tree.push.apply(this.tree,this.parseBlocks());\n\t}\n\t// Return the parse tree\n};\n\n/*\nInstantiate an array of parse rules\n*/\nWikiParser.prototype.instantiateRules = function(classes,type,startPos) {\n\tvar rulesInfo = [],\n\t\tself = this;\n\t$tw.utils.each(classes,function(RuleClass) {\n\t\t// Instantiate the rule\n\t\tvar rule = new RuleClass(self);\n\t\trule.is = {};\n\t\trule.is[type] = true;\n\t\trule.init(self);\n\t\tvar matchIndex = rule.findNextMatch(startPos);\n\t\tif(matchIndex !== undefined) {\n\t\t\trulesInfo.push({\n\t\t\t\trule: rule,\n\t\t\t\tmatchIndex: matchIndex\n\t\t\t});\n\t\t}\n\t});\n\treturn rulesInfo;\n};\n\n/*\nSkip any whitespace at the current position. Options are:\n\ttreatNewlinesAsNonWhitespace: true if newlines are NOT to be treated as whitespace\n*/\nWikiParser.prototype.skipWhitespace = function(options) {\n\toptions = options || {};\n\tvar whitespaceRegExp = options.treatNewlinesAsNonWhitespace ? /([^\\S\\n]+)/mg : /(\\s+)/mg;\n\twhitespaceRegExp.lastIndex = this.pos;\n\tvar whitespaceMatch = whitespaceRegExp.exec(this.source);\n\tif(whitespaceMatch && whitespaceMatch.index === this.pos) {\n\t\tthis.pos = whitespaceRegExp.lastIndex;\n\t}\n};\n\n/*\nGet the next match out of an array of parse rule instances\n*/\nWikiParser.prototype.findNextMatch = function(rules,startPos) {\n\t// Find the best matching rule by finding the closest match position\n\tvar matchingRule,\n\t\tmatchingRulePos = this.sourceLength;\n\t// Step through each rule\n\tfor(var t=0; t<rules.length; t++) {\n\t\tvar ruleInfo = rules[t];\n\t\t// Ask the rule to get the next match if we've moved past the current one\n\t\tif(ruleInfo.matchIndex !== undefined && ruleInfo.matchIndex < startPos) {\n\t\t\truleInfo.matchIndex = ruleInfo.rule.findNextMatch(startPos);\n\t\t}\n\t\t// Adopt this match if it's closer than the current best match\n\t\tif(ruleInfo.matchIndex !== undefined && ruleInfo.matchIndex <= matchingRulePos) {\n\t\t\tmatchingRule = ruleInfo;\n\t\t\tmatchingRulePos = ruleInfo.matchIndex;\n\t\t}\n\t}\n\treturn matchingRule;\n};\n\n/*\nParse any pragmas at the beginning of a block of parse text\n*/\nWikiParser.prototype.parsePragmas = function() {\n\tvar tree = [];\n\twhile(true) {\n\t\t// Skip whitespace\n\t\tthis.skipWhitespace();\n\t\t// Check for the end of the text\n\t\tif(this.pos >= this.sourceLength) {\n\t\t\tbreak;\n\t\t}\n\t\t// Check if we've arrived at a pragma rule match\n\t\tvar nextMatch = this.findNextMatch(this.pragmaRules,this.pos);\n\t\t// If not, just exit\n\t\tif(!nextMatch || nextMatch.matchIndex !== this.pos) {\n\t\t\tbreak;\n\t\t}\n\t\t// Process the pragma rule\n\t\ttree.push.apply(tree,nextMatch.rule.parse());\n\t}\n\treturn tree;\n};\n\n/*\nParse a block from the current position\n\tterminatorRegExpString: optional regular expression string that identifies the end of plain paragraphs. Must not include capturing parenthesis\n*/\nWikiParser.prototype.parseBlock = function(terminatorRegExpString) {\n\tvar terminatorRegExp = terminatorRegExpString ? new RegExp(\"(\" + terminatorRegExpString + \"|\\\\r?\\\\n\\\\r?\\\\n)\",\"mg\") : /(\\r?\\n\\r?\\n)/mg;\n\tthis.skipWhitespace();\n\tif(this.pos >= this.sourceLength) {\n\t\treturn [];\n\t}\n\t// Look for a block rule that applies at the current position\n\tvar nextMatch = this.findNextMatch(this.blockRules,this.pos);\n\tif(nextMatch && nextMatch.matchIndex === this.pos) {\n\t\treturn nextMatch.rule.parse();\n\t}\n\t// Treat it as a paragraph if we didn't find a block rule\n\treturn [{type: \"element\", tag: \"p\", children: this.parseInlineRun(terminatorRegExp)}];\n};\n\n/*\nParse a series of blocks of text until a terminating regexp is encountered or the end of the text\n\tterminatorRegExpString: terminating regular expression\n*/\nWikiParser.prototype.parseBlocks = function(terminatorRegExpString) {\n\tif(terminatorRegExpString) {\n\t\treturn this.parseBlocksTerminated(terminatorRegExpString);\n\t} else {\n\t\treturn this.parseBlocksUnterminated();\n\t}\n};\n\n/*\nParse a block from the current position to the end of the text\n*/\nWikiParser.prototype.parseBlocksUnterminated = function() {\n\tvar tree = [];\n\twhile(this.pos < this.sourceLength) {\n\t\ttree.push.apply(tree,this.parseBlock());\n\t}\n\treturn tree;\n};\n\n/*\nParse blocks of text until a terminating regexp is encountered\n*/\nWikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {\n\tvar terminatorRegExp = new RegExp(\"(\" + terminatorRegExpString + \")\",\"mg\"),\n\t\ttree = [];\n\t// Skip any whitespace\n\tthis.skipWhitespace();\n\t// Check if we've got the end marker\n\tterminatorRegExp.lastIndex = this.pos;\n\tvar match = terminatorRegExp.exec(this.source);\n\t// Parse the text into blocks\n\twhile(this.pos < this.sourceLength && !(match && match.index === this.pos)) {\n\t\tvar blocks = this.parseBlock(terminatorRegExpString);\n\t\ttree.push.apply(tree,blocks);\n\t\t// Skip any whitespace\n\t\tthis.skipWhitespace();\n\t\t// Check if we've got the end marker\n\t\tterminatorRegExp.lastIndex = this.pos;\n\t\tmatch = terminatorRegExp.exec(this.source);\n\t}\n\tif(match && match.index === this.pos) {\n\t\tthis.pos = match.index + match[0].length;\n\t}\n\treturn tree;\n};\n\n/*\nParse a run of text at the current position\n\tterminatorRegExp: a regexp at which to stop the run\n\toptions: see below\nOptions available:\n\teatTerminator: move the parse position past any encountered terminator (default false)\n*/\nWikiParser.prototype.parseInlineRun = function(terminatorRegExp,options) {\n\tif(terminatorRegExp) {\n\t\treturn this.parseInlineRunTerminated(terminatorRegExp,options);\n\t} else {\n\t\treturn this.parseInlineRunUnterminated(options);\n\t}\n};\n\nWikiParser.prototype.parseInlineRunUnterminated = function(options) {\n\tvar tree = [];\n\t// Find the next occurrence of an inline rule\n\tvar nextMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t// Loop around the matches until we've reached the end of the text\n\twhile(this.pos < this.sourceLength && nextMatch) {\n\t\t// Process the text preceding the run rule\n\t\tif(nextMatch.matchIndex > this.pos) {\n\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,nextMatch.matchIndex)});\n\t\t\tthis.pos = nextMatch.matchIndex;\n\t\t}\n\t\t// Process the run rule\n\t\ttree.push.apply(tree,nextMatch.rule.parse());\n\t\t// Look for the next run rule\n\t\tnextMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t}\n\t// Process the remaining text\n\tif(this.pos < this.sourceLength) {\n\t\ttree.push({type: \"text\", text: this.source.substr(this.pos)});\n\t}\n\tthis.pos = this.sourceLength;\n\treturn tree;\n};\n\nWikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,options) {\n\toptions = options || {};\n\tvar tree = [];\n\t// Find the next occurrence of the terminator\n\tterminatorRegExp.lastIndex = this.pos;\n\tvar terminatorMatch = terminatorRegExp.exec(this.source);\n\t// Find the next occurrence of a inlinerule\n\tvar inlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t// Loop around until we've reached the end of the text\n\twhile(this.pos < this.sourceLength && (terminatorMatch || inlineRuleMatch)) {\n\t\t// Return if we've found the terminator, and it precedes any inline rule match\n\t\tif(terminatorMatch) {\n\t\t\tif(!inlineRuleMatch || inlineRuleMatch.matchIndex >= terminatorMatch.index) {\n\t\t\t\tif(terminatorMatch.index > this.pos) {\n\t\t\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,terminatorMatch.index)});\n\t\t\t\t}\n\t\t\t\tthis.pos = terminatorMatch.index;\n\t\t\t\tif(options.eatTerminator) {\n\t\t\t\t\tthis.pos += terminatorMatch[0].length;\n\t\t\t\t}\n\t\t\t\treturn tree;\n\t\t\t}\n\t\t}\n\t\t// Process any inline rule, along with the text preceding it\n\t\tif(inlineRuleMatch) {\n\t\t\t// Preceding text\n\t\t\tif(inlineRuleMatch.matchIndex > this.pos) {\n\t\t\t\ttree.push({type: \"text\", text: this.source.substring(this.pos,inlineRuleMatch.matchIndex)});\n\t\t\t\tthis.pos = inlineRuleMatch.matchIndex;\n\t\t\t}\n\t\t\t// Process the inline rule\n\t\t\ttree.push.apply(tree,inlineRuleMatch.rule.parse());\n\t\t\t// Look for the next inline rule\n\t\t\tinlineRuleMatch = this.findNextMatch(this.inlineRules,this.pos);\n\t\t\t// Look for the next terminator match\n\t\t\tterminatorRegExp.lastIndex = this.pos;\n\t\t\tterminatorMatch = terminatorRegExp.exec(this.source);\n\t\t}\n\t}\n\t// Process the remaining text\n\tif(this.pos < this.sourceLength) {\n\t\ttree.push({type: \"text\", text: this.source.substr(this.pos)});\n\t}\n\tthis.pos = this.sourceLength;\n\treturn tree;\n};\n\n/*\nParse zero or more class specifiers `.classname`\n*/\nWikiParser.prototype.parseClasses = function() {\n\tvar classRegExp = /\\.([^\\s\\.]+)/mg,\n\t\tclassNames = [];\n\tclassRegExp.lastIndex = this.pos;\n\tvar match = classRegExp.exec(this.source);\n\twhile(match && match.index === this.pos) {\n\t\tthis.pos = match.index + match[0].length;\n\t\tclassNames.push(match[1]);\n\t\tmatch = classRegExp.exec(this.source);\n\t}\n\treturn classNames;\n};\n\n/*\nAmend the rules used by this instance of the parser\n\ttype: `only` keeps just the named rules, `except` keeps all but the named rules\n\tnames: array of rule names\n*/\nWikiParser.prototype.amendRules = function(type,names) {\n\tnames = names || [];\n\t// Define the filter function\n\tvar keepFilter;\n\tif(type === \"only\") {\n\t\tkeepFilter = function(name) {\n\t\t\treturn names.indexOf(name) !== -1;\n\t\t};\n\t} else if(type === \"except\") {\n\t\tkeepFilter = function(name) {\n\t\t\treturn names.indexOf(name) === -1;\n\t\t};\n\t} else {\n\t\treturn;\n\t}\n\t// Define a function to process each of our rule arrays\n\tvar processRuleArray = function(ruleArray) {\n\t\tfor(var t=ruleArray.length-1; t>=0; t--) {\n\t\t\tif(!keepFilter(ruleArray[t].rule.name)) {\n\t\t\t\truleArray.splice(t,1);\n\t\t\t}\n\t\t}\n\t};\n\t// Process each rule array\n\tprocessRuleArray(this.pragmaRules);\n\tprocessRuleArray(this.blockRules);\n\tprocessRuleArray(this.inlineRules);\n};\n\nexports[\"text/vnd.tiddlywiki\"] = WikiParser;\n\n})();\n\n",
"title": "$:/core/modules/parsers/wikiparser/wikiparser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/core/modules/parsers/wikiparser/rules/wikirulebase.js": {
"text": "/*\\\ntitle: $:/core/modules/parsers/wikiparser/rules/wikirulebase.js\ntype: application/javascript\nmodule-type: global\n\nBase class for wiki parser rules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nThis constructor is always overridden with a blank constructor, and so shouldn't be used\n*/\nvar WikiRuleBase = function() {\n};\n\n/*\nTo be overridden by individual rules\n*/\nWikiRuleBase.prototype.init = function(parser) {\n\tthis.parser = parser;\n};\n\n/*\nDefault implementation of findNextMatch uses RegExp matching\n*/\nWikiRuleBase.prototype.findNextMatch = function(startPos) {\n\tthis.matchRegExp.lastIndex = startPos;\n\tthis.match = this.matchRegExp.exec(this.parser.source);\n\treturn this.match ? this.match.index : undefined;\n};\n\nexports.WikiRuleBase = WikiRuleBase;\n\n})();\n",
"title": "$:/core/modules/parsers/wikiparser/rules/wikirulebase.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/pluginswitcher.js": {
"text": "/*\\\ntitle: $:/core/modules/pluginswitcher.js\ntype: application/javascript\nmodule-type: global\n\nManages switching plugins for themes and languages.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\noptions:\nwiki: wiki store to be used\npluginType: type of plugin to be switched\ncontrollerTitle: title of tiddler used to control switching of this resource\ndefaultPlugins: array of default plugins to be used if nominated plugin isn't found\n*/\nfunction PluginSwitcher(options) {\n\tthis.wiki = options.wiki;\n\tthis.pluginType = options.pluginType;\n\tthis.controllerTitle = options.controllerTitle;\n\tthis.defaultPlugins = options.defaultPlugins || [];\n\t// Switch to the current plugin\n\tthis.switchPlugins();\n\t// Listen for changes to the selected plugin\n\tvar self = this;\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,self.controllerTitle)) {\n\t\t\tself.switchPlugins();\n\t\t}\n\t});\n}\n\nPluginSwitcher.prototype.switchPlugins = function() {\n\t// Get the name of the current theme\n\tvar selectedPluginTitle = this.wiki.getTiddlerText(this.controllerTitle);\n\t// If it doesn't exist, then fallback to one of the default themes\n\tvar index = 0;\n\twhile(!this.wiki.getTiddler(selectedPluginTitle) && index < this.defaultPlugins.length) {\n\t\tselectedPluginTitle = this.defaultPlugins[index++];\n\t}\n\t// Accumulate the titles of the plugins that we need to load\n\tvar plugins = [],\n\t\tself = this,\n\t\taccumulatePlugin = function(title) {\n\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\tif(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) {\n\t\t\t\tplugins.push(title);\n\t\t\t\tvar pluginInfo = JSON.parse(self.wiki.getTiddlerText(title)),\n\t\t\t\t\tdependents = $tw.utils.parseStringArray(tiddler.fields.dependents || \"\");\n\t\t\t\t$tw.utils.each(dependents,function(title) {\n\t\t\t\t\taccumulatePlugin(title);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\taccumulatePlugin(selectedPluginTitle);\n\t// Unregister any existing theme tiddlers\n\tvar unregisteredTiddlers = $tw.wiki.unregisterPluginTiddlers(this.pluginType);\n\t// Register any new theme tiddlers\n\tvar registeredTiddlers = $tw.wiki.registerPluginTiddlers(this.pluginType,plugins);\n\t// Unpack the current theme tiddlers\n\t$tw.wiki.unpackPluginTiddlers();\n};\n\nexports.PluginSwitcher = PluginSwitcher;\n\n})();\n",
"title": "$:/core/modules/pluginswitcher.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/saver-handler.js": {
"text": "/*\\\ntitle: $:/core/modules/saver-handler.js\ntype: application/javascript\nmodule-type: global\n\nThe saver handler tracks changes to the store and handles saving the entire wiki via saver modules.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInstantiate the saver handler with the following options:\nwiki: wiki to be synced\ndirtyTracking: true if dirty tracking should be performed\n*/\nfunction SaverHandler(options) {\n\tvar self = this;\n\tthis.wiki = options.wiki;\n\tthis.dirtyTracking = options.dirtyTracking;\n\tthis.pendingAutoSave = false;\n\t// Make a logger\n\tthis.logger = new $tw.utils.Logger(\"saver-handler\");\n\t// Initialise our savers\n\tif($tw.browser) {\n\t\tthis.initSavers();\n\t}\n\t// Only do dirty tracking if required\n\tif($tw.browser && this.dirtyTracking) {\n\t\t// Compile the dirty tiddler filter\n\t\tthis.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));\n\t\t// Count of changes that have not yet been saved\n\t\tthis.numChanges = 0;\n\t\t// Listen out for changes to tiddlers\n\t\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\t\t// Filter the changes so that we only count changes to tiddlers that we care about\n\t\t\tvar filteredChanges = self.filterFn.call(self.wiki,function(callback) {\n\t\t\t\t$tw.utils.each(changes,function(change,title) {\n\t\t\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\t\t\tcallback(tiddler,title);\n\t\t\t\t});\n\t\t\t});\n\t\t\t// Adjust the number of changes\n\t\t\tself.numChanges += filteredChanges.length;\n\t\t\tself.updateDirtyStatus();\n\t\t\t// Do any autosave if one is pending and there's no more change events\n\t\t\tif(self.pendingAutoSave && self.wiki.getSizeOfTiddlerEventQueue() === 0) {\n\t\t\t\t// Check if we're dirty\n\t\t\t\tif(self.numChanges > 0) {\n\t\t\t\t\tself.saveWiki({\n\t\t\t\t\t\tmethod: \"autosave\",\n\t\t\t\t\t\tdownloadType: \"text/plain\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tself.pendingAutoSave = false;\n\t\t\t}\n\t\t});\n\t\t// Listen for the autosave event\n\t\t$tw.rootWidget.addEventListener(\"tm-auto-save-wiki\",function(event) {\n\t\t\t// Do the autosave unless there are outstanding tiddler change events\n\t\t\tif(self.wiki.getSizeOfTiddlerEventQueue() === 0) {\n\t\t\t\t// Check if we're dirty\n\t\t\t\tif(self.numChanges > 0) {\n\t\t\t\t\tself.saveWiki({\n\t\t\t\t\t\tmethod: \"autosave\",\n\t\t\t\t\t\tdownloadType: \"text/plain\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Otherwise put ourselves in the \"pending autosave\" state and wait for the change event before we do the autosave\n\t\t\t\tself.pendingAutoSave = true;\n\t\t\t}\n\t\t});\n\t\t// Set up our beforeunload handler\n\t\twindow.onbeforeunload = function(event) {\n\t\t\tvar confirmationMessage;\n\t\t\tif(self.isDirty()) {\n\t\t\t\tconfirmationMessage = $tw.language.getString(\"UnsavedChangesWarning\");\n\t\t\t\tevent.returnValue = confirmationMessage; // Gecko\n\t\t\t}\n\t\t\treturn confirmationMessage;\n\t\t};\n\t}\n\t// Install the save action handlers\n\tif($tw.browser) {\n\t\t$tw.rootWidget.addEventListener(\"tm-save-wiki\",function(event) {\n\t\t\tself.saveWiki({\n\t\t\t\ttemplate: event.param,\n\t\t\t\tdownloadType: \"text/plain\",\n\t\t\t\tvariables: event.paramObject\n\t\t\t});\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-download-file\",function(event) {\n\t\t\tself.saveWiki({\n\t\t\t\tmethod: \"download\",\n\t\t\t\ttemplate: event.param,\n\t\t\t\tdownloadType: \"text/plain\",\n\t\t\t\tvariables: event.paramObject\n\t\t\t});\n\t\t});\n\t}\n}\n\nSaverHandler.prototype.titleSyncFilter = \"$:/config/SaverFilter\";\nSaverHandler.prototype.titleAutoSave = \"$:/config/AutoSave\";\nSaverHandler.prototype.titleSavedNotification = \"$:/language/Notifications/Save/Done\";\n\n/*\nSelect the appropriate saver modules and set them up\n*/\nSaverHandler.prototype.initSavers = function(moduleType) {\n\tmoduleType = moduleType || \"saver\";\n\t// Instantiate the available savers\n\tthis.savers = [];\n\tvar self = this;\n\t$tw.modules.forEachModuleOfType(moduleType,function(title,module) {\n\t\tif(module.canSave(self)) {\n\t\t\tself.savers.push(module.create(self.wiki));\n\t\t}\n\t});\n\t// Sort the savers into priority order\n\tthis.savers.sort(function(a,b) {\n\t\tif(a.info.priority < b.info.priority) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tif(a.info.priority > b.info.priority) {\n\t\t\t\treturn +1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nSave the wiki contents. Options are:\n\tmethod: \"save\", \"autosave\" or \"download\"\n\ttemplate: the tiddler containing the template to save\n\tdownloadType: the content type for the saved file\n*/\nSaverHandler.prototype.saveWiki = function(options) {\n\toptions = options || {};\n\tvar self = this,\n\t\tmethod = options.method || \"save\",\n\t\tvariables = options.variables || {},\n\t\ttemplate = options.template || \"$:/core/save/all\",\n\t\tdownloadType = options.downloadType || \"text/plain\",\n\t\ttext = this.wiki.renderTiddler(downloadType,template,options),\n\t\tcallback = function(err) {\n\t\t\tif(err) {\n\t\t\t\talert(\"Error while saving:\\n\\n\" + err);\n\t\t\t} else {\n\t\t\t\t// Clear the task queue if we're saving (rather than downloading)\n\t\t\t\tif(method !== \"download\") {\n\t\t\t\t\tself.numChanges = 0;\n\t\t\t\t\tself.updateDirtyStatus();\n\t\t\t\t}\n\t\t\t\t$tw.notifier.display(self.titleSavedNotification);\n\t\t\t\tif(options.callback) {\n\t\t\t\t\toptions.callback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t// Ignore autosave if disabled\n\tif(method === \"autosave\" && this.wiki.getTiddlerText(this.titleAutoSave,\"yes\") !== \"yes\") {\n\t\treturn false;\n\t}\n\t// Call the highest priority saver that supports this method\n\tfor(var t=this.savers.length-1; t>=0; t--) {\n\t\tvar saver = this.savers[t];\n\t\tif(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename}})) {\n\t\t\tthis.logger.log(\"Saving wiki with method\",method,\"through saver\",saver.info.name);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n};\n\n/*\nChecks whether the wiki is dirty (ie the window shouldn't be closed)\n*/\nSaverHandler.prototype.isDirty = function() {\n\treturn this.numChanges > 0;\n};\n\n/*\nUpdate the document body with the class \"tc-dirty\" if the wiki has unsaved/unsynced changes\n*/\nSaverHandler.prototype.updateDirtyStatus = function() {\n\tif($tw.browser) {\n\t\t$tw.utils.toggleClass(document.body,\"tc-dirty\",this.isDirty());\n\t}\n};\n\nexports.SaverHandler = SaverHandler;\n\n})();\n",
"title": "$:/core/modules/saver-handler.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/savers/andtidwiki.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/andtidwiki.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the AndTidWiki Android app\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar AndTidWiki = function(wiki) {\n};\n\nAndTidWiki.prototype.save = function(text,method,callback) {\n\t// Get the pathname of this document\n\tvar pathname = decodeURIComponent(document.location.toString().split(\"#\")[0]);\n\t// Strip the file://\n\tif(pathname.indexOf(\"file://\") === 0) {\n\t\tpathname = pathname.substr(7);\n\t}\n\t// Strip any query or location part\n\tvar p = pathname.indexOf(\"?\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\tp = pathname.indexOf(\"#\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\t// Save the file\n\twindow.twi.saveFile(pathname,text);\n\t// Call the callback\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nAndTidWiki.prototype.info = {\n\tname: \"andtidwiki\",\n\tpriority: 1600,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn !!window.twi && !!window.twi.saveFile;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new AndTidWiki(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/andtidwiki.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/download.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/download.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via HTML5's download APIs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar DownloadSaver = function(wiki) {\n};\n\nDownloadSaver.prototype.save = function(text,method,callback,options) {\n\toptions = options || {};\n\t// Get the current filename\n\tvar filename = options.variables.filename;\n\tif(!filename) {\n\t\tvar p = document.location.pathname.lastIndexOf(\"/\");\n\t\tif(p !== -1) {\n\t\t\tfilename = document.location.pathname.substr(p+1);\n\t\t}\n\t}\n\tif(!filename) {\n\t\tfilename = \"tiddlywiki.html\";\n\t}\n\t// Set up the link\n\tvar link = document.createElement(\"a\");\n\tlink.setAttribute(\"target\",\"_blank\");\n\tif(Blob !== undefined) {\n\t\tvar blob = new Blob([text], {type: \"text/html\"});\n\t\tlink.setAttribute(\"href\", URL.createObjectURL(blob));\n\t} else {\n\t\tlink.setAttribute(\"href\",\"data:text/html,\" + encodeURIComponent(text));\n\t}\n\tlink.setAttribute(\"download\",filename);\n\tdocument.body.appendChild(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nDownloadSaver.prototype.info = {\n\tname: \"download\",\n\tpriority: 100,\n\tcapabilities: [\"save\", \"download\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn document.createElement(\"a\").download !== undefined;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new DownloadSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/download.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/fsosaver.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/fsosaver.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via MS FileSystemObject ActiveXObject\n\nNote: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally won't be available. \nHowever, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar FSOSaver = function(wiki) {\n};\n\nFSOSaver.prototype.save = function(text,method,callback) {\n\t// Get the pathname of this document\n\tvar pathname = unescape(document.location.pathname);\n\t// Test for a Windows path of the form /x:\\blah...\n\tif(/^\\/[A-Z]\\:\\\\[^\\\\]+/i.test(pathname)) {\t// ie: ^/[a-z]:/[^/]+\n\t\t// Remove the leading slash\n\t\tpathname = pathname.substr(1);\n\t} else if(document.location.hostname !== \"\" && /^\\/\\\\[^\\\\]+\\\\[^\\\\]+/i.test(pathname)) {\t// test for \\\\server\\share\\blah... - ^/[^/]+/[^/]+\n\t\t// Remove the leading slash\n\t\tpathname = pathname.substr(1);\n\t\t// reconstruct UNC path\n\t\tpathname = \"\\\\\\\\\" + document.location.hostname + pathname;\n\t} else {\n\t\treturn false;\n\t}\n\t// Save the file (as UTF-16)\n\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tvar file = fso.OpenTextFile(pathname,2,-1,-1);\n\tfile.Write(text);\n\tfile.Close();\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nFSOSaver.prototype.info = {\n\tname: \"FSOSaver\",\n\tpriority: 120,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\ttry {\n\t\treturn (window.location.protocol === \"file:\") && !!(new ActiveXObject(\"Scripting.FileSystemObject\"));\n\t} catch(e) { return false; }\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new FSOSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/fsosaver.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/manualdownload.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/manualdownload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via HTML5's download APIs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Title of the tiddler containing the download message\nvar downloadInstructionsTitle = \"$:/language/Modals/Download\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar ManualDownloadSaver = function(wiki) {\n};\n\nManualDownloadSaver.prototype.save = function(text,method,callback) {\n\t$tw.modal.display(downloadInstructionsTitle,{\n\t\tdownloadLink: \"data:text/html,\" + encodeURIComponent(text)\n\t});\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nManualDownloadSaver.prototype.info = {\n\tname: \"manualdownload\",\n\tpriority: 0,\n\tcapabilities: [\"save\", \"download\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new ManualDownloadSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/manualdownload.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/msdownload.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/msdownload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via window.navigator.msSaveBlob()\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar MsDownloadSaver = function(wiki) {\n};\n\nMsDownloadSaver.prototype.save = function(text,method,callback) {\n\t// Get the current filename\n\tvar filename = \"tiddlywiki.html\",\n\t\tp = document.location.pathname.lastIndexOf(\"/\");\n\tif(p !== -1) {\n\t\tfilename = document.location.pathname.substr(p+1);\n\t}\n\t// Set up the link\n\tvar blob = new Blob([text], {type: \"text/html\"});\n\twindow.navigator.msSaveBlob(blob,filename);\n\t// Callback that we succeeded\n\tcallback(null);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nMsDownloadSaver.prototype.info = {\n\tname: \"msdownload\",\n\tpriority: 110,\n\tcapabilities: [\"save\", \"download\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn !!window.navigator.msSaveBlob;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new MsDownloadSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/msdownload.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/tiddlyfox.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/tiddlyfox.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the TiddlyFox file extension\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar TiddlyFoxSaver = function(wiki) {\n};\n\nTiddlyFoxSaver.prototype.save = function(text,method,callback) {\n\tvar messageBox = document.getElementById(\"tiddlyfox-message-box\");\n\tif(messageBox) {\n\t\t// Get the pathname of this document\n\t\tvar pathname = document.location.toString().split(\"#\")[0];\n\t\t// Replace file://localhost/ with file:///\n\t\tif(pathname.indexOf(\"file://localhost/\") === 0) {\n\t\t\tpathname = \"file://\" + pathname.substr(16);\n\t\t}\n\t\t// Windows path file:///x:/blah/blah --> x:\\blah\\blah\n\t\tif(/^file\\:\\/\\/\\/[A-Z]\\:\\//i.test(pathname)) {\n\t\t\t// Remove the leading slash and convert slashes to backslashes\n\t\t\tpathname = pathname.substr(8).replace(/\\//g,\"\\\\\");\n\t\t// Firefox Windows network path file://///server/share/blah/blah --> //server/share/blah/blah\n\t\t} else if(pathname.indexOf(\"file://///\") === 0) {\n\t\t\tpathname = \"\\\\\\\\\" + unescape(pathname.substr(10)).replace(/\\//g,\"\\\\\");\n\t\t// Mac/Unix local path file:///path/path --> /path/path\n\t\t} else if(pathname.indexOf(\"file:///\") === 0) {\n\t\t\tpathname = unescape(pathname.substr(7));\n\t\t// Mac/Unix local path file:/path/path --> /path/path\n\t\t} else if(pathname.indexOf(\"file:/\") === 0) {\n\t\t\tpathname = unescape(pathname.substr(5));\n\t\t// Otherwise Windows networth path file://server/share/path/path --> \\\\server\\share\\path\\path\n\t\t} else {\n\t\t\tpathname = \"\\\\\\\\\" + unescape(pathname.substr(7)).replace(new RegExp(\"/\",\"g\"),\"\\\\\");\n\t\t}\n\t\t// Create the message element and put it in the message box\n\t\tvar message = document.createElement(\"div\");\n\t\tmessage.setAttribute(\"data-tiddlyfox-path\",decodeURIComponent(pathname));\n\t\tmessage.setAttribute(\"data-tiddlyfox-content\",text);\n\t\tmessageBox.appendChild(message);\n\t\t// Add an event handler for when the file has been saved\n\t\tmessage.addEventListener(\"tiddlyfox-have-saved-file\",function(event) {\n\t\t\tcallback(null);\n\t\t}, false);\n\t\t// Create and dispatch the custom event to the extension\n\t\tvar event = document.createEvent(\"Events\");\n\t\tevent.initEvent(\"tiddlyfox-save-file\",true,false);\n\t\tmessage.dispatchEvent(event);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n\n/*\nInformation about this saver\n*/\nTiddlyFoxSaver.prototype.info = {\n\tname: \"tiddlyfox\",\n\tpriority: 1500,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn (window.location.protocol === \"file:\");\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TiddlyFoxSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/tiddlyfox.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/tiddlyie.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/tiddlyie.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via Internet Explorer BHO extenion (TiddlyIE)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar TiddlyIESaver = function(wiki) {\n};\n\nTiddlyIESaver.prototype.save = function(text,method,callback) {\n\t// Check existence of TiddlyIE BHO extension (note: only works after document is complete)\n\tif(typeof(window.TiddlyIE) != \"undefined\") {\n\t\t// Get the pathname of this document\n\t\tvar pathname = unescape(document.location.pathname);\n\t\t// Test for a Windows path of the form /x:/blah...\n\t\tif(/^\\/[A-Z]\\:\\/[^\\/]+/i.test(pathname)) {\t// ie: ^/[a-z]:/[^/]+ (is this better?: ^/[a-z]:/[^/]+(/[^/]+)*\\.[^/]+ )\n\t\t\t// Remove the leading slash\n\t\t\tpathname = pathname.substr(1);\n\t\t\t// Convert slashes to backslashes\n\t\t\tpathname = pathname.replace(/\\//g,\"\\\\\");\n\t\t} else if(document.hostname !== \"\" && /^\\/[^\\/]+\\/[^\\/]+/i.test(pathname)) {\t// test for \\\\server\\share\\blah... - ^/[^/]+/[^/]+\n\t\t\t// Convert slashes to backslashes\n\t\t\tpathname = pathname.replace(/\\//g,\"\\\\\");\n\t\t\t// reconstruct UNC path\n\t\t\tpathname = \"\\\\\\\\\" + document.location.hostname + pathname;\n\t\t} else return false;\n\t\t// Prompt the user to save the file\n\t\twindow.TiddlyIE.save(pathname, text);\n\t\t// Callback that we succeeded\n\t\tcallback(null);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n};\n\n/*\nInformation about this saver\n*/\nTiddlyIESaver.prototype.info = {\n\tname: \"tiddlyiesaver\",\n\tpriority: 1500,\n\tcapabilities: [\"save\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn (window.location.protocol === \"file:\");\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TiddlyIESaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/tiddlyie.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/twedit.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/twedit.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via the TWEdit iOS app\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false, netscape: false, Components: false */\n\"use strict\";\n\nvar TWEditSaver = function(wiki) {\n};\n\nTWEditSaver.prototype.save = function(text,method,callback) {\n\t// Bail if we're not running under TWEdit\n\tif(typeof DeviceInfo !== \"object\") {\n\t\treturn false;\n\t}\n\t// Get the pathname of this document\n\tvar pathname = decodeURIComponent(document.location.pathname);\n\t// Strip any query or location part\n\tvar p = pathname.indexOf(\"?\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\tp = pathname.indexOf(\"#\");\n\tif(p !== -1) {\n\t\tpathname = pathname.substr(0,p);\n\t}\n\t// Remove the leading \"/Documents\" from path\n\tvar prefix = \"/Documents\";\n\tif(pathname.indexOf(prefix) === 0) {\n\t\tpathname = pathname.substr(prefix.length);\n\t}\n\t// Error handler\n\tvar errorHandler = function(event) {\n\t\t// Error\n\t\tcallback(\"Error saving to TWEdit: \" + event.target.error.code);\n\t};\n\t// Get the file system\n\twindow.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(fileSystem) {\n\t\t// Now we've got the filesystem, get the fileEntry\n\t\tfileSystem.root.getFile(pathname, {create: true}, function(fileEntry) {\n\t\t\t// Now we've got the fileEntry, create the writer\n\t\t\tfileEntry.createWriter(function(writer) {\n\t\t\t\twriter.onerror = errorHandler;\n\t\t\t\twriter.onwrite = function() {\n\t\t\t\t\tcallback(null);\n\t\t\t\t};\n\t\t\t\twriter.position = 0;\n\t\t\t\twriter.write(text);\n\t\t\t},errorHandler);\n\t\t}, errorHandler);\n\t}, errorHandler);\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nTWEditSaver.prototype.info = {\n\tname: \"twedit\",\n\tpriority: 1600,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new TWEditSaver(wiki);\n};\n\n/////////////////////////// Hack\n// HACK: This ensures that TWEdit recognises us as a TiddlyWiki document\nif($tw.browser) {\n\twindow.version = {title: \"TiddlyWiki\"};\n}\n\n})();\n",
"title": "$:/core/modules/savers/twedit.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/savers/upload.js": {
"text": "/*\\\ntitle: $:/core/modules/savers/upload.js\ntype: application/javascript\nmodule-type: saver\n\nHandles saving changes via upload to a server.\n\nDesigned to be compatible with BidiX's UploadPlugin at http://tiddlywiki.bidix.info/#UploadPlugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSelect the appropriate saver module and set it up\n*/\nvar UploadSaver = function(wiki) {\n\tthis.wiki = wiki;\n};\n\nUploadSaver.prototype.save = function(text,method,callback) {\n\t// Get the various parameters we need\n\tvar backupDir = this.wiki.getTextReference(\"$:/UploadBackupDir\") || \".\",\n\t\tusername = this.wiki.getTextReference(\"$:/UploadName\"),\n\t\tpassword = $tw.utils.getPassword(\"upload\"),\n\t\tuploadDir = this.wiki.getTextReference(\"$:/UploadDir\") || \".\",\n\t\tuploadFilename = this.wiki.getTextReference(\"$:/UploadFilename\") || \"index.html\",\n\t\turl = this.wiki.getTextReference(\"$:/UploadURL\");\n\t// Bail out if we don't have the bits we need\n\tif(!username || username.toString().trim() === \"\" || !password || password.toString().trim() === \"\") {\n\t\treturn false;\n\t}\n\t// Construct the url if not provided\n\tif(!url) {\n\t\turl = \"http://\" + username + \".tiddlyspot.com/store.cgi\";\n\t}\n\t// Assemble the header\n\tvar boundary = \"---------------------------\" + \"AaB03x\";\t\n\tvar uploadFormName = \"UploadPlugin\";\n\tvar head = [];\n\thead.push(\"--\" + boundary + \"\\r\\nContent-disposition: form-data; name=\\\"UploadPlugin\\\"\\r\\n\");\n\thead.push(\"backupDir=\" + backupDir + \";user=\" + username + \";password=\" + password + \";uploaddir=\" + uploadDir + \";;\"); \n\thead.push(\"\\r\\n\" + \"--\" + boundary);\n\thead.push(\"Content-disposition: form-data; name=\\\"userfile\\\"; filename=\\\"\" + uploadFilename + \"\\\"\");\n\thead.push(\"Content-Type: text/html;charset=UTF-8\");\n\thead.push(\"Content-Length: \" + text.length + \"\\r\\n\");\n\thead.push(\"\");\n\t// Assemble the tail and the data itself\n\tvar tail = \"\\r\\n--\" + boundary + \"--\\r\\n\",\n\t\tdata = head.join(\"\\r\\n\") + text + tail;\n\t// Do the HTTP post\n\tvar http = new XMLHttpRequest();\n\thttp.open(\"POST\",url,true,username,password);\n\thttp.setRequestHeader(\"Content-Type\",\"multipart/form-data; ;charset=UTF-8; boundary=\" + boundary);\n\thttp.onreadystatechange = function() {\n\t\tif(http.readyState == 4 && http.status == 200) {\n\t\t\tif(http.responseText.substr(0,4) === \"0 - \") {\n\t\t\t\tcallback(null);\n\t\t\t} else {\n\t\t\t\tcallback(http.responseText);\n\t\t\t}\n\t\t}\n\t};\n\ttry {\n\t\thttp.send(data);\n\t} catch(ex) {\n\t\treturn callback(\"Error:\" + ex);\n\t}\n\t$tw.notifier.display(\"$:/language/Notifications/Save/Starting\");\n\treturn true;\n};\n\n/*\nInformation about this saver\n*/\nUploadSaver.prototype.info = {\n\tname: \"upload\",\n\tpriority: 2000,\n\tcapabilities: [\"save\", \"autosave\"]\n};\n\n/*\nStatic method that returns true if this saver is capable of working\n*/\nexports.canSave = function(wiki) {\n\treturn true;\n};\n\n/*\nCreate an instance of this saver\n*/\nexports.create = function(wiki) {\n\treturn new UploadSaver(wiki);\n};\n\n})();\n",
"title": "$:/core/modules/savers/upload.js",
"type": "application/javascript",
"module-type": "saver"
},
"$:/core/modules/startup/commands.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/commands.js\ntype: application/javascript\nmodule-type: startup\n\nCommand processing\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"commands\";\nexports.platforms = [\"node\"];\nexports.after = [\"story\"];\nexports.synchronous = false;\n\nexports.startup = function(callback) {\n\t// On the server, start a commander with the command line arguments\n\tvar commander = new $tw.Commander(\n\t\t$tw.boot.argv,\n\t\tfunction(err) {\n\t\t\tif(err) {\n\t\t\t\treturn $tw.utils.error(\"Error: \" + err);\n\t\t\t}\n\t\t\tcallback();\n\t\t},\n\t\t$tw.wiki,\n\t\t{output: process.stdout, error: process.stderr}\n\t);\n\tcommander.execute();\n};\n\n})();\n",
"title": "$:/core/modules/startup/commands.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/favicon.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/favicon.js\ntype: application/javascript\nmodule-type: startup\n\nFavicon handling\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"favicon\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\t\t\n// Favicon tiddler\nvar FAVICON_TITLE = \"$:/favicon.ico\";\n\nexports.startup = function() {\n\t// Set up the favicon\n\tsetFavicon();\n\t// Reset the favicon when the tiddler changes\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,FAVICON_TITLE)) {\n\t\t\tsetFavicon();\n\t\t}\n\t});\n};\n\nfunction setFavicon() {\n\tvar tiddler = $tw.wiki.getTiddler(FAVICON_TITLE);\n\tif(tiddler) {\n\t\tvar faviconLink = document.getElementById(\"faviconLink\");\n\t\tfaviconLink.setAttribute(\"href\",\"data:\" + tiddler.fields.type + \";base64,\" + tiddler.fields.text);\n\t}\n}\n\n})();\n",
"title": "$:/core/modules/startup/favicon.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/info.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/info.js\ntype: application/javascript\nmodule-type: startup\n\nInitialise $:/info tiddlers via $:/temp/info-plugin pseudo-plugin\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"info\";\nexports.before = [\"startup\"];\nexports.after = [\"load-modules\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Collect up the info tiddlers\n\tvar infoTiddlerFields = {};\n\t// Give each info module a chance to fill in as many info tiddlers as they want\n\t$tw.modules.forEachModuleOfType(\"info\",function(title,moduleExports) {\n\t\tif(moduleExports && moduleExports.getInfoTiddlerFields) {\n\t\t\tvar tiddlerFieldsArray = moduleExports.getInfoTiddlerFields(infoTiddlerFields);\n\t\t\t$tw.utils.each(tiddlerFieldsArray,function(fields) {\n\t\t\t\tif(fields) {\n\t\t\t\t\tinfoTiddlerFields[fields.title] = fields;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t// Bake the info tiddlers into a plugin\n\tvar fields = {\n\t\ttitle: \"$:/temp/info-plugin\",\n\t\ttype: \"application/json\",\n\t\t\"plugin-type\": \"info\",\n\t\ttext: JSON.stringify({tiddlers: infoTiddlerFields},null,$tw.config.preferences.jsonSpaces)\n\t};\n\t$tw.wiki.addTiddler(new $tw.Tiddler(fields));\n\t$tw.wiki.readPluginInfo();\n\t$tw.wiki.registerPluginTiddlers(\"info\");\n\t$tw.wiki.unpackPluginTiddlers();\n};\n\n})();\n",
"title": "$:/core/modules/startup/info.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/load-modules.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/load-modules.js\ntype: application/javascript\nmodule-type: startup\n\nLoad core modules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"load-modules\";\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Load modules\n\t$tw.modules.applyMethods(\"utils\",$tw.utils);\n\tif($tw.node) {\n\t\t$tw.modules.applyMethods(\"utils-node\",$tw.utils);\n\t}\n\t$tw.modules.applyMethods(\"global\",$tw);\n\t$tw.modules.applyMethods(\"config\",$tw.config);\n\t$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap(\"tiddlerfield\");\n\t$tw.modules.applyMethods(\"tiddlermethod\",$tw.Tiddler.prototype);\n\t$tw.modules.applyMethods(\"wikimethod\",$tw.Wiki.prototype);\n\t$tw.modules.applyMethods(\"tiddlerdeserializer\",$tw.Wiki.tiddlerDeserializerModules);\n\t$tw.macros = $tw.modules.getModulesByTypeAsHashmap(\"macro\");\n\t$tw.wiki.initParsers();\n\t$tw.Commander.initCommands();\n};\n\n})();\n",
"title": "$:/core/modules/startup/load-modules.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/password.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/password.js\ntype: application/javascript\nmodule-type: startup\n\nPassword handling\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"password\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t$tw.rootWidget.addEventListener(\"tm-set-password\",function(event) {\n\t\t$tw.passwordPrompt.createPrompt({\n\t\t\tserviceName: $tw.language.getString(\"Encryption/PromptSetPassword\"),\n\t\t\tnoUserName: true,\n\t\t\tsubmitText: \"Set password\",\n\t\t\tcanCancel: true,\n\t\t\trepeatPassword: true,\n\t\t\tcallback: function(data) {\n\t\t\t\tif(data) {\n\t\t\t\t\t$tw.crypto.setPassword(data.password);\n\t\t\t\t}\n\t\t\t\treturn true; // Get rid of the password prompt\n\t\t\t}\n\t\t});\n\t});\n\t$tw.rootWidget.addEventListener(\"tm-clear-password\",function(event) {\n\t\tif($tw.browser) {\n\t\t\tif(!confirm($tw.language.getString(\"Encryption/ConfirmClearPassword\"))) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$tw.crypto.setPassword(null);\n\t});\n\t// Ensure that $:/isEncrypted is maintained properly\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.utils.hop(changes,\"$:/isEncrypted\")) {\n\t\t\t$tw.crypto.updateCryptoStateTiddler();\n\t\t}\n\t});\n};\n\n})();\n",
"title": "$:/core/modules/startup/password.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/render.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/render.js\ntype: application/javascript\nmodule-type: startup\n\nTitle, stylesheet and page rendering\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"render\";\nexports.platforms = [\"browser\"];\nexports.after = [\"story\"];\nexports.synchronous = true;\n\n// Default story and history lists\nvar PAGE_TITLE_TITLE = \"$:/core/wiki/title\";\nvar PAGE_STYLESHEET_TITLE = \"$:/core/ui/PageStylesheet\";\nvar PAGE_TEMPLATE_TITLE = \"$:/core/ui/PageTemplate\";\n\n// Time (in ms) that we defer refreshing changes to draft tiddlers\nvar DRAFT_TIDDLER_TIMEOUT = 400;\n\nexports.startup = function() {\n\t// Set up the title\n\t$tw.titleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TITLE_TITLE,{document: $tw.fakeDocument, parseAsInline: true});\n\t$tw.titleContainer = $tw.fakeDocument.createElement(\"div\");\n\t$tw.titleWidgetNode.render($tw.titleContainer,null);\n\tdocument.title = $tw.titleContainer.textContent;\n\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\tif($tw.titleWidgetNode.refresh(changes,$tw.titleContainer,null)) {\n\t\t\tdocument.title = $tw.titleContainer.textContent;\n\t\t}\n\t});\n\t// Set up the styles\n\t$tw.styleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_STYLESHEET_TITLE,{document: $tw.fakeDocument});\n\t$tw.styleContainer = $tw.fakeDocument.createElement(\"style\");\n\t$tw.styleWidgetNode.render($tw.styleContainer,null);\n\t$tw.styleElement = document.createElement(\"style\");\n\t$tw.styleElement.innerHTML = $tw.styleContainer.textContent;\n\tdocument.head.insertBefore($tw.styleElement,document.head.firstChild);\n\t$tw.wiki.addEventListener(\"change\",$tw.perf.report(\"styleRefresh\",function(changes) {\n\t\tif($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) {\n\t\t\t$tw.styleElement.innerHTML = $tw.styleContainer.textContent;\n\t\t}\n\t}));\n\t// Display the $:/core/ui/PageTemplate tiddler to kick off the display\n\t$tw.perf.report(\"mainRender\",function() {\n\t\t$tw.pageWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TEMPLATE_TITLE,{document: document, parentWidget: $tw.rootWidget});\n\t\t$tw.pageContainer = document.createElement(\"div\");\n\t\t$tw.utils.addClass($tw.pageContainer,\"tc-page-container-wrapper\");\n\t\tdocument.body.insertBefore($tw.pageContainer,document.body.firstChild);\n\t\t$tw.pageWidgetNode.render($tw.pageContainer,null);\n\t})();\n\t// Prepare refresh mechanism\n\tvar deferredChanges = Object.create(null),\n\t\ttimerId;\n\tfunction refresh() {\n\t\t// Process the refresh\n\t\t$tw.pageWidgetNode.refresh(deferredChanges);\n\t\tdeferredChanges = Object.create(null);\n\t}\n\t// Add the change event handler\n\t$tw.wiki.addEventListener(\"change\",$tw.perf.report(\"mainRefresh\",function(changes) {\n\t\t// Check if only drafts have changed\n\t\tvar onlyDraftsHaveChanged = true;\n\t\tfor(var title in changes) {\n\t\t\tvar tiddler = $tw.wiki.getTiddler(title);\n\t\t\tif(!tiddler || !tiddler.hasField(\"draft.of\")) {\n\t\t\t\tonlyDraftsHaveChanged = false;\n\t\t\t}\n\t\t}\n\t\t// Defer the change if only drafts have changed\n\t\tif(timerId) {\n\t\t\tclearTimeout(timerId);\n\t\t}\n\t\ttimerId = null;\n\t\tif(onlyDraftsHaveChanged) {\n\t\t\ttimerId = setTimeout(refresh,DRAFT_TIDDLER_TIMEOUT);\n\t\t\t$tw.utils.extend(deferredChanges,changes);\n\t\t} else {\n\t\t\t$tw.utils.extend(deferredChanges,changes);\n\t\t\trefresh();\n\t\t}\n\t}));\n\t// Fix up the link between the root widget and the page container\n\t$tw.rootWidget.domNodes = [$tw.pageContainer];\n\t$tw.rootWidget.children = [$tw.pageWidgetNode];\n};\n\n})();\n",
"title": "$:/core/modules/startup/render.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/rootwidget.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/rootwidget.js\ntype: application/javascript\nmodule-type: startup\n\nSetup the root widget and the core root widget handlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"rootwidget\";\nexports.platforms = [\"browser\"];\nexports.after = [\"startup\"];\nexports.before = [\"story\"];\nexports.synchronous = true;\n\nexports.startup = function() {\n\t// Install the modal message mechanism\n\t$tw.modal = new $tw.utils.Modal($tw.wiki);\n\t$tw.rootWidget.addEventListener(\"tm-modal\",function(event) {\n\t\t$tw.modal.display(event.param,{variables: event.paramObject});\n\t});\n\t// Install the notification mechanism\n\t$tw.notifier = new $tw.utils.Notifier($tw.wiki);\n\t$tw.rootWidget.addEventListener(\"tm-notify\",function(event) {\n\t\t$tw.notifier.display(event.param);\n\t});\n\t// Install the scroller\n\t$tw.pageScroller = new $tw.utils.PageScroller();\n\t$tw.rootWidget.addEventListener(\"tm-scroll\",function(event) {\n\t\t$tw.pageScroller.handleEvent(event);\n\t});\n\tvar fullscreen = $tw.utils.getFullScreenApis();\n\tif(fullscreen) {\n\t\t$tw.rootWidget.addEventListener(\"tm-full-screen\",function(event) {\n\t\t\tif(document[fullscreen._fullscreenElement]) {\n\t\t\t\tdocument[fullscreen._exitFullscreen]();\n\t\t\t} else {\n\t\t\t\tdocument.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);\n\t\t\t}\n\t\t});\n\t}\n\t// If we're being viewed on a data: URI then give instructions for how to save\n\tif(document.location.protocol === \"data:\") {\n\t\t$tw.rootWidget.dispatchEvent({\n\t\t\ttype: \"tm-modal\",\n\t\t\tparam: \"$:/language/Modals/SaveInstructions\"\n\t\t});\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/startup/rootwidget.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup.js": {
"text": "/*\\\ntitle: $:/core/modules/startup.js\ntype: application/javascript\nmodule-type: startup\n\nMiscellaneous startup logic for both the client and server.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"startup\";\nexports.after = [\"load-modules\"];\nexports.synchronous = true;\n\n// Set to `true` to enable performance instrumentation\nvar PERFORMANCE_INSTRUMENTATION = false;\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nexports.startup = function() {\n\tvar modules,n,m,f;\n\tif($tw.browser) {\n\t\t$tw.browser.isIE = (/msie|trident/i.test(navigator.userAgent));\n\t}\n\t$tw.version = $tw.utils.extractVersionInfo();\n\t// Set up the performance framework\n\t$tw.perf = new $tw.Performance(PERFORMANCE_INSTRUMENTATION);\n\t// Kick off the language manager and switcher\n\t$tw.language = new $tw.Language();\n\t$tw.languageSwitcher = new $tw.PluginSwitcher({\n\t\twiki: $tw.wiki,\n\t\tpluginType: \"language\",\n\t\tcontrollerTitle: \"$:/language\",\n\t\tdefaultPlugins: [\n\t\t\t\"$:/languages/en-US\"\n\t\t]\n\t});\n\t// Kick off the theme manager\n\t$tw.themeManager = new $tw.PluginSwitcher({\n\t\twiki: $tw.wiki,\n\t\tpluginType: \"theme\",\n\t\tcontrollerTitle: \"$:/theme\",\n\t\tdefaultPlugins: [\n\t\t\t\"$:/themes/tiddlywiki/snowwhite\",\n\t\t\t\"$:/themes/tiddlywiki/vanilla\"\n\t\t]\n\t});\n\t// Clear outstanding tiddler store change events to avoid an unnecessary refresh cycle at startup\n\t$tw.wiki.clearTiddlerEventQueue();\n\t// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers\n\tif($tw.browser) {\n\t\t$tw.rootWidget = new widget.widget({\n\t\t\ttype: \"widget\",\n\t\t\tchildren: []\n\t\t},{\n\t\t\twiki: $tw.wiki,\n\t\t\tdocument: document\n\t\t});\n\t}\n\t// Find a working syncadaptor\n\t$tw.syncadaptor = undefined;\n\t$tw.modules.forEachModuleOfType(\"syncadaptor\",function(title,module) {\n\t\tif(!$tw.syncadaptor && module.adaptorClass) {\n\t\t\t$tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki});\n\t\t}\n\t});\n\t// Set up the syncer object if we've got a syncadaptor\n\tif($tw.syncadaptor) {\n\t\t$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});\n\t} \n\t// Setup the saver handler\n\t$tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki, dirtyTracking: !$tw.syncadaptor});\n\t// Host-specific startup\n\tif($tw.browser) {\n\t\t// Install the popup manager\n\t\t$tw.popup = new $tw.utils.Popup();\n\t\t// Install the animator\n\t\t$tw.anim = new $tw.utils.Animator();\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/startup.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/startup/story.js": {
"text": "/*\\\ntitle: $:/core/modules/startup/story.js\ntype: application/javascript\nmodule-type: startup\n\nLoad core modules\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Export name and synchronous status\nexports.name = \"story\";\nexports.after = [\"startup\"];\nexports.synchronous = true;\n\n// Default story and history lists\nvar DEFAULT_STORY_TITLE = \"$:/StoryList\";\nvar DEFAULT_HISTORY_TITLE = \"$:/HistoryList\";\n\n// Default tiddlers\nvar DEFAULT_TIDDLERS_TITLE = \"$:/DefaultTiddlers\";\n\n// Config\nvar CONFIG_UPDATE_ADDRESS_BAR = \"$:/config/Navigation/UpdateAddressBar\"; // Can be \"no\", \"permalink\", \"permaview\"\nvar CONFIG_UPDATE_HISTORY = \"$:/config/Navigation/UpdateHistory\"; // Can be \"yes\" or \"no\"\n\nexports.startup = function() {\n\t// Open startup tiddlers\n\topenStartupTiddlers();\n\tif($tw.browser) {\n\t\t// Set up location hash update\n\t\t$tw.wiki.addEventListener(\"change\",function(changes) {\n\t\t\tif($tw.utils.hop(changes,DEFAULT_STORY_TITLE) || $tw.utils.hop(changes,DEFAULT_HISTORY_TITLE)) {\n\t\t\t\tupdateLocationHash({\n\t\t\t\t\tupdateAddressBar: $tw.wiki.getTiddlerText(CONFIG_UPDATE_ADDRESS_BAR,\"permaview\").trim(),\n\t\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim()\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t// Listen for changes to the browser location hash\n\t\twindow.addEventListener(\"hashchange\",function() {\n\t\t\tvar hash = $tw.utils.getLocationHash();\n\t\t\tif(hash !== $tw.locationHash) {\n\t\t\t\t$tw.locationHash = hash;\n\t\t\t\topenStartupTiddlers({defaultToCurrentStory: true});\n\t\t\t}\n\t\t},false);\n\t\t// Listen for the tm-browser-refresh message\n\t\t$tw.rootWidget.addEventListener(\"tm-browser-refresh\",function(event) {\n\t\t\twindow.location.reload(true);\n\t\t});\n\t\t// Listen for the tm-home message\n\t\t$tw.rootWidget.addEventListener(\"tm-home\",function(event) {\n\t\t\twindow.location.hash = \"\";\n\t\t\tvar storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE),\n\t\t\t\tstoryList = $tw.wiki.filterTiddlers(storyFilter);\n\t\t\t//invoke any hooks that might change the default story list\n\t\t\tstoryList = $tw.hooks.invokeHook(\"th-opening-default-tiddlers-list\",storyList);\n\t\t\t$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: \"\", list: storyList},$tw.wiki.getModificationFields());\n\t\t\tif(storyList[0]) {\n\t\t\t\t$tw.wiki.addToHistory(storyList[0]);\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t// Listen for the tm-permalink message\n\t\t$tw.rootWidget.addEventListener(\"tm-permalink\",function(event) {\n\t\t\tupdateLocationHash({\n\t\t\t\tupdateAddressBar: \"permalink\",\n\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim(),\n\t\t\t\ttargetTiddler: event.param || event.tiddlerTitle\n\t\t\t});\n\t\t});\n\t\t// Listen for the tm-permaview message\n\t\t$tw.rootWidget.addEventListener(\"tm-permaview\",function(event) {\n\t\t\tupdateLocationHash({\n\t\t\t\tupdateAddressBar: \"permaview\",\n\t\t\t\tupdateHistory: $tw.wiki.getTiddlerText(CONFIG_UPDATE_HISTORY,\"no\").trim(),\n\t\t\t\ttargetTiddler: event.param || event.tiddlerTitle\n\t\t\t});\n\t\t});\n\t}\n};\n\n/*\nProcess the location hash to open the specified tiddlers. Options:\ndefaultToCurrentStory: If true, the current story is retained as the default, instead of opening the default tiddlers\n*/\nfunction openStartupTiddlers(options) {\n\toptions = options || {};\n\t// Work out the target tiddler and the story filter. \"null\" means \"unspecified\"\n\tvar target = null,\n\t\tstoryFilter = null;\n\tif($tw.locationHash.length > 1) {\n\t\tvar hash = $tw.locationHash.substr(1),\n\t\t\tsplit = hash.indexOf(\":\");\n\t\tif(split === -1) {\n\t\t\ttarget = decodeURIComponent(hash.trim());\n\t\t} else {\n\t\t\ttarget = decodeURIComponent(hash.substr(0,split).trim());\n\t\t\tstoryFilter = decodeURIComponent(hash.substr(split + 1).trim());\n\t\t}\n\t}\n\t// If the story wasn't specified use the current tiddlers or a blank story\n\tif(storyFilter === null) {\n\t\tif(options.defaultToCurrentStory) {\n\t\t\tvar currStoryList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE);\n\t\t\tstoryFilter = $tw.utils.stringifyList(currStoryList);\n\t\t} else {\n\t\t\tif(target && target !== \"\") {\n\t\t\t\tstoryFilter = \"\";\n\t\t\t} else {\n\t\t\t\tstoryFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);\n\t\t\t}\n\t\t}\n\t}\n\t// Process the story filter to get the story list\n\tvar storyList = $tw.wiki.filterTiddlers(storyFilter);\n\t//invoke any hooks that might change the default story list\n\tstoryList = $tw.hooks.invokeHook(\"th-opening-default-tiddlers-list\",storyList);\n\t// If the target tiddler isn't included then splice it in at the top\n\tif(target && storyList.indexOf(target) === -1) {\n\t\tstoryList.unshift(target);\n\t}\n\t// Save the story list\n\t$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: \"\", list: storyList},$tw.wiki.getModificationFields());\n\t// If a target tiddler was specified add it to the history stack\n\tif(target && target !== \"\") {\n\t\t// The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present\n\t\tif(target.indexOf(\"[[\") === 0 && target.substr(-2) === \"]]\") {\n\t\t\ttarget = target.substr(2,target.length - 4);\n\t\t}\n\t\t$tw.wiki.addToHistory(target);\n\t} else if(storyList.length > 0) {\n\t\t$tw.wiki.addToHistory(storyList[0]);\n\t}\n}\n\n/*\noptions: See below\noptions.updateAddressBar: \"permalink\", \"permaview\" or \"no\" (defaults to \"permaview\")\noptions.updateHistory: \"yes\" or \"no\" (defaults to \"no\")\noptions.targetTiddler: optional title of target tiddler for permalink\n*/\nfunction updateLocationHash(options) {\n\tif(options.updateAddressBar !== \"no\") {\n\t\t// Get the story and the history stack\n\t\tvar storyList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE),\n\t\t\thistoryList = $tw.wiki.getTiddlerData(DEFAULT_HISTORY_TITLE,[]),\n\t\t\ttargetTiddler = \"\";\n\t\tif(options.targetTiddler) {\n\t\t\ttargetTiddler = options.targetTiddler;\n\t\t} else {\n\t\t\t// The target tiddler is the one at the top of the stack\n\t\t\tif(historyList.length > 0) {\n\t\t\t\ttargetTiddler = historyList[historyList.length-1].title;\n\t\t\t}\n\t\t\t// Blank the target tiddler if it isn't present in the story\n\t\t\tif(storyList.indexOf(targetTiddler) === -1) {\n\t\t\t\ttargetTiddler = \"\";\n\t\t\t}\n\t\t}\n\t\t// Assemble the location hash\n\t\tif(options.updateAddressBar === \"permalink\") {\n\t\t\t$tw.locationHash = \"#\" + encodeURIComponent(targetTiddler);\n\t\t} else {\n\t\t\t$tw.locationHash = \"#\" + encodeURIComponent(targetTiddler) + \":\" + encodeURIComponent($tw.utils.stringifyList(storyList));\n\t\t}\n\t\t// Only change the location hash if we must, thus avoiding unnecessary onhashchange events\n\t\tif($tw.utils.getLocationHash() !== $tw.locationHash) {\n\t\t\tif(options.updateHistory === \"yes\") {\n\t\t\t\t// Assign the location hash so that history is updated\n\t\t\t\twindow.location.hash = $tw.locationHash;\n\t\t\t} else {\n\t\t\t\t// We use replace so that browser history isn't affected\n\t\t\t\twindow.location.replace(window.location.toString().split(\"#\")[0] + $tw.locationHash);\n\t\t\t}\n\t\t}\n\t}\n}\n\n})();\n",
"title": "$:/core/modules/startup/story.js",
"type": "application/javascript",
"module-type": "startup"
},
"$:/core/modules/storyviews/classic.js": {
"text": "/*\\\ntitle: $:/core/modules/storyviews/classic.js\ntype: application/javascript\nmodule-type: storyview\n\nViews the story as a linear sequence\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar easing = \"cubic-bezier(0.645, 0.045, 0.355, 1)\"; // From http://easings.net/#easeInOutCubic\n\nvar ClassicStoryView = function(listWidget) {\n\tthis.listWidget = listWidget;\n};\n\nClassicStoryView.prototype.navigateTo = function(historyInfo) {\n\tvar listElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Scroll the node into view\n\tthis.listWidget.dispatchEvent({type: \"tm-scroll\", target: targetElement});\n};\n\nClassicStoryView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Get the current height of the tiddler\n\tvar computedStyle = window.getComputedStyle(targetElement),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrHeight = targetElement.offsetHeight + currMarginTop;\n\t// Reset the margin once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(targetElement,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"}\n\t\t]);\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{marginBottom: (-currHeight) + \"px\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t// Transition to the final position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"opacity \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms \" + easing},\n\t\t{marginBottom: currMarginBottom + \"px\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n};\n\nClassicStoryView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\twidget.removeChildDomNodes();\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Get the current height of the tiddler\n\tvar currWidth = targetElement.offsetWidth,\n\t\tcomputedStyle = window.getComputedStyle(targetElement),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrHeight = targetElement.offsetHeight + currMarginTop;\n\t// Remove the dom nodes of the widget at the end of the transition\n\tsetTimeout(removeElement,duration);\n\t// Animate the closure\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"translateX(0px)\"},\n\t\t{marginBottom: currMarginBottom + \"px\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms \" + easing + \", \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms \" + easing},\n\t\t{transform: \"translateX(-\" + currWidth + \"px)\"},\n\t\t{marginBottom: (-currHeight) + \"px\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n};\n\nexports.classic = ClassicStoryView;\n\n})();",
"title": "$:/core/modules/storyviews/classic.js",
"type": "application/javascript",
"module-type": "storyview"
},
"$:/core/modules/storyviews/pop.js": {
"text": "/*\\\ntitle: $:/core/modules/storyviews/pop.js\ntype: application/javascript\nmodule-type: storyview\n\nAnimates list insertions and removals\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar PopStoryView = function(listWidget) {\n\tthis.listWidget = listWidget;\n};\n\nPopStoryView.prototype.navigateTo = function(historyInfo) {\n\tvar listElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Scroll the node into view\n\tthis.listWidget.dispatchEvent({type: \"tm-scroll\", target: targetElement});\n};\n\nPopStoryView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Reset once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(targetElement,[\n\t\t\t{transition: \"none\"},\n\t\t\t{transform: \"none\"}\n\t\t]);\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"scale(2)\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t// Transition to the final position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{transform: \"scale(1)\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n};\n\nPopStoryView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\tif(targetElement.parentNode) {\n\t\t\t\twidget.removeChildDomNodes();\n\t\t\t}\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Remove the element at the end of the transition\n\tsetTimeout(removeElement,duration);\n\t// Animate the closure\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: \"none\"},\n\t\t{transform: \"scale(1)\"},\n\t\t{opacity: \"1.0\"}\n\t]);\n\t$tw.utils.forceLayout(targetElement);\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{transform: \"scale(0.1)\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n};\n\nexports.pop = PopStoryView;\n\n})();\n",
"title": "$:/core/modules/storyviews/pop.js",
"type": "application/javascript",
"module-type": "storyview"
},
"$:/core/modules/storyviews/zoomin.js": {
"text": "/*\\\ntitle: $:/core/modules/storyviews/zoomin.js\ntype: application/javascript\nmodule-type: storyview\n\nZooms between individual tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar easing = \"cubic-bezier(0.645, 0.045, 0.355, 1)\"; // From http://easings.net/#easeInOutCubic\n\nvar ZoominListView = function(listWidget) {\n\tvar self = this;\n\tthis.listWidget = listWidget;\n\t// Get the index of the tiddler that is at the top of the history\n\tvar history = this.listWidget.wiki.getTiddlerData(this.listWidget.historyTitle,[]),\n\t\ttargetTiddler;\n\tif(history.length > 0) {\n\t\ttargetTiddler = history[history.length-1].title;\n\t}\n\t// Make all the tiddlers position absolute, and hide all but the top (or first) one\n\t$tw.utils.each(this.listWidget.children,function(itemWidget,index) {\n\t\tvar domNode = itemWidget.findFirstDomNode();\n\t\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\t\tif(!(domNode instanceof Element)) {\n\t\t\treturn;\n\t\t}\n\t\tif(targetTiddler !== itemWidget.parseTreeNode.itemTitle || (!targetTiddler && index)) {\n\t\t\tdomNode.style.display = \"none\";\n\t\t} else {\n\t\t\tself.currentTiddlerDomNode = domNode;\n\t\t}\n\t\t$tw.utils.addClass(domNode,\"tc-storyview-zoomin-tiddler\");\n\t});\n};\n\nZoominListView.prototype.navigateTo = function(historyInfo) {\n\tvar duration = $tw.utils.getAnimationDuration(),\n\t\tlistElementIndex = this.listWidget.findListItem(0,historyInfo.title);\n\tif(listElementIndex === undefined) {\n\t\treturn;\n\t}\n\tvar listItemWidget = this.listWidget.children[listElementIndex],\n\t\ttargetElement = listItemWidget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Make the new tiddler be position absolute and visible so that we can measure it\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"block\"},\n\t\t{transformOrigin: \"0 0\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{transition: \"none\"},\n\t\t{opacity: \"0.0\"}\n\t]);\n\t// Get the position of the source node, or use the centre of the window as the source position\n\tvar sourceBounds = historyInfo.fromPageRect || {\n\t\t\tleft: window.innerWidth/2 - 2,\n\t\t\ttop: window.innerHeight/2 - 2,\n\t\t\twidth: window.innerWidth/8,\n\t\t\theight: window.innerHeight/8\n\t\t};\n\t// Try to find the title node in the target tiddler\n\tvar titleDomNode = findTitleDomNode(listItemWidget) || listItemWidget.findFirstDomNode(),\n\t\tzoomBounds = titleDomNode.getBoundingClientRect();\n\t// Compute the transform for the target tiddler to make the title lie over the source rectange\n\tvar targetBounds = targetElement.getBoundingClientRect(),\n\t\tscale = sourceBounds.width / zoomBounds.width,\n\t\tx = sourceBounds.left - targetBounds.left - (zoomBounds.left - targetBounds.left) * scale,\n\t\ty = sourceBounds.top - targetBounds.top - (zoomBounds.top - targetBounds.top) * scale;\n\t// Transform the target tiddler to its starting position\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transform: \"translateX(\" + x + \"px) translateY(\" + y + \"px) scale(\" + scale + \")\"}\n\t]);\n\t// Force layout\n\t$tw.utils.forceLayout(targetElement);\n\t// Apply the ending transitions with a timeout to ensure that the previously applied transformations are applied first\n\tvar self = this,\n\t\tprevCurrentTiddler = this.currentTiddlerDomNode;\n\tthis.currentTiddlerDomNode = targetElement;\n\t// Transform the target tiddler to its natural size\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t{opacity: \"1.0\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{zIndex: \"500\"},\n\t]);\n\t// Transform the previous tiddler out of the way and then hide it\n\tif(prevCurrentTiddler && prevCurrentTiddler !== targetElement) {\n\t\tscale = zoomBounds.width / sourceBounds.width;\n\t\tx = zoomBounds.left - targetBounds.left - (sourceBounds.left - targetBounds.left) * scale;\n\t\ty = zoomBounds.top - targetBounds.top - (sourceBounds.top - targetBounds.top) * scale;\n\t\t$tw.utils.setStyle(prevCurrentTiddler,[\n\t\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t\t{opacity: \"0.0\"},\n\t\t\t{transformOrigin: \"0 0\"},\n\t\t\t{transform: \"translateX(\" + x + \"px) translateY(\" + y + \"px) scale(\" + scale + \")\"},\n\t\t\t{zIndex: \"0\"}\n\t\t]);\n\t\t// Hide the tiddler when the transition has finished\n\t\tsetTimeout(function() {\n\t\t\tif(self.currentTiddlerDomNode !== prevCurrentTiddler) {\n\t\t\t\tprevCurrentTiddler.style.display = \"none\";\n\t\t\t}\n\t\t},duration);\n\t}\n\t// Scroll the target into view\n//\t$tw.pageScroller.scrollIntoView(targetElement);\n};\n\n/*\nFind the first child DOM node of a widget that has the class \"tc-title\"\n*/\nfunction findTitleDomNode(widget,targetClass) {\n\ttargetClass = targetClass || \"tc-title\";\n\tvar domNode = widget.findFirstDomNode();\n\tif(domNode && domNode.querySelector) {\n\t\treturn domNode.querySelector(\".\" + targetClass);\n\t}\n\treturn null;\n}\n\nZoominListView.prototype.insert = function(widget) {\n\tvar targetElement = widget.findFirstDomNode();\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\treturn;\n\t}\n\t// Make the newly inserted node position absolute and hidden\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"none\"}\n\t]);\n};\n\nZoominListView.prototype.remove = function(widget) {\n\tvar targetElement = widget.findFirstDomNode(),\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\tremoveElement = function() {\n\t\t\twidget.removeChildDomNodes();\n\t\t};\n\t// Abandon if the list entry isn't a DOM element (it might be a text node)\n\tif(!(targetElement instanceof Element)) {\n\t\tremoveElement();\n\t\treturn;\n\t}\n\t// Set up the tiddler that is being closed\n\t$tw.utils.addClass(targetElement,\"tc-storyview-zoomin-tiddler\");\n\t$tw.utils.setStyle(targetElement,[\n\t\t{display: \"block\"},\n\t\t{transformOrigin: \"50% 50%\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t{transition: \"none\"},\n\t\t{zIndex: \"0\"}\n\t]);\n\t// We'll move back to the previous or next element in the story\n\tvar toWidget = widget.previousSibling();\n\tif(!toWidget) {\n\t\ttoWidget = widget.nextSibling();\n\t}\n\tvar toWidgetDomNode = toWidget && toWidget.findFirstDomNode();\n\t// Set up the tiddler we're moving back in\n\tif(toWidgetDomNode) {\n\t\t$tw.utils.addClass(toWidgetDomNode,\"tc-storyview-zoomin-tiddler\");\n\t\t$tw.utils.setStyle(toWidgetDomNode,[\n\t\t\t{display: \"block\"},\n\t\t\t{transformOrigin: \"50% 50%\"},\n\t\t\t{transform: \"translateX(0px) translateY(0px) scale(10)\"},\n\t\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t\t{opacity: \"0\"},\n\t\t\t{zIndex: \"500\"}\n\t\t]);\n\t\tthis.currentTiddlerDomNode = toWidgetDomNode;\n\t}\n\t// Animate them both\n\t// Force layout\n\t$tw.utils.forceLayout(this.listWidget.parentDomNode);\n\t// First, the tiddler we're closing\n\t$tw.utils.setStyle(targetElement,[\n\t\t{transformOrigin: \"50% 50%\"},\n\t\t{transform: \"translateX(0px) translateY(0px) scale(0.1)\"},\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms \" + easing + \", opacity \" + duration + \"ms \" + easing},\n\t\t{opacity: \"0\"},\n\t\t{zIndex: \"0\"}\n\t]);\n\tsetTimeout(removeElement,duration);\n\t// Now the tiddler we're going back to\n\tif(toWidgetDomNode) {\n\t\t$tw.utils.setStyle(toWidgetDomNode,[\n\t\t\t{transform: \"translateX(0px) translateY(0px) scale(1)\"},\n\t\t\t{opacity: \"1\"}\n\t\t]);\n\t}\n\treturn true; // Indicate that we'll delete the DOM node\n};\n\nexports.zoomin = ZoominListView;\n\n})();",
"title": "$:/core/modules/storyviews/zoomin.js",
"type": "application/javascript",
"module-type": "storyview"
},
"$:/core/modules/syncer.js": {
"text": "/*\\\ntitle: $:/core/modules/syncer.js\ntype: application/javascript\nmodule-type: global\n\nThe syncer tracks changes to the store. If a syncadaptor is used then individual tiddlers are synchronised through it. If there is no syncadaptor then the entire wiki is saved via saver modules.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nInstantiate the syncer with the following options:\nsyncadaptor: reference to syncadaptor to be used\nwiki: wiki to be synced\n*/\nfunction Syncer(options) {\n\tvar self = this;\n\tthis.wiki = options.wiki;\n\tthis.syncadaptor = options.syncadaptor;\n\t// Make a logger\n\tthis.logger = new $tw.utils.Logger(\"syncer\" + ($tw.browser ? \"-browser\" : \"\") + ($tw.node ? \"-server\" : \"\"));\n\t// Compile the dirty tiddler filter\n\tthis.filterFn = this.wiki.compileFilter(this.wiki.getTiddlerText(this.titleSyncFilter));\n\t// Record information for known tiddlers\n\tthis.readTiddlerInfo();\n\t// Tasks are {type: \"load\"/\"save\"/\"delete\", title:, queueTime:, lastModificationTime:}\n\tthis.taskQueue = {}; // Hashmap of tasks yet to be performed\n\tthis.taskInProgress = {}; // Hash of tasks in progress\n\tthis.taskTimerId = null; // Timer for task dispatch\n\tthis.pollTimerId = null; // Timer for polling server\n\t// Listen out for changes to tiddlers\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tself.syncToServer(changes);\n\t});\n\t// Browser event handlers\n\tif($tw.browser) {\n\t\t// Set up our beforeunload handler\n\t\twindow.onbeforeunload = function(event) {\n\t\t\tvar confirmationMessage;\n\t\t\tif(self.isDirty()) {\n\t\t\t\tconfirmationMessage = $tw.language.getString(\"UnsavedChangesWarning\");\n\t\t\t\tevent.returnValue = confirmationMessage; // Gecko\n\t\t\t}\n\t\t\treturn confirmationMessage;\n\t\t};\n\t\t// Listen out for login/logout/refresh events in the browser\n\t\t$tw.rootWidget.addEventListener(\"tm-login\",function() {\n\t\t\tself.handleLoginEvent();\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-logout\",function() {\n\t\t\tself.handleLogoutEvent();\n\t\t});\n\t\t$tw.rootWidget.addEventListener(\"tm-server-refresh\",function() {\n\t\t\tself.handleRefreshEvent();\n\t\t});\n\t}\n\t// Listen out for lazyLoad events\n\tthis.wiki.addEventListener(\"lazyLoad\",function(title) {\n\t\tself.handleLazyLoadEvent(title);\n\t});\n\t// Get the login status\n\tthis.getStatus(function(err,isLoggedIn) {\n\t\t// Do a sync from the server\n\t\tself.syncFromServer();\n\t});\n}\n\n/*\nConstants\n*/\nSyncer.prototype.titleIsLoggedIn = \"$:/status/IsLoggedIn\";\nSyncer.prototype.titleUserName = \"$:/status/UserName\";\nSyncer.prototype.titleSyncFilter = \"$:/config/SyncFilter\";\nSyncer.prototype.titleSavedNotification = \"$:/language/Notifications/Save/Done\";\nSyncer.prototype.taskTimerInterval = 1 * 1000; // Interval for sync timer\nSyncer.prototype.throttleInterval = 1 * 1000; // Defer saving tiddlers if they've changed in the last 1s...\nSyncer.prototype.fallbackInterval = 10 * 1000; // Unless the task is older than 10s\nSyncer.prototype.pollTimerInterval = 60 * 1000; // Interval for polling for changes from the adaptor\n\n\n/*\nRead (or re-read) the latest tiddler info from the store\n*/\nSyncer.prototype.readTiddlerInfo = function() {\n\t// Hashmap by title of {revision:,changeCount:,adaptorInfo:}\n\tthis.tiddlerInfo = {};\n\t// Record information for known tiddlers\n\tvar self = this,\n\t\ttiddlers = this.filterFn.call(this.wiki);\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\tself.tiddlerInfo[title] = {\n\t\t\trevision: tiddler.fields.revision,\n\t\t\tadaptorInfo: self.syncadaptor && self.syncadaptor.getTiddlerInfo(tiddler),\n\t\t\tchangeCount: self.wiki.getChangeCount(title)\n\t\t};\n\t});\n};\n\n/*\nChecks whether the wiki is dirty (ie the window shouldn't be closed)\n*/\nSyncer.prototype.isDirty = function() {\n\treturn (this.numTasksInQueue() > 0) || (this.numTasksInProgress() > 0);\n};\n\n/*\nUpdate the document body with the class \"tc-dirty\" if the wiki has unsaved/unsynced changes\n*/\nSyncer.prototype.updateDirtyStatus = function() {\n\tif($tw.browser) {\n\t\t$tw.utils.toggleClass(document.body,\"tc-dirty\",this.isDirty());\n\t}\n};\n\n/*\nSave an incoming tiddler in the store, and updates the associated tiddlerInfo\n*/\nSyncer.prototype.storeTiddler = function(tiddlerFields) {\n\t// Save the tiddler\n\tvar tiddler = new $tw.Tiddler(this.wiki.getTiddler(tiddlerFields.title),tiddlerFields);\n\tthis.wiki.addTiddler(tiddler);\n\t// Save the tiddler revision and changeCount details\n\tthis.tiddlerInfo[tiddlerFields.title] = {\n\t\trevision: tiddlerFields.revision,\n\t\tadaptorInfo: this.syncadaptor.getTiddlerInfo(tiddler),\n\t\tchangeCount: this.wiki.getChangeCount(tiddlerFields.title)\n\t};\n};\n\nSyncer.prototype.getStatus = function(callback) {\n\tvar self = this;\n\t// Check if the adaptor supports getStatus()\n\tif(this.syncadaptor && this.syncadaptor.getStatus) {\n\t\t// Mark us as not logged in\n\t\tthis.wiki.addTiddler({title: this.titleIsLoggedIn,text: \"no\"});\n\t\t// Get login status\n\t\tthis.syncadaptor.getStatus(function(err,isLoggedIn,username) {\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert(err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Set the various status tiddlers\n\t\t\tself.wiki.addTiddler({title: self.titleIsLoggedIn,text: isLoggedIn ? \"yes\" : \"no\"});\n\t\t\tif(isLoggedIn) {\n\t\t\t\tself.wiki.addTiddler({title: self.titleUserName,text: username || \"\"});\n\t\t\t} else {\n\t\t\t\tself.wiki.deleteTiddler(self.titleUserName);\n\t\t\t}\n\t\t\t// Invoke the callback\n\t\t\tif(callback) {\n\t\t\t\tcallback(err,isLoggedIn,username);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tcallback(null,true,\"UNAUTHENTICATED\");\n\t}\n};\n\n/*\nSynchronise from the server by reading the skinny tiddler list and queuing up loads for any tiddlers that we don't already have up to date\n*/\nSyncer.prototype.syncFromServer = function() {\n\tif(this.syncadaptor && this.syncadaptor.getSkinnyTiddlers) {\n\t\tthis.logger.log(\"Retrieving skinny tiddler list\");\n\t\tvar self = this;\n\t\tif(this.pollTimerId) {\n\t\t\tclearTimeout(this.pollTimerId);\n\t\t\tthis.pollTimerId = null;\n\t\t}\n\t\tthis.syncadaptor.getSkinnyTiddlers(function(err,tiddlers) {\n\t\t\t// Trigger the next sync\n\t\t\tself.pollTimerId = setTimeout(function() {\n\t\t\t\tself.pollTimerId = null;\n\t\t\t\tself.syncFromServer.call(self);\n\t\t\t},self.pollTimerInterval);\n\t\t\t// Check for errors\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert(\"Error retrieving skinny tiddler list:\",err);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Process each incoming tiddler\n\t\t\tfor(var t=0; t<tiddlers.length; t++) {\n\t\t\t\t// Get the incoming tiddler fields, and the existing tiddler\n\t\t\t\tvar tiddlerFields = tiddlers[t],\n\t\t\t\t\tincomingRevision = tiddlerFields.revision + \"\",\n\t\t\t\t\ttiddler = self.wiki.getTiddler(tiddlerFields.title),\n\t\t\t\t\ttiddlerInfo = self.tiddlerInfo[tiddlerFields.title],\n\t\t\t\t\tcurrRevision = tiddlerInfo ? tiddlerInfo.revision : null;\n\t\t\t\t// Ignore the incoming tiddler if it's the same as the revision we've already got\n\t\t\t\tif(currRevision !== incomingRevision) {\n\t\t\t\t\t// Do a full load if we've already got a fat version of the tiddler\n\t\t\t\t\tif(tiddler && tiddler.fields.text !== undefined) {\n\t\t\t\t\t\t// Do a full load of this tiddler\n\t\t\t\t\t\tself.enqueueSyncTask({\n\t\t\t\t\t\t\ttype: \"load\",\n\t\t\t\t\t\t\ttitle: tiddlerFields.title\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Load the skinny version of the tiddler\n\t\t\t\t\t\tself.storeTiddler(tiddlerFields);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\n/*\nSynchronise a set of changes to the server\n*/\nSyncer.prototype.syncToServer = function(changes) {\n\tvar self = this,\n\t\tnow = Date.now(),\n\t\tfilteredChanges = this.filterFn.call(this.wiki,function(callback) {\n\t\t\t$tw.utils.each(changes,function(change,title) {\n\t\t\t\tvar tiddler = self.wiki.getTiddler(title);\n\t\t\t\tcallback(tiddler,title);\n\t\t\t});\n\t\t});\n\t$tw.utils.each(changes,function(change,title,object) {\n\t\t// Process the change if it is a deletion of a tiddler we're already syncing, or is on the filtered change list\n\t\tif((change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) || filteredChanges.indexOf(title) !== -1) {\n\t\t\t// Queue a task to sync this tiddler\n\t\t\tself.enqueueSyncTask({\n\t\t\t\ttype: change.deleted ? \"delete\" : \"save\",\n\t\t\t\ttitle: title\n\t\t\t});\n\t\t}\n\t});\n};\n\n/*\nLazily load a skinny tiddler if we can\n*/\nSyncer.prototype.handleLazyLoadEvent = function(title) {\n\t// Queue up a sync task to load this tiddler\n\tthis.enqueueSyncTask({\n\t\ttype: \"load\",\n\t\ttitle: title\n\t});\n};\n\n/*\nDispay a password prompt and allow the user to login\n*/\nSyncer.prototype.handleLoginEvent = function() {\n\tvar self = this;\n\tthis.getStatus(function(err,isLoggedIn,username) {\n\t\tif(!isLoggedIn) {\n\t\t\t$tw.passwordPrompt.createPrompt({\n\t\t\t\tserviceName: \"Login to TiddlySpace\",\n\t\t\t\tcallback: function(data) {\n\t\t\t\t\tself.login(data.username,data.password,function(err,isLoggedIn) {\n\t\t\t\t\t\tself.syncFromServer();\n\t\t\t\t\t});\n\t\t\t\t\treturn true; // Get rid of the password prompt\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n};\n\n/*\nAttempt to login to TiddlyWeb.\n\tusername: username\n\tpassword: password\n\tcallback: invoked with arguments (err,isLoggedIn)\n*/\nSyncer.prototype.login = function(username,password,callback) {\n\tthis.logger.log(\"Attempting to login as\",username);\n\tvar self = this;\n\tif(this.syncadaptor.login) {\n\t\tthis.syncadaptor.login(username,password,function(err) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\tself.getStatus(function(err,isLoggedIn,username) {\n\t\t\t\tif(callback) {\n\t\t\t\t\tcallback(null,isLoggedIn);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t} else {\n\t\tcallback(null,true);\n\t}\n};\n\n/*\nAttempt to log out of TiddlyWeb\n*/\nSyncer.prototype.handleLogoutEvent = function() {\n\tthis.logger.log(\"Attempting to logout\");\n\tvar self = this;\n\tif(this.syncadaptor.logout) {\n\t\tthis.syncadaptor.logout(function(err) {\n\t\t\tif(err) {\n\t\t\t\tself.logger.alert(err);\n\t\t\t} else {\n\t\t\t\tself.getStatus();\n\t\t\t}\n\t\t});\n\t}\n};\n\n/*\nImmediately refresh from the server\n*/\nSyncer.prototype.handleRefreshEvent = function() {\n\tthis.syncFromServer();\n};\n\n/*\nQueue up a sync task. If there is already a pending task for the tiddler, just update the last modification time\n*/\nSyncer.prototype.enqueueSyncTask = function(task) {\n\tvar self = this,\n\t\tnow = Date.now();\n\t// Set the timestamps on this task\n\ttask.queueTime = now;\n\ttask.lastModificationTime = now;\n\t// Fill in some tiddlerInfo if the tiddler is one we haven't seen before\n\tif(!$tw.utils.hop(this.tiddlerInfo,task.title)) {\n\t\tthis.tiddlerInfo[task.title] = {\n\t\t\trevision: null,\n\t\t\tadaptorInfo: {},\n\t\t\tchangeCount: -1\n\t\t};\n\t}\n\t// Bail if this is a save and the tiddler is already at the changeCount that the server has\n\tif(task.type === \"save\" && this.wiki.getChangeCount(task.title) <= this.tiddlerInfo[task.title].changeCount) {\n\t\treturn;\n\t}\n\t// Check if this tiddler is already in the queue\n\tif($tw.utils.hop(this.taskQueue,task.title)) {\n\t\t// this.logger.log(\"Re-queueing up sync task with type:\",task.type,\"title:\",task.title);\n\t\tvar existingTask = this.taskQueue[task.title];\n\t\t// If so, just update the last modification time\n\t\texistingTask.lastModificationTime = task.lastModificationTime;\n\t\t// If the new task is a save then we upgrade the existing task to a save. Thus a pending load is turned into a save if the tiddler changes locally in the meantime. But a pending save is not modified to become a load\n\t\tif(task.type === \"save\" || task.type === \"delete\") {\n\t\t\texistingTask.type = task.type;\n\t\t}\n\t} else {\n\t\t// this.logger.log(\"Queuing up sync task with type:\",task.type,\"title:\",task.title);\n\t\t// If it is not in the queue, insert it\n\t\tthis.taskQueue[task.title] = task;\n\t\tthis.updateDirtyStatus();\n\t}\n\t// Process the queue\n\t$tw.utils.nextTick(function() {self.processTaskQueue.call(self);});\n};\n\n/*\nReturn the number of tasks in progress\n*/\nSyncer.prototype.numTasksInProgress = function() {\n\treturn $tw.utils.count(this.taskInProgress);\n};\n\n/*\nReturn the number of tasks in the queue\n*/\nSyncer.prototype.numTasksInQueue = function() {\n\treturn $tw.utils.count(this.taskQueue);\n};\n\n/*\nTrigger a timeout if one isn't already outstanding\n*/\nSyncer.prototype.triggerTimeout = function() {\n\tvar self = this;\n\tif(!this.taskTimerId) {\n\t\tthis.taskTimerId = setTimeout(function() {\n\t\t\tself.taskTimerId = null;\n\t\t\tself.processTaskQueue.call(self);\n\t\t},self.taskTimerInterval);\n\t}\n};\n\n/*\nProcess the task queue, performing the next task if appropriate\n*/\nSyncer.prototype.processTaskQueue = function() {\n\tvar self = this;\n\t// Only process a task if we're not already performing a task. If we are already performing a task then we'll dispatch the next one when it completes\n\tif(this.numTasksInProgress() === 0) {\n\t\t// Choose the next task to perform\n\t\tvar task = this.chooseNextTask();\n\t\t// Perform the task if we had one\n\t\tif(task) {\n\t\t\t// Remove the task from the queue and add it to the in progress list\n\t\t\tdelete this.taskQueue[task.title];\n\t\t\tthis.taskInProgress[task.title] = task;\n\t\t\tthis.updateDirtyStatus();\n\t\t\t// Dispatch the task\n\t\t\tthis.dispatchTask(task,function(err) {\n\t\t\t\tif(err) {\n\t\t\t\t\tself.logger.alert(\"Sync error while processing '\" + task.title + \"':\\n\" + err);\n\t\t\t\t}\n\t\t\t\t// Mark that this task is no longer in progress\n\t\t\t\tdelete self.taskInProgress[task.title];\n\t\t\t\tself.updateDirtyStatus();\n\t\t\t\t// Process the next task\n\t\t\t\tself.processTaskQueue.call(self);\n\t\t\t});\n\t\t} else {\n\t\t\t// Make sure we've set a time if there wasn't a task to perform, but we've still got tasks in the queue\n\t\t\tif(this.numTasksInQueue() > 0) {\n\t\t\t\tthis.triggerTimeout();\n\t\t\t}\n\t\t}\n\t}\n};\n\n/*\nChoose the next applicable task\n*/\nSyncer.prototype.chooseNextTask = function() {\n\tvar self = this,\n\t\tcandidateTask = null,\n\t\tnow = Date.now();\n\t// Select the best candidate task\n\t$tw.utils.each(this.taskQueue,function(task,title) {\n\t\t// Exclude the task if there's one of the same name in progress\n\t\tif($tw.utils.hop(self.taskInProgress,title)) {\n\t\t\treturn;\n\t\t}\n\t\t// Exclude the task if it is a save and the tiddler has been modified recently, but not hit the fallback time\n\t\tif(task.type === \"save\" && (now - task.lastModificationTime) < self.throttleInterval &&\n\t\t\t(now - task.queueTime) < self.fallbackInterval) {\n\t\t\treturn;\n\t\t}\n\t\t// Exclude the task if it is newer than the current best candidate\n\t\tif(candidateTask && candidateTask.queueTime < task.queueTime) {\n\t\t\treturn;\n\t\t}\n\t\t// Now this is our best candidate\n\t\tcandidateTask = task;\n\t});\n\treturn candidateTask;\n};\n\n/*\nDispatch a task and invoke the callback\n*/\nSyncer.prototype.dispatchTask = function(task,callback) {\n\tvar self = this;\n\tif(task.type === \"save\") {\n\t\tvar changeCount = this.wiki.getChangeCount(task.title),\n\t\t\ttiddler = this.wiki.getTiddler(task.title);\n\t\tthis.logger.log(\"Dispatching 'save' task:\",task.title);\n\t\tif(tiddler) {\n\t\t\tthis.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {\n\t\t\t\tif(err) {\n\t\t\t\t\treturn callback(err);\n\t\t\t\t}\n\t\t\t\t// Adjust the info stored about this tiddler\n\t\t\t\tself.tiddlerInfo[task.title] = {\n\t\t\t\t\tchangeCount: changeCount,\n\t\t\t\t\tadaptorInfo: adaptorInfo,\n\t\t\t\t\trevision: revision\n\t\t\t\t};\n\t\t\t\t// Invoke the callback\n\t\t\t\tcallback(null);\n\t\t\t},{\n\t\t\t\ttiddlerInfo: self.tiddlerInfo[task.title]\n\t\t\t});\n\t\t} else {\n\t\t\tthis.logger.log(\" Not Dispatching 'save' task:\",task.title,\"tiddler does not exist\");\n\t\t\treturn callback(null);\n\t\t}\n\t} else if(task.type === \"load\") {\n\t\t// Load the tiddler\n\t\tthis.logger.log(\"Dispatching 'load' task:\",task.title);\n\t\tthis.syncadaptor.loadTiddler(task.title,function(err,tiddlerFields) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\t// Store the tiddler\n\t\t\tif(tiddlerFields) {\n\t\t\t\tself.storeTiddler(tiddlerFields);\n\t\t\t}\n\t\t\t// Invoke the callback\n\t\t\tcallback(null);\n\t\t});\n\t} else if(task.type === \"delete\") {\n\t\t// Delete the tiddler\n\t\tthis.logger.log(\"Dispatching 'delete' task:\",task.title);\n\t\tthis.syncadaptor.deleteTiddler(task.title,function(err) {\n\t\t\tif(err) {\n\t\t\t\treturn callback(err);\n\t\t\t}\n\t\t\tdelete self.tiddlerInfo[task.title];\n\t\t\t// Invoke the callback\n\t\t\tcallback(null);\n\t\t},{\n\t\t\ttiddlerInfo: self.tiddlerInfo[task.title]\n\t\t});\n\t}\n};\n\nexports.Syncer = Syncer;\n\n})();\n",
"title": "$:/core/modules/syncer.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/tiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/tiddler.js\ntype: application/javascript\nmodule-type: tiddlermethod\n\nExtension methods for the $tw.Tiddler object (constructor and methods required at boot time are in boot/boot.js)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.hasTag = function(tag) {\n\treturn this.fields.tags && this.fields.tags.indexOf(tag) !== -1;\n};\n\nexports.isPlugin = function() {\n\treturn this.fields.type === \"application/json\" && this.hasField(\"plugin-type\");\n};\n\nexports.isDraft = function() {\n\treturn this.hasField(\"draft.of\");\n};\n\nexports.getFieldString = function(field) {\n\tvar value = this.fields[field];\n\t// Check for a missing field\n\tif(value === undefined || value === null) {\n\t\treturn \"\";\n\t}\n\t// Parse the field with the associated module (if any)\n\tvar fieldModule = $tw.Tiddler.fieldModules[field];\n\tif(fieldModule && fieldModule.stringify) {\n\t\treturn fieldModule.stringify.call(this,value);\n\t} else {\n\t\treturn value.toString();\n\t}\n};\n\n/*\nGet all the fields as a name:value block. Options:\n\texclude: an array of field names to exclude\n*/\nexports.getFieldStringBlock = function(options) {\n\toptions = options || {};\n\tvar exclude = options.exclude || [];\n\tvar fields = [];\n\tfor(var field in this.fields) {\n\t\tif($tw.utils.hop(this.fields,field)) {\n\t\t\tif(exclude.indexOf(field) === -1) {\n\t\t\t\tfields.push(field + \": \" + this.getFieldString(field));\n\t\t\t}\n\t\t}\n\t}\n\treturn fields.join(\"\\n\");\n};\n\n/*\nCompare two tiddlers for equality\ntiddler: the tiddler to compare\nexcludeFields: array of field names to exclude from the comparison\n*/\nexports.isEqual = function(tiddler,excludeFields) {\n\tif(!(tiddler instanceof $tw.Tiddler)) {\n\t\treturn false;\n\t}\n\texcludeFields = excludeFields || [];\n\tvar self = this,\n\t\tdifferences = []; // Fields that have differences\n\t// Add to the differences array\n\tfunction addDifference(fieldName) {\n\t\t// Check for this field being excluded\n\t\tif(excludeFields.indexOf(fieldName) === -1) {\n\t\t\t// Save the field as a difference\n\t\t\t$tw.utils.pushTop(differences,fieldName);\n\t\t}\n\t}\n\t// Returns true if the two values of this field are equal\n\tfunction isFieldValueEqual(fieldName) {\n\t\tvar valueA = self.fields[fieldName],\n\t\t\tvalueB = tiddler.fields[fieldName];\n\t\t// Check for identical string values\n\t\tif(typeof(valueA) === \"string\" && typeof(valueB) === \"string\" && valueA === valueB) {\n\t\t\treturn true;\n\t\t}\n\t\t// Check for identical array values\n\t\tif($tw.utils.isArray(valueA) && $tw.utils.isArray(valueB) && $tw.utils.isArrayEqual(valueA,valueB)) {\n\t\t\treturn true;\n\t\t}\n\t\t// Otherwise the fields must be different\n\t\treturn false;\n\t}\n\t// Compare our fields\n\tfor(var fieldName in this.fields) {\n\t\tif(!isFieldValueEqual(fieldName)) {\n\t\t\taddDifference(fieldName);\n\t\t}\n\t}\n\t// There's a difference for every field in the other tiddler that we don't have\n\tfor(fieldName in tiddler.fields) {\n\t\tif(!(fieldName in this.fields)) {\n\t\t\taddDifference(fieldName);\n\t\t}\n\t}\n\t// Return whether there were any differences\n\treturn differences.length === 0;\n};\n\n})();\n",
"title": "$:/core/modules/tiddler.js",
"type": "application/javascript",
"module-type": "tiddlermethod"
},
"$:/core/modules/upgraders/plugins.js": {
"text": "/*\\\ntitle: $:/core/modules/upgraders/plugins.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that checks that plugins are newer than any already installed version\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar UPGRADE_LIBRARY_TITLE = \"$:/UpgradeLibrary\";\n\nvar BLOCKED_PLUGINS = {\n\t\"$:/themes/tiddlywiki/stickytitles\": {\n\t\tversions: [\"*\"]\n\t},\n\t\"$:/plugins/tiddlywiki/fullscreen\": {\n\t\tversions: [\"*\"]\n\t}\n};\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {},\n\t\tupgradeLibrary,\n\t\tgetLibraryTiddler = function(title) {\n\t\t\tif(!upgradeLibrary) {\n\t\t\t\tupgradeLibrary = wiki.getTiddlerData(UPGRADE_LIBRARY_TITLE,{});\n\t\t\t\tupgradeLibrary.tiddlers = upgradeLibrary.tiddlers || {};\n\t\t\t}\n\t\t\treturn upgradeLibrary.tiddlers[title];\n\t\t};\n\n\t// Go through all the incoming tiddlers\n\t$tw.utils.each(titles,function(title) {\n\t\tvar incomingTiddler = tiddlers[title];\n\t\t// Check if we're dealing with a plugin\n\t\tif(incomingTiddler && incomingTiddler[\"plugin-type\"] && incomingTiddler.version) {\n\t\t\t// Upgrade the incoming plugin if we've got a newer version in the upgrade library\n\t\t\tvar libraryTiddler = getLibraryTiddler(title);\n\t\t\tif(libraryTiddler && libraryTiddler[\"plugin-type\"] && libraryTiddler.version) {\n\t\t\t\tif($tw.utils.checkVersions(libraryTiddler.version,incomingTiddler.version)) {\n\t\t\t\t\ttiddlers[title] = libraryTiddler;\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Upgraded\",{variables: {incoming: incomingTiddler.version, upgraded: libraryTiddler.version}});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Suppress the incoming plugin if it is older than the currently installed one\n\t\t\tvar existingTiddler = wiki.getTiddler(title);\n\t\t\tif(existingTiddler && existingTiddler.hasField(\"plugin-type\") && existingTiddler.hasField(\"version\")) {\n\t\t\t\t// Reject the incoming plugin by blanking all its fields\n\t\t\t\tif($tw.utils.checkVersions(existingTiddler.fields.version,incomingTiddler.version)) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Suppressed/Version\",{variables: {incoming: incomingTiddler.version, existing: existingTiddler.fields.version}});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(incomingTiddler && incomingTiddler[\"plugin-type\"]) {\n\t\t\t// Check whether the plugin is on the blocked list\n\t\t\tvar blockInfo = BLOCKED_PLUGINS[title];\n\t\t\tif(blockInfo) {\n\t\t\t\tif(blockInfo.versions.indexOf(\"*\") !== -1 || (incomingTiddler.version && blockInfo.versions.indexOf(incomingTiddler.version) !== -1)) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/Plugins/Suppressed/Incompatible\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
"title": "$:/core/modules/upgraders/plugins.js",
"type": "application/javascript",
"module-type": "upgrader"
},
"$:/core/modules/upgraders/system.js": {
"text": "/*\\\ntitle: $:/core/modules/upgraders/system.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that suppresses certain system tiddlers that shouldn't be imported\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar DONT_IMPORT_LIST = [\"$:/StoryList\",\"$:/HistoryList\"],\n\tDONT_IMPORT_PREFIX_LIST = [\"$:/temp/\",\"$:/state/\"];\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {};\n\t// Check for tiddlers on our list\n\t$tw.utils.each(titles,function(title) {\n\t\tif(DONT_IMPORT_LIST.indexOf(title) !== -1) {\n\t\t\ttiddlers[title] = Object.create(null);\n\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/System/Suppressed\");\n\t\t} else {\n\t\t\tfor(var t=0; t<DONT_IMPORT_PREFIX_LIST.length; t++) {\n\t\t\t\tvar prefix = DONT_IMPORT_PREFIX_LIST[t];\n\t\t\t\tif(title.substr(0,prefix.length) === prefix) {\n\t\t\t\t\ttiddlers[title] = Object.create(null);\n\t\t\t\t\tmessages[title] = $tw.language.getString(\"Import/Upgrader/State/Suppressed\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
"title": "$:/core/modules/upgraders/system.js",
"type": "application/javascript",
"module-type": "upgrader"
},
"$:/core/modules/upgraders/themetweaks.js": {
"text": "/*\\\ntitle: $:/core/modules/upgraders/themetweaks.js\ntype: application/javascript\nmodule-type: upgrader\n\nUpgrader module that handles the change in theme tweak storage introduced in 5.0.14-beta.\n\nPreviously, theme tweaks were stored in two data tiddlers:\n\n* $:/themes/tiddlywiki/vanilla/metrics\n* $:/themes/tiddlywiki/vanilla/settings\n\nNow, each tweak is stored in its own separate tiddler.\n\nThis upgrader copies any values from the old format to the new. The old data tiddlers are not deleted in case they have been used to store additional indexes.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar MAPPINGS = {\n\t\"$:/themes/tiddlywiki/vanilla/metrics\": {\n\t\t\"fontsize\": \"$:/themes/tiddlywiki/vanilla/metrics/fontsize\",\n\t\t\"lineheight\": \"$:/themes/tiddlywiki/vanilla/metrics/lineheight\",\n\t\t\"storyleft\": \"$:/themes/tiddlywiki/vanilla/metrics/storyleft\",\n\t\t\"storytop\": \"$:/themes/tiddlywiki/vanilla/metrics/storytop\",\n\t\t\"storyright\": \"$:/themes/tiddlywiki/vanilla/metrics/storyright\",\n\t\t\"storywidth\": \"$:/themes/tiddlywiki/vanilla/metrics/storywidth\",\n\t\t\"tiddlerwidth\": \"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth\"\n\t},\n\t\"$:/themes/tiddlywiki/vanilla/settings\": {\n\t\t\"fontfamily\": \"$:/themes/tiddlywiki/vanilla/settings/fontfamily\"\n\t}\n};\n\nexports.upgrade = function(wiki,titles,tiddlers) {\n\tvar self = this,\n\t\tmessages = {};\n\t// Check for tiddlers on our list\n\t$tw.utils.each(titles,function(title) {\n\t\tvar mapping = MAPPINGS[title];\n\t\tif(mapping) {\n\t\t\tvar tiddler = new $tw.Tiddler(tiddlers[title]),\n\t\t\t\ttiddlerData = wiki.getTiddlerData(tiddler,{});\n\t\t\tfor(var index in mapping) {\n\t\t\t\tvar mappedTitle = mapping[index];\n\t\t\t\tif(!tiddlers[mappedTitle] || tiddlers[mappedTitle].title !== mappedTitle) {\n\t\t\t\t\ttiddlers[mappedTitle] = {\n\t\t\t\t\t\ttitle: mappedTitle,\n\t\t\t\t\t\ttext: tiddlerData[index]\n\t\t\t\t\t};\n\t\t\t\t\tmessages[mappedTitle] = $tw.language.getString(\"Import/Upgrader/ThemeTweaks/Created\",{variables: {\n\t\t\t\t\t\tfrom: title + \"##\" + index\n\t\t\t\t\t}});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn messages;\n};\n\n})();\n",
"title": "$:/core/modules/upgraders/themetweaks.js",
"type": "application/javascript",
"module-type": "upgrader"
},
"$:/core/modules/utils/crypto.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/crypto.js\ntype: application/javascript\nmodule-type: utils\n\nUtility functions related to crypto.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nLook for an encrypted store area in the text of a TiddlyWiki file\n*/\nexports.extractEncryptedStoreArea = function(text) {\n\tvar encryptedStoreAreaStartMarker = \"<pre id=\\\"encryptedStoreArea\\\" type=\\\"text/plain\\\" style=\\\"display:none;\\\">\",\n\t\tencryptedStoreAreaStart = text.indexOf(encryptedStoreAreaStartMarker);\n\tif(encryptedStoreAreaStart !== -1) {\n\t\tvar encryptedStoreAreaEnd = text.indexOf(\"</pre>\",encryptedStoreAreaStart);\n\t\tif(encryptedStoreAreaEnd !== -1) {\n\t\t\treturn $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd-1));\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nAttempt to extract the tiddlers from an encrypted store area using the current password. If the password is not provided then the password in the password store will be used\n*/\nexports.decryptStoreArea = function(encryptedStoreArea,password) {\n\tvar decryptedText = $tw.crypto.decrypt(encryptedStoreArea,password);\n\tif(decryptedText) {\n\t\tvar json = JSON.parse(decryptedText),\n\t\t\ttiddlers = [];\n\t\tfor(var title in json) {\n\t\t\tif(title !== \"$:/isEncrypted\") {\n\t\t\t\ttiddlers.push(json[title]);\n\t\t\t}\n\t\t}\n\t\treturn tiddlers;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n\n/*\nAttempt to extract the tiddlers from an encrypted store area using the current password. If that fails, the user is prompted for a password.\nencryptedStoreArea: text of the TiddlyWiki encrypted store area\ncallback: function(tiddlers) called with the array of decrypted tiddlers\n\nThe following configuration settings are supported:\n\n$tw.config.usePasswordVault: causes any password entered by the user to also be put into the system password vault\n*/\nexports.decryptStoreAreaInteractive = function(encryptedStoreArea,callback,options) {\n\t// Try to decrypt with the current password\n\tvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea);\n\tif(tiddlers) {\n\t\tcallback(tiddlers);\n\t} else {\n\t\t// Prompt for a new password and keep trying\n\t\t$tw.passwordPrompt.createPrompt({\n\t\t\tserviceName: \"Enter a password to decrypt the imported TiddlyWiki\",\n\t\t\tnoUserName: true,\n\t\t\tcanCancel: true,\n\t\t\tsubmitText: \"Decrypt\",\n\t\t\tcallback: function(data) {\n\t\t\t\t// Exit if the user cancelled\n\t\t\t\tif(!data) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Attempt to decrypt the tiddlers\n\t\t\t\tvar tiddlers = $tw.utils.decryptStoreArea(encryptedStoreArea,data.password);\n\t\t\t\tif(tiddlers) {\n\t\t\t\t\tif($tw.config.usePasswordVault) {\n\t\t\t\t\t\t$tw.crypto.setPassword(data.password);\n\t\t\t\t\t}\n\t\t\t\t\tcallback(tiddlers);\n\t\t\t\t\t// Exit and remove the password prompt\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t// We didn't decrypt everything, so continue to prompt for password\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/utils/crypto.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/animations/slide.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/animations/slide.js\ntype: application/javascript\nmodule-type: animation\n\nA simple slide animation that varies the height of the element\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction slideOpen(domNode,options) {\n\toptions = options || {};\n\tvar duration = options.duration || $tw.utils.getAnimationDuration();\n\t// Get the current height of the domNode\n\tvar computedStyle = window.getComputedStyle(domNode),\n\t\tcurrMarginBottom = parseInt(computedStyle.marginBottom,10),\n\t\tcurrMarginTop = parseInt(computedStyle.marginTop,10),\n\t\tcurrPaddingBottom = parseInt(computedStyle.paddingBottom,10),\n\t\tcurrPaddingTop = parseInt(computedStyle.paddingTop,10),\n\t\tcurrHeight = domNode.offsetHeight;\n\t// Reset the margin once the transition is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(domNode,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"},\n\t\t\t{marginTop: \"\"},\n\t\t\t{paddingBottom: \"\"},\n\t\t\t{paddingTop: \"\"},\n\t\t\t{height: \"auto\"},\n\t\t\t{opacity: \"\"}\n\t\t]);\n\t\tif(options.callback) {\n\t\t\toptions.callback();\n\t\t}\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"none\"},\n\t\t{marginTop: \"0px\"},\n\t\t{marginBottom: \"0px\"},\n\t\t{paddingTop: \"0px\"},\n\t\t{paddingBottom: \"0px\"},\n\t\t{height: \"0px\"},\n\t\t{opacity: \"0\"}\n\t]);\n\t$tw.utils.forceLayout(domNode);\n\t// Transition to the final position\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"margin-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"height \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{marginBottom: currMarginBottom + \"px\"},\n\t\t{marginTop: currMarginTop + \"px\"},\n\t\t{paddingBottom: currPaddingBottom + \"px\"},\n\t\t{paddingTop: currPaddingTop + \"px\"},\n\t\t{height: currHeight + \"px\"},\n\t\t{opacity: \"1\"}\n\t]);\n}\n\nfunction slideClosed(domNode,options) {\n\toptions = options || {};\n\tvar duration = options.duration || $tw.utils.getAnimationDuration(),\n\t\tcurrHeight = domNode.offsetHeight;\n\t// Clear the properties we've set when the animation is over\n\tsetTimeout(function() {\n\t\t$tw.utils.setStyle(domNode,[\n\t\t\t{transition: \"none\"},\n\t\t\t{marginBottom: \"\"},\n\t\t\t{marginTop: \"\"},\n\t\t\t{paddingBottom: \"\"},\n\t\t\t{paddingTop: \"\"},\n\t\t\t{height: \"auto\"},\n\t\t\t{opacity: \"\"}\n\t\t]);\n\t\tif(options.callback) {\n\t\t\toptions.callback();\n\t\t}\n\t},duration);\n\t// Set up the initial position of the element\n\t$tw.utils.setStyle(domNode,[\n\t\t{height: currHeight + \"px\"},\n\t\t{opacity: \"1\"}\n\t]);\n\t$tw.utils.forceLayout(domNode);\n\t// Transition to the final position\n\t$tw.utils.setStyle(domNode,[\n\t\t{transition: \"margin-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"margin-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-top \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"padding-bottom \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"height \" + duration + \"ms ease-in-out, \" +\n\t\t\t\t\t\"opacity \" + duration + \"ms ease-in-out\"},\n\t\t{marginTop: \"0px\"},\n\t\t{marginBottom: \"0px\"},\n\t\t{paddingTop: \"0px\"},\n\t\t{paddingBottom: \"0px\"},\n\t\t{height: \"0px\"},\n\t\t{opacity: \"0\"}\n\t]);\n}\n\nexports.slide = {\n\topen: slideOpen,\n\tclose: slideClosed\n};\n\n})();\n",
"title": "$:/core/modules/utils/dom/animations/slide.js",
"type": "application/javascript",
"module-type": "animation"
},
"$:/core/modules/utils/dom/animator.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/animator.js\ntype: application/javascript\nmodule-type: utils\n\nOrchestrates animations and transitions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction Animator() {\n\t// Get the registered animation modules\n\tthis.animations = {};\n\t$tw.modules.applyMethods(\"animation\",this.animations);\n}\n\nAnimator.prototype.perform = function(type,domNode,options) {\n\toptions = options || {};\n\t// Find an animation that can handle this type\n\tvar chosenAnimation;\n\t$tw.utils.each(this.animations,function(animation,name) {\n\t\tif($tw.utils.hop(animation,type)) {\n\t\t\tchosenAnimation = animation[type];\n\t\t}\n\t});\n\tif(!chosenAnimation) {\n\t\tchosenAnimation = function(domNode,options) {\n\t\t\tif(options.callback) {\n\t\t\t\toptions.callback();\n\t\t\t}\n\t\t};\n\t}\n\t// Call the animation\n\tchosenAnimation(domNode,options);\n};\n\nexports.Animator = Animator;\n\n})();\n",
"title": "$:/core/modules/utils/dom/animator.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/browser.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/browser.js\ntype: application/javascript\nmodule-type: utils\n\nBrowser feature detection\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nSet style properties of an element\n\telement: dom node\n\tstyles: ordered array of {name: value} pairs\n*/\nexports.setStyle = function(element,styles) {\n\tif(element.nodeType === 1) { // Element.ELEMENT_NODE\n\t\tfor(var t=0; t<styles.length; t++) {\n\t\t\tfor(var styleName in styles[t]) {\n\t\t\t\telement.style[$tw.utils.convertStyleNameToPropertyName(styleName)] = styles[t][styleName];\n\t\t\t}\n\t\t}\n\t}\n};\n\n/*\nConverts a standard CSS property name into the local browser-specific equivalent. For example:\n\t\"background-color\" --> \"backgroundColor\"\n\t\"transition\" --> \"webkitTransition\"\n*/\n\nvar styleNameCache = {}; // We'll cache the style name conversions\n\nexports.convertStyleNameToPropertyName = function(styleName) {\n\t// Return from the cache if we can\n\tif(styleNameCache[styleName]) {\n\t\treturn styleNameCache[styleName];\n\t}\n\t// Convert it by first removing any hyphens\n\tvar propertyName = $tw.utils.unHyphenateCss(styleName);\n\t// Then check if it needs a prefix\n\tif(document.body.style[propertyName] === undefined) {\n\t\tvar prefixes = [\"O\",\"MS\",\"Moz\",\"webkit\"];\n\t\tfor(var t=0; t<prefixes.length; t++) {\n\t\t\tvar prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1);\n\t\t\tif(document.body.style[prefixedName] !== undefined) {\n\t\t\t\tpropertyName = prefixedName;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// Put it in the cache too\n\tstyleNameCache[styleName] = propertyName;\n\treturn propertyName;\n};\n\n/*\nConverts a JS format CSS property name back into the dashed form used in CSS declarations. For example:\n\t\"backgroundColor\" --> \"background-color\"\n\t\"webkitTransform\" --> \"-webkit-transform\"\n*/\nexports.convertPropertyNameToStyleName = function(propertyName) {\n\t// Rehyphenate the name\n\tvar styleName = $tw.utils.hyphenateCss(propertyName);\n\t// If there's a webkit prefix, add a dash (other browsers have uppercase prefixes, and so get the dash automatically)\n\tif(styleName.indexOf(\"webkit\") === 0) {\n\t\tstyleName = \"-\" + styleName;\n\t} else if(styleName.indexOf(\"-m-s\") === 0) {\n\t\tstyleName = \"-ms\" + styleName.substr(4);\n\t}\n\treturn styleName;\n};\n\n/*\nRound trip a stylename to a property name and back again. For example:\n\t\"transform\" --> \"webkitTransform\" --> \"-webkit-transform\"\n*/\nexports.roundTripPropertyName = function(propertyName) {\n\treturn $tw.utils.convertPropertyNameToStyleName($tw.utils.convertStyleNameToPropertyName(propertyName));\n};\n\n/*\nConverts a standard event name into the local browser specific equivalent. For example:\n\t\"animationEnd\" --> \"webkitAnimationEnd\"\n*/\n\nvar eventNameCache = {}; // We'll cache the conversions\n\nvar eventNameMappings = {\n\t\"transitionEnd\": {\n\t\tcorrespondingCssProperty: \"transition\",\n\t\tmappings: {\n\t\t\ttransition: \"transitionend\",\n\t\t\tOTransition: \"oTransitionEnd\",\n\t\t\tMSTransition: \"msTransitionEnd\",\n\t\t\tMozTransition: \"transitionend\",\n\t\t\twebkitTransition: \"webkitTransitionEnd\"\n\t\t}\n\t},\n\t\"animationEnd\": {\n\t\tcorrespondingCssProperty: \"animation\",\n\t\tmappings: {\n\t\t\tanimation: \"animationend\",\n\t\t\tOAnimation: \"oAnimationEnd\",\n\t\t\tMSAnimation: \"msAnimationEnd\",\n\t\t\tMozAnimation: \"animationend\",\n\t\t\twebkitAnimation: \"webkitAnimationEnd\"\n\t\t}\n\t}\n};\n\nexports.convertEventName = function(eventName) {\n\tif(eventNameCache[eventName]) {\n\t\treturn eventNameCache[eventName];\n\t}\n\tvar newEventName = eventName,\n\t\tmappings = eventNameMappings[eventName];\n\tif(mappings) {\n\t\tvar convertedProperty = $tw.utils.convertStyleNameToPropertyName(mappings.correspondingCssProperty);\n\t\tif(mappings.mappings[convertedProperty]) {\n\t\t\tnewEventName = mappings.mappings[convertedProperty];\n\t\t}\n\t}\n\t// Put it in the cache too\n\teventNameCache[eventName] = newEventName;\n\treturn newEventName;\n};\n\n/*\nReturn the names of the fullscreen APIs\n*/\nexports.getFullScreenApis = function() {\n\tvar d = document,\n\t\tdb = d.body,\n\t\tresult = {\n\t\t\"_requestFullscreen\": db.webkitRequestFullscreen !== undefined ? \"webkitRequestFullscreen\" :\n\t\t\t\t\t\t\tdb.mozRequestFullScreen !== undefined ? \"mozRequestFullScreen\" :\n\t\t\t\t\t\t\tdb.msRequestFullscreen !== undefined ? \"msRequestFullscreen\" :\n\t\t\t\t\t\t\tdb.requestFullscreen !== undefined ? \"requestFullscreen\" : \"\",\n\t\t\"_exitFullscreen\": d.webkitExitFullscreen !== undefined ? \"webkitExitFullscreen\" :\n\t\t\t\t\t\t\td.mozCancelFullScreen !== undefined ? \"mozCancelFullScreen\" :\n\t\t\t\t\t\t\td.msExitFullscreen !== undefined ? \"msExitFullscreen\" :\n\t\t\t\t\t\t\td.exitFullscreen !== undefined ? \"exitFullscreen\" : \"\",\n\t\t\"_fullscreenElement\": d.webkitFullscreenElement !== undefined ? \"webkitFullscreenElement\" :\n\t\t\t\t\t\t\td.mozFullScreenElement !== undefined ? \"mozFullScreenElement\" :\n\t\t\t\t\t\t\td.msFullscreenElement !== undefined ? \"msFullscreenElement\" :\n\t\t\t\t\t\t\td.fullscreenElement !== undefined ? \"fullscreenElement\" : \"\",\n\t\t\"_fullscreenChange\": d.webkitFullscreenElement !== undefined ? \"webkitfullscreenchange\" :\n\t\t\t\t\t\t\td.mozFullScreenElement !== undefined ? \"mozfullscreenchange\" :\n\t\t\t\t\t\t\td.msFullscreenElement !== undefined ? \"MSFullscreenChange\" :\n\t\t\t\t\t\t\td.fullscreenElement !== undefined ? \"fullscreenchange\" : \"\"\n\t};\n\tif(!result._requestFullscreen || !result._exitFullscreen || !result._fullscreenElement || !result._fullscreenChange) {\n\t\treturn null;\n\t} else {\n\t\treturn result;\n\t}\n};\n\n})();\n",
"title": "$:/core/modules/utils/dom/browser.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/csscolorparser.js": {
"text": "// (c) Dean McNamee <dean@gmail.com>, 2012.\n//\n// https://github.com/deanm/css-color-parser-js\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n// http://www.w3.org/TR/css3-color/\nvar kCSSColorTable = {\n \"transparent\": [0,0,0,0], \"aliceblue\": [240,248,255,1],\n \"antiquewhite\": [250,235,215,1], \"aqua\": [0,255,255,1],\n \"aquamarine\": [127,255,212,1], \"azure\": [240,255,255,1],\n \"beige\": [245,245,220,1], \"bisque\": [255,228,196,1],\n \"black\": [0,0,0,1], \"blanchedalmond\": [255,235,205,1],\n \"blue\": [0,0,255,1], \"blueviolet\": [138,43,226,1],\n \"brown\": [165,42,42,1], \"burlywood\": [222,184,135,1],\n \"cadetblue\": [95,158,160,1], \"chartreuse\": [127,255,0,1],\n \"chocolate\": [210,105,30,1], \"coral\": [255,127,80,1],\n \"cornflowerblue\": [100,149,237,1], \"cornsilk\": [255,248,220,1],\n \"crimson\": [220,20,60,1], \"cyan\": [0,255,255,1],\n \"darkblue\": [0,0,139,1], \"darkcyan\": [0,139,139,1],\n \"darkgoldenrod\": [184,134,11,1], \"darkgray\": [169,169,169,1],\n \"darkgreen\": [0,100,0,1], \"darkgrey\": [169,169,169,1],\n \"darkkhaki\": [189,183,107,1], \"darkmagenta\": [139,0,139,1],\n \"darkolivegreen\": [85,107,47,1], \"darkorange\": [255,140,0,1],\n \"darkorchid\": [153,50,204,1], \"darkred\": [139,0,0,1],\n \"darksalmon\": [233,150,122,1], \"darkseagreen\": [143,188,143,1],\n \"darkslateblue\": [72,61,139,1], \"darkslategray\": [47,79,79,1],\n \"darkslategrey\": [47,79,79,1], \"darkturquoise\": [0,206,209,1],\n \"darkviolet\": [148,0,211,1], \"deeppink\": [255,20,147,1],\n \"deepskyblue\": [0,191,255,1], \"dimgray\": [105,105,105,1],\n \"dimgrey\": [105,105,105,1], \"dodgerblue\": [30,144,255,1],\n \"firebrick\": [178,34,34,1], \"floralwhite\": [255,250,240,1],\n \"forestgreen\": [34,139,34,1], \"fuchsia\": [255,0,255,1],\n \"gainsboro\": [220,220,220,1], \"ghostwhite\": [248,248,255,1],\n \"gold\": [255,215,0,1], \"goldenrod\": [218,165,32,1],\n \"gray\": [128,128,128,1], \"green\": [0,128,0,1],\n \"greenyellow\": [173,255,47,1], \"grey\": [128,128,128,1],\n \"honeydew\": [240,255,240,1], \"hotpink\": [255,105,180,1],\n \"indianred\": [205,92,92,1], \"indigo\": [75,0,130,1],\n \"ivory\": [255,255,240,1], \"khaki\": [240,230,140,1],\n \"lavender\": [230,230,250,1], \"lavenderblush\": [255,240,245,1],\n \"lawngreen\": [124,252,0,1], \"lemonchiffon\": [255,250,205,1],\n \"lightblue\": [173,216,230,1], \"lightcoral\": [240,128,128,1],\n \"lightcyan\": [224,255,255,1], \"lightgoldenrodyellow\": [250,250,210,1],\n \"lightgray\": [211,211,211,1], \"lightgreen\": [144,238,144,1],\n \"lightgrey\": [211,211,211,1], \"lightpink\": [255,182,193,1],\n \"lightsalmon\": [255,160,122,1], \"lightseagreen\": [32,178,170,1],\n \"lightskyblue\": [135,206,250,1], \"lightslategray\": [119,136,153,1],\n \"lightslategrey\": [119,136,153,1], \"lightsteelblue\": [176,196,222,1],\n \"lightyellow\": [255,255,224,1], \"lime\": [0,255,0,1],\n \"limegreen\": [50,205,50,1], \"linen\": [250,240,230,1],\n \"magenta\": [255,0,255,1], \"maroon\": [128,0,0,1],\n \"mediumaquamarine\": [102,205,170,1], \"mediumblue\": [0,0,205,1],\n \"mediumorchid\": [186,85,211,1], \"mediumpurple\": [147,112,219,1],\n \"mediumseagreen\": [60,179,113,1], \"mediumslateblue\": [123,104,238,1],\n \"mediumspringgreen\": [0,250,154,1], \"mediumturquoise\": [72,209,204,1],\n \"mediumvioletred\": [199,21,133,1], \"midnightblue\": [25,25,112,1],\n \"mintcream\": [245,255,250,1], \"mistyrose\": [255,228,225,1],\n \"moccasin\": [255,228,181,1], \"navajowhite\": [255,222,173,1],\n \"navy\": [0,0,128,1], \"oldlace\": [253,245,230,1],\n \"olive\": [128,128,0,1], \"olivedrab\": [107,142,35,1],\n \"orange\": [255,165,0,1], \"orangered\": [255,69,0,1],\n \"orchid\": [218,112,214,1], \"palegoldenrod\": [238,232,170,1],\n \"palegreen\": [152,251,152,1], \"paleturquoise\": [175,238,238,1],\n \"palevioletred\": [219,112,147,1], \"papayawhip\": [255,239,213,1],\n \"peachpuff\": [255,218,185,1], \"peru\": [205,133,63,1],\n \"pink\": [255,192,203,1], \"plum\": [221,160,221,1],\n \"powderblue\": [176,224,230,1], \"purple\": [128,0,128,1],\n \"red\": [255,0,0,1], \"rosybrown\": [188,143,143,1],\n \"royalblue\": [65,105,225,1], \"saddlebrown\": [139,69,19,1],\n \"salmon\": [250,128,114,1], \"sandybrown\": [244,164,96,1],\n \"seagreen\": [46,139,87,1], \"seashell\": [255,245,238,1],\n \"sienna\": [160,82,45,1], \"silver\": [192,192,192,1],\n \"skyblue\": [135,206,235,1], \"slateblue\": [106,90,205,1],\n \"slategray\": [112,128,144,1], \"slategrey\": [112,128,144,1],\n \"snow\": [255,250,250,1], \"springgreen\": [0,255,127,1],\n \"steelblue\": [70,130,180,1], \"tan\": [210,180,140,1],\n \"teal\": [0,128,128,1], \"thistle\": [216,191,216,1],\n \"tomato\": [255,99,71,1], \"turquoise\": [64,224,208,1],\n \"violet\": [238,130,238,1], \"wheat\": [245,222,179,1],\n \"white\": [255,255,255,1], \"whitesmoke\": [245,245,245,1],\n \"yellow\": [255,255,0,1], \"yellowgreen\": [154,205,50,1]}\n\nfunction clamp_css_byte(i) { // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clamp_css_float(f) { // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parse_css_int(str) { // int or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_byte(parseFloat(str) / 100 * 255);\n return clamp_css_byte(parseInt(str));\n}\n\nfunction parse_css_float(str) { // float or percentage.\n if (str[str.length - 1] === '%')\n return clamp_css_float(parseFloat(str) / 100);\n return clamp_css_float(parseFloat(str));\n}\n\nfunction css_hue_to_rgb(m1, m2, h) {\n if (h < 0) h += 1;\n else if (h > 1) h -= 1;\n\n if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;\n if (h * 2 < 1) return m2;\n if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;\n return m1;\n}\n\nfunction parseCSSColor(css_str) {\n // Remove all whitespace, not compliant, but should just be more accepting.\n var str = css_str.replace(/ /g, '').toLowerCase();\n\n // Color keywords (and transparent) lookup.\n if (str in kCSSColorTable) return kCSSColorTable[str].slice(); // dup.\n\n // #abc and #abc123 syntax.\n if (str[0] === '#') {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xfff)) return null; // Covers NaN.\n return [((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),\n (iv & 0xf0) | ((iv & 0xf0) >> 4),\n (iv & 0xf) | ((iv & 0xf) << 4),\n 1];\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n if (!(iv >= 0 && iv <= 0xffffff)) return null; // Covers NaN.\n return [(iv & 0xff0000) >> 16,\n (iv & 0xff00) >> 8,\n iv & 0xff,\n 1];\n }\n\n return null;\n }\n\n var op = str.indexOf('('), ep = str.indexOf(')');\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op+1, ep-(op+1)).split(',');\n var alpha = 1; // To allow case fallthrough.\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'rgb':\n if (params.length !== 3) return null;\n return [parse_css_int(params[0]),\n parse_css_int(params[1]),\n parse_css_int(params[2]),\n alpha];\n case 'hsla':\n if (params.length !== 4) return null;\n alpha = parse_css_float(params.pop());\n // Fall through.\n case 'hsl':\n if (params.length !== 3) return null;\n var h = (((parseFloat(params[0]) % 360) + 360) % 360) / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n var s = parse_css_float(params[1]);\n var l = parse_css_float(params[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n return [clamp_css_byte(css_hue_to_rgb(m1, m2, h+1/3) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h) * 255),\n clamp_css_byte(css_hue_to_rgb(m1, m2, h-1/3) * 255),\n alpha];\n default:\n return null;\n }\n }\n\n return null;\n}\n\ntry { exports.parseCSSColor = parseCSSColor } catch(e) { }\n",
"title": "$:/core/modules/utils/dom/csscolorparser.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom.js\ntype: application/javascript\nmodule-type: utils\n\nVarious static DOM-related utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nDetermines whether element 'a' contains element 'b'\nCode thanks to John Resig, http://ejohn.org/blog/comparing-document-position/\n*/\nexports.domContains = function(a,b) {\n\treturn a.contains ?\n\t\ta !== b && a.contains(b) :\n\t\t!!(a.compareDocumentPosition(b) & 16);\n};\n\nexports.removeChildren = function(node) {\n\twhile(node.hasChildNodes()) {\n\t\tnode.removeChild(node.firstChild);\n\t}\n};\n\nexports.hasClass = function(el,className) {\n\treturn el && el.className && el.className.toString().split(\" \").indexOf(className) !== -1;\n};\n\nexports.addClass = function(el,className) {\n\tvar c = el.className.split(\" \");\n\tif(c.indexOf(className) === -1) {\n\t\tc.push(className);\n\t}\n\tel.className = c.join(\" \");\n};\n\nexports.removeClass = function(el,className) {\n\tvar c = el.className.split(\" \"),\n\t\tp = c.indexOf(className);\n\tif(p !== -1) {\n\t\tc.splice(p,1);\n\t\tel.className = c.join(\" \");\n\t}\n};\n\nexports.toggleClass = function(el,className,status) {\n\tif(status === undefined) {\n\t\tstatus = !exports.hasClass(el,className);\n\t}\n\tif(status) {\n\t\texports.addClass(el,className);\n\t} else {\n\t\texports.removeClass(el,className);\n\t}\n};\n\n/*\nGet the scroll position of the viewport\nReturns:\n\t{\n\t\tx: horizontal scroll position in pixels,\n\t\ty: vertical scroll position in pixels\n\t}\n*/\nexports.getScrollPosition = function() {\n\tif(\"scrollX\" in window) {\n\t\treturn {x: window.scrollX, y: window.scrollY};\n\t} else {\n\t\treturn {x: document.documentElement.scrollLeft, y: document.documentElement.scrollTop};\n\t}\n};\n\n/*\nGets the bounding rectangle of an element in absolute page coordinates\n*/\nexports.getBoundingPageRect = function(element) {\n\tvar scrollPos = $tw.utils.getScrollPosition(),\n\t\tclientRect = element.getBoundingClientRect();\n\treturn {\n\t\tleft: clientRect.left + scrollPos.x,\n\t\twidth: clientRect.width,\n\t\tright: clientRect.right + scrollPos.x,\n\t\ttop: clientRect.top + scrollPos.y,\n\t\theight: clientRect.height,\n\t\tbottom: clientRect.bottom + scrollPos.y\n\t};\n};\n\n/*\nSaves a named password in the browser\n*/\nexports.savePassword = function(name,password) {\n\ttry {\n\t\tif(window.localStorage) {\n\t\t\tlocalStorage.setItem(\"tw5-password-\" + name,password);\n\t\t}\n\t} catch(e) {\n\t}\n};\n\n/*\nRetrieve a named password from the browser\n*/\nexports.getPassword = function(name) {\n\ttry {\n\t\treturn window.localStorage ? localStorage.getItem(\"tw5-password-\" + name) : \"\";\n\t} catch(e) {\n\t\treturn \"\";\n\t}\n};\n\n/*\nForce layout of a dom node and its descendents\n*/\nexports.forceLayout = function(element) {\n\tvar dummy = element.offsetWidth;\n};\n\n/*\nPulse an element for debugging purposes\n*/\nexports.pulseElement = function(element) {\n\t// Event handler to remove the class at the end\n\telement.addEventListener($tw.browser.animationEnd,function handler(event) {\n\t\telement.removeEventListener($tw.browser.animationEnd,handler,false);\n\t\t$tw.utils.removeClass(element,\"pulse\");\n\t},false);\n\t// Apply the pulse class\n\t$tw.utils.removeClass(element,\"pulse\");\n\t$tw.utils.forceLayout(element);\n\t$tw.utils.addClass(element,\"pulse\");\n};\n\n/*\nAttach specified event handlers to a DOM node\ndomNode: where to attach the event handlers\nevents: array of event handlers to be added (see below)\nEach entry in the events array is an object with these properties:\nhandlerFunction: optional event handler function\nhandlerObject: optional event handler object\nhandlerMethod: optionally specifies object handler method name (defaults to `handleEvent`)\n*/\nexports.addEventListeners = function(domNode,events) {\n\t$tw.utils.each(events,function(eventInfo) {\n\t\tvar handler;\n\t\tif(eventInfo.handlerFunction) {\n\t\t\thandler = eventInfo.handlerFunction;\n\t\t} else if(eventInfo.handlerObject) {\n\t\t\tif(eventInfo.handlerMethod) {\n\t\t\t\thandler = function(event) {\n\t\t\t\t\teventInfo.handlerObject[eventInfo.handlerMethod].call(eventInfo.handlerObject,event);\n\t\t\t\t};\t\n\t\t\t} else {\n\t\t\t\thandler = eventInfo.handlerObject;\n\t\t\t}\n\t\t}\n\t\tdomNode.addEventListener(eventInfo.name,handler,false);\n\t});\n};\n\n\n})();\n",
"title": "$:/core/modules/utils/dom.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/http.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/http.js\ntype: application/javascript\nmodule-type: utils\n\nBrowser HTTP support\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nA quick and dirty HTTP function; to be refactored later. Options are:\n\turl: URL to retrieve\n\ttype: GET, PUT, POST etc\n\tcallback: function invoked with (err,data)\n*/\nexports.httpRequest = function(options) {\n\tvar type = options.type || \"GET\",\n\t\theaders = options.headers || {accept: \"application/json\"},\n\t\trequest = new XMLHttpRequest(),\n\t\tdata = \"\",\n\t\tf,results;\n\t// Massage the data hashmap into a string\n\tif(options.data) {\n\t\tif(typeof options.data === \"string\") { // Already a string\n\t\t\tdata = options.data;\n\t\t} else { // A hashmap of strings\n\t\t\tresults = [];\n\t\t\t$tw.utils.each(options.data,function(dataItem,dataItemTitle) {\n\t\t\t\tresults.push(dataItemTitle + \"=\" + encodeURIComponent(dataItem));\n\t\t\t});\n\t\t\tdata = results.join(\"&\");\n\t\t}\n\t}\n\t// Set up the state change handler\n\trequest.onreadystatechange = function() {\n\t\tif(this.readyState === 4) {\n\t\t\tif(this.status === 200 || this.status === 201 || this.status === 204) {\n\t\t\t\t// Success!\n\t\t\t\toptions.callback(null,this.responseText,this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t// Something went wrong\n\t\toptions.callback(\"XMLHttpRequest error code: \" + this.status);\n\t\t}\n\t};\n\t// Make the request\n\trequest.open(type,options.url,true);\n\tif(headers) {\n\t\t$tw.utils.each(headers,function(header,headerTitle,object) {\n\t\t\trequest.setRequestHeader(headerTitle,header);\n\t\t});\n\t}\n\tif(data && !$tw.utils.hop(headers,\"Content-type\")) {\n\t\trequest.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded; charset=UTF-8\");\n\t}\n\trequest.send(data);\n\treturn request;\n};\n\n})();\n",
"title": "$:/core/modules/utils/dom/http.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/keyboard.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/keyboard.js\ntype: application/javascript\nmodule-type: utils\n\nKeyboard utilities\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar namedKeys = {\n\t\"backspace\": 8,\n\t\"tab\": 9,\n\t\"enter\": 13,\n\t\"escape\": 27\n};\n\n/*\nParses a key descriptor into the structure:\n{\n\tkeyCode: numeric keycode\n\tshiftKey: boolean\n\taltKey: boolean\n\tctrlKey: boolean\n}\nKey descriptors have the following format:\n\tctrl+enter\n\tctrl+shift+alt+A\n*/\nexports.parseKeyDescriptor = function(keyDescriptor) {\n\tvar components = keyDescriptor.split(\"+\"),\n\t\tinfo = {\n\t\t\tkeyCode: 0,\n\t\t\tshiftKey: false,\n\t\t\taltKey: false,\n\t\t\tctrlKey: false\n\t\t};\n\tfor(var t=0; t<components.length; t++) {\n\t\tvar s = components[t].toLowerCase();\n\t\t// Look for modifier keys\n\t\tif(s === \"ctrl\") {\n\t\t\tinfo.ctrlKey = true;\n\t\t} else if(s === \"shift\") {\n\t\t\tinfo.shiftKey = true;\n\t\t} else if(s === \"alt\") {\n\t\t\tinfo.altKey = true;\n\t\t} else if(s === \"meta\") {\n\t\t\tinfo.metaKey = true;\n\t\t}\n\t\t// Replace named keys with their code\n\t\tif(namedKeys[s]) {\n\t\t\tinfo.keyCode = namedKeys[s];\n\t\t}\n\t}\n\treturn info;\n};\n\nexports.checkKeyDescriptor = function(event,keyInfo) {\n\tvar metaKeyStatus = !!keyInfo.metaKey; // Using a temporary variable to keep JSHint happy\n\treturn event.keyCode === keyInfo.keyCode && \n\t\t\tevent.shiftKey === keyInfo.shiftKey && \n\t\t\tevent.altKey === keyInfo.altKey && \n\t\t\tevent.ctrlKey === keyInfo.ctrlKey && \n\t\t\tevent.metaKey === metaKeyStatus;\t\n};\n\n})();\n",
"title": "$:/core/modules/utils/dom/keyboard.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/modal.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/modal.js\ntype: application/javascript\nmodule-type: utils\n\nModal message mechanism\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar Modal = function(wiki) {\n\tthis.wiki = wiki;\n\tthis.modalCount = 0;\n};\n\n/*\nDisplay a modal dialogue\n\ttitle: Title of tiddler to display\n\toptions: see below\nOptions include:\n\tdownloadLink: Text of a big download link to include\n*/\nModal.prototype.display = function(title,options) {\n\toptions = options || {};\n\tvar self = this,\n\t\tduration = $tw.utils.getAnimationDuration(),\n\t\ttiddler = this.wiki.getTiddler(title);\n\t// Don't do anything if the tiddler doesn't exist\n\tif(!tiddler) {\n\t\treturn;\n\t}\n\t// Create the variables\n\tvar variables = $tw.utils.extend({currentTiddler: title},options.variables);\n\t// Create the wrapper divs\n\tvar wrapper = document.createElement(\"div\"),\n\t\tmodalBackdrop = document.createElement(\"div\"),\n\t\tmodalWrapper = document.createElement(\"div\"),\n\t\tmodalHeader = document.createElement(\"div\"),\n\t\theaderTitle = document.createElement(\"h3\"),\n\t\tmodalBody = document.createElement(\"div\"),\n\t\tmodalLink = document.createElement(\"a\"),\n\t\tmodalFooter = document.createElement(\"div\"),\n\t\tmodalFooterHelp = document.createElement(\"span\"),\n\t\tmodalFooterButtons = document.createElement(\"span\");\n\t// Up the modal count and adjust the body class\n\tthis.modalCount++;\n\tthis.adjustPageClass();\n\t// Add classes\n\t$tw.utils.addClass(wrapper,\"tc-modal-wrapper\");\n\t$tw.utils.addClass(modalBackdrop,\"tc-modal-backdrop\");\n\t$tw.utils.addClass(modalWrapper,\"tc-modal\");\n\t$tw.utils.addClass(modalHeader,\"tc-modal-header\");\n\t$tw.utils.addClass(modalBody,\"tc-modal-body\");\n\t$tw.utils.addClass(modalFooter,\"tc-modal-footer\");\n\t// Join them together\n\twrapper.appendChild(modalBackdrop);\n\twrapper.appendChild(modalWrapper);\n\tmodalHeader.appendChild(headerTitle);\n\tmodalWrapper.appendChild(modalHeader);\n\tmodalWrapper.appendChild(modalBody);\n\tmodalFooter.appendChild(modalFooterHelp);\n\tmodalFooter.appendChild(modalFooterButtons);\n\tmodalWrapper.appendChild(modalFooter);\n\t// Render the title of the message\n\tvar headerWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tfield: \"subtitle\",\n\t\tchildren: [{\n\t\t\ttype: \"text\",\n\t\t\tattributes: {\n\t\t\t\ttext: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: title\n\t\t}}}],\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables\n\t});\n\theaderWidgetNode.render(headerTitle,null);\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\theaderWidgetNode.refresh(changes,modalHeader,null);\n\t});\n\t// Render the body of the message\n\tvar bodyWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables\n\t});\n\tbodyWidgetNode.render(modalBody,null);\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tbodyWidgetNode.refresh(changes,modalBody,null);\n\t});\n\t// Setup the link if present\n\tif(options.downloadLink) {\n\t\tmodalLink.href = options.downloadLink;\n\t\tmodalLink.appendChild(document.createTextNode(\"Right-click to save changes\"));\n\t\tmodalBody.appendChild(modalLink);\n\t}\n\t// Render the footer of the message\n\tif(tiddler && tiddler.fields && tiddler.fields.help) {\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\",tiddler.fields.help);\n\t\tlink.setAttribute(\"target\",\"_blank\");\n\t\tlink.appendChild(document.createTextNode(\"Help\"));\n\t\tmodalFooterHelp.appendChild(link);\n\t\tmodalFooterHelp.style.float = \"left\";\n\t}\n\tvar footerWidgetNode = this.wiki.makeTranscludeWidget(title,{\n\t\tfield: \"footer\",\n\t\tchildren: [{\n\t\t\ttype: \"button\",\n\t\t\tattributes: {\n\t\t\t\tmessage: {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tvalue: \"tm-close-tiddler\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tchildren: [{\n\t\t\t\ttype: \"text\",\n\t\t\t\tattributes: {\n\t\t\t\t\ttext: {\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tvalue: \"Close\"\n\t\t\t}}}\n\t\t]}],\n\t\tparentWidget: $tw.rootWidget,\n\t\tdocument: document,\n\t\tvariables: variables\n\t});\n\tfooterWidgetNode.render(modalFooterButtons,null);\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\tfooterWidgetNode.refresh(changes,modalFooterButtons,null);\n\t});\n\t// Add the close event handler\n\tvar closeHandler = function(event) {\n\t\t// Decrease the modal count and adjust the body class\n\t\tself.modalCount--;\n\t\tself.adjustPageClass();\n\t\t// Force layout and animate the modal message away\n\t\t$tw.utils.forceLayout(modalBackdrop);\n\t\t$tw.utils.forceLayout(modalWrapper);\n\t\t$tw.utils.setStyle(modalBackdrop,[\n\t\t\t{opacity: \"0\"}\n\t\t]);\n\t\t$tw.utils.setStyle(modalWrapper,[\n\t\t\t{transform: \"translateY(\" + window.innerHeight + \"px)\"}\n\t\t]);\n\t\t// Set up an event for the transition end\n\t\twindow.setTimeout(function() {\n\t\t\tif(wrapper.parentNode) {\n\t\t\t\t// Remove the modal message from the DOM\n\t\t\t\tdocument.body.removeChild(wrapper);\n\t\t\t}\n\t\t},duration);\n\t\t// Don't let anyone else handle the tm-close-tiddler message\n\t\treturn false;\n\t};\n\theaderWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\tbodyWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\tfooterWidgetNode.addEventListener(\"tm-close-tiddler\",closeHandler,false);\n\t// Set the initial styles for the message\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{opacity: \"0\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transformOrigin: \"0% 0%\"},\n\t\t{transform: \"translateY(\" + (-window.innerHeight) + \"px)\"}\n\t]);\n\t// Put the message into the document\n\tdocument.body.appendChild(wrapper);\n\t// Set up animation for the styles\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{transition: \"opacity \" + duration + \"ms ease-out\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transition: $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out\"}\n\t]);\n\t// Force layout\n\t$tw.utils.forceLayout(modalBackdrop);\n\t$tw.utils.forceLayout(modalWrapper);\n\t// Set final animated styles\n\t$tw.utils.setStyle(modalBackdrop,[\n\t\t{opacity: \"0.7\"}\n\t]);\n\t$tw.utils.setStyle(modalWrapper,[\n\t\t{transform: \"translateY(0px)\"}\n\t]);\n};\n\nModal.prototype.adjustPageClass = function() {\n\tif($tw.pageContainer) {\n\t\t$tw.utils.toggleClass($tw.pageContainer,\"tc-modal-displayed\",this.modalCount > 0);\n\t}\n};\n\nexports.Modal = Modal;\n\n})();\n",
"title": "$:/core/modules/utils/dom/modal.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/notifier.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/notifier.js\ntype: application/javascript\nmodule-type: utils\n\nNotifier mechanism\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar Notifier = function(wiki) {\n\tthis.wiki = wiki;\n};\n\n/*\nDisplay a notification\n\ttitle: Title of tiddler containing the notification text\n\toptions: see below\nOptions include:\n*/\nNotifier.prototype.display = function(title,options) {\n\toptions = options || {};\n\t// Create the wrapper divs\n\tvar notification = document.createElement(\"div\"),\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tduration = $tw.utils.getAnimationDuration();\n\t// Don't do anything if the tiddler doesn't exist\n\tif(!tiddler) {\n\t\treturn;\n\t}\n\t// Add classes\n\t$tw.utils.addClass(notification,\"tc-notification\");\n\t// Render the body of the notification\n\tvar widgetNode = this.wiki.makeTranscludeWidget(title,{parentWidget: $tw.rootWidget, document: document});\n\twidgetNode.render(notification,null);\n\tthis.wiki.addEventListener(\"change\",function(changes) {\n\t\twidgetNode.refresh(changes,notification,null);\n\t});\n\t// Set the initial styles for the notification\n\t$tw.utils.setStyle(notification,[\n\t\t{opacity: \"0\"},\n\t\t{transformOrigin: \"0% 0%\"},\n\t\t{transform: \"translateY(\" + (-window.innerHeight) + \"px)\"},\n\t\t{transition: \"opacity \" + duration + \"ms ease-out, \" + $tw.utils.roundTripPropertyName(\"transform\") + \" \" + duration + \"ms ease-in-out\"}\n\t]);\n\t// Add the notification to the DOM\n\tdocument.body.appendChild(notification);\n\t// Force layout\n\t$tw.utils.forceLayout(notification);\n\t// Set final animated styles\n\t$tw.utils.setStyle(notification,[\n\t\t{opacity: \"1.0\"},\n\t\t{transform: \"translateY(0px)\"}\n\t]);\n\t// Set a timer to remove the notification\n\twindow.setTimeout(function() {\n\t\t// Force layout and animate the notification away\n\t\t$tw.utils.forceLayout(notification);\n\t\t$tw.utils.setStyle(notification,[\n\t\t\t{opacity: \"0.0\"},\n\t\t\t{transform: \"translateX(\" + (notification.offsetWidth) + \"px)\"}\n\t\t]);\n\t\t// Remove the modal message from the DOM once the transition ends\n\t\tsetTimeout(function() {\n\t\t\tif(notification.parentNode) {\n\t\t\t\tdocument.body.removeChild(notification);\n\t\t\t}\n\t\t},duration);\n\t},$tw.config.preferences.notificationDuration);\n};\n\nexports.Notifier = Notifier;\n\n})();\n",
"title": "$:/core/modules/utils/dom/notifier.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/popup.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/popup.js\ntype: application/javascript\nmodule-type: utils\n\nModule that creates a $tw.utils.Popup object prototype that manages popups in the browser\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreates a Popup object with these options:\n\trootElement: the DOM element to which the popup zapper should be attached\n*/\nvar Popup = function(options) {\n\toptions = options || {};\n\tthis.rootElement = options.rootElement || document.documentElement;\n\tthis.popups = []; // Array of {title:,wiki:,domNode:} objects\n};\n\n/*\nTrigger a popup open or closed. Parameters are in a hashmap:\n\ttitle: title of the tiddler where the popup details are stored\n\tdomNode: dom node to which the popup will be positioned\n\twiki: wiki\n\tforce: if specified, forces the popup state to true or false (instead of toggling it)\n*/\nPopup.prototype.triggerPopup = function(options) {\n\t// Check if this popup is already active\n\tvar index = -1;\n\tfor(var t=0; t<this.popups.length; t++) {\n\t\tif(this.popups[t].title === options.title) {\n\t\t\tindex = t;\n\t\t}\n\t}\n\t// Compute the new state\n\tvar state = index === -1;\n\tif(options.force !== undefined) {\n\t\tstate = options.force;\n\t}\n\t// Show or cancel the popup according to the new state\n\tif(state) {\n\t\tthis.show(options);\n\t} else {\n\t\tthis.cancel(index);\n\t}\n};\n\nPopup.prototype.handleEvent = function(event) {\n\tif(event.type === \"click\") {\n\t\t// Find out what was clicked on\n\t\tvar info = this.popupInfo(event.target),\n\t\t\tcancelLevel = info.popupLevel - 1;\n\t\t// Don't remove the level that was clicked on if we clicked on a handle\n\t\tif(info.isHandle) {\n\t\t\tcancelLevel++;\n\t\t}\n\t\t// Cancel\n\t\tthis.cancel(cancelLevel);\n\t}\n};\n\n/*\nFind the popup level containing a DOM node. Returns:\npopupLevel: count of the number of nested popups containing the specified element\nisHandle: true if the specified element is within a popup handle\n*/\nPopup.prototype.popupInfo = function(domNode) {\n\tvar isHandle = false,\n\t\tpopupCount = 0,\n\t\tnode = domNode;\n\t// First check ancestors to see if we're within a popup handle\n\twhile(node) {\n\t\tif($tw.utils.hasClass(node,\"tc-popup-handle\")) {\n\t\t\tisHandle = true;\n\t\t\tpopupCount++;\n\t\t}\n\t\tif($tw.utils.hasClass(node,\"tc-popup-keep\")) {\n\t\t\tisHandle = true;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\t// Then count the number of ancestor popups\n\tnode = domNode;\n\twhile(node) {\n\t\tif($tw.utils.hasClass(node,\"tc-popup\")) {\n\t\t\tpopupCount++;\n\t\t}\n\t\tnode = node.parentNode;\n\t}\n\tvar info = {\n\t\tpopupLevel: popupCount,\n\t\tisHandle: isHandle\n\t};\n\treturn info;\n};\n\n/*\nDisplay a popup by adding it to the stack\n*/\nPopup.prototype.show = function(options) {\n\t// Find out what was clicked on\n\tvar info = this.popupInfo(options.domNode);\n\t// Cancel any higher level popups\n\tthis.cancel(info.popupLevel);\n\t// Store the popup details\n\tthis.popups.push({\n\t\ttitle: options.title,\n\t\twiki: options.wiki,\n\t\tdomNode: options.domNode\n\t});\n\t// Set the state tiddler\n\toptions.wiki.setTextReference(options.title,\n\t\t\t\"(\" + options.domNode.offsetLeft + \",\" + options.domNode.offsetTop + \",\" + \n\t\t\t\toptions.domNode.offsetWidth + \",\" + options.domNode.offsetHeight + \")\");\n\t// Add the click handler if we have any popups\n\tif(this.popups.length > 0) {\n\t\tthis.rootElement.addEventListener(\"click\",this,true);\t\t\n\t}\n};\n\n/*\nCancel all popups at or above a specified level or DOM node\nlevel: popup level to cancel (0 cancels all popups)\n*/\nPopup.prototype.cancel = function(level) {\n\tvar numPopups = this.popups.length;\n\tlevel = Math.max(0,Math.min(level,numPopups));\n\tfor(var t=level; t<numPopups; t++) {\n\t\tvar popup = this.popups.pop();\n\t\tif(popup.title) {\n\t\t\tpopup.wiki.deleteTiddler(popup.title);\n\t\t}\n\t}\n\tif(this.popups.length === 0) {\n\t\tthis.rootElement.removeEventListener(\"click\",this,false);\n\t}\n};\n\n/*\nReturns true if the specified title and text identifies an active popup\n*/\nPopup.prototype.readPopupState = function(text) {\n\tvar popupLocationRegExp = /^\\((-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+)\\)$/;\n\treturn popupLocationRegExp.test(text);\n};\n\nexports.Popup = Popup;\n\n})();\n",
"title": "$:/core/modules/utils/dom/popup.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/dom/scroller.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/dom/scroller.js\ntype: application/javascript\nmodule-type: utils\n\nModule that creates a $tw.utils.Scroller object prototype that manages scrolling in the browser\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nEvent handler for when the `tm-scroll` event hits the document body\n*/\nvar PageScroller = function() {\n\tthis.idRequestFrame = null;\n\tthis.requestAnimationFrame = window.requestAnimationFrame ||\n\t\twindow.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame ||\n\t\tfunction(callback) {\n\t\t\treturn window.setTimeout(callback, 1000/60);\n\t\t};\n\tthis.cancelAnimationFrame = window.cancelAnimationFrame ||\n\t\twindow.webkitCancelAnimationFrame ||\n\t\twindow.webkitCancelRequestAnimationFrame ||\n\t\twindow.mozCancelAnimationFrame ||\n\t\twindow.mozCancelRequestAnimationFrame ||\n\t\tfunction(id) {\n\t\t\twindow.clearTimeout(id);\n\t\t};\n};\n\nPageScroller.prototype.cancelScroll = function() {\n\tif(this.idRequestFrame) {\n\t\tthis.cancelAnimationFrame.call(window,this.idRequestFrame);\n\t\tthis.idRequestFrame = null;\n\t}\n};\n\n/*\nHandle an event\n*/\nPageScroller.prototype.handleEvent = function(event) {\n\tif(event.type === \"tm-scroll\") {\n\t\treturn this.scrollIntoView(event.target);\n\t}\n\treturn true;\n};\n\n/*\nHandle a scroll event hitting the page document\n*/\nPageScroller.prototype.scrollIntoView = function(element) {\n\tvar duration = $tw.utils.getAnimationDuration();\n\t// Now get ready to scroll the body\n\tthis.cancelScroll();\n\tthis.startTime = Date.now();\n\tvar scrollPosition = $tw.utils.getScrollPosition();\n\t// Get the client bounds of the element and adjust by the scroll position\n\tvar clientBounds = element.getBoundingClientRect(),\n\t\tbounds = {\n\t\t\tleft: clientBounds.left + scrollPosition.x,\n\t\t\ttop: clientBounds.top + scrollPosition.y,\n\t\t\twidth: clientBounds.width,\n\t\t\theight: clientBounds.height\n\t\t};\n\t// We'll consider the horizontal and vertical scroll directions separately via this function\n\tvar getEndPos = function(targetPos,targetSize,currentPos,currentSize) {\n\t\t\t// If the target is above/left of the current view, then scroll to it's top/left\n\t\t\tif(targetPos <= currentPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// If the target is smaller than the window and the scroll position is too far up, then scroll till the target is at the bottom of the window\n\t\t\t} else if(targetSize < currentSize && currentPos < (targetPos + targetSize - currentSize)) {\n\t\t\t\treturn targetPos + targetSize - currentSize;\n\t\t\t// If the target is big, then just scroll to the top\n\t\t\t} else if(currentPos < targetPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// Otherwise, stay where we are\n\t\t\t} else {\n\t\t\t\treturn currentPos;\n\t\t\t}\n\t\t},\n\t\tendX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth),\n\t\tendY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight);\n\t// Only scroll if necessary\n\tif(endX !== scrollPosition.x || endY !== scrollPosition.y) {\n\t\tvar self = this,\n\t\t\tdrawFrame;\n\t\tdrawFrame = function () {\n\t\t\tvar t;\n\t\t\tif(duration <= 0) {\n\t\t\t\tt = 1;\n\t\t\t} else {\n\t\t\t\tt = ((Date.now()) - self.startTime) / duration;\t\n\t\t\t}\n\t\t\tif(t >= 1) {\n\t\t\t\tself.cancelScroll();\n\t\t\t\tt = 1;\n\t\t\t}\n\t\t\tt = $tw.utils.slowInSlowOut(t);\n\t\t\twindow.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y) * t);\n\t\t\tif(t < 1) {\n\t\t\t\tself.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);\n\t\t\t}\n\t\t};\n\t\tdrawFrame();\n\t}\n};\n\nexports.PageScroller = PageScroller;\n\n})();\n",
"title": "$:/core/modules/utils/dom/scroller.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/edition-info.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/edition-info.js\ntype: application/javascript\nmodule-type: utils-node\n\nInformation about the available editions\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n\tpath = require(\"path\");\n\nvar editionInfo;\n\nexports.getEditionInfo = function() {\n\tif(!editionInfo) {\n\t\t// Enumerate the edition paths\n\t\tvar editionPaths = $tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar);\n\t\teditionInfo = {};\n\t\tfor(var editionIndex=0; editionIndex<editionPaths.length; editionIndex++) {\n\t\t\tvar editionPath = editionPaths[editionIndex];\n\t\t\t// Enumerate the folders\n\t\t\tvar entries = fs.readdirSync(editionPath);\n\t\t\tfor(var entryIndex=0; entryIndex<entries.length; entryIndex++) {\n\t\t\t\tvar entry = entries[entryIndex];\n\t\t\t\t// Check if directories have a valid tiddlywiki.info\n\t\t\t\tif(!editionInfo[entry] && $tw.utils.isDirectory(path.resolve(editionPath,entry))) {\n\t\t\t\t\tvar info;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tinfo = JSON.parse(fs.readFileSync(path.resolve(editionPath,entry,\"tiddlywiki.info\"),\"utf8\"));\n\t\t\t\t\t} catch(ex) {\n\t\t\t\t\t}\n\t\t\t\t\tif(info) {\n\t\t\t\t\t\teditionInfo[entry] = info;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn editionInfo;\n};\n\n})();\n",
"title": "$:/core/modules/utils/edition-info.js",
"type": "application/javascript",
"module-type": "utils-node"
},
"$:/core/modules/utils/fakedom.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/fakedom.js\ntype: application/javascript\nmodule-type: global\n\nA barebones implementation of DOM interfaces needed by the rendering mechanism.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Sequence number used to enable us to track objects for testing\nvar sequenceNumber = null;\n\nvar bumpSequenceNumber = function(object) {\n\tif(sequenceNumber !== null) {\n\t\tobject.sequenceNumber = sequenceNumber++;\n\t}\n};\n\nvar TW_TextNode = function(text) {\n\tbumpSequenceNumber(this);\n\tthis.textContent = text;\n};\n\nObject.defineProperty(TW_TextNode.prototype, \"formattedTextContent\", {\n\tget: function() {\n\t\treturn this.textContent.replace(/(\\r?\\n)/g,\"\");\n\t}\n});\n\nvar TW_Element = function(tag,namespace) {\n\tbumpSequenceNumber(this);\n\tthis.isTiddlyWikiFakeDom = true;\n\tthis.tag = tag;\n\tthis.attributes = {};\n\tthis.isRaw = false;\n\tthis.children = [];\n\tthis.style = {};\n\tthis.namespaceURI = namespace || \"http://www.w3.org/1999/xhtml\";\n};\n\nTW_Element.prototype.setAttribute = function(name,value) {\n\tif(this.isRaw) {\n\t\tthrow \"Cannot setAttribute on a raw TW_Element\";\n\t}\n\tthis.attributes[name] = value;\n};\n\nTW_Element.prototype.setAttributeNS = function(namespace,name,value) {\n\tthis.setAttribute(name,value);\n};\n\nTW_Element.prototype.removeAttribute = function(name) {\n\tif(this.isRaw) {\n\t\tthrow \"Cannot removeAttribute on a raw TW_Element\";\n\t}\n\tif($tw.utils.hop(this.attributes,name)) {\n\t\tdelete this.attributes[name];\n\t}\n};\n\nTW_Element.prototype.appendChild = function(node) {\n\tthis.children.push(node);\n\tnode.parentNode = this;\n};\n\nTW_Element.prototype.insertBefore = function(node,nextSibling) {\n\tif(nextSibling) {\n\t\tvar p = this.children.indexOf(nextSibling);\n\t\tif(p !== -1) {\n\t\t\tthis.children.splice(p,0,node);\n\t\t\tnode.parentNode = this;\n\t\t} else {\n\t\t\tthis.appendChild(node);\n\t\t}\n\t} else {\n\t\tthis.appendChild(node);\n\t}\n};\n\nTW_Element.prototype.removeChild = function(node) {\n\tvar p = this.children.indexOf(node);\n\tif(p !== -1) {\n\t\tthis.children.splice(p,1);\n\t}\n};\n\nTW_Element.prototype.hasChildNodes = function() {\n\treturn !!this.children.length;\n};\n\nObject.defineProperty(TW_Element.prototype, \"firstChild\", {\n\tget: function() {\n\t\treturn this.children[0];\n\t}\n});\n\nTW_Element.prototype.addEventListener = function(type,listener,useCapture) {\n\t// Do nothing\n};\n\nObject.defineProperty(TW_Element.prototype, \"className\", {\n\tget: function() {\n\t\treturn this.attributes[\"class\"] || \"\";\n\t},\n\tset: function(value) {\n\t\tthis.attributes[\"class\"] = value;\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"value\", {\n\tget: function() {\n\t\treturn this.attributes.value || \"\";\n\t},\n\tset: function(value) {\n\t\tthis.attributes.value = value;\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"outerHTML\", {\n\tget: function() {\n\t\tvar output = [],attr,a,v;\n\t\toutput.push(\"<\",this.tag);\n\t\tif(this.attributes) {\n\t\t\tattr = [];\n\t\t\tfor(a in this.attributes) {\n\t\t\t\tattr.push(a);\n\t\t\t}\n\t\t\tattr.sort();\n\t\t\tfor(a=0; a<attr.length; a++) {\n\t\t\t\tv = this.attributes[attr[a]];\n\t\t\t\tif(v !== undefined) {\n\t\t\t\t\toutput.push(\" \",attr[a],\"='\",$tw.utils.htmlEncode(v),\"'\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(this.style) {\n\t\t\tvar style = [];\n\t\t\tfor(var s in this.style) {\n\t\t\t\tstyle.push(s + \":\" + this.style[s] + \";\");\n\t\t\t}\n\t\t\tif(style.length > 0) {\n\t\t\t\toutput.push(\" style='\",style.join(\"\"),\"'\")\n\t\t\t}\n\t\t}\n\t\toutput.push(\">\");\n\t\tif($tw.config.htmlVoidElements.indexOf(this.tag) === -1) {\n\t\t\toutput.push(this.innerHTML);\n\t\t\toutput.push(\"</\",this.tag,\">\");\n\t\t}\n\t\treturn output.join(\"\");\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"innerHTML\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\treturn this.rawHTML;\n\t\t} else {\n\t\t\tvar b = [];\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tif(node instanceof TW_Element) {\n\t\t\t\t\tb.push(node.outerHTML);\n\t\t\t\t} else if(node instanceof TW_TextNode) {\n\t\t\t\t\tb.push($tw.utils.htmlEncode(node.textContent));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn b.join(\"\");\n\t\t}\n\t},\n\tset: function(value) {\n\t\tthis.isRaw = true;\n\t\tthis.rawHTML = value;\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"textContent\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\tthrow \"Cannot get textContent on a raw TW_Element\";\n\t\t} else {\n\t\t\tvar b = [];\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tb.push(node.textContent);\n\t\t\t});\n\t\t\treturn b.join(\"\");\n\t\t}\n\t},\n\tset: function(value) {\n\t\tthis.children = [new TW_TextNode(value)];\n\t}\n});\n\nObject.defineProperty(TW_Element.prototype, \"formattedTextContent\", {\n\tget: function() {\n\t\tif(this.isRaw) {\n\t\t\tthrow \"Cannot get formattedTextContent on a raw TW_Element\";\n\t\t} else {\n\t\t\tvar b = [],\n\t\t\t\tisBlock = $tw.config.htmlBlockElements.indexOf(this.tag) !== -1;\n\t\t\tif(isBlock) {\n\t\t\t\tb.push(\"\\n\");\n\t\t\t}\n\t\t\tif(this.tag === \"li\") {\n\t\t\t\tb.push(\"* \");\n\t\t\t}\n\t\t\t$tw.utils.each(this.children,function(node) {\n\t\t\t\tb.push(node.formattedTextContent);\n\t\t\t});\n\t\t\tif(isBlock) {\n\t\t\t\tb.push(\"\\n\");\n\t\t\t}\n\t\t\treturn b.join(\"\");\n\t\t}\n\t}\n});\n\nvar document = {\n\tsetSequenceNumber: function(value) {\n\t\tsequenceNumber = value;\n\t},\n\tcreateElementNS: function(namespace,tag) {\n\t\treturn new TW_Element(tag,namespace);\n\t},\n\tcreateElement: function(tag) {\n\t\treturn new TW_Element(tag);\n\t},\n\tcreateTextNode: function(text) {\n\t\treturn new TW_TextNode(text);\n\t},\n\tcompatMode: \"CSS1Compat\", // For KaTeX to know that we're not a browser in quirks mode\n\tisTiddlyWikiFakeDom: true\n};\n\nexports.fakeDocument = document;\n\n})();\n",
"title": "$:/core/modules/utils/fakedom.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/utils/filesystem.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/filesystem.js\ntype: application/javascript\nmodule-type: utils-node\n\nFile system utilities\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar fs = require(\"fs\"),\n\tpath = require(\"path\");\n\n/*\nRecursively (and synchronously) copy a directory and all its content\n*/\nexports.copyDirectory = function(srcPath,dstPath) {\n\t// Remove any trailing path separators\n\tsrcPath = $tw.utils.removeTrailingSeparator(srcPath);\n\tdstPath = $tw.utils.removeTrailingSeparator(dstPath);\n\t// Create the destination directory\n\tvar err = $tw.utils.createDirectory(dstPath);\n\tif(err) {\n\t\treturn err;\n\t}\n\t// Function to copy a folder full of files\n\tvar copy = function(srcPath,dstPath) {\n\t\tvar srcStats = fs.lstatSync(srcPath),\n\t\t\tdstExists = fs.existsSync(dstPath);\n\t\tif(srcStats.isFile()) {\n\t\t\t$tw.utils.copyFile(srcPath,dstPath);\n\t\t} else if(srcStats.isDirectory()) {\n\t\t\tvar items = fs.readdirSync(srcPath);\n\t\t\tfor(var t=0; t<items.length; t++) {\n\t\t\t\tvar item = items[t],\n\t\t\t\t\terr = copy(srcPath + path.sep + item,dstPath + path.sep + item);\n\t\t\t\tif(err) {\n\t\t\t\t\treturn err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tcopy(srcPath,dstPath);\n\treturn null;\n};\n\n/*\nCopy a file\n*/\nvar FILE_BUFFER_LENGTH = 64 * 1024,\n\tfileBuffer;\n\nexports.copyFile = function(srcPath,dstPath) {\n\t// Create buffer if required\n\tif(!fileBuffer) {\n\t\tfileBuffer = new Buffer(FILE_BUFFER_LENGTH);\n\t}\n\t// Create any directories in the destination\n\t$tw.utils.createDirectory(path.dirname(dstPath));\n\t// Copy the file\n\tvar srcFile = fs.openSync(srcPath,\"r\"),\n\t\tdstFile = fs.openSync(dstPath,\"w\"),\n\t\tbytesRead = 1,\n\t\tpos = 0;\n\twhile (bytesRead > 0) {\n\t\tbytesRead = fs.readSync(srcFile,fileBuffer,0,FILE_BUFFER_LENGTH,pos);\n\t\tfs.writeSync(dstFile,fileBuffer,0,bytesRead);\n\t\tpos += bytesRead;\n\t}\n\tfs.closeSync(srcFile);\n\tfs.closeSync(dstFile);\n\treturn null;\n};\n\n/*\nRemove trailing path separator\n*/\nexports.removeTrailingSeparator = function(dirPath) {\n\tvar len = dirPath.length;\n\tif(dirPath.charAt(len-1) === path.sep) {\n\t\tdirPath = dirPath.substr(0,len-1);\n\t}\n\treturn dirPath;\n};\n\n/*\nRecursively create a directory\n*/\nexports.createDirectory = function(dirPath) {\n\tif(dirPath.substr(dirPath.length-1,1) !== path.sep) {\n\t\tdirPath = dirPath + path.sep;\n\t}\n\tvar pos = 1;\n\tpos = dirPath.indexOf(path.sep,pos);\n\twhile(pos !== -1) {\n\t\tvar subDirPath = dirPath.substr(0,pos);\n\t\tif(!$tw.utils.isDirectory(subDirPath)) {\n\t\t\ttry {\n\t\t\t\tfs.mkdirSync(subDirPath);\n\t\t\t} catch(e) {\n\t\t\t\treturn \"Error creating directory '\" + subDirPath + \"'\";\n\t\t\t}\n\t\t}\n\t\tpos = dirPath.indexOf(path.sep,pos + 1);\n\t}\n\treturn null;\n};\n\n/*\nRecursively create directories needed to contain a specified file\n*/\nexports.createFileDirectories = function(filePath) {\n\treturn $tw.utils.createDirectory(path.dirname(filePath));\n};\n\n/*\nRecursively delete a directory\n*/\nexports.deleteDirectory = function(dirPath) {\n\tif(fs.existsSync(dirPath)) {\n\t\tvar entries = fs.readdirSync(dirPath);\n\t\tfor(var entryIndex=0; entryIndex<entries.length; entryIndex++) {\n\t\t\tvar currPath = dirPath + path.sep + entries[entryIndex];\n\t\t\tif(fs.lstatSync(currPath).isDirectory()) {\n\t\t\t\t$tw.utils.deleteDirectory(currPath);\n\t\t\t} else {\n\t\t\t\tfs.unlinkSync(currPath);\n\t\t\t}\n\t\t}\n\tfs.rmdirSync(dirPath);\n\t}\n\treturn null;\n};\n\n/*\nCheck if a path identifies a directory\n*/\nexports.isDirectory = function(dirPath) {\n\treturn fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();\n};\n\n/*\nCheck if a path identifies a directory that is empty\n*/\nexports.isDirectoryEmpty = function(dirPath) {\n\tif(!$tw.utils.isDirectory(dirPath)) {\n\t\treturn false;\n\t}\n\tvar files = fs.readdirSync(dirPath),\n\t\tempty = true;\n\t$tw.utils.each(files,function(file,index) {\n\t\tif(file.charAt(0) !== \".\") {\n\t\t\tempty = false;\n\t\t}\n\t});\n\treturn empty;\n};\n\n})();\n",
"title": "$:/core/modules/utils/filesystem.js",
"type": "application/javascript",
"module-type": "utils-node"
},
"$:/core/modules/utils/logger.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/logger.js\ntype: application/javascript\nmodule-type: utils\n\nA basic logging implementation\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar ALERT_TAG = \"$:/tags/Alert\";\n\n/*\nMake a new logger\n*/\nfunction Logger(componentName) {\n\tthis.componentName = componentName || \"\";\n}\n\n/*\nLog a message\n*/\nLogger.prototype.log = function(/* args */) {\n\tif(console !== undefined && console.log !== undefined) {\n\t\treturn Function.apply.call(console.log, console, [this.componentName + \":\"].concat(Array.prototype.slice.call(arguments,0)));\n\t}\n};\n\n/*\nAlert a message\n*/\nLogger.prototype.alert = function(/* args */) {\n\t// Prepare the text of the alert\n\tvar text = Array.prototype.join.call(arguments,\" \");\n\t// Check if there is an existing alert with the same text and the same component\n\tvar existingAlerts = $tw.wiki.getTiddlersWithTag(ALERT_TAG),\n\t\talertFields,\n\t\texistingCount,\n\t\tself = this;\n\t$tw.utils.each(existingAlerts,function(title) {\n\t\tvar tiddler = $tw.wiki.getTiddler(title);\n\t\tif(tiddler.fields.text === text && tiddler.fields.component === self.componentName && tiddler.fields.modified && (!alertFields || tiddler.fields.modified < alertFields.modified)) {\n\t\t\t\talertFields = $tw.utils.extend({},tiddler.fields);\n\t\t}\n\t});\n\tif(alertFields) {\n\t\texistingCount = alertFields.count || 1;\n\t} else {\n\t\talertFields = {\n\t\t\ttitle: $tw.wiki.generateNewTitle(\"$:/temp/alerts/alert\",{prefix: \"\"}),\n\t\t\ttext: text,\n\t\t\ttags: [ALERT_TAG],\n\t\t\tcomponent: this.componentName\n\t\t};\n\t\texistingCount = 0;\n\t}\n\talertFields.modified = new Date();\n\tif(++existingCount > 1) {\n\t\talertFields.count = existingCount;\n\t} else {\n\t\talertFields.count = undefined;\n\t}\n\t$tw.wiki.addTiddler(new $tw.Tiddler(alertFields));\n\t// Log it too\n\tthis.log.apply(this,Array.prototype.slice.call(arguments,0));\n};\n\nexports.Logger = Logger;\n\n})();\n",
"title": "$:/core/modules/utils/logger.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/parsetree.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/parsetree.js\ntype: application/javascript\nmodule-type: utils\n\nParse tree utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nexports.addAttributeToParseTreeNode = function(node,name,value) {\n\tnode.attributes = node.attributes || {};\n\tnode.attributes[name] = {type: \"string\", value: value};\n};\n\nexports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {\n\tif(node.attributes && node.attributes[name] && node.attributes[name].value !== undefined) {\n\t\treturn node.attributes[name].value;\n\t}\n\treturn defaultValue;\n};\n\nexports.addClassToParseTreeNode = function(node,classString) {\n\tvar classes = [];\n\tnode.attributes = node.attributes || {};\n\tnode.attributes[\"class\"] = node.attributes[\"class\"] || {type: \"string\", value: \"\"};\n\tif(node.attributes[\"class\"].type === \"string\") {\n\t\tif(node.attributes[\"class\"].value !== \"\") {\n\t\t\tclasses = node.attributes[\"class\"].value.split(\" \");\n\t\t}\n\t\tif(classString !== \"\") {\n\t\t\t$tw.utils.pushTop(classes,classString.split(\" \"));\n\t\t}\n\t\tnode.attributes[\"class\"].value = classes.join(\" \");\n\t}\n};\n\nexports.addStyleToParseTreeNode = function(node,name,value) {\n\t\tnode.attributes = node.attributes || {};\n\t\tnode.attributes.style = node.attributes.style || {type: \"string\", value: \"\"};\n\t\tif(node.attributes.style.type === \"string\") {\n\t\t\tnode.attributes.style.value += name + \":\" + value + \";\";\n\t\t}\n};\n\nexports.findParseTreeNode = function(nodeArray,search) {\n\tfor(var t=0; t<nodeArray.length; t++) {\n\t\tif(nodeArray[t].type === search.type && nodeArray[t].tag === search.tag) {\n\t\t\treturn nodeArray[t];\n\t\t}\n\t}\n\treturn undefined;\n};\n\n})();\n",
"title": "$:/core/modules/utils/parsetree.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/performance.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/performance.js\ntype: application/javascript\nmodule-type: global\n\nPerformance measurement.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nfunction Performance(enabled) {\n\tthis.enabled = !!enabled;\n\tthis.measures = {}; // Hashmap of current values of measurements\n\tthis.logger = new $tw.utils.Logger(\"performance\");\n}\n\n/*\nWrap performance reporting around a top level function\n*/\nPerformance.prototype.report = function(name,fn) {\n\tvar self = this;\n\tif(this.enabled) {\n\t\treturn function() {\n\t\t\tself.measures = {};\n\t\t\tvar startTime = $tw.utils.timer(),\n\t\t\t\tresult = fn.apply(this,arguments);\n\t\t\tself.logger.log(name + \": \" + $tw.utils.timer(startTime) + \"ms\");\n\t\t\tfor(var m in self.measures) {\n\t\t\t\tself.logger.log(\"+\" + m + \": \" + self.measures[m] + \"ms\");\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t} else {\n\t\treturn fn;\n\t}\n};\n\n/*\nWrap performance measurements around a subfunction\n*/\nPerformance.prototype.measure = function(name,fn) {\n\tvar self = this;\n\tif(this.enabled) {\n\t\treturn function() {\n\t\t\tvar startTime = $tw.utils.timer(),\n\t\t\t\tresult = fn.apply(this,arguments),\n\t\t\t\tvalue = self.measures[name] || 0;\n\t\t\tself.measures[name] = value + $tw.utils.timer(startTime);\n\t\t\treturn result;\n\t\t};\n\t} else {\n\t\treturn fn;\n\t}\n};\n\nexports.Performance = Performance;\n\n})();\n",
"title": "$:/core/modules/utils/performance.js",
"type": "application/javascript",
"module-type": "global"
},
"$:/core/modules/utils/pluginmaker.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/pluginmaker.js\ntype: application/javascript\nmodule-type: utils\n\nA quick and dirty way to pack up plugins within the browser.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nRepack a plugin, and then delete any non-shadow payload tiddlers\n*/\nexports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {\n\tadditionalTiddlers = additionalTiddlers || [];\n\texcludeTiddlers = excludeTiddlers || [];\n\t// Get the plugin tiddler\n\tvar pluginTiddler = $tw.wiki.getTiddler(title);\n\tif(!pluginTiddler) {\n\t\tthrow \"No such tiddler as \" + title;\n\t}\n\t// Extract the JSON\n\tvar jsonPluginTiddler;\n\ttry {\n\t\tjsonPluginTiddler = JSON.parse(pluginTiddler.fields.text);\n\t} catch(e) {\n\t\tthrow \"Cannot parse plugin tiddler \" + title + \"\\nError: \" + e;\n\t}\n\t// Get the list of tiddlers\n\tvar tiddlers = Object.keys(jsonPluginTiddler.tiddlers);\n\t// Add the additional tiddlers\n\t$tw.utils.pushTop(tiddlers,additionalTiddlers);\n\t// Remove any excluded tiddlers\n\tfor(var t=tiddlers.length-1; t>=0; t--) {\n\t\tif(excludeTiddlers.indexOf(tiddlers[t]) !== -1) {\n\t\t\ttiddlers.splice(t,1);\n\t\t}\n\t}\n\t// Pack up the tiddlers into a block of JSON\n\tvar plugins = {};\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = $tw.wiki.getTiddler(title),\n\t\t\tfields = {};\n\t\t$tw.utils.each(tiddler.fields,function (value,name) {\n\t\t\tfields[name] = tiddler.getFieldString(name);\n\t\t});\n\t\tplugins[title] = fields;\n\t});\n\t// Retrieve and bump the version number\n\tvar pluginVersion = $tw.utils.parseVersion(pluginTiddler.getFieldString(\"version\") || \"0.0.0\") || {\n\t\t\tmajor: \"0\",\n\t\t\tminor: \"0\",\n\t\t\tpatch: \"0\"\n\t\t};\n\tpluginVersion.patch++;\n\tvar version = pluginVersion.major + \".\" + pluginVersion.minor + \".\" + pluginVersion.patch;\n\tif(pluginVersion.prerelease) {\n\t\tversion += \"-\" + pluginVersion.prerelease;\n\t}\n\tif(pluginVersion.build) {\n\t\tversion += \"+\" + pluginVersion.build;\n\t}\n\t// Save the tiddler\n\t$tw.wiki.addTiddler(new $tw.Tiddler(pluginTiddler,{text: JSON.stringify({tiddlers: plugins},null,4), version: version}));\n\t// Delete any non-shadow constituent tiddlers\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tif($tw.wiki.tiddlerExists(title)) {\n\t\t\t$tw.wiki.deleteTiddler(title);\n\t\t}\n\t});\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\t// Return a heartwarming confirmation\n\treturn \"Plugin \" + title + \" successfully saved\";\n};\n\n})();\n",
"title": "$:/core/modules/utils/pluginmaker.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/utils/utils.js": {
"text": "/*\\\ntitle: $:/core/modules/utils/utils.js\ntype: application/javascript\nmodule-type: utils\n\nVarious static utility functions.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nDisplay a warning, in colour if we're on a terminal\n*/\nexports.warning = function(text) {\n\tconsole.log($tw.node ? \"\\x1b[1;33m\" + text + \"\\x1b[0m\" : text);\n}\n\n/*\nTrim whitespace from the start and end of a string\nThanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript\n*/\nexports.trim = function(str) {\n\tif(typeof str === \"string\") {\n\t\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t} else {\n\t\treturn str;\n\t}\n};\n\n/*\nReturn the number of keys in an object\n*/\nexports.count = function(object) {\n\tvar s = 0;\n\t$tw.utils.each(object,function() {s++;});\n\treturn s;\n};\n\n/*\nCheck if an array is equal by value and by reference.\n*/\nexports.isArrayEqual = function(array1,array2) {\n\tif(array1 === array2) {\n\t\treturn true;\n\t}\n\tarray1 = array1 || [];\n\tarray2 = array2 || [];\n\tif(array1.length !== array2.length) {\n\t\treturn false;\n\t}\n\treturn array1.every(function(value,index) {\n\t\treturn value === array2[index];\n\t});\n};\n\n/*\nPush entries onto an array, removing them first if they already exist in the array\n\tarray: array to modify (assumed to be free of duplicates)\n\tvalue: a single value to push or an array of values to push\n*/\nexports.pushTop = function(array,value) {\n\tvar t,p;\n\tif($tw.utils.isArray(value)) {\n\t\t// Remove any array entries that are duplicated in the new values\n\t\tif(value.length !== 0) {\n\t\t\tif(array.length !== 0) {\n\t\t\t\tif(value.length < array.length) {\n\t\t\t\t\tfor(t=0; t<value.length; t++) {\n\t\t\t\t\t\tp = array.indexOf(value[t]);\n\t\t\t\t\t\tif(p !== -1) {\n\t\t\t\t\t\t\tarray.splice(p,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor(t=array.length-1; t>=0; t--) {\n\t\t\t\t\t\tp = value.indexOf(array[t]);\n\t\t\t\t\t\tif(p !== -1) {\n\t\t\t\t\t\t\tarray.splice(t,1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Push the values on top of the main array\n\t\t\tarray.push.apply(array,value);\n\t\t}\n\t} else {\n\t\tp = array.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tarray.splice(p,1);\n\t\t}\n\t\tarray.push(value);\n\t}\n\treturn array;\n};\n\n/*\nRemove entries from an array\n\tarray: array to modify\n\tvalue: a single value to remove, or an array of values to remove\n*/\nexports.removeArrayEntries = function(array,value) {\n\tvar t,p;\n\tif($tw.utils.isArray(value)) {\n\t\tfor(t=0; t<value.length; t++) {\n\t\t\tp = array.indexOf(value[t]);\n\t\t\tif(p !== -1) {\n\t\t\t\tarray.splice(p,1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tp = array.indexOf(value);\n\t\tif(p !== -1) {\n\t\t\tarray.splice(p,1);\n\t\t}\n\t}\n};\n\n/*\nCheck whether any members of a hashmap are present in another hashmap\n*/\nexports.checkDependencies = function(dependencies,changes) {\n\tvar hit = false;\n\t$tw.utils.each(changes,function(change,title) {\n\t\tif($tw.utils.hop(dependencies,title)) {\n\t\t\thit = true;\n\t\t}\n\t});\n\treturn hit;\n};\n\nexports.extend = function(object /* [, src] */) {\n\t$tw.utils.each(Array.prototype.slice.call(arguments, 1), function(source) {\n\t\tif(source) {\n\t\t\tfor(var property in source) {\n\t\t\t\tobject[property] = source[property];\n\t\t\t}\n\t\t}\n\t});\n\treturn object;\n};\n\nexports.deepCopy = function(object) {\n\tvar result,t;\n\tif($tw.utils.isArray(object)) {\n\t\t// Copy arrays\n\t\tresult = object.slice(0);\n\t} else if(typeof object === \"object\") {\n\t\tresult = {};\n\t\tfor(t in object) {\n\t\t\tif(object[t] !== undefined) {\n\t\t\t\tresult[t] = $tw.utils.deepCopy(object[t]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult = object;\n\t}\n\treturn result;\n};\n\nexports.extendDeepCopy = function(object,extendedProperties) {\n\tvar result = $tw.utils.deepCopy(object),t;\n\tfor(t in extendedProperties) {\n\t\tif(extendedProperties[t] !== undefined) {\n\t\t\tresult[t] = $tw.utils.deepCopy(extendedProperties[t]);\n\t\t}\n\t}\n\treturn result;\n};\n\nexports.slowInSlowOut = function(t) {\n\treturn (1 - ((Math.cos(t * Math.PI) + 1) / 2));\n};\n\nexports.formatDateString = function(date,template) {\n\tvar result = \"\",\n\t\tt = template,\n\t\tmatches = [\n\t\t\t[/^0hh12/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getHours12(date));\n\t\t\t}],\n\t\t\t[/^wYYYY/, function() {\n\t\t\t\treturn $tw.utils.getYearForWeekNo(date);\n\t\t\t}],\n\t\t\t[/^hh12/, function() {\n\t\t\t\treturn $tw.utils.getHours12(date);\n\t\t\t}],\n\t\t\t[/^DDth/, function() {\n\t\t\t\treturn date.getDate() + $tw.utils.getDaySuffix(date);\n\t\t\t}],\n\t\t\t[/^YYYY/, function() {\n\t\t\t\treturn date.getFullYear();\n\t\t\t}],\n\t\t\t[/^0hh/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getHours());\n\t\t\t}],\n\t\t\t[/^0mm/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getMinutes());\n\t\t\t}],\n\t\t\t[/^0ss/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getSeconds());\n\t\t\t}],\n\t\t\t[/^0DD/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getDate());\n\t\t\t}],\n\t\t\t[/^0MM/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getMonth()+1);\n\t\t\t}],\n\t\t\t[/^0WW/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getWeek(date));\n\t\t\t}],\n\t\t\t[/^ddd/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Short/Day/\" + date.getDay());\n\t\t\t}],\n\t\t\t[/^mmm/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Short/Month/\" + (date.getMonth() + 1));\n\t\t\t}],\n\t\t\t[/^DDD/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Long/Day/\" + date.getDay());\n\t\t\t}],\n\t\t\t[/^MMM/, function() {\n\t\t\t\treturn $tw.language.getString(\"Date/Long/Month/\" + (date.getMonth() + 1));\n\t\t\t}],\n\t\t\t[/^TZD/, function() {\n\t\t\t\tvar tz = date.getTimezoneOffset(),\n\t\t\t\tatz = Math.abs(tz);\n\t\t\t\treturn (tz < 0 ? '+' : '-') + $tw.utils.pad(Math.floor(atz / 60)) + ':' + $tw.utils.pad(atz % 60);\n\t\t\t}],\n\t\t\t[/^wYY/, function() {\n\t\t\t\treturn $tw.utils.pad($tw.utils.getYearForWeekNo(date) - 2000);\n\t\t\t}],\n\t\t\t[/^[ap]m/, function() {\n\t\t\t\treturn $tw.utils.getAmPm(date).toLowerCase();\n\t\t\t}],\n\t\t\t[/^hh/, function() {\n\t\t\t\treturn date.getHours();\n\t\t\t}],\n\t\t\t[/^mm/, function() {\n\t\t\t\treturn date.getMinutes();\n\t\t\t}],\n\t\t\t[/^ss/, function() {\n\t\t\t\treturn date.getSeconds();\n\t\t\t}],\n\t\t\t[/^[AP]M/, function() {\n\t\t\t\treturn $tw.utils.getAmPm(date).toUpperCase();\n\t\t\t}],\n\t\t\t[/^DD/, function() {\n\t\t\t\treturn date.getDate();\n\t\t\t}],\n\t\t\t[/^MM/, function() {\n\t\t\t\treturn date.getMonth() + 1;\n\t\t\t}],\n\t\t\t[/^WW/, function() {\n\t\t\t\treturn $tw.utils.getWeek(date);\n\t\t\t}],\n\t\t\t[/^YY/, function() {\n\t\t\t\treturn $tw.utils.pad(date.getFullYear() - 2000);\n\t\t\t}]\n\t\t];\n\twhile(t.length){\n\t\tvar matchString = \"\";\n\t\t$tw.utils.each(matches, function(m) {\n\t\t\tvar match = m[0].exec(t);\n\t\t\tif(match) {\n\t\t\t\tmatchString = m[1].call();\n\t\t\t\tt = t.substr(match[0].length);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif(matchString) {\n\t\t\tresult += matchString;\n\t\t} else {\n\t\t\tresult += t.charAt(0);\n\t\t\tt = t.substr(1);\n\t\t}\n\t}\n\tresult = result.replace(/\\\\(.)/g,\"$1\");\n\treturn result;\n};\n\nexports.getAmPm = function(date) {\n\treturn $tw.language.getString(\"Date/Period/\" + (date.getHours() >= 12 ? \"pm\" : \"am\"));\n};\n\nexports.getDaySuffix = function(date) {\n\treturn $tw.language.getString(\"Date/DaySuffix/\" + date.getDate());\n};\n\nexports.getWeek = function(date) {\n\tvar dt = new Date(date.getTime());\n\tvar d = dt.getDay();\n\tif(d === 0) {\n\t\td = 7; // JavaScript Sun=0, ISO Sun=7\n\t}\n\tdt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week to calculate weekNo\n\tvar n = Math.floor((dt.getTime()-new Date(dt.getFullYear(),0,1) + 3600000) / 86400000);\n\treturn Math.floor(n / 7) + 1;\n};\n\nexports.getYearForWeekNo = function(date) {\n\tvar dt = new Date(date.getTime());\n\tvar d = dt.getDay();\n\tif(d === 0) {\n\t\td = 7; // JavaScript Sun=0, ISO Sun=7\n\t}\n\tdt.setTime(dt.getTime() + (4 - d) * 86400000);// shift day to Thurs of same week\n\treturn dt.getFullYear();\n};\n\nexports.getHours12 = function(date) {\n\tvar h = date.getHours();\n\treturn h > 12 ? h-12 : ( h > 0 ? h : 12 );\n};\n\n/*\nConvert a date delta in milliseconds into a string representation of \"23 seconds ago\", \"27 minutes ago\" etc.\n\tdelta: delta in milliseconds\nReturns an object with these members:\n\tdescription: string describing the delta period\n\tupdatePeriod: time in millisecond until the string will be inaccurate\n*/\nexports.getRelativeDate = function(delta) {\n\tvar futurep = false;\n\tif(delta < 0) {\n\t\tdelta = -1 * delta;\n\t\tfuturep = true;\n\t}\n\tvar units = [\n\t\t{name: \"Years\", duration: 365 * 24 * 60 * 60 * 1000},\n\t\t{name: \"Months\", duration: (365/12) * 24 * 60 * 60 * 1000},\n\t\t{name: \"Days\", duration: 24 * 60 * 60 * 1000},\n\t\t{name: \"Hours\", duration: 60 * 60 * 1000},\n\t\t{name: \"Minutes\", duration: 60 * 1000},\n\t\t{name: \"Seconds\", duration: 1000}\n\t];\n\tfor(var t=0; t<units.length; t++) {\n\t\tvar result = Math.floor(delta / units[t].duration);\n\t\tif(result >= 2) {\n\t\t\treturn {\n\t\t\t\tdelta: delta,\n\t\t\t\tdescription: $tw.language.getString(\n\t\t\t\t\t\"RelativeDate/\" + (futurep ? \"Future\" : \"Past\") + \"/\" + units[t].name,\n\t\t\t\t\t{variables:\n\t\t\t\t\t\t{period: result.toString()}\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t\tupdatePeriod: units[t].duration\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tdelta: delta,\n\t\tdescription: $tw.language.getString(\n\t\t\t\"RelativeDate/\" + (futurep ? \"Future\" : \"Past\") + \"/Second\",\n\t\t\t{variables:\n\t\t\t\t{period: \"1\"}\n\t\t\t}\n\t\t),\n\t\tupdatePeriod: 1000\n\t};\n};\n\n// Convert & to \"&\", < to \"<\", > to \">\" and \" to \""\"\nexports.htmlEncode = function(s) {\n\tif(s) {\n\t\treturn s.toString().replace(/&/mg,\"&\").replace(/</mg,\"<\").replace(/>/mg,\">\").replace(/\\\"/mg,\""\");\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\n// Converts all HTML entities to their character equivalents\nexports.entityDecode = function(s) {\n\tvar e = s.substr(1,s.length-2); // Strip the & and the ;\n\tif(e.charAt(0) === \"#\") {\n\t\tif(e.charAt(1) === \"x\" || e.charAt(1) === \"X\") {\n\t\t\treturn String.fromCharCode(parseInt(e.substr(2),16));\t\n\t\t} else {\n\t\t\treturn String.fromCharCode(parseInt(e.substr(1),10));\n\t\t}\n\t} else {\n\t\tvar c = $tw.config.htmlEntities[e];\n\t\tif(c) {\n\t\t\treturn String.fromCharCode(c);\n\t\t} else {\n\t\t\treturn s; // Couldn't convert it as an entity, just return it raw\n\t\t}\n\t}\n};\n\nexports.unescapeLineBreaks = function(s) {\n\treturn s.replace(/\\\\n/mg,\"\\n\").replace(/\\\\b/mg,\" \").replace(/\\\\s/mg,\"\\\\\").replace(/\\r/mg,\"\");\n};\n\n/*\n * Returns an escape sequence for given character. Uses \\x for characters <=\n * 0xFF to save space, \\u for the rest.\n *\n * The code needs to be in sync with th code template in the compilation\n * function for \"action\" nodes.\n */\n// Copied from peg.js, thanks to David Majda\nexports.escape = function(ch) {\n\tvar charCode = ch.charCodeAt(0);\n\tif(charCode <= 0xFF) {\n\t\treturn '\\\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase());\n\t} else {\n\t\treturn '\\\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);\n\t}\n};\n\n// Turns a string into a legal JavaScript string\n// Copied from peg.js, thanks to David Majda\nexports.stringify = function(s) {\n\t/*\n\t* ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a string\n\t* literal except for the closing quote character, backslash, carriage return,\n\t* line separator, paragraph separator, and line feed. Any character may\n\t* appear in the form of an escape sequence.\n\t*\n\t* For portability, we also escape escape all non-ASCII characters.\n\t*/\n\treturn s\n\t\t.replace(/\\\\/g, '\\\\\\\\') // backslash\n\t\t.replace(/\"/g, '\\\\\"') // double quote character\n\t\t.replace(/'/g, \"\\\\'\") // single quote character\n\t\t.replace(/\\r/g, '\\\\r') // carriage return\n\t\t.replace(/\\n/g, '\\\\n') // line feed\n\t\t.replace(/[\\x80-\\uFFFF]/g, exports.escape); // non-ASCII characters\n};\n\n/*\nEscape the RegExp special characters with a preceding backslash\n*/\nexports.escapeRegExp = function(s) {\n return s.replace(/[\\-\\/\\\\\\^\\$\\*\\+\\?\\.\\(\\)\\|\\[\\]\\{\\}]/g, '\\\\$&');\n};\n\n// Checks whether a link target is external, i.e. not a tiddler title\nexports.isLinkExternal = function(to) {\n\tvar externalRegExp = /(?:file|http|https|mailto|ftp|irc|news|data|skype):[^\\s<>{}\\[\\]`|'\"\\\\^~]+(?:\\/|\\b)/i;\n\treturn externalRegExp.test(to);\n};\n\nexports.nextTick = function(fn) {\n/*global window: false */\n\tif(typeof process === \"undefined\") {\n\t\t// Apparently it would be faster to use postMessage - http://dbaron.org/log/20100309-faster-timeouts\n\t\twindow.setTimeout(fn,4);\n\t} else {\n\t\tprocess.nextTick(fn);\n\t}\n};\n\n/*\nConvert a hyphenated CSS property name into a camel case one\n*/\nexports.unHyphenateCss = function(propName) {\n\treturn propName.replace(/-([a-z])/gi, function(match0,match1) {\n\t\treturn match1.toUpperCase();\n\t});\n};\n\n/*\nConvert a camelcase CSS property name into a dashed one (\"backgroundColor\" --> \"background-color\")\n*/\nexports.hyphenateCss = function(propName) {\n\treturn propName.replace(/([A-Z])/g, function(match0,match1) {\n\t\treturn \"-\" + match1.toLowerCase();\n\t});\n};\n\n/*\nParse a text reference of one of these forms:\n* title\n* !!field\n* title!!field\n* title##index\n* etc\nReturns an object with the following fields, all optional:\n* title: tiddler title\n* field: tiddler field name\n* index: JSON property index\n*/\nexports.parseTextReference = function(textRef) {\n\t// Separate out the title, field name and/or JSON indices\n\tvar reTextRef = /(?:(.*?)!!(.+))|(?:(.*?)##(.+))|(.*)/mg,\n\t\tmatch = reTextRef.exec(textRef),\n\t\tresult = {};\n\tif(match && reTextRef.lastIndex === textRef.length) {\n\t\t// Return the parts\n\t\tif(match[1]) {\n\t\t\tresult.title = match[1];\n\t\t}\n\t\tif(match[2]) {\n\t\t\tresult.field = match[2];\n\t\t}\n\t\tif(match[3]) {\n\t\t\tresult.title = match[3];\n\t\t}\n\t\tif(match[4]) {\n\t\t\tresult.index = match[4];\n\t\t}\n\t\tif(match[5]) {\n\t\t\tresult.title = match[5];\n\t\t}\n\t} else {\n\t\t// If we couldn't parse it\n\t\tresult.title = textRef\n\t}\n\treturn result;\n};\n\n/*\nChecks whether a string is a valid fieldname\n*/\nexports.isValidFieldName = function(name) {\n\tif(!name || typeof name !== \"string\") {\n\t\treturn false;\n\t}\n\tname = name.toLowerCase().trim();\n\tvar fieldValidatorRegEx = /^[a-z0-9\\-\\._]+$/mg;\n\treturn fieldValidatorRegEx.test(name);\n};\n\n/*\nExtract the version number from the meta tag or from the boot file\n*/\n\n// Browser version\nexports.extractVersionInfo = function() {\n\tif($tw.packageInfo) {\n\t\treturn $tw.packageInfo.version;\n\t} else {\n\t\tvar metatags = document.getElementsByTagName(\"meta\");\n\t\tfor(var t=0; t<metatags.length; t++) {\n\t\t\tvar m = metatags[t];\n\t\t\tif(m.name === \"tiddlywiki-version\") {\n\t\t\t\treturn m.content;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nGet the animation duration in ms\n*/\nexports.getAnimationDuration = function() {\n\treturn parseInt($tw.wiki.getTiddlerText(\"$:/config/AnimationDuration\",\"400\"),10);\n};\n\n/*\nHash a string to a number\nDerived from http://stackoverflow.com/a/15710692\n*/\nexports.hashString = function(str) {\n\treturn str.split(\"\").reduce(function(a,b) {\n\t\ta = ((a << 5) - a) + b.charCodeAt(0);\n\t\treturn a & a;\n\t},0);\n};\n\n/*\nDecode a base64 string\n*/\nexports.base64Decode = function(string64) {\n\tif($tw.browser) {\n\t\t// TODO\n\t\tthrow \"$tw.utils.base64Decode() doesn't work in the browser\";\n\t} else {\n\t\treturn (new Buffer(string64,\"base64\")).toString();\n\t}\n};\n\n/*\nConvert a hashmap into a tiddler dictionary format sequence of name:value pairs\n*/\nexports.makeTiddlerDictionary = function(data) {\n\tvar output = [];\n\tfor(var name in data) {\n\t\toutput.push(name + \": \" + data[name]);\n\t}\n\treturn output.join(\"\\n\");\n};\n\n/*\nHigh resolution microsecond timer for profiling\n*/\nexports.timer = function(base) {\n\tvar m;\n\tif($tw.node) {\n\t\tvar r = process.hrtime();\t\t\n\t\tm = r[0] * 1e3 + (r[1] / 1e6);\n\t} else if(window.performance) {\n\t\tm = performance.now();\n\t} else {\n\t\tm = Date.now();\n\t}\n\tif(typeof base !== \"undefined\") {\n\t\tm = m - base;\n\t}\n\treturn m;\n};\n\n})();",
"title": "$:/core/modules/utils/utils.js",
"type": "application/javascript",
"module-type": "utils"
},
"$:/core/modules/widgets/action-deletefield.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/action-deletefield.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to delete fields of a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DeleteFieldWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDeleteFieldWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDeleteFieldWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nDeleteFieldWidget.prototype.execute = function() {\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.actionField = this.getAttribute(\"$field\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nDeleteFieldWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$tiddler\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nDeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar self = this,\n\t\ttiddler = this.wiki.getTiddler(self.actionTiddler),\n\t\tremoveFields = {};\n\tif(this.actionField) {\n\t\tremoveFields[this.actionField] = undefined;\n\t}\n\tif(tiddler) {\n\t\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\t\tif(name.charAt(0) !== \"$\" && name !== \"title\") {\n\t\t\t\tremoveFields[name] = undefined;\n\t\t\t}\n\t\t});\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,removeFields));\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-deletefield\"] = DeleteFieldWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/action-deletefield.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/action-deletetiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/action-deletetiddler.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to delete a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DeleteTiddlerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDeleteTiddlerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDeleteTiddlerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nDeleteTiddlerWidget.prototype.execute = function() {\n\tthis.actionFilter = this.getAttribute(\"$filter\");\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nDeleteTiddlerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$filter\"] || changedAttributes[\"$tiddler\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nDeleteTiddlerWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar tiddlers = [];\n\tif(this.actionFilter) {\n\t\ttiddlers = this.wiki.filterTiddlers(this.actionFilter,this);\n\t}\n\tif(this.actionTiddler) {\n\t\ttiddlers.push(this.actionTiddler);\n\t}\n\tfor(var t=0; t<tiddlers.length; t++) {\n\t\tthis.wiki.deleteTiddler(tiddlers[t]);\n\t}\n\treturn true; // Action was invoked\n};\n\nexports[\"action-deletetiddler\"] = DeleteTiddlerWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/action-deletetiddler.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/action-navigate.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/action-navigate.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to navigate to a tiddler\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar NavigateWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nNavigateWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nNavigateWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nNavigateWidget.prototype.execute = function() {\n\tthis.actionTo = this.getAttribute(\"$to\");\n\tthis.actionScroll = this.getAttribute(\"$scroll\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nNavigateWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$to\"] || changedAttributes[\"$scroll\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nNavigateWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar bounds = triggeringWidget && triggeringWidget.getBoundingClientRect && triggeringWidget.getBoundingClientRect(),\n\t\tsuppressNavigation = event.metaKey || event.ctrlKey || (event.button === 1);\n\tif(this.actionScroll === \"yes\") {\n\t\tsuppressNavigation = false;\n\t} else if(this.actionScroll === \"no\") {\n\t\tsuppressNavigation = true;\n\t}\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.actionTo === undefined ? this.getVariable(\"currentTiddler\") : this.actionTo,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: triggeringWidget,\n\t\tnavigateFromClientRect: bounds && { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: suppressNavigation\n\t});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-navigate\"] = NavigateWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/action-navigate.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/action-sendmessage.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/action-sendmessage.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to send a message\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SendMessageWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSendMessageWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSendMessageWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nSendMessageWidget.prototype.execute = function() {\n\tthis.actionMessage = this.getAttribute(\"$message\");\n\tthis.actionParam = this.getAttribute(\"$param\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nSendMessageWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$message\"] || changedAttributes[\"$param\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nSendMessageWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\t// Get the string parameter\n\tvar param = this.actionParam;\n\t// Assemble the attributes as a hashmap\n\tvar paramObject = Object.create(null);\n\tvar count = 0;\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tparamObject[name] = attribute;\n\t\t\tcount++;\n\t\t}\n\t});\n\t// Dispatch the message\n\tthis.dispatchEvent({type: this.actionMessage, param: param, paramObject: paramObject, tiddlerTitle: this.getVariable(\"currentTiddler\")});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-sendmessage\"] = SendMessageWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/action-sendmessage.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/action-setfield.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/action-setfield.js\ntype: application/javascript\nmodule-type: widget\n\nAction widget to set a single field or index on a tiddler.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SetFieldWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSetFieldWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSetFieldWidget.prototype.render = function(parent,nextSibling) {\n\tthis.computeAttributes();\n\tthis.execute();\n};\n\n/*\nCompute the internal state of the widget\n*/\nSetFieldWidget.prototype.execute = function() {\n\tthis.actionTiddler = this.getAttribute(\"$tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.actionField = this.getAttribute(\"$field\");\n\tthis.actionIndex = this.getAttribute(\"$index\");\n\tthis.actionValue = this.getAttribute(\"$value\");\n};\n\n/*\nRefresh the widget by ensuring our attributes are up to date\n*/\nSetFieldWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"$tiddler\"] || changedAttributes[\"$field\"] || changedAttributes[\"$index\"] || changedAttributes[\"$value\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nInvoke the action associated with this widget\n*/\nSetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {\n\tvar self = this;\n\tif(typeof this.actionValue === \"string\") {\n\t\tthis.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue);\t\t\n\t}\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tself.wiki.setText(self.actionTiddler,name,undefined,attribute);\n\t\t}\n\t});\n\treturn true; // Action was invoked\n};\n\nexports[\"action-setfield\"] = SetFieldWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/action-setfield.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/browse.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/browse.js\ntype: application/javascript\nmodule-type: widget\n\nBrowse widget for browsing for files to import\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar BrowseWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nBrowseWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nBrowseWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"input\");\n\tdomNode.setAttribute(\"type\",\"file\");\n\tif(this.browseMultiple) {\n\t\tdomNode.setAttribute(\"multiple\",\"multiple\");\n\t}\n\tif(this.tooltip) {\n\t\tdomNode.setAttribute(\"title\",this.tooltip);\n\t}\n\tif(this.nwsaveas) {\n\t\tdomNode.setAttribute(\"nwsaveas\",this.nwsaveas);\n\t}\n\t// Add a click event handler\n\tdomNode.addEventListener(\"change\",function (event) {\n\t\tif(self.message) {\n\t\t\tself.dispatchEvent({type: self.message, param: self.param, files: event.target.files});\n\t\t} else {\n\t\t\tself.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {\n\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t\t\t});\n\t\t}\n\t\treturn false;\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nBrowseWidget.prototype.execute = function() {\n\tthis.browseMultiple = this.getAttribute(\"multiple\");\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis.nwsaveas = this.getAttribute(\"nwsaveas\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nBrowseWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.browse = BrowseWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/browse.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/button.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/button.js\ntype: application/javascript\nmodule-type: widget\n\nButton widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ButtonWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nButtonWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nButtonWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"button\");\n\t// Assign classes\n\tvar classes = this[\"class\"].split(\" \") || [],\n\t\tisPoppedUp = this.popup && this.isPoppedUp();\n\tif(this.selectedClass) {\n\t\tif(this.set && this.setTo && this.isSelected()) {\n\t\t\t$tw.utils.pushTop(classes,this.selectedClass.split(\" \"));\n\t\t}\n\t\tif(isPoppedUp) {\n\t\t\t$tw.utils.pushTop(classes,this.selectedClass.split(\" \"));\n\t\t}\n\t}\n\tif(isPoppedUp) {\n\t\t$tw.utils.pushTop(classes,\"tc-popup-handle\");\n\t}\n\tdomNode.className = classes.join(\" \");\n\t// Assign other attributes\n\tif(this.style) {\n\t\tdomNode.setAttribute(\"style\",this.style);\n\t}\n\tif(this.tooltip) {\n\t\tdomNode.setAttribute(\"title\",this.tooltip);\n\t}\n\tif(this[\"aria-label\"]) {\n\t\tdomNode.setAttribute(\"aria-label\",this[\"aria-label\"]);\n\t}\n\t// Add a click event handler\n\tdomNode.addEventListener(\"click\",function (event) {\n\t\tvar handled = false;\n\t\tif(self.invokeActions(event)) {\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.to) {\n\t\t\tself.navigateTo(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.message) {\n\t\t\tself.dispatchMessage(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.popup) {\n\t\t\tself.triggerPopup(event);\n\t\t\thandled = true;\n\t\t}\n\t\tif(self.set) {\n\t\t\tself.setTiddler();\n\t\t\thandled = true;\n\t\t}\n\t\tif(handled) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\treturn handled;\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nButtonWidget.prototype.getBoundingClientRect = function() {\n\treturn this.domNodes[0].getBoundingClientRect();\n}\n\nButtonWidget.prototype.isSelected = function() {\n\tvar tiddler = this.wiki.getTiddler(this.set);\n\treturn tiddler ? tiddler.fields.text === this.setTo : this.defaultSetValue === this.setTo;\n};\n\nButtonWidget.prototype.isPoppedUp = function() {\n\tvar tiddler = this.wiki.getTiddler(this.popup);\n\tvar result = tiddler && tiddler.fields.text ? $tw.popup.readPopupState(tiddler.fields.text) : false;\n\treturn result;\n};\n\nButtonWidget.prototype.navigateTo = function(event) {\n\tvar bounds = this.getBoundingClientRect();\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.to,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: this,\n\t\tnavigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1)\n\t});\n};\n\nButtonWidget.prototype.dispatchMessage = function(event) {\n\tthis.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable(\"currentTiddler\")});\n};\n\nButtonWidget.prototype.triggerPopup = function(event) {\n\t$tw.popup.triggerPopup({\n\t\tdomNode: this.domNodes[0],\n\t\ttitle: this.popup,\n\t\twiki: this.wiki\n\t});\n};\n\nButtonWidget.prototype.setTiddler = function() {\n\tthis.wiki.setTextReference(this.set,this.setTo,this.getVariable(\"currentTiddler\"));\n};\n\n/*\nCompute the internal state of the widget\n*/\nButtonWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.to = this.getAttribute(\"to\");\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.set = this.getAttribute(\"set\");\n\tthis.setTo = this.getAttribute(\"setTo\");\n\tthis.popup = this.getAttribute(\"popup\");\n\tthis.hover = this.getAttribute(\"hover\");\n\tthis[\"class\"] = this.getAttribute(\"class\",\"\");\n\tthis[\"aria-label\"] = this.getAttribute(\"aria-label\");\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis.style = this.getAttribute(\"style\");\n\tthis.selectedClass = this.getAttribute(\"selectedClass\");\n\tthis.defaultSetValue = this.getAttribute(\"default\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nButtonWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes[\"class\"] || changedAttributes.selectedClass || changedAttributes.style || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup])) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.button = ButtonWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/button.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/checkbox.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/checkbox.js\ntype: application/javascript\nmodule-type: widget\n\nCheckbox widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CheckboxWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCheckboxWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCheckboxWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our elements\n\tthis.labelDomNode = this.document.createElement(\"label\");\n\tthis.inputDomNode = this.document.createElement(\"input\");\n\tthis.inputDomNode.setAttribute(\"type\",\"checkbox\");\n\tif(this.getValue()) {\n\t\tthis.inputDomNode.setAttribute(\"checked\",\"true\");\n\t}\n\tthis.labelDomNode.appendChild(this.inputDomNode);\n\tthis.spanDomNode = this.document.createElement(\"span\");\n\tthis.labelDomNode.appendChild(this.spanDomNode);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(this.inputDomNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(this.labelDomNode,nextSibling);\n\tthis.renderChildren(this.spanDomNode,null);\n\tthis.domNodes.push(this.labelDomNode);\n};\n\nCheckboxWidget.prototype.getValue = function() {\n\tvar tiddler = this.wiki.getTiddler(this.checkboxTitle);\n\tif(tiddler) {\n\t\tif(this.checkboxTag) {\n\t\t\treturn tiddler.hasTag(this.checkboxTag);\n\t\t}\n\t\tif(this.checkboxField) {\n\t\t\tvar value = tiddler.fields[this.checkboxField] || this.checkboxDefault || \"\";\n\t\t\tif(value === this.checkboxChecked) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(value === this.checkboxUnchecked) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif(this.checkboxTag) {\n\t\t\treturn false;\n\t\t}\n\t\tif(this.checkboxField) {\n\t\t\tif(this.checkboxDefault === this.checkboxChecked) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif(this.checkboxDefault === this.checkboxUnchecked) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\nCheckboxWidget.prototype.handleChangeEvent = function(event) {\n\tvar checked = this.inputDomNode.checked,\n\t\ttiddler = this.wiki.getTiddler(this.checkboxTitle),\n\t\tfallbackFields = {text: \"\"},\n\t\tnewFields = {title: this.checkboxTitle},\n\t\thasChanged = false;\n\t// Set the tag if specified\n\tif(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) {\n\t\tnewFields.tags = tiddler ? (tiddler.fields.tags || []).slice(0) : [];\n\t\tvar pos = newFields.tags.indexOf(this.checkboxTag);\n\t\tif(pos !== -1) {\n\t\t\tnewFields.tags.splice(pos,1);\n\t\t}\n\t\tif(checked) {\n\t\t\tnewFields.tags.push(this.checkboxTag);\n\t\t}\n\t\thasChanged = true;\n\t}\n\t// Set the field if specified\n\tif(this.checkboxField) {\n\t\tvar value = checked ? this.checkboxChecked : this.checkboxUnchecked;\n\t\tif(!tiddler || tiddler.fields[this.checkboxField] !== value) {\n\t\t\tnewFields[this.checkboxField] = value;\n\t\t\thasChanged = true;\n\t\t}\n\t}\n\tif(hasChanged) {\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nCheckboxWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.checkboxTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.checkboxTag = this.getAttribute(\"tag\");\n\tthis.checkboxField = this.getAttribute(\"field\");\n\tthis.checkboxChecked = this.getAttribute(\"checked\");\n\tthis.checkboxUnchecked = this.getAttribute(\"unchecked\");\n\tthis.checkboxDefault = this.getAttribute(\"default\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCheckboxWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.field || changedAttributes.checked || changedAttributes.unchecked || changedAttributes[\"default\"] || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false;\n\t\tif(changedTiddlers[this.checkboxTitle]) {\n\t\t\tthis.inputDomNode.checked = this.getValue();\n\t\t\trefreshed = true;\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\nexports.checkbox = CheckboxWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/checkbox.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/codeblock.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/codeblock.js\ntype: application/javascript\nmodule-type: widget\n\nCode block node widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CodeBlockWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCodeBlockWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCodeBlockWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar codeNode = this.document.createElement(\"code\"),\n\t\tdomNode = this.document.createElement(\"pre\");\n\tcodeNode.appendChild(this.document.createTextNode(this.getAttribute(\"code\")));\n\tdomNode.appendChild(codeNode);\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.domNodes.push(domNode);\n\tif(this.postRender) {\n\t\tthis.postRender();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nCodeBlockWidget.prototype.execute = function() {\n\tthis.language = this.getAttribute(\"language\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCodeBlockWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.codeblock = CodeBlockWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/codeblock.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/count.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/count.js\ntype: application/javascript\nmodule-type: widget\n\nCount widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar CountWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nCountWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nCountWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.currentCount);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nCountWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.filter = this.getAttribute(\"filter\");\n\t// Execute the filter\n\tif(this.filter) {\n\t\tthis.currentCount = this.wiki.filterTiddlers(this.filter,this).length;\n\t} else {\n\t\tthis.currentCount = undefined;\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nCountWidget.prototype.refresh = function(changedTiddlers) {\n\t// Re-execute the filter to get the count\n\tthis.computeAttributes();\n\tvar oldCount = this.currentCount;\n\tthis.execute();\n\tif(this.currentCount !== oldCount) {\n\t\t// Regenerate and rerender the widget and replace the existing DOM node\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n};\n\nexports.count = CountWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/count.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/dropzone.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/dropzone.js\ntype: application/javascript\nmodule-type: widget\n\nDropzone widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar DropZoneWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nDropZoneWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nDropZoneWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"div\");\n\tdomNode.className = \"tc-dropzone\";\n\t// Add event handlers\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"dragenter\", handlerObject: this, handlerMethod: \"handleDragEnterEvent\"},\n\t\t{name: \"dragover\", handlerObject: this, handlerMethod: \"handleDragOverEvent\"},\n\t\t{name: \"dragleave\", handlerObject: this, handlerMethod: \"handleDragLeaveEvent\"},\n\t\t{name: \"drop\", handlerObject: this, handlerMethod: \"handleDropEvent\"},\n\t\t{name: \"paste\", handlerObject: this, handlerMethod: \"handlePasteEvent\"}\n\t]);\n\tdomNode.addEventListener(\"click\",function (event) {\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nDropZoneWidget.prototype.enterDrag = function() {\n\t// We count enter/leave events\n\tthis.dragEnterCount = (this.dragEnterCount || 0) + 1;\n\t// If we're entering for the first time we need to apply highlighting\n\tif(this.dragEnterCount === 1) {\n\t\t$tw.utils.addClass(this.domNodes[0],\"tc-dragover\");\n\t}\n};\n\nDropZoneWidget.prototype.leaveDrag = function() {\n\t// Reduce the enter count\n\tthis.dragEnterCount = (this.dragEnterCount || 0) - 1;\n\t// Remove highlighting if we're leaving externally\n\tif(this.dragEnterCount <= 0) {\n\t\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t}\n};\n\nDropZoneWidget.prototype.handleDragEnterEvent = function(event) {\n\tthis.enterDrag();\n\t// Tell the browser that we're ready to handle the drop\n\tevent.preventDefault();\n\t// Tell the browser not to ripple the drag up to any parent drop handlers\n\tevent.stopPropagation();\n};\n\nDropZoneWidget.prototype.handleDragOverEvent = function(event) {\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\t// Tell the browser that we're still interested in the drop\n\tevent.preventDefault();\n\tevent.dataTransfer.dropEffect = \"copy\"; // Explicitly show this is a copy\n};\n\nDropZoneWidget.prototype.handleDragLeaveEvent = function(event) {\n\tthis.leaveDrag();\n};\n\nDropZoneWidget.prototype.handleDropEvent = function(event) {\n\tthis.leaveDrag();\n\t// Check for being over a TEXTAREA or INPUT\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) !== -1) {\n\t\treturn false;\n\t}\n\tvar self = this,\n\t\tdataTransfer = event.dataTransfer;\n\t// Reset the enter count\n\tthis.dragEnterCount = 0;\n\t// Remove highlighting\n\t$tw.utils.removeClass(this.domNodes[0],\"tc-dragover\");\n\t// Import any files in the drop\n\tvar numFiles = this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {\n\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t});\n\t// Try to import the various data types we understand\n\tif(numFiles === 0) {\n\t\tthis.importData(dataTransfer);\n\t}\n\t// Tell the browser that we handled the drop\n\tevent.preventDefault();\n\t// Stop the drop ripple up to any parent handlers\n\tevent.stopPropagation();\n};\n\nDropZoneWidget.prototype.importData = function(dataTransfer) {\n\t// Try each provided data type in turn\n\tfor(var t=0; t<this.importDataTypes.length; t++) {\n\t\tif(!$tw.browser.isIE || this.importDataTypes[t].IECompatible) {\n\t\t\t// Get the data\n\t\t\tvar dataType = this.importDataTypes[t];\n\t\t\t\tvar data = dataTransfer.getData(dataType.type);\n\t\t\t// Import the tiddlers in the data\n\t\t\tif(data !== \"\" && data !== null) {\n\t\t\t\tif($tw.log.IMPORT) {\n\t\t\t\t\tconsole.log(\"Importing data type '\" + dataType.type + \"', data: '\" + data + \"'\")\n\t\t\t\t}\n\t\t\t\tvar tiddlerFields = dataType.convertToFields(data);\n\t\t\t\tif(!tiddlerFields.title) {\n\t\t\t\t\ttiddlerFields.title = this.wiki.generateNewTitle(\"Untitled\");\n\t\t\t\t}\n\t\t\t\tthis.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify([tiddlerFields])});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nDropZoneWidget.prototype.importDataTypes = [\n\t{type: \"text/vnd.tiddler\", IECompatible: false, convertToFields: function(data) {\n\t\treturn JSON.parse(data);\n\t}},\n\t{type: \"URL\", IECompatible: true, convertToFields: function(data) {\n\t\t// Check for tiddler data URI\n\t\tvar match = decodeURI(data).match(/^data\\:text\\/vnd\\.tiddler,(.*)/i);\n\t\tif(match) {\n\t\t\treturn JSON.parse(match[1]);\n\t\t} else {\n\t\t\treturn { // As URL string\n\t\t\t\ttext: data\n\t\t\t};\n\t\t}\n\t}},\n\t{type: \"text/x-moz-url\", IECompatible: false, convertToFields: function(data) {\n\t\t// Check for tiddler data URI\n\t\tvar match = decodeURI(data).match(/^data\\:text\\/vnd\\.tiddler,(.*)/i);\n\t\tif(match) {\n\t\t\treturn JSON.parse(match[1]);\n\t\t} else {\n\t\t\treturn { // As URL string\n\t\t\t\ttext: data\n\t\t\t};\n\t\t}\n\t}},\n\t{type: \"text/html\", IECompatible: false, convertToFields: function(data) {\n\t\treturn {\n\t\t\ttext: data\n\t\t};\n\t}},\n\t{type: \"text/plain\", IECompatible: false, convertToFields: function(data) {\n\t\treturn {\n\t\t\ttext: data\n\t\t};\n\t}},\n\t{type: \"Text\", IECompatible: true, convertToFields: function(data) {\n\t\treturn {\n\t\t\ttext: data\n\t\t};\n\t}},\n\t{type: \"text/uri-list\", IECompatible: false, convertToFields: function(data) {\n\t\treturn {\n\t\t\ttext: data\n\t\t};\n\t}}\n];\n\nDropZoneWidget.prototype.handlePasteEvent = function(event) {\n\t// Let the browser handle it if we're in a textarea or input box\n\tif([\"TEXTAREA\",\"INPUT\"].indexOf(event.target.tagName) == -1) {\n\t\tvar self = this,\n\t\t\titems = event.clipboardData.items;\n\t\t// Enumerate the clipboard items\n\t\tfor(var t = 0; t<items.length; t++) {\n\t\t\tvar item = items[t];\n\t\t\tif(item.kind === \"file\") {\n\t\t\t\t// Import any files\n\t\t\t\tthis.wiki.readFile(item.getAsFile(),function(tiddlerFieldsArray) {\n\t\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify(tiddlerFieldsArray)});\n\t\t\t\t});\n\t\t\t} else if(item.kind === \"string\") {\n\t\t\t\t// Create tiddlers from string items\n\t\t\t\tvar type = item.type;\n\t\t\t\titem.getAsString(function(str) {\n\t\t\t\t\tvar tiddlerFields = {\n\t\t\t\t\t\ttitle: self.wiki.generateNewTitle(\"Untitled\"),\n\t\t\t\t\t\ttext: str,\n\t\t\t\t\t\ttype: type\n\t\t\t\t\t};\n\t\t\t\t\tif($tw.log.IMPORT) {\n\t\t\t\t\t\tconsole.log(\"Importing string '\" + str + \"', type: '\" + type + \"'\");\n\t\t\t\t\t}\n\t\t\t\t\tself.dispatchEvent({type: \"tm-import-tiddlers\", param: JSON.stringify([tiddlerFields])});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t// Tell the browser that we've handled the paste\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nDropZoneWidget.prototype.execute = function() {\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nDropZoneWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.dropzone = DropZoneWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/dropzone.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/edit-binary.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/edit-binary.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-binary widget; placeholder for editing binary tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar BINARY_WARNING_MESSAGE = \"$:/core/ui/BinaryWarning\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditBinaryWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditBinaryWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditBinaryWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditBinaryWidget.prototype.execute = function() {\n\t// Construct the child widgets\n\tthis.makeChildWidgets([{\n\t\ttype: \"transclude\",\n\t\tattributes: {\n\t\t\ttiddler: {type: \"string\", value: BINARY_WARNING_MESSAGE}\n\t\t}\n\t}]);\n};\n\n/*\nRefresh by refreshing our child widget\n*/\nEditBinaryWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports[\"edit-binary\"] = EditBinaryWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/edit-binary.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/edit-bitmap.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/edit-bitmap.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-bitmap widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n// Default image sizes\nvar DEFAULT_IMAGE_WIDTH = 300,\n\tDEFAULT_IMAGE_HEIGHT = 185;\n\n// Configuration tiddlers\nvar LINE_WIDTH_TITLE = \"$:/config/BitmapEditor/LineWidth\",\n\tLINE_COLOUR_TITLE = \"$:/config/BitmapEditor/Colour\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditBitmapWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditBitmapWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditBitmapWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our element\n\tthis.canvasDomNode = $tw.utils.domMaker(\"canvas\",{\n\t\tdocument: this.document,\n\t\t\"class\":\"tc-edit-bitmapeditor\",\n\t\teventListeners: [{\n\t\t\tname: \"touchstart\", handlerObject: this, handlerMethod: \"handleTouchStartEvent\"\n\t\t},{\n\t\t\tname: \"touchmove\", handlerObject: this, handlerMethod: \"handleTouchMoveEvent\"\n\t\t},{\n\t\t\tname: \"touchend\", handlerObject: this, handlerMethod: \"handleTouchEndEvent\"\n\t\t},{\n\t\t\tname: \"mousedown\", handlerObject: this, handlerMethod: \"handleMouseDownEvent\"\n\t\t},{\n\t\t\tname: \"mousemove\", handlerObject: this, handlerMethod: \"handleMouseMoveEvent\"\n\t\t},{\n\t\t\tname: \"mouseup\", handlerObject: this, handlerMethod: \"handleMouseUpEvent\"\n\t\t}]\n\t});\n\tthis.widthDomNode = $tw.utils.domMaker(\"input\",{\n\t\tdocument: this.document,\n\t\t\"class\":\"tc-edit-bitmapeditor-width\",\n\t\teventListeners: [{\n\t\t\tname: \"change\", handlerObject: this, handlerMethod: \"handleWidthChangeEvent\"\n\t\t}]\n\t});\n\tthis.heightDomNode = $tw.utils.domMaker(\"input\",{\n\t\tdocument: this.document,\n\t\t\"class\":\"tc-edit-bitmapeditor-height\",\n\t\teventListeners: [{\n\t\t\tname: \"change\", handlerObject: this, handlerMethod: \"handleHeightChangeEvent\"\n\t\t}]\n\t});\n\t// Insert the elements into the DOM\n\tparent.insertBefore(this.canvasDomNode,nextSibling);\n\tparent.insertBefore(this.widthDomNode,nextSibling);\n\tparent.insertBefore(this.heightDomNode,nextSibling);\n\tthis.domNodes.push(this.canvasDomNode,this.widthDomNode,this.heightDomNode);\n\t// Load the image into the canvas\n\tif($tw.browser) {\n\t\tthis.loadCanvas();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditBitmapWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n};\n\n/*\nNote that the bitmap editor intentionally doesn't try to refresh itself because it would be confusing to have the image changing spontaneously while editting it\n*/\nEditBitmapWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nEditBitmapWidget.prototype.loadCanvas = function() {\n\tvar tiddler = this.wiki.getTiddler(this.editTitle),\n\t\tcurrImage = new Image();\n\t// Set up event handlers for loading the image\n\tvar self = this;\n\tcurrImage.onload = function() {\n\t\t// Copy the image to the on-screen canvas\n\t\tself.initCanvas(self.canvasDomNode,currImage.width,currImage.height,currImage);\n\t\t// And also copy the current bitmap to the off-screen canvas\n\t\tself.currCanvas = self.document.createElement(\"canvas\");\n\t\tself.initCanvas(self.currCanvas,currImage.width,currImage.height,currImage);\n\t\t// Set the width and height input boxes\n\t\tself.updateSize();\n\t};\n\tcurrImage.onerror = function() {\n\t\t// Set the on-screen canvas size and clear it\n\t\tself.initCanvas(self.canvasDomNode,DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT);\n\t\t// Set the off-screen canvas size and clear it\n\t\tself.currCanvas = self.document.createElement(\"canvas\");\n\t\tself.initCanvas(self.currCanvas,DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT);\n\t\t// Set the width and height input boxes\n\t\tself.updateSize();\n\t};\n\t// Get the current bitmap into an image object\n\tcurrImage.src = \"data:\" + tiddler.fields.type + \";base64,\" + tiddler.fields.text;\n};\n\nEditBitmapWidget.prototype.initCanvas = function(canvas,width,height,image) {\n\tcanvas.width = width;\n\tcanvas.height = height;\n\tvar ctx = canvas.getContext(\"2d\");\n\tif(image) {\n\t\tctx.drawImage(image,0,0);\n\t} else {\n\t\tctx.fillStyle = \"#fff\";\n\t\tctx.fillRect(0,0,canvas.width,canvas.height);\n\t}\n};\n\n/*\n** Update the input boxes with the actual size of the canvas\n*/\nEditBitmapWidget.prototype.updateSize = function() {\n\tthis.widthDomNode.value = this.currCanvas.width;\n\tthis.heightDomNode.value = this.currCanvas.height;\n};\n\n/*\n** Change the size of the canvas, preserving the current image\n*/\nEditBitmapWidget.prototype.changeCanvasSize = function(newWidth,newHeight) {\n\t// Create and size a new canvas\n\tvar newCanvas = this.document.createElement(\"canvas\");\n\tthis.initCanvas(newCanvas,newWidth,newHeight);\n\t// Copy the old image\n\tvar ctx = newCanvas.getContext(\"2d\");\n\tctx.drawImage(this.currCanvas,0,0);\n\t// Set the new canvas as the current one\n\tthis.currCanvas = newCanvas;\n\t// Set the size of the onscreen canvas\n\tthis.canvasDomNode.width = newWidth;\n\tthis.canvasDomNode.height = newHeight;\n\t// Paint the onscreen canvas with the offscreen canvas\n\tctx = this.canvasDomNode.getContext(\"2d\");\n\tctx.drawImage(this.currCanvas,0,0);\n};\n\nEditBitmapWidget.prototype.handleWidthChangeEvent = function(event) {\n\t// Get the new width\n\tvar newWidth = parseInt(this.widthDomNode.value,10);\n\t// Update if necessary\n\tif(newWidth > 0 && newWidth !== this.currCanvas.width) {\n\t\tthis.changeCanvasSize(newWidth,this.currCanvas.height);\n\t}\n\t// Update the input controls\n\tthis.updateSize();\n};\n\nEditBitmapWidget.prototype.handleHeightChangeEvent = function(event) {\n\t// Get the new width\n\tvar newHeight = parseInt(this.heightDomNode.value,10);\n\t// Update if necessary\n\tif(newHeight > 0 && newHeight !== this.currCanvas.height) {\n\t\tthis.changeCanvasSize(this.currCanvas.width,newHeight);\n\t}\n\t// Update the input controls\n\tthis.updateSize();\n};\n\nEditBitmapWidget.prototype.handleTouchStartEvent = function(event) {\n\tthis.brushDown = true;\n\tthis.strokeStart(event.touches[0].clientX,event.touches[0].clientY);\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleTouchMoveEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.strokeMove(event.touches[0].clientX,event.touches[0].clientY);\n\t}\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleTouchEndEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.brushDown = false;\n\t\tthis.strokeEnd();\n\t}\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleMouseDownEvent = function(event) {\n\tthis.strokeStart(event.clientX,event.clientY);\n\tthis.brushDown = true;\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nEditBitmapWidget.prototype.handleMouseMoveEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.strokeMove(event.clientX,event.clientY);\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}\n\treturn true;\n};\n\nEditBitmapWidget.prototype.handleMouseUpEvent = function(event) {\n\tif(this.brushDown) {\n\t\tthis.brushDown = false;\n\t\tthis.strokeEnd();\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}\n\treturn true;\n};\n\nEditBitmapWidget.prototype.adjustCoordinates = function(x,y) {\n\tvar canvasRect = this.canvasDomNode.getBoundingClientRect(),\n\t\tscale = this.canvasDomNode.width/canvasRect.width;\n\treturn {x: (x - canvasRect.left) * scale, y: (y - canvasRect.top) * scale};\n};\n\nEditBitmapWidget.prototype.strokeStart = function(x,y) {\n\t// Start off a new stroke\n\tthis.stroke = [this.adjustCoordinates(x,y)];\n};\n\nEditBitmapWidget.prototype.strokeMove = function(x,y) {\n\tvar ctx = this.canvasDomNode.getContext(\"2d\"),\n\t\tt;\n\t// Add the new position to the end of the stroke\n\tthis.stroke.push(this.adjustCoordinates(x,y));\n\t// Redraw the previous image\n\tctx.drawImage(this.currCanvas,0,0);\n\t// Render the stroke\n\tctx.strokeStyle = this.wiki.getTiddlerText(LINE_COLOUR_TITLE,\"#ff0\");\n\tctx.lineWidth = parseInt(this.wiki.getTiddlerText(LINE_WIDTH_TITLE,\"3\"),10);\n\tctx.lineCap = \"round\";\n\tctx.lineJoin = \"round\";\n\tctx.beginPath();\n\tctx.moveTo(this.stroke[0].x,this.stroke[0].y);\n\tfor(t=1; t<this.stroke.length-1; t++) {\n\t\tvar s1 = this.stroke[t],\n\t\t\ts2 = this.stroke[t-1],\n\t\t\ttx = (s1.x + s2.x)/2,\n\t\t\tty = (s1.y + s2.y)/2;\n\t\tctx.quadraticCurveTo(s2.x,s2.y,tx,ty);\n\t}\n\tctx.stroke();\n};\n\nEditBitmapWidget.prototype.strokeEnd = function() {\n\t// Copy the bitmap to the off-screen canvas\n\tvar ctx = this.currCanvas.getContext(\"2d\");\n\tctx.drawImage(this.canvasDomNode,0,0);\n\t// Save the image into the tiddler\n\tthis.saveChanges();\n};\n\nEditBitmapWidget.prototype.saveChanges = function() {\n\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\tif(tiddler) {\n\t\t// data URIs look like \"data:<type>;base64,<text>\"\n\t\tvar dataURL = this.canvasDomNode.toDataURL(tiddler.fields.type,1.0),\n\t\t\tposColon = dataURL.indexOf(\":\"),\n\t\t\tposSemiColon = dataURL.indexOf(\";\"),\n\t\t\tposComma = dataURL.indexOf(\",\"),\n\t\t\ttype = dataURL.substring(posColon+1,posSemiColon),\n\t\t\ttext = dataURL.substring(posComma+1);\n\t\tvar update = {type: type, text: text};\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,update));\n\t}\n};\n\nexports[\"edit-bitmap\"] = EditBitmapWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/edit-bitmap.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/edit-text.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/edit-text.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-text widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar DEFAULT_MIN_TEXT_AREA_HEIGHT = \"100px\"; // Minimum height of textareas in pixels\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditTextWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditTextWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditTextWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our element\n\tvar editInfo = this.getEditInfo();\n\tvar domNode = this.document.createElement(this.editTag);\n\tif(this.editType) {\n\t\tdomNode.setAttribute(\"type\",this.editType);\n\t}\n\tif(editInfo.value === \"\" && this.editPlaceholder) {\n\t\tdomNode.setAttribute(\"placeholder\",this.editPlaceholder);\n\t}\n\tif(this.editSize) {\n\t\tdomNode.setAttribute(\"size\",this.editSize);\n\t}\n\t// Assign classes\n\tif(this.editClass) {\n\t\tdomNode.className = this.editClass;\n\t}\n\t// Set the text\n\tif(this.editTag === \"textarea\") {\n\t\tdomNode.appendChild(this.document.createTextNode(editInfo.value));\n\t} else {\n\t\tdomNode.value = editInfo.value;\n\t}\n\t// Add an input event handler\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"focus\", handlerObject: this, handlerMethod: \"handleFocusEvent\"},\n\t\t{name: \"input\", handlerObject: this, handlerMethod: \"handleInputEvent\"}\n\t]);\n\t// Insert the element into the DOM\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.domNodes.push(domNode);\n\tif(this.postRender) {\n\t\tthis.postRender();\n\t}\n\t// Fix height\n\tthis.fixHeight();\n\t// Focus field\n\tif(this.editFocus === \"true\") {\n\t\tif(domNode.focus && domNode.select) {\n\t\t\tdomNode.focus();\n\t\t\tdomNode.select();\t\t\t\n\t\t}\n\t}\n};\n\n/*\nGet the tiddler being edited and current value\n*/\nEditTextWidget.prototype.getEditInfo = function() {\n\t// Get the edit value\n\tvar self = this,\n\t\tvalue,\n\t\tupdate;\n\tif(this.editIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.editTitle,this.editIndex,this.editDefault);\n\t\tupdate = function(value) {\n\t\t\tvar data = self.wiki.getTiddlerData(self.editTitle,{});\n\t\t\tif(data[self.editIndex] !== value) {\n\t\t\t\tdata[self.editIndex] = value;\n\t\t\t\tself.wiki.setTiddlerData(self.editTitle,data);\n\t\t\t}\n\t\t};\n\t} else {\n\t\t// Get the current tiddler and the field name\n\t\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\t\tif(tiddler) {\n\t\t\t// If we've got a tiddler, the value to display is the field string value\n\t\t\tvalue = tiddler.getFieldString(this.editField);\n\t\t} else {\n\t\t\t// Otherwise, we need to construct a default value for the editor\n\t\t\tswitch(this.editField) {\n\t\t\t\tcase \"text\":\n\t\t\t\t\tvalue = \"Type the text for the tiddler '\" + this.editTitle + \"'\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"title\":\n\t\t\t\t\tvalue = this.editTitle;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(this.editDefault !== undefined) {\n\t\t\t\tvalue = this.editDefault;\n\t\t\t}\n\t\t}\n\t\tupdate = function(value) {\n\t\t\tvar tiddler = self.wiki.getTiddler(self.editTitle),\n\t\t\t\tupdateFields = {\n\t\t\t\t\ttitle: self.editTitle\n\t\t\t\t};\n\t\t\tupdateFields[self.editField] = value;\n\t\t\tself.wiki.addTiddler(new $tw.Tiddler(self.wiki.getCreationFields(),tiddler,updateFields,self.wiki.getModificationFields()));\n\t\t};\n\t}\n\treturn {value: value, update: update};\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditTextWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.editField = this.getAttribute(\"field\",\"text\");\n\tthis.editIndex = this.getAttribute(\"index\");\n\tthis.editDefault = this.getAttribute(\"default\");\n\tthis.editClass = this.getAttribute(\"class\");\n\tthis.editPlaceholder = this.getAttribute(\"placeholder\");\n\tthis.editSize = this.getAttribute(\"size\");\n\tthis.editAutoHeight = this.getAttribute(\"autoHeight\",\"yes\") === \"yes\";\n\tthis.editMinHeight = this.getAttribute(\"minHeight\",DEFAULT_MIN_TEXT_AREA_HEIGHT);\n\tthis.editFocusPopup = this.getAttribute(\"focusPopup\");\n\tthis.editFocus = this.getAttribute(\"focus\");\n\t// Get the editor element tag and type\n\tvar tag,type;\n\tif(this.editField === \"text\") {\n\t\ttag = \"textarea\";\n\t} else {\n\t\ttag = \"input\";\n\t\tvar fieldModule = $tw.Tiddler.fieldModules[this.editField];\n\t\tif(fieldModule && fieldModule.editTag) {\n\t\t\ttag = fieldModule.editTag;\n\t\t}\n\t\tif(fieldModule && fieldModule.editType) {\n\t\t\ttype = fieldModule.editType;\n\t\t}\n\t\ttype = type || \"text\";\n\t}\n\t// Get the rest of our parameters\n\tthis.editTag = this.getAttribute(\"tag\",tag);\n\tthis.editType = this.getAttribute(\"type\",type);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEditTextWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Completely rerender if any of our attributes have changed\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes[\"default\"] || changedAttributes[\"class\"] || changedAttributes.placeholder || changedAttributes.size || changedAttributes.autoHeight || changedAttributes.minHeight || changedAttributes.focusPopup) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else if(changedTiddlers[this.editTitle]) {\n\t\tthis.updateEditor(this.getEditInfo().value);\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n/*\nUpdate the editor with new text. This method is separate from updateEditorDomNode()\nso that subclasses can override updateEditor() and still use updateEditorDomNode()\n*/\nEditTextWidget.prototype.updateEditor = function(text) {\n\tthis.updateEditorDomNode(text);\n};\n\n/*\nUpdate the editor dom node with new text\n*/\nEditTextWidget.prototype.updateEditorDomNode = function(text) {\n\t// Replace the edit value if the tiddler we're editing has changed\n\tvar domNode = this.domNodes[0];\n\tif(!domNode.isTiddlyWikiFakeDom) {\n\t\tif(this.document.activeElement !== domNode) {\n\t\t\tdomNode.value = text;\n\t\t}\n\t\t// Fix the height if needed\n\t\tthis.fixHeight();\n\t}\n};\n\n/*\nFix the height of textareas to fit their content\n*/\nEditTextWidget.prototype.fixHeight = function() {\n\tvar self = this,\n\t\tdomNode = this.domNodes[0];\n\tif(this.editAutoHeight && domNode && !domNode.isTiddlyWikiFakeDom && this.editTag === \"textarea\") {\n\t\t// Resize the textarea to fit its content, preserving scroll position\n\t\tvar scrollPosition = $tw.utils.getScrollPosition(),\n\t\t\tscrollTop = scrollPosition.y;\n\t\t// Measure the specified minimum height\n\t\tdomNode.style.height = self.editMinHeight;\n\t\tvar minHeight = domNode.offsetHeight;\n\t\t// Set its height to auto so that it snaps to the correct height\n\t\tdomNode.style.height = \"auto\";\n\t\t// Calculate the revised height\n\t\tvar newHeight = Math.max(domNode.scrollHeight + domNode.offsetHeight - domNode.clientHeight,minHeight);\n\t\t// Only try to change the height if it has changed\n\t\tif(newHeight !== domNode.offsetHeight) {\n\t\t\tdomNode.style.height = newHeight + \"px\";\n\t\t\t// Make sure that the dimensions of the textarea are recalculated\n\t\t\t$tw.utils.forceLayout(domNode);\n\t\t\t// Check that the scroll position is still visible before trying to scroll back to it\n\t\t\tscrollTop = Math.min(scrollTop,self.document.body.scrollHeight - window.innerHeight);\n\t\t\twindow.scrollTo(scrollPosition.x,scrollTop);\n\t\t}\n\t}\n};\n\n/*\nHandle a dom \"input\" event\n*/\nEditTextWidget.prototype.handleInputEvent = function(event) {\n\tthis.saveChanges(this.domNodes[0].value);\n\tthis.fixHeight();\n\treturn true;\n};\n\nEditTextWidget.prototype.handleFocusEvent = function(event) {\n\tif(this.editFocusPopup) {\n\t\t$tw.popup.triggerPopup({\n\t\t\tdomNode: this.domNodes[0],\n\t\t\ttitle: this.editFocusPopup,\n\t\t\twiki: this.wiki,\n\t\t\tforce: true\n\t\t});\n\t}\n\treturn true;\n};\n\nEditTextWidget.prototype.saveChanges = function(text) {\n\tvar editInfo = this.getEditInfo();\n\tif(text !== editInfo.value) {\n\t\teditInfo.update(text);\n\t}\n};\n\nexports[\"edit-text\"] = EditTextWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/edit-text.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/edit.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/edit.js\ntype: application/javascript\nmodule-type: widget\n\nEdit widget is a meta-widget chooses the appropriate actual editting widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n// Mappings from content type to editor type are stored in tiddlers with this prefix\nvar EDITOR_MAPPING_PREFIX = \"$:/config/EditorTypeMappings/\";\n\n/*\nCompute the internal state of the widget\n*/\nEditWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.editField = this.getAttribute(\"field\",\"text\");\n\tthis.editIndex = this.getAttribute(\"index\");\n\tthis.editClass = this.getAttribute(\"class\");\n\tthis.editPlaceholder = this.getAttribute(\"placeholder\");\n\t// Choose the appropriate edit widget\n\tthis.editorType = this.getEditorType();\n\t// Make the child widgets\n\tthis.makeChildWidgets([{\n\t\ttype: \"edit-\" + this.editorType,\n\t\tattributes: {\n\t\t\ttiddler: {type: \"string\", value: this.editTitle},\n\t\t\tfield: {type: \"string\", value: this.editField},\n\t\t\tindex: {type: \"string\", value: this.editIndex},\n\t\t\t\"class\": {type: \"string\", value: this.editClass},\n\t\t\t\"placeholder\": {type: \"string\", value: this.editPlaceholder}\n\t\t}\n\t}]);\n};\n\nEditWidget.prototype.getEditorType = function() {\n\t// Get the content type of the thing we're editing\n\tvar type;\n\tif(this.editField === \"text\") {\n\t\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\t\tif(tiddler) {\n\t\t\ttype = tiddler.fields.type;\n\t\t}\n\t}\n\ttype = type || \"text/vnd.tiddlywiki\";\n\tvar editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type);\n\tif(!editorType) {\n\t\tvar typeInfo = $tw.config.contentTypeInfo[type];\n\t\tif(typeInfo && typeInfo.encoding === \"base64\") {\n\t\t\teditorType = \"binary\";\n\t\t} else {\n\t\t\teditorType = \"text\";\n\t\t}\n\t}\n\treturn editorType;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEditWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Refresh if an attribute has changed, or the type associated with the target tiddler has changed\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || (changedTiddlers[this.editTitle] && this.getEditorType() !== this.editorType)) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.edit = EditWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/edit.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/element.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/element.js\ntype: application/javascript\nmodule-type: widget\n\nElement widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ElementWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nElementWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nElementWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Neuter blacklisted elements\n\tvar tag = this.parseTreeNode.tag;\n\tif($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {\n\t\ttag = \"safe-\" + tag;\n\t}\n\tvar domNode = this.document.createElementNS(this.namespace,tag);\n\tthis.assignAttributes(domNode,{excludeEventAttributes: true});\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nElementWidget.prototype.execute = function() {\n\t// Select the namespace for the tag\n\tvar tagNamespaces = {\n\t\t\tsvg: \"http://www.w3.org/2000/svg\",\n\t\t\tmath: \"http://www.w3.org/1998/Math/MathML\",\n\t\t\tbody: \"http://www.w3.org/1999/xhtml\"\n\t\t};\n\tthis.namespace = tagNamespaces[this.parseTreeNode.tag];\n\tif(this.namespace) {\n\t\tthis.setVariable(\"namespace\",this.namespace);\n\t} else {\n\t\tthis.namespace = this.getVariable(\"namespace\",{defaultValue: \"http://www.w3.org/1999/xhtml\"});\n\t}\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nElementWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes(),\n\t\thasChangedAttributes = $tw.utils.count(changedAttributes) > 0;\n\tif(hasChangedAttributes) {\n\t\t// Update our attributes\n\t\tthis.assignAttributes(this.domNodes[0],{excludeEventAttributes: true});\n\t}\n\treturn this.refreshChildren(changedTiddlers) || hasChangedAttributes;\n};\n\nexports.element = ElementWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/element.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/encrypt.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/encrypt.js\ntype: application/javascript\nmodule-type: widget\n\nEncrypt widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EncryptWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEncryptWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEncryptWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.encryptedText);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEncryptWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.filter = this.getAttribute(\"filter\",\"[!is[system]]\");\n\t// Encrypt the filtered tiddlers\n\tvar tiddlers = this.wiki.filterTiddlers(this.filter),\n\t\tjson = {},\n\t\tself = this;\n\t$tw.utils.each(tiddlers,function(title) {\n\t\tvar tiddler = self.wiki.getTiddler(title),\n\t\t\tjsonTiddler = {};\n\t\tfor(var f in tiddler.fields) {\n\t\t\tjsonTiddler[f] = tiddler.getFieldString(f);\n\t\t}\n\t\tjson[title] = jsonTiddler;\n\t});\n\tthis.encryptedText = $tw.utils.htmlEncode($tw.crypto.encrypt(JSON.stringify(json)));\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEncryptWidget.prototype.refresh = function(changedTiddlers) {\n\t// We don't need to worry about refreshing because the encrypt widget isn't for interactive use\n\treturn false;\n};\n\nexports.encrypt = EncryptWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/encrypt.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/entity.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/entity.js\ntype: application/javascript\nmodule-type: widget\n\nHTML entity widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EntityWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEntityWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEntityWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tvar textNode = this.document.createTextNode($tw.utils.entityDecode(this.parseTreeNode.entity));\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nEntityWidget.prototype.execute = function() {\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEntityWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.entity = EntityWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/entity.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/fieldmangler.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/fieldmangler.js\ntype: application/javascript\nmodule-type: widget\n\nField mangler widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar FieldManglerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-remove-field\", handler: \"handleRemoveFieldEvent\"},\n\t\t{type: \"tm-add-field\", handler: \"handleAddFieldEvent\"},\n\t\t{type: \"tm-remove-tag\", handler: \"handleRemoveTagEvent\"},\n\t\t{type: \"tm-add-tag\", handler: \"handleAddTagEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nFieldManglerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nFieldManglerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nFieldManglerWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.mangleTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nFieldManglerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nFieldManglerWidget.prototype.handleRemoveFieldEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle),\n\t\tdeletion = {};\n\tdeletion[event.param] = undefined;\n\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,deletion));\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleAddFieldEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle),\n\t\taddition = this.wiki.getModificationFields(),\n\t\thadInvalidFieldName = false,\n\t\taddField = function(name,value) {\n\t\t\tvar trimmedName = name.toLowerCase().trim();\n\t\t\tif(!$tw.utils.isValidFieldName(trimmedName)) {\n\t\t\t\tif(!hadInvalidFieldName) {\n\t\t\t\t\talert($tw.language.getString(\n\t\t\t\t\t\t\"InvalidFieldName\",\n\t\t\t\t\t\t{variables:\n\t\t\t\t\t\t\t{fieldName: trimmedName}\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\t\t\t\t\thadInvalidFieldName = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!value && tiddler) {\n\t\t\t\t\tvalue = tiddler.fields[trimmedName];\n\t\t\t\t}\n\t\t\t\taddition[trimmedName] = value || \"\";\n\t\t\t}\n\t\t\treturn;\n\t\t};\n\taddition.title = this.mangleTitle;\n\tif(typeof event.param === \"string\") {\n\t\taddField(event.param,\"\");\n\t}\n\tif(typeof event.paramObject === \"object\") {\n\t\tfor(var name in event.paramObject) {\n\t\t\taddField(name,event.paramObject[name]);\n\t\t}\n\t}\n\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle);\n\tif(tiddler && tiddler.fields.tags) {\n\t\tvar p = tiddler.fields.tags.indexOf(event.param);\n\t\tif(p !== -1) {\n\t\t\tvar modification = this.wiki.getModificationFields();\n\t\t\tmodification.tags = (tiddler.fields.tags || []).slice(0);\n\t\t\tmodification.tags.splice(p,1);\n\t\t\tif(modification.tags.length === 0) {\n\t\t\t\tmodification.tags = undefined;\n\t\t\t}\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));\n\t\t}\n\t}\n\treturn true;\n};\n\nFieldManglerWidget.prototype.handleAddTagEvent = function(event) {\n\tvar tiddler = this.wiki.getTiddler(this.mangleTitle);\n\tif(tiddler && typeof event.param === \"string\") {\n\t\tvar tag = event.param.trim();\n\t\tif(tag !== \"\") {\n\t\t\tvar modification = this.wiki.getModificationFields();\n\t\t\tmodification.tags = (tiddler.fields.tags || []).slice(0);\n\t\t\t$tw.utils.pushTop(modification.tags,tag);\n\t\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));\t\t\t\n\t\t}\n\t}\n\treturn true;\n};\n\nexports.fieldmangler = FieldManglerWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/fieldmangler.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/fields.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/fields.js\ntype: application/javascript\nmodule-type: widget\n\nFields widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar FieldsWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nFieldsWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nFieldsWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar textNode = this.document.createTextNode(this.text);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nFieldsWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.tiddlerTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.template = this.getAttribute(\"template\");\n\tthis.exclude = this.getAttribute(\"exclude\");\n\tthis.stripTitlePrefix = this.getAttribute(\"stripTitlePrefix\",\"no\") === \"yes\";\n\t// Get the value to display\n\tvar tiddler = this.wiki.getTiddler(this.tiddlerTitle);\n\t// Get the exclusion list\n\tvar exclude;\n\tif(this.exclude) {\n\t\texclude = this.exclude.split(\" \");\n\t} else {\n\t\texclude = [\"text\"]; \n\t}\n\t// Compose the template\n\tvar text = [];\n\tif(this.template && tiddler) {\n\t\tvar fields = [];\n\t\tfor(var fieldName in tiddler.fields) {\n\t\t\tif(exclude.indexOf(fieldName) === -1) {\n\t\t\t\tfields.push(fieldName);\n\t\t\t}\n\t\t}\n\t\tfields.sort();\n\t\tfor(var f=0; f<fields.length; f++) {\n\t\t\tfieldName = fields[f];\n\t\t\tif(exclude.indexOf(fieldName) === -1) {\n\t\t\t\tvar row = this.template,\n\t\t\t\t\tvalue = tiddler.getFieldString(fieldName);\n\t\t\t\tif(this.stripTitlePrefix && fieldName === \"title\") {\n\t\t\t\t\tvar reStrip = /^\\{[^\\}]+\\}(.+)/mg,\n\t\t\t\t\t\treMatch = reStrip.exec(value);\n\t\t\t\t\tif(reMatch) {\n\t\t\t\t\t\tvalue = reMatch[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trow = row.replace(\"$name$\",fieldName);\n\t\t\t\trow = row.replace(\"$value$\",value);\n\t\t\t\trow = row.replace(\"$encoded_value$\",$tw.utils.htmlEncode(value));\n\t\t\t\ttext.push(row);\n\t\t\t}\n\t\t}\n\t}\n\tthis.text = text.join(\"\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nFieldsWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.template || changedAttributes.exclude || changedAttributes.stripTitlePrefix || changedTiddlers[this.tiddlerTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.fields = FieldsWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/fields.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/image.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/image.js\ntype: application/javascript\nmodule-type: widget\n\nThe image widget displays an image referenced with an external URI or with a local tiddler title.\n\n```\n<$image src=\"TiddlerTitle\" width=\"320\" height=\"400\" class=\"classnames\">\n```\n\nThe image source can be the title of an existing tiddler or the URL of an external image.\n\nExternal images always generate an HTML `<img>` tag.\n\nTiddlers that have a _canonical_uri field generate an HTML `<img>` tag with the src attribute containing the URI.\n\nTiddlers that contain image data generate an HTML `<img>` tag with the src attribute containing a base64 representation of the image.\n\nTiddlers that contain wikitext could be rendered to a DIV of the usual size of a tiddler, and then transformed to the size requested.\n\nThe width and height attributes are interpreted as a number of pixels, and do not need to include the \"px\" suffix.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ImageWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nImageWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nImageWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\t// Determine what type of image it is\n\tvar tag = \"img\", src = \"\",\n\t\ttiddler = this.wiki.getTiddler(this.imageSource);\n\tif(!tiddler) {\n\t\t// The source isn't the title of a tiddler, so we'll assume it's a URL\n\t\tsrc = this.imageSource;\n\t} else {\n\t\t// Check if it is an image tiddler\n\t\tif(this.wiki.isImageTiddler(this.imageSource)) {\n\t\t\tvar type = tiddler.fields.type,\n\t\t\t\ttext = tiddler.fields.text,\n\t\t\t\t_canonical_uri = tiddler.fields._canonical_uri;\n\t\t\t// If the tiddler has body text then it doesn't need to be lazily loaded\n\t\t\tif(text) {\n\t\t\t\t// Render the appropriate element for the image type\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase \"application/pdf\":\n\t\t\t\t\t\ttag = \"embed\";\n\t\t\t\t\t\tsrc = \"data:application/pdf;base64,\" + text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/svg+xml\":\n\t\t\t\t\t\tsrc = \"data:image/svg+xml,\" + encodeURIComponent(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsrc = \"data:\" + type + \";base64,\" + text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if(_canonical_uri) {\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase \"application/pdf\":\n\t\t\t\t\t\ttag = \"embed\";\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/svg+xml\":\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsrc = _canonical_uri;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}\n\t// Create the element and assign the attributes\n\tvar domNode = this.document.createElement(tag);\n\tdomNode.setAttribute(\"src\",src);\n\tif(this.imageClass) {\n\t\tdomNode.setAttribute(\"class\",this.imageClass);\t\t\n\t}\n\tif(this.imageWidth) {\n\t\tdomNode.setAttribute(\"width\",this.imageWidth);\n\t}\n\tif(this.imageHeight) {\n\t\tdomNode.setAttribute(\"height\",this.imageHeight);\n\t}\n\tif(this.imageTooltip) {\n\t\tdomNode.setAttribute(\"title\",this.imageTooltip);\t\t\n\t}\n\tif(this.imageAlt) {\n\t\tdomNode.setAttribute(\"alt\",this.imageAlt);\t\t\n\t}\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.domNodes.push(domNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nImageWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.imageSource = this.getAttribute(\"source\");\n\tthis.imageWidth = this.getAttribute(\"width\");\n\tthis.imageHeight = this.getAttribute(\"height\");\n\tthis.imageClass = this.getAttribute(\"class\");\n\tthis.imageTooltip = this.getAttribute(\"tooltip\");\n\tthis.imageAlt = this.getAttribute(\"alt\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nImageWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.source || changedAttributes.width || changedAttributes.height || changedAttributes[\"class\"] || changedAttributes.tooltip || changedTiddlers[this.imageSource]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\t\n\t}\n};\n\nexports.image = ImageWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/image.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/importvariables.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/importvariables.js\ntype: application/javascript\nmodule-type: widget\n\nImport variable definitions from other tiddlers\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ImportVariablesWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nImportVariablesWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nImportVariablesWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nImportVariablesWidget.prototype.execute = function(tiddlerList) {\n\tvar self = this;\n\t// Get our parameters\n\tthis.filter = this.getAttribute(\"filter\");\n\t// Compute the filter\n\tthis.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);\n\t// Accumulate the <$set> widgets from each tiddler\n\tvar widgetStackStart,widgetStackEnd;\n\tfunction addWidgetNode(widgetNode) {\n\t\tif(widgetNode) {\n\t\t\tif(!widgetStackStart && !widgetStackEnd) {\n\t\t\t\twidgetStackStart = widgetNode;\n\t\t\t\twidgetStackEnd = widgetNode;\n\t\t\t} else {\n\t\t\t\twidgetStackEnd.children = [widgetNode];\n\t\t\t\twidgetStackEnd = widgetNode;\n\t\t\t}\n\t\t}\n\t}\n\t$tw.utils.each(this.tiddlerList,function(title) {\n\t\tvar parser = self.wiki.parseTiddler(title);\n\t\tif(parser) {\n\t\t\tvar parseTreeNode = parser.tree[0];\n\t\t\twhile(parseTreeNode && parseTreeNode.type === \"set\") {\n\t\t\t\taddWidgetNode({\n\t\t\t\t\ttype: \"set\",\n\t\t\t\t\tattributes: parseTreeNode.attributes,\n\t\t\t\t\tparams: parseTreeNode.params\n\t\t\t\t});\n\t\t\t\tparseTreeNode = parseTreeNode.children[0];\n\t\t\t}\n\t\t} \n\t});\n\t// Add our own children to the end of the pile\n\tvar parseTreeNodes;\n\tif(widgetStackStart && widgetStackEnd) {\n\t\tparseTreeNodes = [widgetStackStart];\n\t\twidgetStackEnd.children = this.parseTreeNode.children;\n\t} else {\n\t\tparseTreeNodes = this.parseTreeNode.children;\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nImportVariablesWidget.prototype.refresh = function(changedTiddlers) {\n\t// Recompute our attributes and the filter list\n\tvar changedAttributes = this.computeAttributes(),\n\t\ttiddlerList = this.wiki.filterTiddlers(this.getAttribute(\"filter\"),this);\n\t// Refresh if the filter has changed, or the list of tiddlers has changed, or any of the tiddlers in the list has changed\n\tfunction haveListedTiddlersChanged() {\n\t\tvar changed = false;\n\t\ttiddlerList.forEach(function(title) {\n\t\t\tif(changedTiddlers[title]) {\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t});\n\t\treturn changed;\n\t}\n\tif(changedAttributes.filter || !$tw.utils.isArrayEqual(this.tiddlerList,tiddlerList) || haveListedTiddlersChanged()) {\n\t\t// Compute the filter\n\t\tthis.removeChildDomNodes();\n\t\tthis.execute(tiddlerList);\n\t\tthis.renderChildren(this.parentDomNode,this.findNextSiblingDomNode());\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.importvariables = ImportVariablesWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/importvariables.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/keyboard.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/keyboard.js\ntype: application/javascript\nmodule-type: widget\n\nKeyboard shortcut widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar KeyboardWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nKeyboardWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nKeyboardWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create element\n\tvar domNode = this.document.createElement(\"div\");\n\t// Assign classes\n\tvar classes = (this[\"class\"] || \"\").split(\" \");\n\tclasses.push(\"tc-keyboard\");\n\tdomNode.className = classes.join(\" \");\n\t// Add a keyboard event handler\n\tdomNode.addEventListener(\"keydown\",function (event) {\n\t\tif($tw.utils.checkKeyDescriptor(event,self.keyInfo)) {\n\t\t\tself.dispatchMessage(event);\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t},false);\n\t// Insert element\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nKeyboardWidget.prototype.dispatchMessage = function(event) {\n\tthis.dispatchEvent({type: this.message, param: this.param, tiddlerTitle: this.getVariable(\"currentTiddler\")});\n};\n\n/*\nCompute the internal state of the widget\n*/\nKeyboardWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.message = this.getAttribute(\"message\");\n\tthis.param = this.getAttribute(\"param\");\n\tthis.key = this.getAttribute(\"key\");\n\tthis.keyInfo = $tw.utils.parseKeyDescriptor(this.key);\n\tthis[\"class\"] = this.getAttribute(\"class\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nKeyboardWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.message || changedAttributes.param || changedAttributes.key || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.keyboard = KeyboardWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/keyboard.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/link.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/link.js\ntype: application/javascript\nmodule-type: widget\n\nLink widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar LinkWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nLinkWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nLinkWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Get the value of the tv-wikilinks configuration macro\n\tvar wikiLinksMacro = this.getVariable(\"tv-wikilinks\"),\n\t\tuseWikiLinks = wikiLinksMacro ? (wikiLinksMacro.trim() !== \"no\") : true;\n\t// Render the link if required\n\tif(useWikiLinks) {\n\t\tthis.renderLink(parent,nextSibling);\n\t} else {\n\t\t// Just insert the link text\n\t\tvar domNode = this.document.createElement(\"span\");\n\t\tparent.insertBefore(domNode,nextSibling);\n\t\tthis.renderChildren(domNode,null);\n\t\tthis.domNodes.push(domNode);\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nLinkWidget.prototype.renderLink = function(parent,nextSibling) {\n\tvar self = this;\n\t// Create our element\n\tvar domNode = this.document.createElement(\"a\");\n\t// Assign classes\n\tvar classes = [];\n\tif(this.linkClasses) {\n\t\tclasses.push(this.linkClasses);\n\t}\n\tclasses.push(\"tc-tiddlylink\");\n\tif(this.isShadow) {\n\t\tclasses.push(\"tc-tiddlylink-shadow\");\n\t}\n\tif(this.isMissing && !this.isShadow) {\n\t\tclasses.push(\"tc-tiddlylink-missing\");\n\t} else {\n\t\tif(!this.isMissing) {\n\t\t\tclasses.push(\"tc-tiddlylink-resolves\");\n\t\t}\n\t}\n\tdomNode.setAttribute(\"class\",classes.join(\" \"));\n\t// Set an href\n\tvar wikiLinkTemplateMacro = this.getVariable(\"tv-wikilink-template\"),\n\t\twikiLinkTemplate = wikiLinkTemplateMacro ? wikiLinkTemplateMacro.trim() : \"#$uri_encoded$\",\n\t\twikiLinkText = wikiLinkTemplate.replace(\"$uri_encoded$\",encodeURIComponent(this.to));\n\twikiLinkText = wikiLinkText.replace(\"$uri_doubleencoded$\",encodeURIComponent(encodeURIComponent(this.to)));\n\tdomNode.setAttribute(\"href\",wikiLinkText);\n\t// Set the tooltip\n\t// HACK: Performance issues with re-parsing the tooltip prevent us defaulting the tooltip to \"<$transclude field='tooltip'><$transclude field='title'/></$transclude>\"\n\tvar tooltipWikiText = this.tooltip || this.getVariable(\"tv-wikilink-tooltip\");\n\tif(tooltipWikiText) {\n\t\tvar tooltipText = this.wiki.renderText(\"text/plain\",\"text/vnd.tiddlywiki\",tooltipWikiText,{\n\t\t\t\tparseAsInline: true,\n\t\t\t\tvariables: {\n\t\t\t\t\tcurrentTiddler: this.to\n\t\t\t\t},\n\t\t\t\tparentWidget: this\n\t\t\t});\n\t\tdomNode.setAttribute(\"title\",tooltipText);\n\t}\n\tif(this[\"aria-label\"]) {\n\t\tdomNode.setAttribute(\"aria-label\",this[\"aria-label\"]);\n\t}\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"click\", handlerObject: this, handlerMethod: \"handleClickEvent\"},\n\t\t{name: \"dragstart\", handlerObject: this, handlerMethod: \"handleDragStartEvent\"},\n\t\t{name: \"dragend\", handlerObject: this, handlerMethod: \"handleDragEndEvent\"}\n\t]);\n\t// Insert the link into the DOM and render any children\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nLinkWidget.prototype.handleClickEvent = function(event) {\n\t// Send the click on its way as a navigate event\n\tvar bounds = this.domNodes[0].getBoundingClientRect();\n\tthis.dispatchEvent({\n\t\ttype: \"tm-navigate\",\n\t\tnavigateTo: this.to,\n\t\tnavigateFromTitle: this.getVariable(\"storyTiddler\"),\n\t\tnavigateFromNode: this,\n\t\tnavigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height\n\t\t},\n\t\tnavigateSuppressNavigation: event.metaKey || event.ctrlKey || (event.button === 1)\n\t});\n\tevent.preventDefault();\n\tevent.stopPropagation();\n\treturn false;\n};\n\nLinkWidget.prototype.handleDragStartEvent = function(event) {\n\tif(event.target === this.domNodes[0]) {\n\t\tif(this.to) {\n\t\t\t// Set the dragging class on the element being dragged\n\t\t\t$tw.utils.addClass(event.target,\"tc-tiddlylink-dragging\");\n\t\t\t// Create the drag image elements\n\t\t\tthis.dragImage = this.document.createElement(\"div\");\n\t\t\tthis.dragImage.className = \"tc-tiddler-dragger\";\n\t\t\tvar inner = this.document.createElement(\"div\");\n\t\t\tinner.className = \"tc-tiddler-dragger-inner\";\n\t\t\tinner.appendChild(this.document.createTextNode(this.to));\n\t\t\tthis.dragImage.appendChild(inner);\n\t\t\tthis.document.body.appendChild(this.dragImage);\n\t\t\t// Astoundingly, we need to cover the dragger up: http://www.kryogenix.org/code/browser/custom-drag-image.html\n\t\t\tvar cover = this.document.createElement(\"div\");\n\t\t\tcover.className = \"tc-tiddler-dragger-cover\";\n\t\t\tcover.style.left = (inner.offsetLeft - 16) + \"px\";\n\t\t\tcover.style.top = (inner.offsetTop - 16) + \"px\";\n\t\t\tcover.style.width = (inner.offsetWidth + 32) + \"px\";\n\t\t\tcover.style.height = (inner.offsetHeight + 32) + \"px\";\n\t\t\tthis.dragImage.appendChild(cover);\n\t\t\t// Set the data transfer properties\n\t\t\tvar dataTransfer = event.dataTransfer;\n\t\t\t// First the image\n\t\t\tdataTransfer.effectAllowed = \"copy\";\n\t\t\tif(dataTransfer.setDragImage) {\n\t\t\t\tdataTransfer.setDragImage(this.dragImage.firstChild,-16,-16);\n\t\t\t}\n\t\t\t// Then the data\n\t\t\tdataTransfer.clearData();\n\t\t\tvar jsonData = this.wiki.getTiddlerAsJson(this.to),\n\t\t\t\ttextData = this.wiki.getTiddlerText(this.to,\"\"),\n\t\t\t\ttitle = (new RegExp(\"^\" + $tw.config.textPrimitives.wikiLink + \"$\",\"mg\")).exec(this.to) ? this.to : \"[[\" + this.to + \"]]\";\n\t\t\t// IE doesn't like these content types\n\t\t\tif(!$tw.browser.isIE) {\n\t\t\t\tdataTransfer.setData(\"text/vnd.tiddler\",jsonData);\n\t\t\t\tdataTransfer.setData(\"text/plain\",title);\n\t\t\t\tdataTransfer.setData(\"text/x-moz-url\",\"data:text/vnd.tiddler,\" + encodeURI(jsonData));\n\t\t\t}\n\t\t\tdataTransfer.setData(\"URL\",\"data:text/vnd.tiddler,\" + encodeURI(jsonData));\n\t\t\tdataTransfer.setData(\"Text\",title);\n\t\t\tevent.stopPropagation();\n\t\t} else {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\nLinkWidget.prototype.handleDragEndEvent = function(event) {\n\tif(event.target === this.domNodes[0]) {\n\t\t// Remove the dragging class on the element being dragged\n\t\t$tw.utils.removeClass(event.target,\"tc-tiddlylink-dragging\");\n\t\t// Delete the drag image element\n\t\tif(this.dragImage) {\n\t\t\tthis.dragImage.parentNode.removeChild(this.dragImage);\n\t\t}\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nLinkWidget.prototype.execute = function() {\n\t// Get the target tiddler title\n\tthis.to = this.getAttribute(\"to\",this.getVariable(\"currentTiddler\"));\n\t// Get the link title and aria label\n\tthis.tooltip = this.getAttribute(\"tooltip\");\n\tthis[\"aria-label\"] = this.getAttribute(\"aria-label\");\n\t// Get the link classes\n\tthis.linkClasses = this.getAttribute(\"class\");\n\t// Determine the link characteristics\n\tthis.isMissing = !this.wiki.tiddlerExists(this.to);\n\tthis.isShadow = this.wiki.isShadowTiddler(this.to);\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nLinkWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedTiddlers[this.to] || changedAttributes[\"aria-label\"] || changedAttributes.tooltip) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.link = LinkWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/link.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/linkcatcher.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/linkcatcher.js\ntype: application/javascript\nmodule-type: widget\n\nLinkcatcher widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar LinkCatcherWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-navigate\", handler: \"handleNavigateEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nLinkCatcherWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nLinkCatcherWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nLinkCatcherWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.catchTo = this.getAttribute(\"to\");\n\tthis.catchMessage = this.getAttribute(\"message\");\n\tthis.catchSet = this.getAttribute(\"set\");\n\tthis.catchSetTo = this.getAttribute(\"setTo\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nLinkCatcherWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.to || changedAttributes.message || changedAttributes.set || changedAttributes.setTo) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\n/*\nHandle a tm-navigate event\n*/\nLinkCatcherWidget.prototype.handleNavigateEvent = function(event) {\n\tif(this.catchTo) {\n\t\tthis.wiki.setTextReference(this.catchTo,event.navigateTo,this.getVariable(\"currentTiddler\"));\n\t}\n\tif(this.catchMessage && this.parentWidget) {\n\t\tthis.parentWidget.dispatchEvent({\n\t\t\ttype: this.catchMessage,\n\t\t\tparam: event.navigateTo,\n\t\t\tnavigateTo: event.navigateTo\n\t\t});\n\t}\n\tif(this.catchSet) {\n\t\tvar tiddler = this.wiki.getTiddler(this.catchSet);\n\t\tthis.wiki.addTiddler(new $tw.Tiddler(tiddler,{title: this.catchSet, text: this.catchSetTo}));\n\t}\n\treturn false;\n};\n\nexports.linkcatcher = LinkCatcherWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/linkcatcher.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/list.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/list.js\ntype: application/javascript\nmodule-type: widget\n\nList and list item widgets\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\n/*\nThe list widget creates list element sub-widgets that reach back into the list widget for their configuration\n*/\n\nvar ListWidget = function(parseTreeNode,options) {\n\t// Initialise the storyviews if they've not been done already\n\tif(!this.storyViews) {\n\t\tListWidget.prototype.storyViews = {};\n\t\t$tw.modules.applyMethods(\"storyview\",this.storyViews);\n\t}\n\t// Main initialisation inherited from widget.js\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nListWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nListWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n\t// Construct the storyview\n\tvar StoryView = this.storyViews[this.storyViewName];\n\tif(StoryView && !this.document.isTiddlyWikiFakeDom) {\n\t\tthis.storyview = new StoryView(this);\n\t} else {\n\t\tthis.storyview = null;\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nListWidget.prototype.execute = function() {\n\t// Get our attributes\n\tthis.template = this.getAttribute(\"template\");\n\tthis.editTemplate = this.getAttribute(\"editTemplate\");\n\tthis.variableName = this.getAttribute(\"variable\",\"currentTiddler\");\n\tthis.storyViewName = this.getAttribute(\"storyview\");\n\tthis.historyTitle = this.getAttribute(\"history\");\n\tthis.iterator = this.getAttribute(\"iterator\",\"iterator\");\n\t// Compose the list elements\n\tthis.list = this.getTiddlerList();\n\tvar members = [],\n\t\tself = this,\n\t\tcount = self.list.length;\n\t// Check for an empty list\n\tif(0 === count) {\n\t\tmembers = this.getEmptyMessage();\n\t} else {\n\t\t$tw.utils.each(this.list,function(title,index) {\n\t\t\tmembers.push(self.makeItemTemplate(title,index,count,self.iterator));\n\t\t});\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(members);\n\t// Clear the last history\n\tthis.history = [];\n};\n\nListWidget.prototype.getTiddlerList = function() {\n\tvar defaultFilter = \"[!is[system]sort[title]]\";\n\treturn this.wiki.filterTiddlers(this.getAttribute(\"filter\",defaultFilter),this);\n};\n\nListWidget.prototype.getEmptyMessage = function() {\n\tvar emptyMessage = this.getAttribute(\"emptyMessage\",\"\"),\n\t\tparser = this.wiki.parseText(\"text/vnd.tiddlywiki\",emptyMessage,{parseAsInline: true});\n\tif(parser) {\n\t\treturn parser.tree;\n\t} else {\n\t\treturn [];\n\t}\n};\n\n/*\nCompose the template for a list item\n*/\nListWidget.prototype.makeItemTemplate = function(title,index,count,iterator) {\n\t// Check if the tiddler is a draft\n\tvar tiddler = this.wiki.getTiddler(title),\n\t\tisDraft = tiddler && tiddler.hasField(\"draft.of\"),\n\t\ttemplate = this.template,\n\t\ttemplateTree;\n\tif(isDraft && this.editTemplate) {\n\t\ttemplate = this.editTemplate;\n\t}\n\t// Compose the transclusion of the template\n\tif(template) {\n\t\ttemplateTree = [{type: \"transclude\", attributes: {tiddler: {type: \"string\", value: template}}}];\n\t} else {\n\t\tif(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {\n\t\t\ttemplateTree = this.parseTreeNode.children;\n\t\t} else {\n\t\t\t// Default template is a link to the title\n\t\t\ttemplateTree = [{type: \"element\", tag: this.parseTreeNode.isBlock ? \"div\" : \"span\", children: [{type: \"link\", attributes: {to: {type: \"string\", value: title}}, children: [\n\t\t\t\t\t{type: \"text\", text: title}\n\t\t\t]}]}];\n\t\t}\n\t}\n\t// Return the list item\n\treturn {\n\t\ttype: \"listitem\",\n\t\titemTitle: title,\n\t\tvariableName: this.variableName,\n\t\tchildren: templateTree,\n\t\tindex: index,\n\t\tcount: count,\n\t\titerator: iterator\n\t};\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nListWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Completely refresh if any of our attributes have changed\n\tif(changedAttributes.filter || changedAttributes.template || changedAttributes.editTemplate || changedAttributes.emptyMessage || changedAttributes.storyview || changedAttributes.history) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\t// Handle any changes to the list\n\t\tvar hasChanged = this.handleListChanges(changedTiddlers);\n\t\t// Handle any changes to the history stack\n\t\tif(this.historyTitle && changedTiddlers[this.historyTitle]) {\n\t\t\tthis.handleHistoryChanges();\n\t\t}\n\t\treturn hasChanged;\n\t}\n};\n\n/*\nHandle any changes to the history list\n*/\nListWidget.prototype.handleHistoryChanges = function() {\n\t// Get the history data\n\tvar newHistory = this.wiki.getTiddlerData(this.historyTitle,[]);\n\t// Ignore any entries of the history that match the previous history\n\tvar entry = 0;\n\twhile(entry < newHistory.length && entry < this.history.length && newHistory[entry].title === this.history[entry].title) {\n\t\tentry++;\n\t}\n\t// Navigate forwards to each of the new tiddlers\n\twhile(entry < newHistory.length) {\n\t\tif(this.storyview && this.storyview.navigateTo) {\n\t\t\tthis.storyview.navigateTo(newHistory[entry]);\n\t\t}\n\t\tentry++;\n\t}\n\t// Update the history\n\tthis.history = newHistory;\n};\n\n/*\nProcess any changes to the list\n*/\nListWidget.prototype.handleListChanges = function(changedTiddlers) {\n\t// Get the new list\n\tvar prevList = this.list;\n\tthis.list = this.getTiddlerList();\n\t// Check for an empty list\n\tif(this.list.length === 0) {\n\t\t// Check if it was empty before\n\t\tif(prevList.length === 0) {\n\t\t\t// If so, just refresh the empty message\n\t\t\treturn this.refreshChildren(changedTiddlers);\n\t\t} else {\n\t\t\t// Replace the previous content with the empty message\n\t\t\tfor(t=this.children.length-1; t>=0; t--) {\n\t\t\t\tthis.removeListItem(t);\n\t\t\t}\n\t\t\tvar nextSibling = this.findNextSiblingDomNode();\n\t\t\tthis.makeChildWidgets(this.getEmptyMessage());\n\t\t\tthis.renderChildren(this.parentDomNode,nextSibling);\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\t// If the list was empty then we need to remove the empty message\n\t\tif(prevList.length === 0) {\n\t\t\tthis.removeChildDomNodes();\n\t\t\tthis.children = [];\n\t\t}\n\t\t// Cycle through the list, inserting and removing list items as needed\n\t\tvar hasRefreshed = false;\n\t\tfor(var t=0; t<this.list.length; t++) {\n\t\t\tvar index = this.findListItem(t,this.list[t]);\n\t\t\tif(index === undefined) {\n\t\t\t\t// The list item must be inserted\n\t\t\t\tthis.insertListItem(t,this.list[t]);\n\t\t\t\thasRefreshed = true;\n\t\t\t} else {\n\t\t\t\t// There are intervening list items that must be removed\n\t\t\t\tfor(var n=index-1; n>=t; n--) {\n\t\t\t\t\tthis.removeListItem(n);\n\t\t\t\t\thasRefreshed = true;\n\t\t\t\t}\n\t\t\t\t// Refresh the item we're reusing\n\t\t\t\tvar refreshed = this.children[t].refresh(changedTiddlers);\n\t\t\t\thasRefreshed = hasRefreshed || refreshed;\n\t\t\t}\n\t\t}\n\t\t// Remove any left over items\n\t\tfor(t=this.children.length-1; t>=this.list.length; t--) {\n\t\t\tthis.removeListItem(t);\n\t\t\thasRefreshed = true;\n\t\t}\n\t\treturn hasRefreshed;\n\t}\n};\n\n/*\nFind the list item with a given title, starting from a specified position\n*/\nListWidget.prototype.findListItem = function(startIndex,title) {\n\twhile(startIndex < this.children.length) {\n\t\tif(this.children[startIndex].parseTreeNode.itemTitle === title) {\n\t\t\treturn startIndex;\n\t\t}\n\t\tstartIndex++;\n\t}\n\treturn undefined;\n};\n\n/*\nInsert a new list item at the specified index\n*/\nListWidget.prototype.insertListItem = function(index,title) {\n\t// Create, insert and render the new child widgets\n\tvar widget = this.makeChildWidget(this.makeItemTemplate(title));\n\twidget.parentDomNode = this.parentDomNode; // Hack to enable findNextSiblingDomNode() to work\n\tthis.children.splice(index,0,widget);\n\tvar nextSibling = widget.findNextSiblingDomNode();\n\twidget.render(this.parentDomNode,nextSibling);\n\t// Animate the insertion if required\n\tif(this.storyview && this.storyview.insert) {\n\t\tthis.storyview.insert(widget);\n\t}\n\treturn true;\n};\n\n/*\nRemove the specified list item\n*/\nListWidget.prototype.removeListItem = function(index) {\n\tvar widget = this.children[index];\n\t// Animate the removal if required\n\tif(this.storyview && this.storyview.remove) {\n\t\tthis.storyview.remove(widget);\n\t} else {\n\t\twidget.removeChildDomNodes();\n\t}\n\t// Remove the child widget\n\tthis.children.splice(index,1);\n};\n\nexports.list = ListWidget;\n\nvar ListItemWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nListItemWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nListItemWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nListItemWidget.prototype.execute = function() {\n\tvar item = this.parseTreeNode;\n\t// Set the current list item title\n\tthis.setVariable(item.variableName,item.itemTitle);\n\tthis.setVariable(item.iterator,(item.index + 1).toString());\n\tthis.setVariable(item.iterator + \"-even\",item.index % 2 == 1 ? \"true\" : \"false\");\n\tthis.setVariable(item.iterator + \"-last\",item.index + 1 == item.count ? \"true\" : \"false\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nListItemWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.listitem = ListItemWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/list.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/macrocall.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/macrocall.js\ntype: application/javascript\nmodule-type: widget\n\nMacrocall widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar MacroCallWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nMacroCallWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nMacroCallWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nMacroCallWidget.prototype.execute = function() {\n\t// Get the parse type if specified\n\tthis.parseType = this.getAttribute(\"$type\",\"text/vnd.tiddlywiki\");\n\tthis.renderOutput = this.getAttribute(\"$output\",\"text/html\");\n\t// Merge together the parameters specified in the parse tree with the specified attributes\n\tvar params = this.parseTreeNode.params ? this.parseTreeNode.params.slice(0) : [];\n\t$tw.utils.each(this.attributes,function(attribute,name) {\n\t\tif(name.charAt(0) !== \"$\") {\n\t\t\tparams.push({name: name, value: attribute});\t\t\t\n\t\t}\n\t});\n\t// Get the macro value\n\tvar text = this.getVariable(this.parseTreeNode.name || this.getAttribute(\"$name\"),{params: params}),\n\t\tparseTreeNodes;\n\t// Are we rendering to HTML?\n\tif(this.renderOutput === \"text/html\") {\n\t\t// If so we'll return the parsed macro\n\t\tvar parser = this.wiki.parseText(this.parseType,text,\n\t\t\t\t\t\t\t{parseAsInline: !this.parseTreeNode.isBlock});\n\t\tparseTreeNodes = parser ? parser.tree : [];\n\t} else {\n\t\t// Otherwise, we'll render the text\n\t\tvar plainText = this.wiki.renderText(\"text/plain\",this.parseType,text,{parentWidget: this});\n\t\tparseTreeNodes = [{type: \"text\", text: plainText}];\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nMacroCallWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif($tw.utils.count(changedAttributes) > 0) {\n\t\t// Rerender ourselves\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.macrocall = MacroCallWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/macrocall.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/navigator.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/navigator.js\ntype: application/javascript\nmodule-type: widget\n\nNavigator widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar IMPORT_TITLE = \"$:/Import\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar NavigatorWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.addEventListeners([\n\t\t{type: \"tm-navigate\", handler: \"handleNavigateEvent\"},\n\t\t{type: \"tm-edit-tiddler\", handler: \"handleEditTiddlerEvent\"},\n\t\t{type: \"tm-delete-tiddler\", handler: \"handleDeleteTiddlerEvent\"},\n\t\t{type: \"tm-save-tiddler\", handler: \"handleSaveTiddlerEvent\"},\n\t\t{type: \"tm-cancel-tiddler\", handler: \"handleCancelTiddlerEvent\"},\n\t\t{type: \"tm-close-tiddler\", handler: \"handleCloseTiddlerEvent\"},\n\t\t{type: \"tm-close-all-tiddlers\", handler: \"handleCloseAllTiddlersEvent\"},\n\t\t{type: \"tm-close-other-tiddlers\", handler: \"handleCloseOtherTiddlersEvent\"},\n\t\t{type: \"tm-new-tiddler\", handler: \"handleNewTiddlerEvent\"},\n\t\t{type: \"tm-import-tiddlers\", handler: \"handleImportTiddlersEvent\"},\n\t\t{type: \"tm-perform-import\", handler: \"handlePerformImportEvent\"}\n\t]);\n};\n\n/*\nInherit from the base widget class\n*/\nNavigatorWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nNavigatorWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nNavigatorWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.storyTitle = this.getAttribute(\"story\");\n\tthis.historyTitle = this.getAttribute(\"history\");\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nNavigatorWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.story || changedAttributes.history) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nNavigatorWidget.prototype.getStoryList = function() {\n\treturn this.storyTitle ? this.wiki.getTiddlerList(this.storyTitle) : null;\n};\n\nNavigatorWidget.prototype.saveStoryList = function(storyList) {\n\tvar storyTiddler = this.wiki.getTiddler(this.storyTitle);\n\tthis.wiki.addTiddler(new $tw.Tiddler(\n\t\t{title: this.storyTitle},\n\t\tstoryTiddler,\n\t\t{list: storyList}\n\t));\n};\n\nNavigatorWidget.prototype.findTitleInStory = function(storyList,title,defaultIndex) {\n\tvar p = storyList.indexOf(title);\n\treturn p === -1 ? defaultIndex : p;\n};\n\nNavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) {\n\tvar p = storyList.indexOf(title);\n\twhile(p !== -1) {\n\t\tstoryList.splice(p,1);\n\t\tp = storyList.indexOf(title);\n\t}\n};\n\nNavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle,newTitle) {\n\tvar pos = storyList.indexOf(oldTitle);\n\tif(pos !== -1) {\n\t\tstoryList[pos] = newTitle;\n\t\tdo {\n\t\t\tpos = storyList.indexOf(oldTitle,pos + 1);\n\t\t\tif(pos !== -1) {\n\t\t\t\tstoryList.splice(pos,1);\n\t\t\t}\n\t\t} while(pos !== -1);\n\t} else {\n\t\tstoryList.splice(0,0,newTitle);\n\t}\n};\n\nNavigatorWidget.prototype.addToStory = function(title,fromTitle) {\n\tvar storyList = this.getStoryList();\n\tif(storyList) {\n\t\t// See if the tiddler is already there\n\t\tvar slot = this.findTitleInStory(storyList,title,-1);\n\t\t// If not we need to add it\n\t\tif(slot === -1) {\n\t\t\t// First we try to find the position of the story element we navigated from\n\t\t\tslot = this.findTitleInStory(storyList,fromTitle,-1) + 1;\n\t\t\t// Add the tiddler\n\t\t\tstoryList.splice(slot,0,title);\n\t\t\t// Save the story\n\t\t\tthis.saveStoryList(storyList);\n\t\t}\n\t}\n};\n\n/*\nAdd a new record to the top of the history stack\ntitle: a title string or an array of title strings\nfromPageRect: page coordinates of the origin of the navigation\n*/\nNavigatorWidget.prototype.addToHistory = function(title,fromPageRect) {\n\tthis.wiki.addToHistory(title,fromPageRect,this.historyTitle);\n};\n\n/*\nHandle a tm-navigate event\n*/\nNavigatorWidget.prototype.handleNavigateEvent = function(event) {\n\tthis.addToStory(event.navigateTo,event.navigateFromTitle);\n\tif(!event.navigateSuppressNavigation) {\n\t\tthis.addToHistory(event.navigateTo,event.navigateFromClientRect);\n\t}\n\treturn false;\n};\n\n// Close a specified tiddler\nNavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle,\n\t\tstoryList = this.getStoryList();\n\t// Look for tiddlers with this title to close\n\tthis.removeTitleFromStory(storyList,title);\n\tthis.saveStoryList(storyList);\n\treturn false;\n};\n\n// Close all tiddlers\nNavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {\n\tthis.saveStoryList([]);\n\treturn false;\n};\n\n// Close other tiddlers\nNavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle;\n\tthis.saveStoryList([title]);\n\treturn false;\n};\n\n// Place a tiddler in edit mode\nNavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {\n\tvar self = this;\n\tfunction isUnmodifiedShadow(title) {\n\t\treturn self.wiki.isShadowTiddler(title) && !self.wiki.tiddlerExists(title);\n\t}\n\tfunction confirmEditShadow(title) {\n\t\treturn confirm($tw.language.getString(\n\t\t\t\"ConfirmEditShadowTiddler\",\n\t\t\t{variables:\n\t\t\t\t{title: title}\n\t\t\t}\n\t\t));\n\t}\n\tvar title = event.param || event.tiddlerTitle;\n\tif(isUnmodifiedShadow(title) && !confirmEditShadow(title)) {\n\t\treturn false;\n\t}\n\t// Replace the specified tiddler with a draft in edit mode\n\tvar draftTiddler = this.makeDraftTiddler(title),\n\t\tdraftTitle = draftTiddler.fields.title,\n\t\tstoryList = this.getStoryList();\n\tthis.removeTitleFromStory(storyList,draftTitle);\n\tthis.replaceFirstTitleInStory(storyList,title,draftTitle);\n\tthis.addToHistory(draftTitle,event.navigateFromClientRect);\n\tthis.saveStoryList(storyList);\n\treturn false;\n};\n\n// Delete a tiddler\nNavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {\n\t// Get the tiddler we're deleting\n\tvar title = event.param || event.tiddlerTitle,\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tstoryList = this.getStoryList(),\n\t\toriginalTitle = tiddler.fields[\"draft.of\"],\n\t\tconfirmationTitle;\n\t// Check if the tiddler we're deleting is in draft mode\n\tif(originalTitle) {\n\t\t// If so, we'll prompt for confirmation referencing the original tiddler\n\t\tconfirmationTitle = originalTitle;\n\t} else {\n\t\t// If not a draft, then prompt for confirmation referencing the specified tiddler\n\t\tconfirmationTitle = title;\n\t}\n\t// Seek confirmation\n\tif((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || \"\") !== \"\") && !confirm($tw.language.getString(\n\t\t\t\t\"ConfirmDeleteTiddler\",\n\t\t\t\t{variables:\n\t\t\t\t\t{title: confirmationTitle}\n\t\t\t\t}\n\t\t\t))) {\n\t\treturn false;\n\t}\n\t// Delete the original tiddler\n\tif(originalTitle) {\n\t\tthis.wiki.deleteTiddler(originalTitle);\n\t\tthis.removeTitleFromStory(storyList,originalTitle);\n\t}\n\t// Delete this tiddler\n\tthis.wiki.deleteTiddler(title);\n\t// Remove the closed tiddler from the story\n\tthis.removeTitleFromStory(storyList,title);\n\tthis.saveStoryList(storyList);\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\treturn false;\n};\n\n/*\nCreate/reuse the draft tiddler for a given title\n*/\nNavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {\n\t// See if there is already a draft tiddler for this tiddler\n\tvar draftTitle = this.wiki.findDraft(targetTitle);\n\tif(draftTitle) {\n\t\treturn this.wiki.getTiddler(draftTitle);\n\t}\n\t// Get the current value of the tiddler we're editing\n\tvar tiddler = this.wiki.getTiddler(targetTitle);\n\t// Save the initial value of the draft tiddler\n\tdraftTitle = this.generateDraftTitle(targetTitle);\n\tvar draftTiddler = new $tw.Tiddler(\n\t\t\ttiddler,\n\t\t\t{\n\t\t\t\ttitle: draftTitle,\n\t\t\t\t\"draft.title\": targetTitle,\n\t\t\t\t\"draft.of\": targetTitle\n\t\t\t},\n\t\t\tthis.wiki.getModificationFields()\n\t\t);\n\tthis.wiki.addTiddler(draftTiddler);\n\treturn draftTiddler;\n};\n\n/*\nGenerate a title for the draft of a given tiddler\n*/\nNavigatorWidget.prototype.generateDraftTitle = function(title) {\n\tvar c = 0,\n\t\tdraftTitle;\n\tdo {\n\t\tdraftTitle = \"Draft \" + (c ? (c + 1) + \" \" : \"\") + \"of '\" + title + \"'\";\n\t\tc++;\n\t} while(this.wiki.tiddlerExists(draftTitle));\n\treturn draftTitle;\n};\n\n// Take a tiddler out of edit mode, saving the changes\nNavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {\n\tvar title = event.param || event.tiddlerTitle,\n\t\ttiddler = this.wiki.getTiddler(title),\n\t\tstoryList = this.getStoryList();\n\t// Replace the original tiddler with the draft\n\tif(tiddler) {\n\t\tvar draftTitle = (tiddler.fields[\"draft.title\"] || \"\").trim(),\n\t\t\tdraftOf = (tiddler.fields[\"draft.of\"] || \"\").trim();\n\t\tif(draftTitle) {\n\t\t\tvar isRename = draftOf !== draftTitle,\n\t\t\t\tisConfirmed = true;\n\t\t\tif(isRename && this.wiki.tiddlerExists(draftTitle)) {\n\t\t\t\tisConfirmed = confirm($tw.language.getString(\n\t\t\t\t\t\"ConfirmOverwriteTiddler\",\n\t\t\t\t\t{variables:\n\t\t\t\t\t\t{title: draftTitle}\n\t\t\t\t\t}\n\t\t\t\t));\n\t\t\t}\n\t\t\tif(isConfirmed) {\n\t\t\t\t// Save the draft tiddler as the real tiddler\n\t\t\t\tthis.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{\n\t\t\t\t\ttitle: draftTitle,\n\t\t\t\t\t\"draft.title\": undefined,\n\t\t\t\t\t\"draft.of\": undefined\n\t\t\t\t},this.wiki.getModificationFields()));\n\t\t\t\t// Remove the draft tiddler\n\t\t\t\tthis.wiki.deleteTiddler(title);\n\t\t\t\t// Remove the original tiddler if we're renaming it\n\t\t\t\tif(isRename) {\n\t\t\t\t\tthis.wiki.deleteTiddler(draftOf);\n\t\t\t\t}\n\t\t\t\t// Replace the draft in the story with the original\n\t\t\t\tthis.replaceFirstTitleInStory(storyList,title,draftTitle);\n\t\t\t\tthis.addToHistory(draftTitle,event.navigateFromClientRect);\n\t\t\t\tif(draftTitle !== this.storyTitle) {\n\t\t\t\t\tthis.saveStoryList(storyList);\n\t\t\t\t}\n\t\t\t\t// Trigger an autosave\n\t\t\t\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n};\n\n// Take a tiddler out of edit mode without saving the changes\nNavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {\n\t// Flip the specified tiddler from draft back to the original\n\tvar draftTitle = event.param || event.tiddlerTitle,\n\t\tdraftTiddler = this.wiki.getTiddler(draftTitle),\n\t\toriginalTitle = draftTiddler && draftTiddler.fields[\"draft.of\"];\n\tif(draftTiddler && originalTitle) {\n\t\t// Ask for confirmation if the tiddler text has changed\n\t\tvar isConfirmed = true,\n\t\t\toriginalTiddler = this.wiki.getTiddler(originalTitle),\n\t\t\tstoryList = this.getStoryList();\n\t\tif(this.wiki.isDraftModified(draftTitle)) {\n\t\t\tisConfirmed = confirm($tw.language.getString(\n\t\t\t\t\"ConfirmCancelTiddler\",\n\t\t\t\t{variables:\n\t\t\t\t\t{title: draftTitle}\n\t\t\t\t}\n\t\t\t));\n\t\t}\n\t\t// Remove the draft tiddler\n\t\tif(isConfirmed) {\n\t\t\tthis.wiki.deleteTiddler(draftTitle);\n\t\t\tif(originalTiddler) {\n\t\t\t\tthis.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);\n\t\t\t\tthis.addToHistory(originalTitle,event.navigateFromClientRect);\n\t\t\t} else {\n\t\t\t\tthis.removeTitleFromStory(storyList,draftTitle);\n\t\t\t}\n\t\t\tthis.saveStoryList(storyList);\n\t\t\t// Trigger an autosave\n\t\t\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\t\t\t\n\t\t}\n\t}\n\treturn false;\n};\n\n// Create a new draft tiddler\n// event.param can either be the title of a template tiddler, or a hashmap of fields.\n//\n// The title of the newly created tiddler follows these rules:\n// * If a hashmap was used and a title field was specified, use that title\n// * If a hashmap was used without a title field, use a default title, if necessary making it unique with a numeric suffix\n// * If a template tiddler was used, use the title of the template, if necessary making it unique with a numeric suffix\n//\n// If a draft of the target tiddler already exists then it is reused\nNavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {\n\t// Get the story details\n\tvar storyList = this.getStoryList(),\n\t\ttemplateTiddler, additionalFields, title, draftTitle, existingTiddler;\n\t// Get the template tiddler (if any)\n\tif(typeof event.param === \"string\") {\n\t\t// Get the template tiddler\n\t\ttemplateTiddler = this.wiki.getTiddler(event.param);\n\t\t// Generate a new title\n\t\ttitle = this.wiki.generateNewTitle(event.param || $tw.language.getString(\"DefaultNewTiddlerTitle\"));\n\t}\n\t// Get the specified additional fields\n\tif(typeof event.paramObject === \"object\") {\n\t\tadditionalFields = event.paramObject;\n\t}\n\tif(typeof event.param === \"object\") { // Backwards compatibility with 5.1.3\n\t\tadditionalFields = event.param;\n\t}\n\tif(additionalFields && additionalFields.title) {\n\t\ttitle = additionalFields.title;\n\t}\n\t// Generate a title if we don't have one\n\ttitle = title || this.wiki.generateNewTitle($tw.language.getString(\"DefaultNewTiddlerTitle\"));\n\t// Find any existing draft for this tiddler\n\tdraftTitle = this.wiki.findDraft(title);\n\t// Pull in any existing tiddler\n\tif(draftTitle) {\n\t\texistingTiddler = this.wiki.getTiddler(draftTitle);\n\t} else {\n\t\tdraftTitle = this.generateDraftTitle(title);\n\t\texistingTiddler = this.wiki.getTiddler(title);\n\t}\n\t// Merge the tags\n\tvar mergedTags = [];\n\tif(existingTiddler && existingTiddler.fields.tags) {\n\t\t$tw.utils.pushTop(mergedTags,existingTiddler.fields.tags)\n\t}\n\tif(additionalFields && additionalFields.tags) {\n\t\t// Merge tags\n\t\tmergedTags = $tw.utils.pushTop(mergedTags,$tw.utils.parseStringArray(additionalFields.tags));\n\t}\n\tif(templateTiddler && templateTiddler.fields.tags) {\n\t\t// Merge tags\n\t\tmergedTags = $tw.utils.pushTop(mergedTags,templateTiddler.fields.tags);\n\t}\n\t// Save the draft tiddler\n\tvar draftTiddler = new $tw.Tiddler({\n\t\t\ttext: \"\",\n\t\t\t\"draft.title\": title\n\t\t},\n\t\ttemplateTiddler,\n\t\texistingTiddler,\n\t\tadditionalFields,\n\t\tthis.wiki.getCreationFields(),\n\t\t{\n\t\t\ttitle: draftTitle,\n\t\t\t\"draft.of\": title,\n\t\t\ttags: mergedTags\n\t\t},this.wiki.getModificationFields());\n\tthis.wiki.addTiddler(draftTiddler);\n\t// Update the story to insert the new draft at the top and remove any existing tiddler\n\tif(storyList.indexOf(draftTitle) === -1) {\n\t\tvar slot = storyList.indexOf(event.navigateFromTitle);\n\t\tstoryList.splice(slot + 1,0,draftTitle);\n\t}\n\tif(storyList.indexOf(title) !== -1) {\n\t\tstoryList.splice(storyList.indexOf(title),1);\t\t\n\t}\n\tthis.saveStoryList(storyList);\n\t// Add a new record to the top of the history stack\n\tthis.addToHistory(draftTitle);\n\treturn false;\n};\n\n// Import JSON tiddlers into a pending import tiddler\nNavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {\n\tvar self = this;\n\t// Get the tiddlers\n\tvar tiddlers = [];\n\ttry {\n\t\ttiddlers = JSON.parse(event.param);\t\n\t} catch(e) {\n\t}\n\t// Get the current $:/Import tiddler\n\tvar importTiddler = this.wiki.getTiddler(IMPORT_TITLE),\n\t\timportData = this.wiki.getTiddlerData(IMPORT_TITLE,{}),\n\t\tnewFields = new Object({\n\t\t\ttitle: IMPORT_TITLE,\n\t\t\ttype: \"application/json\",\n\t\t\t\"plugin-type\": \"import\",\n\t\t\t\"status\": \"pending\"\n\t\t}),\n\t\tincomingTiddlers = [];\n\t// Process each tiddler\n\timportData.tiddlers = importData.tiddlers || {};\n\t$tw.utils.each(tiddlers,function(tiddlerFields) {\n\t\tvar title = tiddlerFields.title;\n\t\tif(title) {\n\t\t\tincomingTiddlers.push(title);\n\t\t\timportData.tiddlers[title] = tiddlerFields;\n\t\t}\n\t});\n\t// Give the active upgrader modules a chance to process the incoming tiddlers\n\tvar messages = this.wiki.invokeUpgraders(incomingTiddlers,importData.tiddlers);\n\t$tw.utils.each(messages,function(message,title) {\n\t\tnewFields[\"message-\" + title] = message;\n\t});\n\t// Deselect any suppressed tiddlers\n\t$tw.utils.each(importData.tiddlers,function(tiddler,title) {\n\t\tif($tw.utils.count(tiddler) === 0) {\n\t\t\tnewFields[\"selection-\" + title] = \"unchecked\";\n\t\t}\n\t});\n\t// Save the $:/Import tiddler\n\tnewFields.text = JSON.stringify(importData,null,$tw.config.preferences.jsonSpaces);\n\tthis.wiki.addTiddler(new $tw.Tiddler(importTiddler,newFields));\n\t// Update the story and history details\n\tif(this.getVariable(\"tv-auto-open-on-import\") !== \"no\") {\n\t\tvar storyList = this.getStoryList(),\n\t\t\thistory = [];\n\t\t// Add it to the story\n\t\tif(storyList.indexOf(IMPORT_TITLE) === -1) {\n\t\t\tstoryList.unshift(IMPORT_TITLE);\n\t\t}\n\t\t// And to history\n\t\thistory.push(IMPORT_TITLE);\n\t\t// Save the updated story and history\n\t\tthis.saveStoryList(storyList);\n\t\tthis.addToHistory(history);\t\t\n\t}\n\treturn false;\n};\n\n// \nNavigatorWidget.prototype.handlePerformImportEvent = function(event) {\n\tvar self = this,\n\t\timportTiddler = this.wiki.getTiddler(event.param),\n\t\timportData = this.wiki.getTiddlerData(event.param,{tiddlers: {}}),\n\t\timportReport = [];\n\t// Add the tiddlers to the store\n\timportReport.push(\"The following tiddlers were imported:\\n\");\n\t$tw.utils.each(importData.tiddlers,function(tiddlerFields) {\n\t\tvar title = tiddlerFields.title;\n\t\tif(title && importTiddler && importTiddler.fields[\"selection-\" + title] !== \"unchecked\") {\n\t\t\tself.wiki.addTiddler(new $tw.Tiddler(tiddlerFields));\n\t\t\timportReport.push(\"# [[\" + tiddlerFields.title + \"]]\");\n\t\t}\n\t});\n\t// Replace the $:/Import tiddler with an import report\n\tthis.wiki.addTiddler(new $tw.Tiddler({\n\t\ttitle: IMPORT_TITLE,\n\t\ttext: importReport.join(\"\\n\"),\n\t\t\"status\": \"complete\"\n\t}));\n\t// Navigate to the $:/Import tiddler\n\tthis.addToHistory([IMPORT_TITLE]);\n\t// Trigger an autosave\n\t$tw.rootWidget.dispatchEvent({type: \"tm-auto-save-wiki\"});\n};\n\nexports.navigator = NavigatorWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/navigator.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/password.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/password.js\ntype: application/javascript\nmodule-type: widget\n\nPassword widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar PasswordWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nPasswordWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nPasswordWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Get the current password\n\tvar password = $tw.browser ? $tw.utils.getPassword(this.passwordName) || \"\" : \"\";\n\t// Create our element\n\tvar domNode = this.document.createElement(\"input\");\n\tdomNode.setAttribute(\"type\",\"password\");\n\tdomNode.setAttribute(\"value\",password);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(domNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tthis.domNodes.push(domNode);\n};\n\nPasswordWidget.prototype.handleChangeEvent = function(event) {\n\tvar password = this.domNodes[0].value;\n\treturn $tw.utils.savePassword(this.passwordName,password);\n};\n\n/*\nCompute the internal state of the widget\n*/\nPasswordWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.passwordName = this.getAttribute(\"name\",\"\");\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nPasswordWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.name) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\n\t}\n};\n\nexports.password = PasswordWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/password.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/radio.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/radio.js\ntype: application/javascript\nmodule-type: widget\n\nRadio widget\n\nWill set a field to the selected value:\n\n```\n\t<$radio field=\"myfield\" value=\"check 1\">one</$radio>\n\t<$radio field=\"myfield\" value=\"check 2\">two</$radio>\n\t<$radio field=\"myfield\" value=\"check 3\">three</$radio>\n```\n\n|Parameter |Description |h\n|tiddler |Name of the tiddler in which the field should be set. Defaults to current tiddler |\n|field |The name of the field to be set |\n|value |The value to set |\n|class |Optional class name(s) |\n\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RadioWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRadioWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRadioWidget.prototype.render = function(parent,nextSibling) {\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Create our elements\n\tthis.labelDomNode = this.document.createElement(\"label\");\n\tthis.labelDomNode.setAttribute(\"class\",this.radioClass);\n\tthis.inputDomNode = this.document.createElement(\"input\");\n\tthis.inputDomNode.setAttribute(\"type\",\"radio\");\n\tif(this.getValue() == this.radioValue) {\n\t\tthis.inputDomNode.setAttribute(\"checked\",\"true\");\n\t}\n\tthis.labelDomNode.appendChild(this.inputDomNode);\n\tthis.spanDomNode = this.document.createElement(\"span\");\n\tthis.labelDomNode.appendChild(this.spanDomNode);\n\t// Add a click event handler\n\t$tw.utils.addEventListeners(this.inputDomNode,[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n\t// Insert the label into the DOM and render any children\n\tparent.insertBefore(this.labelDomNode,nextSibling);\n\tthis.renderChildren(this.spanDomNode,null);\n\tthis.domNodes.push(this.labelDomNode);\n};\n\nRadioWidget.prototype.getValue = function() {\n\tvar tiddler = this.wiki.getTiddler(this.radioTitle);\n\treturn tiddler && tiddler.getFieldString(this.radioField);\n};\n\nRadioWidget.prototype.setValue = function() {\n\tif(this.radioField) {\n\t\tvar tiddler = this.wiki.getTiddler(this.radioTitle),\n\t\t\taddition = {};\n\t\taddition[this.radioField] = this.radioValue;\n\t\tthis.wiki.addTiddler(new $tw.Tiddler({title: this.radioTitle},tiddler,addition,this.wiki.getModificationFields()));\n\t}\n};\n\nRadioWidget.prototype.handleChangeEvent = function(event) {\n\tif(this.inputDomNode.checked) {\n\t\tthis.setValue();\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nRadioWidget.prototype.execute = function() {\n\t// Get the parameters from the attributes\n\tthis.radioTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.radioField = this.getAttribute(\"field\",\"text\");\n\tthis.radioValue = this.getAttribute(\"value\");\n\tthis.radioClass = this.getAttribute(\"class\",\"\");\n\tif(this.radioClass !== \"\") {\n\t\tthis.radioClass += \" \";\n\t}\n\tthis.radioClass += \"tc-radio\";\n\t// Make the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRadioWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.value || changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false;\n\t\tif(changedTiddlers[this.radioTitle]) {\n\t\t\tthis.inputDomNode.checked = this.getValue() === this.radioValue;\n\t\t\trefreshed = true;\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\nexports.radio = RadioWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/radio.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/raw.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/raw.js\ntype: application/javascript\nmodule-type: widget\n\nRaw widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RawWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRawWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRawWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tvar div = this.document.createElement(\"div\");\n\tdiv.innerHTML=this.parseTreeNode.html;\n\tparent.insertBefore(div,nextSibling);\n\tthis.domNodes.push(div);\t\n};\n\n/*\nCompute the internal state of the widget\n*/\nRawWidget.prototype.execute = function() {\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRawWidget.prototype.refresh = function(changedTiddlers) {\n\treturn false;\n};\n\nexports.raw = RawWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/raw.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/reveal.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/reveal.js\ntype: application/javascript\nmodule-type: widget\n\nReveal widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar RevealWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nRevealWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nRevealWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar domNode = this.document.createElement(this.parseTreeNode.isBlock ? \"div\" : \"span\");\n\tvar classes = this[\"class\"].split(\" \") || [];\n\tclasses.push(\"tc-reveal\");\n\tdomNode.className = classes.join(\" \");\n\tparent.insertBefore(domNode,nextSibling);\n\tthis.renderChildren(domNode,null);\n\tif(!domNode.isTiddlyWikiFakeDom && this.type === \"popup\" && this.isOpen) {\n\t\tthis.positionPopup(domNode);\n\t\t$tw.utils.addClass(domNode,\"tc-popup\"); // Make sure that clicks don't dismiss popups within the revealed content\n\t}\n\tif(!this.isOpen) {\n\t\tdomNode.setAttribute(\"hidden\",\"true\");\n\t}\n\tthis.domNodes.push(domNode);\n};\n\nRevealWidget.prototype.positionPopup = function(domNode) {\n\tdomNode.style.position = \"absolute\";\n\tdomNode.style.zIndex = \"1000\";\n\tswitch(this.position) {\n\t\tcase \"left\":\n\t\t\tdomNode.style.left = (this.popup.left - domNode.offsetWidth) + \"px\";\n\t\t\tdomNode.style.top = this.popup.top + \"px\";\n\t\t\tbreak;\n\t\tcase \"above\":\n\t\t\tdomNode.style.left = this.popup.left + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top - domNode.offsetHeight) + \"px\";\n\t\t\tbreak;\n\t\tcase \"aboveright\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width) + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height - domNode.offsetHeight) + \"px\";\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width) + \"px\";\n\t\t\tdomNode.style.top = this.popup.top + \"px\";\n\t\t\tbreak;\n\t\tcase \"belowleft\":\n\t\t\tdomNode.style.left = (this.popup.left + this.popup.width - domNode.offsetWidth) + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height) + \"px\";\n\t\t\tbreak;\n\t\tdefault: // Below\n\t\t\tdomNode.style.left = this.popup.left + \"px\";\n\t\t\tdomNode.style.top = (this.popup.top + this.popup.height) + \"px\";\n\t\t\tbreak;\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nRevealWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.state = this.getAttribute(\"state\");\n\tthis.type = this.getAttribute(\"type\");\n\tthis.text = this.getAttribute(\"text\");\n\tthis.position = this.getAttribute(\"position\");\n\tthis[\"class\"] = this.getAttribute(\"class\",\"\");\n\tthis[\"default\"] = this.getAttribute(\"default\",\"\");\n\tthis.animate = this.getAttribute(\"animate\",\"no\");\n\tthis.retain = this.getAttribute(\"retain\",\"no\");\n\tthis.openAnimation = this.animate === \"no\" ? undefined : \"open\";\n\tthis.closeAnimation = this.animate === \"no\" ? undefined : \"close\";\n\t// Compute the title of the state tiddler and read it\n\tthis.stateTitle = this.state;\n\tthis.readState();\n\t// Construct the child widgets\n\tvar childNodes = this.isOpen ? this.parseTreeNode.children : [];\n\tthis.hasChildNodes = this.isOpen;\n\tthis.makeChildWidgets(childNodes);\n};\n\n/*\nRead the state tiddler\n*/\nRevealWidget.prototype.readState = function() {\n\t// Read the information from the state tiddler\n\tvar state = this.stateTitle ? this.wiki.getTextReference(this.stateTitle,this[\"default\"],this.getVariable(\"currentTiddler\")) : this[\"default\"];\n\tswitch(this.type) {\n\t\tcase \"popup\":\n\t\t\tthis.readPopupState(state);\n\t\t\tbreak;\n\t\tcase \"match\":\n\t\t\tthis.readMatchState(state);\n\t\t\tbreak;\n\t\tcase \"nomatch\":\n\t\t\tthis.readMatchState(state);\n\t\t\tthis.isOpen = !this.isOpen;\n\t\t\tbreak;\n\t}\n};\n\nRevealWidget.prototype.readMatchState = function(state) {\n\tthis.isOpen = state === this.text;\n};\n\nRevealWidget.prototype.readPopupState = function(state) {\n\tvar popupLocationRegExp = /^\\((-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+),(-?[0-9\\.E]+)\\)$/,\n\t\tmatch = popupLocationRegExp.exec(state);\n\t// Check if the state matches the location regexp\n\tif(match) {\n\t\t// If so, we're open\n\t\tthis.isOpen = true;\n\t\t// Get the location\n\t\tthis.popup = {\n\t\t\tleft: parseFloat(match[1]),\n\t\t\ttop: parseFloat(match[2]),\n\t\t\twidth: parseFloat(match[3]),\n\t\t\theight: parseFloat(match[4])\n\t\t};\n\t} else {\n\t\t// If not, we're closed\n\t\tthis.isOpen = false;\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nRevealWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.state || changedAttributes.type || changedAttributes.text || changedAttributes.position || changedAttributes[\"default\"] || changedAttributes.animate) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\tvar refreshed = false,\n\t\t\tcurrentlyOpen = this.isOpen;\n\t\tthis.readState();\n\t\tif(this.isOpen !== currentlyOpen) {\n\t\t\tif(this.retain === \"yes\") {\n\t\t\t\tthis.updateState();\n\t\t\t} else {\n\t\t\t\tthis.refreshSelf();\n\t\t\t\trefreshed = true;\n\t\t\t}\n\t\t}\n\t\treturn this.refreshChildren(changedTiddlers) || refreshed;\n\t}\n};\n\n/*\nCalled by refresh() to dynamically show or hide the content\n*/\nRevealWidget.prototype.updateState = function() {\n\t// Read the current state\n\tthis.readState();\n\t// Construct the child nodes if needed\n\tvar domNode = this.domNodes[0];\n\tif(this.isOpen && !this.hasChildNodes) {\n\t\tthis.hasChildNodes = true;\n\t\tthis.makeChildWidgets(this.parseTreeNode.children);\n\t\tthis.renderChildren(domNode,null);\n\t}\n\t// Animate our DOM node\n\tif(!domNode.isTiddlyWikiFakeDom && this.type === \"popup\" && this.isOpen) {\n\t\tthis.positionPopup(domNode);\n\t\t$tw.utils.addClass(domNode,\"tc-popup\"); // Make sure that clicks don't dismiss popups within the revealed content\n\n\t}\n\tif(this.isOpen) {\n\t\tdomNode.removeAttribute(\"hidden\");\n $tw.anim.perform(this.openAnimation,domNode);\n\t} else {\n\t\t$tw.anim.perform(this.closeAnimation,domNode,{callback: function() {\n\t\t\tdomNode.setAttribute(\"hidden\",\"true\");\n }});\n\t}\n};\n\nexports.reveal = RevealWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/reveal.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/scrollable.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/scrollable.js\ntype: application/javascript\nmodule-type: widget\n\nScrollable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ScrollableWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n\tthis.scaleFactor = 1;\n\tthis.addEventListeners([\n\t\t{type: \"tm-scroll\", handler: \"handleScrollEvent\"}\n\t]);\n\tif($tw.browser) {\n\t\tthis.requestAnimationFrame = window.requestAnimationFrame ||\n\t\t\twindow.webkitRequestAnimationFrame ||\n\t\t\twindow.mozRequestAnimationFrame ||\n\t\t\tfunction(callback) {\n\t\t\t\treturn window.setTimeout(callback, 1000/60);\n\t\t\t};\n\t\tthis.cancelAnimationFrame = window.cancelAnimationFrame ||\n\t\t\twindow.webkitCancelAnimationFrame ||\n\t\t\twindow.webkitCancelRequestAnimationFrame ||\n\t\t\twindow.mozCancelAnimationFrame ||\n\t\t\twindow.mozCancelRequestAnimationFrame ||\n\t\t\tfunction(id) {\n\t\t\t\twindow.clearTimeout(id);\n\t\t\t};\n\t}\n};\n\n/*\nInherit from the base widget class\n*/\nScrollableWidget.prototype = new Widget();\n\nScrollableWidget.prototype.cancelScroll = function() {\n\tif(this.idRequestFrame) {\n\t\tthis.cancelAnimationFrame.call(window,this.idRequestFrame);\n\t\tthis.idRequestFrame = null;\n\t}\n};\n\n/*\nHandle a scroll event\n*/\nScrollableWidget.prototype.handleScrollEvent = function(event) {\n\t// Pass the scroll event through if our offsetsize is larger than our scrollsize\n\tif(this.outerDomNode.scrollWidth <= this.outerDomNode.offsetWidth && this.outerDomNode.scrollHeight <= this.outerDomNode.offsetHeight && this.fallthrough === \"yes\") {\n\t\treturn true;\n\t}\n\tthis.scrollIntoView(event.target);\n\treturn false; // Handled event\n};\n\n/*\nScroll an element into view\n*/\nScrollableWidget.prototype.scrollIntoView = function(element) {\n\tvar duration = $tw.utils.getAnimationDuration();\n\tthis.cancelScroll();\n\tthis.startTime = Date.now();\n\tvar scrollPosition = {\n\t\tx: this.outerDomNode.scrollLeft,\n\t\ty: this.outerDomNode.scrollTop\n\t};\n\t// Get the client bounds of the element and adjust by the scroll position\n\tvar scrollableBounds = this.outerDomNode.getBoundingClientRect(),\n\t\tclientTargetBounds = element.getBoundingClientRect(),\n\t\tbounds = {\n\t\t\tleft: clientTargetBounds.left + scrollPosition.x - scrollableBounds.left,\n\t\t\ttop: clientTargetBounds.top + scrollPosition.y - scrollableBounds.top,\n\t\t\twidth: clientTargetBounds.width,\n\t\t\theight: clientTargetBounds.height\n\t\t};\n\t// We'll consider the horizontal and vertical scroll directions separately via this function\n\tvar getEndPos = function(targetPos,targetSize,currentPos,currentSize) {\n\t\t\t// If the target is already visible then stay where we are\n\t\t\tif(targetPos >= currentPos && (targetPos + targetSize) <= (currentPos + currentSize)) {\n\t\t\t\treturn currentPos;\n\t\t\t// If the target is above/left of the current view, then scroll to its top/left\n\t\t\t} else if(targetPos <= currentPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// If the target is smaller than the window and the scroll position is too far up, then scroll till the target is at the bottom of the window\n\t\t\t} else if(targetSize < currentSize && currentPos < (targetPos + targetSize - currentSize)) {\n\t\t\t\treturn targetPos + targetSize - currentSize;\n\t\t\t// If the target is big, then just scroll to the top\n\t\t\t} else if(currentPos < targetPos) {\n\t\t\t\treturn targetPos;\n\t\t\t// Otherwise, stay where we are\n\t\t\t} else {\n\t\t\t\treturn currentPos;\n\t\t\t}\n\t\t},\n\t\tendX = getEndPos(bounds.left,bounds.width,scrollPosition.x,this.outerDomNode.offsetWidth),\n\t\tendY = getEndPos(bounds.top,bounds.height,scrollPosition.y,this.outerDomNode.offsetHeight);\n\t// Only scroll if necessary\n\tif(endX !== scrollPosition.x || endY !== scrollPosition.y) {\n\t\tvar self = this,\n\t\t\tdrawFrame;\n\t\tdrawFrame = function () {\n\t\t\tvar t;\n\t\t\tif(duration <= 0) {\n\t\t\t\tt = 1;\n\t\t\t} else {\n\t\t\t\tt = ((Date.now()) - self.startTime) / duration;\t\n\t\t\t}\n\t\t\tif(t >= 1) {\n\t\t\t\tself.cancelScroll();\n\t\t\t\tt = 1;\n\t\t\t}\n\t\t\tt = $tw.utils.slowInSlowOut(t);\n\t\t\tself.outerDomNode.scrollLeft = scrollPosition.x + (endX - scrollPosition.x) * t;\n\t\t\tself.outerDomNode.scrollTop = scrollPosition.y + (endY - scrollPosition.y) * t;\n\t\t\tif(t < 1) {\n\t\t\t\tself.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);\n\t\t\t}\n\t\t};\n\t\tdrawFrame();\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nScrollableWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Remember parent\n\tthis.parentDomNode = parent;\n\t// Compute attributes and execute state\n\tthis.computeAttributes();\n\tthis.execute();\n\t// Create elements\n\tthis.outerDomNode = this.document.createElement(\"div\");\n\t$tw.utils.setStyle(this.outerDomNode,[\n\t\t{overflowY: \"auto\"},\n\t\t{overflowX: \"auto\"},\n\t\t{webkitOverflowScrolling: \"touch\"}\n\t]);\n\tthis.innerDomNode = this.document.createElement(\"div\");\n\tthis.outerDomNode.appendChild(this.innerDomNode);\n\t// Assign classes\n\tthis.outerDomNode.className = this[\"class\"] || \"\";\n\t// Insert element\n\tparent.insertBefore(this.outerDomNode,nextSibling);\n\tthis.renderChildren(this.innerDomNode,null);\n\tthis.domNodes.push(this.outerDomNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nScrollableWidget.prototype.execute = function() {\n\t// Get attributes\n\tthis.fallthrough = this.getAttribute(\"fallthrough\",\"yes\");\n\tthis[\"class\"] = this.getAttribute(\"class\");\n\t// Make child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nScrollableWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes[\"class\"]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t}\n\treturn this.refreshChildren(changedTiddlers);\n};\n\nexports.scrollable = ScrollableWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/scrollable.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/select.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/select.js\ntype: application/javascript\nmodule-type: widget\n\nSelect widget:\n\n```\n<$select tiddler=\"MyTiddler\" field=\"text\">\n<$list filter=\"[tag[chapter]]\">\n<option value=<<currentTiddler>>>\n<$view field=\"description\"/>\n</option>\n</$list>\n</$select>\n```\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SelectWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSelectWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSelectWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n\tthis.setSelectValue();\n\t$tw.utils.addEventListeners(this.getSelectDomNode(),[\n\t\t{name: \"change\", handlerObject: this, handlerMethod: \"handleChangeEvent\"}\n\t]);\n};\n\n/*\nHandle a change event\n*/\nSelectWidget.prototype.handleChangeEvent = function(event) {\n\tvar value = this.getSelectDomNode().value;\n\tthis.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value);\n};\n\n/*\nIf necessary, set the value of the select element to the current value\n*/\nSelectWidget.prototype.setSelectValue = function() {\n\tvar value = this.selectDefault;\n\t// Get the value\n\tif(this.selectIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.selectTitle,this.selectIndex);\n\t} else {\n\t\tvar tiddler = this.wiki.getTiddler(this.selectTitle);\n\t\tif(tiddler) {\n\t\t\tif(this.selectField === \"text\") {\n\t\t\t\t// Calling getTiddlerText() triggers lazy loading of skinny tiddlers\n\t\t\t\tvalue = this.wiki.getTiddlerText(this.selectTitle);\n\t\t\t} else {\n\t\t\t\tif($tw.utils.hop(tiddler.fields,this.selectField)) {\n\t\t\t\t\tvalue = tiddler.getFieldString(this.selectField);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif(this.selectField === \"title\") {\n\t\t\t\tvalue = this.selectTitle;\n\t\t\t}\n\t\t}\n\t}\n\t// Assign it to the select element if it's different than the current value\n\tvar domNode = this.getSelectDomNode();\n\tif(domNode.value !== value) {\n\t\tdomNode.value = value;\n\t}\n};\n\n/*\nGet the DOM node of the select element\n*/\nSelectWidget.prototype.getSelectDomNode = function() {\n\treturn this.children[0].domNodes[0];\n};\n\n/*\nCompute the internal state of the widget\n*/\nSelectWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.selectTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.selectField = this.getAttribute(\"field\",\"text\");\n\tthis.selectIndex = this.getAttribute(\"index\");\n\tthis.selectClass = this.getAttribute(\"class\");\n\tthis.selectDefault = this.getAttribute(\"default\");\n\t// Make the child widgets\n\tvar selectNode = {\n\t\ttype: \"element\",\n\t\ttag: \"select\",\n\t\tchildren: this.parseTreeNode.children\n\t};\n\tif(this.selectClass) {\n\t\t$tw.utils.addAttributeToParseTreeNode(selectNode,\"class\",this.selectClass);\n\t}\n\tthis.makeChildWidgets([selectNode]);\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nSelectWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// If we're using a different tiddler/field/index then completely refresh ourselves\n\tif(changedAttributes.selectTitle || changedAttributes.selectField || changedAttributes.selectIndex) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t// If the target tiddler value has changed, just update setting and refresh the children\n\t} else {\n\t\tif(changedTiddlers[this.selectTitle]) {\n\t\t\tthis.setSelectValue();\n\t\t} \n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.select = SelectWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/select.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/set.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/set.js\ntype: application/javascript\nmodule-type: widget\n\nSet variable widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar SetWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nSetWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nSetWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nSetWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.setName = this.getAttribute(\"name\",\"currentTiddler\");\n\tthis.setFilter = this.getAttribute(\"filter\");\n\tthis.setValue = this.getAttribute(\"value\");\n\tthis.setEmptyValue = this.getAttribute(\"emptyValue\");\n\t// Set context variable\n\tvar value = this.setValue;\n\tif(this.setFilter) {\n\t\tvar results = this.wiki.filterTiddlers(this.setFilter,this);\n\t\tif(!this.setValue) {\n\t\t\tvalue = $tw.utils.stringifyList(results);\n\t\t}\n\t\tif(results.length === 0 && this.setEmptyValue !== undefined) {\n\t\t\tvalue = this.setEmptyValue;\n\t\t}\n\t}\n\tthis.setVariable(this.setName,value,this.parseTreeNode.params);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nSetWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.name || changedAttributes.filter || changedAttributes.value || changedAttributes.emptyValue) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.setvariable = SetWidget;\nexports.set = SetWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/set.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/text.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/text.js\ntype: application/javascript\nmodule-type: widget\n\nText node widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TextNodeWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTextNodeWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTextNodeWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tvar text = this.getAttribute(\"text\",this.parseTreeNode.text || \"\");\n\ttext = text.replace(/\\r/mg,\"\");\n\tvar textNode = this.document.createTextNode(text);\n\tparent.insertBefore(textNode,nextSibling);\n\tthis.domNodes.push(textNode);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTextNodeWidget.prototype.execute = function() {\n\t// Nothing to do for a text node\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTextNodeWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.text) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.text = TextNodeWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/text.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/tiddler.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/tiddler.js\ntype: application/javascript\nmodule-type: widget\n\nTiddler widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TiddlerWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTiddlerWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTiddlerWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTiddlerWidget.prototype.execute = function() {\n\tthis.tiddlerState = this.computeTiddlerState();\n\tthis.setVariable(\"currentTiddler\",this.tiddlerState.currentTiddler);\n\tthis.setVariable(\"missingTiddlerClass\",this.tiddlerState.missingTiddlerClass);\n\tthis.setVariable(\"shadowTiddlerClass\",this.tiddlerState.shadowTiddlerClass);\n\tthis.setVariable(\"systemTiddlerClass\",this.tiddlerState.systemTiddlerClass);\n\tthis.setVariable(\"tiddlerTagClasses\",this.tiddlerState.tiddlerTagClasses);\n\t// Construct the child widgets\n\tthis.makeChildWidgets();\n};\n\n/*\nCompute the tiddler state flags\n*/\nTiddlerWidget.prototype.computeTiddlerState = function() {\n\t// Get our parameters\n\tthis.tiddlerTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\t// Compute the state\n\tvar state = {\n\t\tcurrentTiddler: this.tiddlerTitle || \"\",\n\t\tmissingTiddlerClass: (this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? \"tc-tiddler-exists\" : \"tc-tiddler-missing\",\n\t\tshadowTiddlerClass: this.wiki.isShadowTiddler(this.tiddlerTitle) ? \"tc-tiddler-shadow\" : \"\",\n\t\tsystemTiddlerClass: this.wiki.isSystemTiddler(this.tiddlerTitle) ? \"tc-tiddler-system\" : \"\",\n\t\ttiddlerTagClasses: this.getTagClasses()\n\t};\n\t// Compute a simple hash to make it easier to detect changes\n\tstate.hash = state.currentTiddler + state.missingTiddlerClass + state.shadowTiddlerClass + state.systemTiddlerClass + state.tiddlerTagClasses;\n\treturn state;\n};\n\n/*\nCreate a string of CSS classes derived from the tags of the current tiddler\n*/\nTiddlerWidget.prototype.getTagClasses = function() {\n\tvar tiddler = this.wiki.getTiddler(this.tiddlerTitle);\n\tif(tiddler) {\n\t\tvar tags = [];\n\t\t$tw.utils.each(tiddler.fields.tags,function(tag) {\n\t\t\ttags.push(\"tc-tagged-\" + encodeURIComponent(tag));\n\t\t});\n\t\treturn tags.join(\" \");\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTiddlerWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes(),\n\t\tnewTiddlerState = this.computeTiddlerState();\n\tif(changedAttributes.tiddler || newTiddlerState.hash !== this.tiddlerState.hash) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.tiddler = TiddlerWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/tiddler.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/transclude.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/transclude.js\ntype: application/javascript\nmodule-type: widget\n\nTransclude widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar TranscludeWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nTranscludeWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nTranscludeWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nTranscludeWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.transcludeTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.transcludeSubTiddler = this.getAttribute(\"subtiddler\");\n\tthis.transcludeField = this.getAttribute(\"field\");\n\tthis.transcludeIndex = this.getAttribute(\"index\");\n\tthis.transcludeMode = this.getAttribute(\"mode\");\n\t// Parse the text reference\n\tvar parseAsInline = !this.parseTreeNode.isBlock;\n\tif(this.transcludeMode === \"inline\") {\n\t\tparseAsInline = true;\n\t} else if(this.transcludeMode === \"block\") {\n\t\tparseAsInline = false;\n\t}\n\tvar parser = this.wiki.parseTextReference(\n\t\t\t\t\t\tthis.transcludeTitle,\n\t\t\t\t\t\tthis.transcludeField,\n\t\t\t\t\t\tthis.transcludeIndex,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparseAsInline: parseAsInline,\n\t\t\t\t\t\t\tsubTiddler: this.transcludeSubTiddler\n\t\t\t\t\t\t}),\n\t\tparseTreeNodes = parser ? parser.tree : this.parseTreeNode.children;\n\t// Set context variables for recursion detection\n\tvar recursionMarker = this.makeRecursionMarker();\n\tthis.setVariable(\"transclusion\",recursionMarker);\n\t// Check for recursion\n\tif(parser) {\n\t\tif(this.parentWidget && this.parentWidget.hasVariable(\"transclusion\",recursionMarker)) {\n\t\t\tparseTreeNodes = [{type: \"element\", tag: \"span\", attributes: {\n\t\t\t\t\"class\": {type: \"string\", value: \"tc-error\"}\n\t\t\t}, children: [\n\t\t\t\t{type: \"text\", text: \"Recursive transclusion error in transclude widget\"}\n\t\t\t]}];\n\t\t}\n\t}\n\t// Construct the child widgets\n\tthis.makeChildWidgets(parseTreeNodes);\n};\n\n/*\nCompose a string comprising the title, field and/or index to identify this transclusion for recursion detection\n*/\nTranscludeWidget.prototype.makeRecursionMarker = function() {\n\tvar output = [];\n\toutput.push(\"{\");\n\toutput.push(this.getVariable(\"currentTiddler\",{defaultValue: \"\"}));\n\toutput.push(\"|\");\n\toutput.push(this.transcludeTitle || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeField || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeIndex || \"\");\n\toutput.push(\"|\");\n\toutput.push(this.transcludeSubTiddler || \"\");\n\toutput.push(\"}\");\n\treturn output.join(\"\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nTranscludeWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn this.refreshChildren(changedTiddlers);\t\t\n\t}\n};\n\nexports.transclude = TranscludeWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/transclude.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/view.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/view.js\ntype: application/javascript\nmodule-type: widget\n\nView widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar ViewWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nViewWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nViewWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.computeAttributes();\n\tthis.execute();\n\tif(this.text) {\n\t\tvar textNode = this.document.createTextNode(this.text);\n\t\tparent.insertBefore(textNode,nextSibling);\n\t\tthis.domNodes.push(textNode);\n\t} else {\n\t\tthis.makeChildWidgets();\n\t\tthis.renderChildren(parent,nextSibling);\n\t}\n};\n\n/*\nCompute the internal state of the widget\n*/\nViewWidget.prototype.execute = function() {\n\t// Get parameters from our attributes\n\tthis.viewTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.viewSubtiddler = this.getAttribute(\"subtiddler\");\n\tthis.viewField = this.getAttribute(\"field\",\"text\");\n\tthis.viewIndex = this.getAttribute(\"index\");\n\tthis.viewFormat = this.getAttribute(\"format\",\"text\");\n\tthis.viewTemplate = this.getAttribute(\"template\",\"\");\n\tswitch(this.viewFormat) {\n\t\tcase \"htmlwikified\":\n\t\t\tthis.text = this.getValueAsHtmlWikified();\n\t\t\tbreak;\n\t\tcase \"htmlencoded\":\n\t\t\tthis.text = this.getValueAsHtmlEncoded();\n\t\t\tbreak;\n\t\tcase \"urlencoded\":\n\t\t\tthis.text = this.getValueAsUrlEncoded();\n\t\t\tbreak;\n\t\tcase \"doubleurlencoded\":\n\t\t\tthis.text = this.getValueAsDoubleUrlEncoded();\n\t\t\tbreak;\n\t\tcase \"date\":\n\t\t\tthis.text = this.getValueAsDate(this.viewTemplate);\n\t\t\tbreak;\n\t\tcase \"relativedate\":\n\t\t\tthis.text = this.getValueAsRelativeDate();\n\t\t\tbreak;\n\t\tcase \"stripcomments\":\n\t\t\tthis.text = this.getValueAsStrippedComments();\n\t\t\tbreak;\n\t\tcase \"jsencoded\":\n\t\t\tthis.text = this.getValueAsJsEncoded();\n\t\t\tbreak;\n\t\tdefault: // \"text\"\n\t\t\tthis.text = this.getValueAsText();\n\t\t\tbreak;\n\t}\n};\n\n/*\nThe various formatter functions are baked into this widget for the moment. Eventually they will be replaced by macro functions\n*/\n\n/*\nRetrieve the value of the widget. Options are:\nasString: Optionally return the value as a string\n*/\nViewWidget.prototype.getValue = function(options) {\n\toptions = options || {};\n\tvar value = options.asString ? \"\" : undefined;\n\tif(this.viewIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.viewTitle,this.viewIndex);\n\t} else {\n\t\tvar tiddler;\n\t\tif(this.viewSubtiddler) {\n\t\t\ttiddler = this.wiki.getSubTiddler(this.viewTitle,this.viewSubtiddler);\t\n\t\t} else {\n\t\t\ttiddler = this.wiki.getTiddler(this.viewTitle);\n\t\t}\n\t\tif(tiddler) {\n\t\t\tif(this.viewField === \"text\" && !this.viewSubtiddler) {\n\t\t\t\t// Calling getTiddlerText() triggers lazy loading of skinny tiddlers\n\t\t\t\tvalue = this.wiki.getTiddlerText(this.viewTitle);\n\t\t\t} else {\n\t\t\t\tif($tw.utils.hop(tiddler.fields,this.viewField)) {\n\t\t\t\t\tif(options.asString) {\n\t\t\t\t\t\tvalue = tiddler.getFieldString(this.viewField);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = tiddler.fields[this.viewField];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif(this.viewField === \"title\") {\n\t\t\t\tvalue = this.viewTitle;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n\nViewWidget.prototype.getValueAsText = function() {\n\treturn this.getValue({asString: true});\n};\n\nViewWidget.prototype.getValueAsHtmlWikified = function() {\n\treturn this.wiki.renderText(\"text/html\",\"text/vnd.tiddlywiki\",this.getValueAsText(),{parentWidget: this});\n};\n\nViewWidget.prototype.getValueAsHtmlEncoded = function() {\n\treturn $tw.utils.htmlEncode(this.getValueAsText());\n};\n\nViewWidget.prototype.getValueAsUrlEncoded = function() {\n\treturn encodeURIComponent(this.getValueAsText());\n};\n\nViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {\n\treturn encodeURIComponent(encodeURIComponent(this.getValueAsText()));\n};\n\nViewWidget.prototype.getValueAsDate = function(format) {\n\tformat = format || \"YYYY MM DD 0hh:0mm\";\n\tvar value = $tw.utils.parseDate(this.getValue());\n\tif(value && $tw.utils.isDate(value) && value.toString() !== \"Invalid Date\") {\n\t\treturn $tw.utils.formatDateString(value,format);\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\nViewWidget.prototype.getValueAsRelativeDate = function(format) {\n\tvar value = $tw.utils.parseDate(this.getValue());\n\tif(value && $tw.utils.isDate(value) && value.toString() !== \"Invalid Date\") {\n\t\treturn $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;\n\t} else {\n\t\treturn \"\";\n\t}\n};\n\nViewWidget.prototype.getValueAsStrippedComments = function() {\n\tvar lines = this.getValueAsText().split(\"\\n\"),\n\t\tout = [];\n\tfor(var line=0; line<lines.length; line++) {\n\t\tvar text = lines[line];\n\t\tif(!/^\\s*\\/\\/#/.test(text)) {\n\t\t\tout.push(text);\n\t\t}\n\t}\n\treturn out.join(\"\\n\");\n};\n\nViewWidget.prototype.getValueAsJsEncoded = function() {\n\treturn $tw.utils.stringify(this.getValueAsText());\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nViewWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else {\n\t\treturn false;\t\n\t}\n};\n\nexports.view = ViewWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/view.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/widgets/widget.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/widget.js\ntype: application/javascript\nmodule-type: widget\n\nWidget base class\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\n/*\nCreate a widget object for a parse tree node\n\tparseTreeNode: reference to the parse tree node to be rendered\n\toptions: see below\nOptions include:\n\twiki: mandatory reference to wiki associated with this render tree\n\tparentWidget: optional reference to a parent renderer node for the context chain\n\tdocument: optional document object to use instead of global document\n*/\nvar Widget = function(parseTreeNode,options) {\n\tif(arguments.length > 0) {\n\t\tthis.initialise(parseTreeNode,options);\n\t}\n};\n\n/*\nInitialise widget properties. These steps are pulled out of the constructor so that we can reuse them in subclasses\n*/\nWidget.prototype.initialise = function(parseTreeNode,options) {\n\toptions = options || {};\n\t// Save widget info\n\tthis.parseTreeNode = parseTreeNode;\n\tthis.wiki = options.wiki;\n\tthis.parentWidget = options.parentWidget;\n\tthis.variablesConstructor = function() {};\n\tthis.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};\n\tthis.variables = new this.variablesConstructor();\n\tthis.document = options.document;\n\tthis.attributes = {};\n\tthis.children = [];\n\tthis.domNodes = [];\n\tthis.eventListeners = {};\n\t// Hashmap of the widget classes\n\tif(!this.widgetClasses) {\n\t\tWidget.prototype.widgetClasses = $tw.modules.applyMethods(\"widget\");\n\t}\n};\n\n/*\nRender this widget into the DOM\n*/\nWidget.prototype.render = function(parent,nextSibling) {\n\tthis.parentDomNode = parent;\n\tthis.execute();\n\tthis.renderChildren(parent,nextSibling);\n};\n\n/*\nCompute the internal state of the widget\n*/\nWidget.prototype.execute = function() {\n\tthis.makeChildWidgets();\n};\n\n/*\nSet the value of a context variable\nname: name of the variable\nvalue: value of the variable\nparams: array of {name:, default:} for each parameter\n*/\nWidget.prototype.setVariable = function(name,value,params) {\n\tthis.variables[name] = {value: value, params: params};\n};\n\n/*\nGet the prevailing value of a context variable\nname: name of variable\noptions: see below\nOptions include\nparams: array of {name:, value:} for each parameter\ndefaultValue: default value if the variable is not defined\n*/\nWidget.prototype.getVariable = function(name,options) {\n\toptions = options || {};\n\tvar actualParams = options.params || [],\n\t\tparentWidget = this.parentWidget;\n\t// Check for the variable defined in the parent widget (or an ancestor in the prototype chain)\n\tif(parentWidget && name in parentWidget.variables) {\n\t\tvar variable = parentWidget.variables[name],\n\t\t\tvalue = variable.value;\n\t\t// Substitute any parameters specified in the definition\n\t\tvalue = this.substituteVariableParameters(value,variable.params,actualParams);\n\t\tvalue = this.substituteVariableReferences(value);\n\t\treturn value;\n\t}\n\t// If the variable doesn't exist in the parent widget then look for a macro module\n\treturn this.evaluateMacroModule(name,actualParams,options.defaultValue);\n};\n\nWidget.prototype.substituteVariableParameters = function(text,formalParams,actualParams) {\n\tif(formalParams) {\n\t\tvar nextAnonParameter = 0, // Next candidate anonymous parameter in macro call\n\t\t\tparamInfo, paramValue;\n\t\t// Step through each of the parameters in the macro definition\n\t\tfor(var p=0; p<formalParams.length; p++) {\n\t\t\t// Check if we've got a macro call parameter with the same name\n\t\t\tparamInfo = formalParams[p];\n\t\t\tparamValue = undefined;\n\t\t\tfor(var m=0; m<actualParams.length; m++) {\n\t\t\t\tif(actualParams[m].name === paramInfo.name) {\n\t\t\t\t\tparamValue = actualParams[m].value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If not, use the next available anonymous macro call parameter\n\t\t\twhile(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {\n\t\t\t\tnextAnonParameter++;\n\t\t\t}\n\t\t\tif(paramValue === undefined && nextAnonParameter < actualParams.length) {\n\t\t\t\tparamValue = actualParams[nextAnonParameter++].value;\n\t\t\t}\n\t\t\t// If we've still not got a value, use the default, if any\n\t\t\tparamValue = paramValue || paramInfo[\"default\"] || \"\";\n\t\t\t// Replace any instances of this parameter\n\t\t\ttext = text.replace(new RegExp(\"\\\\$\" + $tw.utils.escapeRegExp(paramInfo.name) + \"\\\\$\",\"mg\"),paramValue);\n\t\t}\n\t}\n\treturn text;\n};\n\nWidget.prototype.substituteVariableReferences = function(text) {\n\tvar self = this;\n\treturn (text || \"\").replace(/\\$\\(([^\\)\\$]+)\\)\\$/g,function(match,p1,offset,string) {\n\t\treturn self.getVariable(p1,{defaultValue: \"\"});\n\t});\n};\n\nWidget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue) {\n\tif($tw.utils.hop($tw.macros,name)) {\n\t\tvar macro = $tw.macros[name],\n\t\t\targs = [];\n\t\tif(macro.params.length > 0) {\n\t\t\tvar nextAnonParameter = 0, // Next candidate anonymous parameter in macro call\n\t\t\t\tparamInfo, paramValue;\n\t\t\t// Step through each of the parameters in the macro definition\n\t\t\tfor(var p=0; p<macro.params.length; p++) {\n\t\t\t\t// Check if we've got a macro call parameter with the same name\n\t\t\t\tparamInfo = macro.params[p];\n\t\t\t\tparamValue = undefined;\n\t\t\t\tfor(var m=0; m<actualParams.length; m++) {\n\t\t\t\t\tif(actualParams[m].name === paramInfo.name) {\n\t\t\t\t\t\tparamValue = actualParams[m].value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If not, use the next available anonymous macro call parameter\n\t\t\t\twhile(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {\n\t\t\t\t\tnextAnonParameter++;\n\t\t\t\t}\n\t\t\t\tif(paramValue === undefined && nextAnonParameter < actualParams.length) {\n\t\t\t\t\tparamValue = actualParams[nextAnonParameter++].value;\n\t\t\t\t}\n\t\t\t\t// If we've still not got a value, use the default, if any\n\t\t\t\tparamValue = paramValue || paramInfo[\"default\"] || \"\";\n\t\t\t\t// Save the parameter\n\t\t\t\targs.push(paramValue);\n\t\t\t}\n\t\t}\n\t\telse for(var i=0; i<actualParams.length; ++i) {\n\t\t\targs.push(actualParams[i].value);\n\t\t}\n\t\treturn (macro.run.apply(this,args) || \"\").toString();\n\t} else {\n\t\treturn defaultValue;\n\t}\n};\n\n/*\nCheck whether a given context variable value exists in the parent chain\n*/\nWidget.prototype.hasVariable = function(name,value) {\n\tvar node = this;\n\twhile(node) {\n\t\tif($tw.utils.hop(node.variables,name) && node.variables[name].value === value) {\n\t\t\treturn true;\n\t\t}\n\t\tnode = node.parentWidget;\n\t}\n\treturn false;\n};\n\n/*\nConstruct a qualifying string based on a hash of concatenating the values of a given variable in the parent chain\n*/\nWidget.prototype.getStateQualifier = function(name) {\n\tname = name || \"transclusion\";\n\tvar output = [],\n\t\tnode = this;\n\twhile(node && node.parentWidget) {\n\t\tif($tw.utils.hop(node.parentWidget.variables,name)) {\n\t\t\toutput.push(node.getVariable(name));\n\t\t}\n\t\tnode = node.parentWidget;\n\t}\n\treturn $tw.utils.hashString(output.join(\"\"));\n};\n\n/*\nCompute the current values of the attributes of the widget. Returns a hashmap of the names of the attributes that have changed\n*/\nWidget.prototype.computeAttributes = function() {\n\tvar changedAttributes = {},\n\t\tself = this,\n\t\tvalue;\n\t$tw.utils.each(this.parseTreeNode.attributes,function(attribute,name) {\n\t\tif(attribute.type === \"indirect\") {\n\t\t\tvalue = self.wiki.getTextReference(attribute.textReference,\"\",self.getVariable(\"currentTiddler\"));\n\t\t} else if(attribute.type === \"macro\") {\n\t\t\tvalue = self.getVariable(attribute.value.name,{params: attribute.value.params});\n\t\t} else { // String attribute\n\t\t\tvalue = attribute.value;\n\t\t}\n\t\t// Check whether the attribute has changed\n\t\tif(self.attributes[name] !== value) {\n\t\t\tself.attributes[name] = value;\n\t\t\tchangedAttributes[name] = true;\n\t\t}\n\t});\n\treturn changedAttributes;\n};\n\n/*\nCheck for the presence of an attribute\n*/\nWidget.prototype.hasAttribute = function(name) {\n\treturn $tw.utils.hop(this.attributes,name);\n};\n\n/*\nGet the value of an attribute\n*/\nWidget.prototype.getAttribute = function(name,defaultText) {\n\tif($tw.utils.hop(this.attributes,name)) {\n\t\treturn this.attributes[name];\n\t} else {\n\t\treturn defaultText;\n\t}\n};\n\n/*\nAssign the computed attributes of the widget to a domNode\noptions include:\nexcludeEventAttributes: ignores attributes whose name begins with \"on\"\n*/\nWidget.prototype.assignAttributes = function(domNode,options) {\n\toptions = options || {};\n\tvar self = this;\n\t$tw.utils.each(this.attributes,function(v,a) {\n\t\t// Check exclusions\n\t\tif(options.excludeEventAttributes && a.substr(0,2) === \"on\") {\n\t\t\tv = undefined;\n\t\t}\n\t\tif(v !== undefined) {\n\t\t\tvar b = a.split(\":\");\n\t\t\t// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)\n\t\t\ttry {\n\t\t\t\tif (b.length == 2 && b[0] == \"xlink\"){\n\t\t\t\t\tdomNode.setAttributeNS(\"http://www.w3.org/1999/xlink\",b[1],v);\n\t\t\t\t} else {\n\t\t\t\t\tdomNode.setAttributeNS(null,a,v);\n\t\t\t\t}\n\t\t\t} catch(e) {\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nMake child widgets correspondng to specified parseTreeNodes\n*/\nWidget.prototype.makeChildWidgets = function(parseTreeNodes) {\n\tthis.children = [];\n\tvar self = this;\n\t$tw.utils.each(parseTreeNodes || (this.parseTreeNode && this.parseTreeNode.children),function(childNode) {\n\t\tself.children.push(self.makeChildWidget(childNode));\n\t});\n};\n\n/*\nConstruct the widget object for a parse tree node\n*/\nWidget.prototype.makeChildWidget = function(parseTreeNode) {\n\tvar WidgetClass = this.widgetClasses[parseTreeNode.type];\n\tif(!WidgetClass) {\n\t\tWidgetClass = this.widgetClasses.text;\n\t\tparseTreeNode = {type: \"text\", text: \"Undefined widget '\" + parseTreeNode.type + \"'\"};\n\t}\n\treturn new WidgetClass(parseTreeNode,{\n\t\twiki: this.wiki,\n\t\tvariables: {},\n\t\tparentWidget: this,\n\t\tdocument: this.document\n\t});\n};\n\n/*\nGet the next sibling of this widget\n*/\nWidget.prototype.nextSibling = function() {\n\tif(this.parentWidget) {\n\t\tvar index = this.parentWidget.children.indexOf(this);\n\t\tif(index !== -1 && index < this.parentWidget.children.length-1) {\n\t\t\treturn this.parentWidget.children[index+1];\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nGet the previous sibling of this widget\n*/\nWidget.prototype.previousSibling = function() {\n\tif(this.parentWidget) {\n\t\tvar index = this.parentWidget.children.indexOf(this);\n\t\tif(index !== -1 && index > 0) {\n\t\t\treturn this.parentWidget.children[index-1];\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRender the children of this widget into the DOM\n*/\nWidget.prototype.renderChildren = function(parent,nextSibling) {\n\t$tw.utils.each(this.children,function(childWidget) {\n\t\tchildWidget.render(parent,nextSibling);\n\t});\n};\n\n/*\nAdd a list of event listeners from an array [{type:,handler:},...]\n*/\nWidget.prototype.addEventListeners = function(listeners) {\n\tvar self = this;\n\t$tw.utils.each(listeners,function(listenerInfo) {\n\t\tself.addEventListener(listenerInfo.type,listenerInfo.handler);\n\t});\n};\n\n/*\nAdd an event listener\n*/\nWidget.prototype.addEventListener = function(type,handler) {\n\tvar self = this;\n\tif(typeof handler === \"string\") { // The handler is a method name on this widget\n\t\tthis.eventListeners[type] = function(event) {\n\t\t\treturn self[handler].call(self,event);\n\t\t};\n\t} else { // The handler is a function\n\t\tthis.eventListeners[type] = function(event) {\n\t\t\treturn handler.call(self,event);\n\t\t};\n\t}\n};\n\n/*\nDispatch an event to a widget. If the widget doesn't handle the event then it is also dispatched to the parent widget\n*/\nWidget.prototype.dispatchEvent = function(event) {\n\t// Dispatch the event if this widget handles it\n\tvar listener = this.eventListeners[event.type];\n\tif(listener) {\n\t\t// Don't propagate the event if the listener returned false\n\t\tif(!listener(event)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Dispatch the event to the parent widget\n\tif(this.parentWidget) {\n\t\treturn this.parentWidget.dispatchEvent(event);\n\t}\n\treturn true;\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nWidget.prototype.refresh = function(changedTiddlers) {\n\treturn this.refreshChildren(changedTiddlers);\n};\n\n/*\nRebuild a previously rendered widget\n*/\nWidget.prototype.refreshSelf = function() {\n\tvar nextSibling = this.findNextSiblingDomNode();\n\tthis.removeChildDomNodes();\n\tthis.render(this.parentDomNode,nextSibling);\n};\n\n/*\nRefresh all the children of a widget\n*/\nWidget.prototype.refreshChildren = function(changedTiddlers) {\n\tvar self = this,\n\t\trefreshed = false;\n\t$tw.utils.each(this.children,function(childWidget) {\n\t\trefreshed = childWidget.refresh(changedTiddlers) || refreshed;\n\t});\n\treturn refreshed;\n};\n\n/*\nFind the next sibling in the DOM to this widget. This is done by scanning the widget tree through all next siblings and their descendents that share the same parent DOM node\n*/\nWidget.prototype.findNextSiblingDomNode = function(startIndex) {\n\t// Refer to this widget by its index within its parents children\n\tvar parent = this.parentWidget,\n\t\tindex = startIndex !== undefined ? startIndex : parent.children.indexOf(this);\nif(index === -1) {\n\tthrow \"node not found in parents children\";\n}\n\t// Look for a DOM node in the later siblings\n\twhile(++index < parent.children.length) {\n\t\tvar domNode = parent.children[index].findFirstDomNode();\n\t\tif(domNode) {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\t// Go back and look for later siblings of our parent if it has the same parent dom node\n\tvar grandParent = parent.parentWidget;\n\tif(grandParent && parent.parentDomNode === this.parentDomNode) {\n\t\tindex = grandParent.children.indexOf(parent);\n\t\treturn parent.findNextSiblingDomNode(index);\n\t}\n\treturn null;\n};\n\n/*\nFind the first DOM node generated by a widget or its children\n*/\nWidget.prototype.findFirstDomNode = function() {\n\t// Return the first dom node of this widget, if we've got one\n\tif(this.domNodes.length > 0) {\n\t\treturn this.domNodes[0];\n\t}\n\t// Otherwise, recursively call our children\n\tfor(var t=0; t<this.children.length; t++) {\n\t\tvar domNode = this.children[t].findFirstDomNode();\n\t\tif(domNode) {\n\t\t\treturn domNode;\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRemove any DOM nodes created by this widget or its children\n*/\nWidget.prototype.removeChildDomNodes = function() {\n\t// If this widget has directly created DOM nodes, delete them and exit. This assumes that any child widgets are contained within the created DOM nodes, which would normally be the case\n\tif(this.domNodes.length > 0) {\n\t\t$tw.utils.each(this.domNodes,function(domNode) {\n\t\t\tdomNode.parentNode.removeChild(domNode);\n\t\t});\n\t\tthis.domNodes = [];\n\t} else {\n\t\t// Otherwise, ask the child widgets to delete their DOM nodes\n\t\t$tw.utils.each(this.children,function(childWidget) {\n\t\t\tchildWidget.removeChildDomNodes();\n\t\t});\n\t}\n};\n\n/*\nInvoke any action widgets that are immediate children of this widget\n*/\nWidget.prototype.invokeActions = function(event) {\n\tvar handled = false;\n\tfor(var t=0; t<this.children.length; t++) {\n\t\tvar child = this.children[t];\n\t\tif(child.invokeAction && child.invokeAction(this,event)) {\n\t\t\thandled = true;\n\t\t}\n\t}\n\treturn handled;\n};\n\nexports.widget = Widget;\n\n})();\n",
"title": "$:/core/modules/widgets/widget.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/core/modules/wiki.js": {
"text": "/*\\\ntitle: $:/core/modules/wiki.js\ntype: application/javascript\nmodule-type: wikimethod\n\nExtension methods for the $tw.Wiki object\n\nAdds the following properties to the wiki object:\n\n* `eventListeners` is a hashmap by type of arrays of listener functions\n* `changedTiddlers` is a hashmap describing changes to named tiddlers since wiki change events were last dispatched. Each entry is a hashmap containing two fields:\n\tmodified: true/false\n\tdeleted: true/false\n* `changeCount` is a hashmap by tiddler title containing a numerical index that starts at zero and is incremented each time a tiddler is created changed or deleted\n* `caches` is a hashmap by tiddler title containing a further hashmap of named cache objects. Caches are automatically cleared when a tiddler is modified or deleted\n* `globalCache` is a hashmap by cache name of cache objects that are cleared whenever any tiddler change occurs\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar widget = require(\"$:/core/modules/widgets/widget.js\");\n\nvar USER_NAME_TITLE = \"$:/status/UserName\";\n\n/*\nGet the value of a text reference. Text references can have any of these forms:\n\t<tiddlertitle>\n\t<tiddlertitle>!!<fieldname>\n\t!!<fieldname> - specifies a field of the current tiddlers\n\t<tiddlertitle>##<index>\n*/\nexports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle = tr.title || currTiddlerTitle;\n\tif(tr.field) {\n\t\tvar tiddler = this.getTiddler(title);\n\t\tif(tr.field === \"title\") { // Special case so we can return the title of a non-existent tiddler\n\t\t\treturn title;\n\t\t} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {\n\t\t\treturn tiddler.getFieldString(tr.field);\n\t\t} else {\n\t\t\treturn defaultText;\n\t\t}\n\t} else if(tr.index) {\n\t\treturn this.extractTiddlerDataItem(title,tr.index,defaultText);\n\t} else {\n\t\treturn this.getTiddlerText(title,defaultText);\n\t}\n};\n\nexports.setTextReference = function(textRef,value,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle = tr.title || currTiddlerTitle;\n\tthis.setText(title,tr.field,tr.index,value);\n};\n\nexports.setText = function(title,field,index,value) {\n\t// Check if it is a reference to a tiddler field\n\tif(index) {\n\t\tvar data = this.getTiddlerData(title,Object.create(null));\n\t\tdata[index] = value;\n\t\tthis.setTiddlerData(title,data,this.getModificationFields());\n\t} else {\n\t\tvar tiddler = this.getTiddler(title),\n\t\t\tfields = {title: title};\n\t\tfields[field || \"text\"] = value;\n\t\tthis.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));\n\t}\n};\n\nexports.deleteTextReference = function(textRef,currTiddlerTitle) {\n\tvar tr = $tw.utils.parseTextReference(textRef),\n\t\ttitle,tiddler,fields;\n\t// Check if it is a reference to a tiddler\n\tif(tr.title && !tr.field) {\n\t\tthis.deleteTiddler(tr.title);\n\t// Else check for a field reference\n\t} else if(tr.field) {\n\t\ttitle = tr.title || currTiddlerTitle;\n\t\ttiddler = this.getTiddler(title);\n\t\tif(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {\n\t\t\tfields = Object.create(null);\n\t\t\tfields[tr.field] = undefined;\n\t\t\tthis.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));\n\t\t}\n\t}\n};\n\nexports.addEventListener = function(type,listener) {\n\tthis.eventListeners = this.eventListeners || {};\n\tthis.eventListeners[type] = this.eventListeners[type] || [];\n\tthis.eventListeners[type].push(listener);\t\n};\n\nexports.removeEventListener = function(type,listener) {\n\tvar listeners = this.eventListeners[type];\n\tif(listeners) {\n\t\tvar p = listeners.indexOf(listener);\n\t\tif(p !== -1) {\n\t\t\tlisteners.splice(p,1);\n\t\t}\n\t}\n};\n\nexports.dispatchEvent = function(type /*, args */) {\n\tvar args = Array.prototype.slice.call(arguments,1),\n\t\tlisteners = this.eventListeners[type];\n\tif(listeners) {\n\t\tfor(var p=0; p<listeners.length; p++) {\n\t\t\tvar listener = listeners[p];\n\t\t\tlistener.apply(listener,args);\n\t\t}\n\t}\n};\n\n/*\nCauses a tiddler to be marked as changed, incrementing the change count, and triggers event handlers.\nThis method should be called after the changes it describes have been made to the wiki.tiddlers[] array.\n\ttitle: Title of tiddler\n\tisDeleted: defaults to false (meaning the tiddler has been created or modified),\n\t\ttrue if the tiddler has been deleted\n*/\nexports.enqueueTiddlerEvent = function(title,isDeleted) {\n\t// Record the touch in the list of changed tiddlers\n\tthis.changedTiddlers = this.changedTiddlers || Object.create(null);\n\tthis.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null);\n\tthis.changedTiddlers[title][isDeleted ? \"deleted\" : \"modified\"] = true;\n\t// Increment the change count\n\tthis.changeCount = this.changeCount || Object.create(null);\n\tif($tw.utils.hop(this.changeCount,title)) {\n\t\tthis.changeCount[title]++;\n\t} else {\n\t\tthis.changeCount[title] = 1;\n\t}\n\t// Trigger events\n\tthis.eventListeners = this.eventListeners || [];\n\tif(!this.eventsTriggered) {\n\t\tvar self = this;\n\t\t$tw.utils.nextTick(function() {\n\t\t\tvar changes = self.changedTiddlers;\n\t\t\tself.changedTiddlers = Object.create(null);\n\t\t\tself.eventsTriggered = false;\n\t\t\tif($tw.utils.count(changes) > 0) {\n\t\t\t\tself.dispatchEvent(\"change\",changes);\n\t\t\t}\n\t\t});\n\t\tthis.eventsTriggered = true;\n\t}\n};\n\nexports.getSizeOfTiddlerEventQueue = function() {\n\treturn $tw.utils.count(this.changedTiddlers);\n};\n\nexports.clearTiddlerEventQueue = function() {\n\tthis.changedTiddlers = Object.create(null);\n\tthis.changeCount = Object.create(null);\n};\n\nexports.getChangeCount = function(title) {\n\tthis.changeCount = this.changeCount || Object.create(null);\n\tif($tw.utils.hop(this.changeCount,title)) {\n\t\treturn this.changeCount[title];\n\t} else {\n\t\treturn 0;\n\t}\n};\n\n/*\nGenerate an unused title from the specified base\n*/\nexports.generateNewTitle = function(baseTitle,options) {\n\toptions = options || {};\n\tvar c = 0,\n\t\ttitle = baseTitle;\n\twhile(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) {\n\t\ttitle = baseTitle + \n\t\t\t(options.prefix || \" \") + \n\t\t\t(++c);\n\t}\n\treturn title;\n};\n\nexports.isSystemTiddler = function(title) {\n\treturn title.indexOf(\"$:/\") === 0;\n};\n\nexports.isTemporaryTiddler = function(title) {\n\treturn title.indexOf(\"$:/temp/\") === 0;\n};\n\nexports.isImageTiddler = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\t\t\n\t\tvar contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type || \"text/vnd.tiddlywiki\"];\n\t\treturn !!contentTypeInfo && contentTypeInfo.flags.indexOf(\"image\") !== -1;\n\t} else {\n\t\treturn null;\n\t}\n};\n\n/*\nLike addTiddler() except it will silently reject any plugin tiddlers that are older than the currently loaded version. Returns true if the tiddler was imported\n*/\nexports.importTiddler = function(tiddler) {\n\tvar existingTiddler = this.getTiddler(tiddler.fields.title);\n\t// Check if we're dealing with a plugin\n\tif(tiddler && tiddler.hasField(\"plugin-type\") && tiddler.hasField(\"version\") && existingTiddler && existingTiddler.hasField(\"plugin-type\") && existingTiddler.hasField(\"version\")) {\n\t\t// Reject the incoming plugin if it is older\n\t\tif($tw.utils.checkVersions(existingTiddler.fields.version,tiddler.fields.version)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Fall through to adding the tiddler\n\tthis.addTiddler(tiddler);\n\treturn true;\n};\n\n/*\nReturn a hashmap of the fields that should be set when a tiddler is created\n*/\nexports.getCreationFields = function() {\n\tvar fields = {\n\t\t\tcreated: new Date()\n\t\t},\n\t\tcreator = this.getTiddlerText(USER_NAME_TITLE);\n\tif(creator) {\n\t\tfields.creator = creator;\n\t}\n\treturn fields;\n};\n\n/*\nReturn a hashmap of the fields that should be set when a tiddler is modified\n*/\nexports.getModificationFields = function() {\n\tvar fields = Object.create(null),\n\t\tmodifier = this.getTiddlerText(USER_NAME_TITLE);\n\tfields.modified = new Date();\n\tif(modifier) {\n\t\tfields.modifier = modifier;\n\t}\n\treturn fields;\n};\n\n/*\nReturn a sorted array of tiddler titles. Options include:\nsortField: field to sort by\nexcludeTag: tag to exclude\nincludeSystem: whether to include system tiddlers (defaults to false)\n*/\nexports.getTiddlers = function(options) {\n\toptions = options || Object.create(null);\n\tvar self = this,\n\t\tsortField = options.sortField || \"title\",\n\t\ttiddlers = [], t, titles = [];\n\tthis.each(function(tiddler,title) {\n\t\tif(options.includeSystem || !self.isSystemTiddler(title)) {\n\t\t\tif(!options.excludeTag || !tiddler.hasTag(options.excludeTag)) {\n\t\t\t\ttiddlers.push(tiddler);\n\t\t\t}\n\t\t}\n\t});\n\ttiddlers.sort(function(a,b) {\n\t\tvar aa = a.fields[sortField].toLowerCase() || \"\",\n\t\t\tbb = b.fields[sortField].toLowerCase() || \"\";\n\t\tif(aa < bb) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\tif(aa > bb) {\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t});\n\tfor(t=0; t<tiddlers.length; t++) {\n\t\ttitles.push(tiddlers[t].fields.title);\n\t}\n\treturn titles;\n};\n\nexports.countTiddlers = function(excludeTag) {\n\tvar tiddlers = this.getTiddlers({excludeTag: excludeTag});\n\treturn $tw.utils.count(tiddlers);\n};\n\n/*\nReturns a function iterator(callback) that iterates through the specified titles, and invokes the callback with callback(tiddler,title)\n*/\nexports.makeTiddlerIterator = function(titles) {\n\tvar self = this;\n\tif(!$tw.utils.isArray(titles)) {\n\t\ttitles = Object.keys(titles);\n\t} else {\n\t\ttitles = titles.slice(0);\n\t}\n\treturn function(callback) {\n\t\ttitles.forEach(function(title) {\n\t\t\tcallback(self.getTiddler(title),title);\n\t\t});\n\t};\n};\n\n/*\nSort an array of tiddler titles by a specified field\n\ttitles: array of titles (sorted in place)\n\tsortField: name of field to sort by\n\tisDescending: true if the sort should be descending\n\tisCaseSensitive: true if the sort should consider upper and lower case letters to be different\n*/\nexports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric) {\n\tvar self = this;\n\ttitles.sort(function(a,b) {\n\t\tif(sortField !== \"title\") {\n\t\t\tvar tiddlerA = self.getTiddler(a),\n\t\t\t\ttiddlerB = self.getTiddler(b);\n\t\t\tif(tiddlerA) {\n\t\t\t\ta = tiddlerA.fields[sortField] || \"\";\n\t\t\t} else {\n\t\t\t\ta = \"\";\n\t\t\t}\n\t\t\tif(tiddlerB) {\n\t\t\t\tb = tiddlerB.fields[sortField] || \"\";\n\t\t\t} else {\n\t\t\t\tb = \"\";\n\t\t\t}\n\t\t}\n\t\tif(isNumeric) {\n\t\t\ta = Number(a);\n\t\t\tb = Number(b);\n\t\t\treturn isDescending ? b - a : a - b;\n\t\t} else if($tw.utils.isDate(a) && $tw.utils.isDate(b)) {\n\t\t\treturn isDescending ? b - a : a - b;\n\t\t} else {\n\t\t\ta = String(a);\n\t\t\tb = String(b);\n\t\t\tif(!isCaseSensitive) {\n\t\t\t\ta = a.toLowerCase();\n\t\t\t\tb = b.toLowerCase();\n\t\t\t}\n\t\t\treturn isDescending ? b.localeCompare(a) : a.localeCompare(b);\n\t\t}\n\t});\n};\n\n/*\nFor every tiddler invoke a callback(title,tiddler) with `this` set to the wiki object. Options include:\nsortField: field to sort by\nexcludeTag: tag to exclude\nincludeSystem: whether to include system tiddlers (defaults to false)\n*/\nexports.forEachTiddler = function(/* [options,]callback */) {\n\tvar arg = 0,\n\t\toptions = arguments.length >= 2 ? arguments[arg++] : {},\n\t\tcallback = arguments[arg++],\n\t\ttitles = this.getTiddlers(options),\n\t\tt, tiddler;\n\tfor(t=0; t<titles.length; t++) {\n\t\ttiddler = this.getTiddler(titles[t]);\n\t\tif(tiddler) {\n\t\t\tcallback.call(this,tiddler.fields.title,tiddler);\n\t\t}\n\t}\n};\n\n/*\nReturn an array of tiddler titles that are directly linked from the specified tiddler\n*/\nexports.getTiddlerLinks = function(title) {\n\tvar self = this;\n\t// We'll cache the links so they only get computed if the tiddler changes\n\treturn this.getCacheForTiddler(title,\"links\",function() {\n\t\t// Parse the tiddler\n\t\tvar parser = self.parseTiddler(title);\n\t\t// Count up the links\n\t\tvar links = [],\n\t\t\tcheckParseTree = function(parseTree) {\n\t\t\t\tfor(var t=0; t<parseTree.length; t++) {\n\t\t\t\t\tvar parseTreeNode = parseTree[t];\n\t\t\t\t\tif(parseTreeNode.type === \"link\" && parseTreeNode.attributes.to && parseTreeNode.attributes.to.type === \"string\") {\n\t\t\t\t\t\tvar value = parseTreeNode.attributes.to.value;\n\t\t\t\t\t\tif(links.indexOf(value) === -1) {\n\t\t\t\t\t\t\tlinks.push(value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(parseTreeNode.children) {\n\t\t\t\t\t\tcheckParseTree(parseTreeNode.children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\tif(parser) {\n\t\t\tcheckParseTree(parser.tree);\n\t\t}\n\t\treturn links;\n\t});\n};\n\n/*\nReturn an array of tiddler titles that link to the specified tiddler\n*/\nexports.getTiddlerBacklinks = function(targetTitle) {\n\tvar self = this,\n\t\tbacklinks = [];\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\tif(links.indexOf(targetTitle) !== -1) {\n\t\t\tbacklinks.push(title);\n\t\t}\n\t});\n\treturn backlinks;\n};\n\n/*\nReturn a hashmap of tiddler titles that are referenced but not defined. Each value is the number of times the missing tiddler is referenced\n*/\nexports.getMissingTitles = function() {\n\tvar self = this,\n\t\tmissing = [];\n// We should cache the missing tiddler list, even if we recreate it every time any tiddler is modified\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\t$tw.utils.each(links,function(link) {\n\t\t\tif((!self.tiddlerExists(link) && !self.isShadowTiddler(link)) && missing.indexOf(link) === -1) {\n\t\t\t\tmissing.push(link);\n\t\t\t}\n\t\t});\n\t});\n\treturn missing;\n};\n\nexports.getOrphanTitles = function() {\n\tvar self = this,\n\t\torphans = this.getTiddlers();\n\tthis.forEachTiddler(function(title,tiddler) {\n\t\tvar links = self.getTiddlerLinks(title);\n\t\t$tw.utils.each(links,function(link) {\n\t\t\tvar p = orphans.indexOf(link);\n\t\t\tif(p !== -1) {\n\t\t\t\torphans.splice(p,1);\n\t\t\t}\n\t\t});\n\t});\n\treturn orphans; // Todo\n};\n\n/*\nRetrieves a list of the tiddler titles that are tagged with a given tag\n*/\nexports.getTiddlersWithTag = function(tag) {\n\tvar self = this;\n\treturn this.getGlobalCache(\"taglist-\" + tag,function() {\n\t\tvar tagmap = self.getTagMap();\n\t\treturn self.sortByList(tagmap[tag],tag);\n\t});\n};\n\n/*\nGet a hashmap by tag of arrays of tiddler titles\n*/\nexports.getTagMap = function() {\n\tvar self = this;\n\treturn this.getGlobalCache(\"tagmap\",function() {\n\t\tvar tags = Object.create(null),\n\t\t\tstoreTags = function(tagArray,title) {\n\t\t\t\tif(tagArray) {\n\t\t\t\t\tfor(var index=0; index<tagArray.length; index++) {\n\t\t\t\t\t\tvar tag = tagArray[index];\n\t\t\t\t\t\tif($tw.utils.hop(tags,tag)) {\n\t\t\t\t\t\t\ttags[tag].push(title);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttags[tag] = [title];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\ttitle, tiddler;\n\t\t// Collect up all the tags\n\t\tself.eachShadow(function(tiddler,title) {\n\t\t\tif(!self.tiddlerExists(title)) {\n\t\t\t\ttiddler = self.getTiddler(title);\n\t\t\t\tstoreTags(tiddler.fields.tags,title);\n\t\t\t}\n\t\t});\n\t\tself.each(function(tiddler,title) {\n\t\t\tstoreTags(tiddler.fields.tags,title);\n\t\t});\n\t\treturn tags;\n\t});\n};\n\n/*\nLookup a given tiddler and return a list of all the tiddlers that include it in the specified list field\n*/\nexports.findListingsOfTiddler = function(targetTitle,fieldName) {\n\tfieldName = fieldName || \"list\";\n\tvar titles = [];\n\tthis.each(function(tiddler,title) {\n\t\tvar list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);\n\t\tif(list && list.indexOf(targetTitle) !== -1) {\n\t\t\ttitles.push(title);\n\t\t}\n\t});\n\treturn titles;\n};\n\n/*\nSorts an array of tiddler titles according to an ordered list\n*/\nexports.sortByList = function(array,listTitle) {\n\tvar list = this.getTiddlerList(listTitle);\n\tif(!array || array.length === 0) {\n\t\treturn [];\n\t} else {\n\t\tvar titles = [], t, title;\n\t\t// First place any entries that are present in the list\n\t\tfor(t=0; t<list.length; t++) {\n\t\t\ttitle = list[t];\n\t\t\tif(array.indexOf(title) !== -1) {\n\t\t\t\ttitles.push(title);\n\t\t\t}\n\t\t}\n\t\t// Then place any remaining entries\n\t\tfor(t=0; t<array.length; t++) {\n\t\t\ttitle = array[t];\n\t\t\tif(list.indexOf(title) === -1) {\n\t\t\t\ttitles.push(title);\n\t\t\t}\n\t\t}\n\t\t// Finally obey the list-before and list-after fields of each tiddler in turn\n\t\tvar sortedTitles = titles.slice(0);\n\t\tfor(t=0; t<sortedTitles.length; t++) {\n\t\t\ttitle = sortedTitles[t];\n\t\t\tvar currPos = titles.indexOf(title),\n\t\t\t\tnewPos = -1,\n\t\t\t\ttiddler = this.getTiddler(title);\n\t\t\tif(tiddler) {\n\t\t\t\tvar beforeTitle = tiddler.fields[\"list-before\"],\n\t\t\t\t\tafterTitle = tiddler.fields[\"list-after\"];\n\t\t\t\tif(beforeTitle === \"\") {\n\t\t\t\t\tnewPos = 0;\n\t\t\t\t} else if(beforeTitle) {\n\t\t\t\t\tnewPos = titles.indexOf(beforeTitle);\n\t\t\t\t} else if(afterTitle) {\n\t\t\t\t\tnewPos = titles.indexOf(afterTitle);\n\t\t\t\t\tif(newPos >= 0) {\n\t\t\t\t\t\t++newPos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(newPos === -1) {\n\t\t\t\t\tnewPos = currPos;\n\t\t\t\t}\n\t\t\t\tif(newPos !== currPos) {\n\t\t\t\t\ttitles.splice(currPos,1);\n\t\t\t\t\tif(newPos >= currPos) {\n\t\t\t\t\t\tnewPos--;\n\t\t\t\t\t}\n\t\t\t\t\ttitles.splice(newPos,0,title);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn titles;\n\t}\n};\n\nexports.getSubTiddler = function(title,subTiddlerTitle) {\n\tvar bundleInfo = this.getPluginInfo(title) || this.getTiddlerData(title);\n\tif(bundleInfo && bundleInfo.tiddlers) {\n\t\tvar subTiddler = bundleInfo.tiddlers[subTiddlerTitle];\n\t\tif(subTiddler) {\n\t\t\treturn new $tw.Tiddler(subTiddler);\n\t\t}\n\t}\n\treturn null;\n};\n\n/*\nRetrieve a tiddler as a JSON string of the fields\n*/\nexports.getTiddlerAsJson = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\n\t\tvar fields = Object.create(null);\n\t\t$tw.utils.each(tiddler.fields,function(value,name) {\n\t\t\tfields[name] = tiddler.getFieldString(name);\n\t\t});\n\t\treturn JSON.stringify(fields);\n\t} else {\n\t\treturn JSON.stringify({title: title});\n\t}\n};\n\n/*\nGet the content of a tiddler as a JavaScript object. How this is done depends on the type of the tiddler:\n\napplication/json: the tiddler JSON is parsed into an object\napplication/x-tiddler-dictionary: the tiddler is parsed as sequence of name:value pairs\n\nOther types currently just return null.\n\ntitleOrTiddler: string tiddler title or a tiddler object\ndefaultData: default data to be returned if the tiddler is missing or doesn't contain data\n*/\nexports.getTiddlerData = function(titleOrTiddler,defaultData) {\n\tvar tiddler = titleOrTiddler,\n\t\tdata;\n\tif(!(tiddler instanceof $tw.Tiddler)) {\n\t\ttiddler = this.getTiddler(tiddler);\t\n\t}\n\tif(tiddler && tiddler.fields.text) {\n\t\tswitch(tiddler.fields.type) {\n\t\t\tcase \"application/json\":\n\t\t\t\t// JSON tiddler\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse(tiddler.fields.text);\n\t\t\t\t} catch(ex) {\n\t\t\t\t\treturn defaultData;\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\tcase \"application/x-tiddler-dictionary\":\n\t\t\t\treturn $tw.utils.parseFields(tiddler.fields.text);\n\t\t}\n\t}\n\treturn defaultData;\n};\n\n/*\nExtract an indexed field from within a data tiddler\n*/\nexports.extractTiddlerDataItem = function(titleOrTiddler,index,defaultText) {\n\tvar data = this.getTiddlerData(titleOrTiddler,Object.create(null)),\n\t\ttext;\n\tif(data && $tw.utils.hop(data,index)) {\n\t\ttext = data[index];\n\t}\n\tif(typeof text === \"string\" || typeof text === \"number\") {\n\t\treturn text.toString();\n\t} else {\n\t\treturn defaultText;\n\t}\n};\n\n/*\nSet a tiddlers content to a JavaScript object. Currently this is done by setting the tiddler's type to \"application/json\" and setting the text to the JSON text of the data.\ntitle: title of tiddler\ndata: object that can be serialised to JSON\nfields: optional hashmap of additional tiddler fields to be set\n*/\nexports.setTiddlerData = function(title,data,fields) {\n\tvar existingTiddler = this.getTiddler(title),\n\t\tnewFields = {\n\t\t\ttitle: title\n\t};\n\tif(existingTiddler && existingTiddler.fields.type === \"application/x-tiddler-dictionary\") {\n\t\tnewFields.text = $tw.utils.makeTiddlerDictionary(data);\n\t} else {\n\t\tnewFields.type = \"application/json\";\n\t\tnewFields.text = JSON.stringify(data,null,$tw.config.preferences.jsonSpaces);\n\t}\n\tthis.addTiddler(new $tw.Tiddler(this.getCreationFields(),existingTiddler,fields,newFields,this.getModificationFields()));\n};\n\n/*\nReturn the content of a tiddler as an array containing each line\n*/\nexports.getTiddlerList = function(title,field,index) {\n\tif(index) {\n\t\treturn $tw.utils.parseStringArray(this.extractTiddlerDataItem(title,index,\"\"));\n\t}\n\tfield = field || \"list\";\n\tvar tiddler = this.getTiddler(title);\n\tif(tiddler) {\n\t\treturn ($tw.utils.parseStringArray(tiddler.fields[field]) || []).slice(0);\n\t}\n\treturn [];\n};\n\n// Return a named global cache object. Global cache objects are cleared whenever a tiddler change occurs\nexports.getGlobalCache = function(cacheName,initializer) {\n\tthis.globalCache = this.globalCache || Object.create(null);\n\tif($tw.utils.hop(this.globalCache,cacheName)) {\n\t\treturn this.globalCache[cacheName];\n\t} else {\n\t\tthis.globalCache[cacheName] = initializer();\n\t\treturn this.globalCache[cacheName];\n\t}\n};\n\nexports.clearGlobalCache = function() {\n\tthis.globalCache = Object.create(null);\n};\n\n// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it\nexports.getCacheForTiddler = function(title,cacheName,initializer) {\n\n// Temporarily disable caching so that tweakParseTreeNode() works\nreturn initializer();\n\n//\tthis.caches = this.caches || Object.create(null);\n//\tvar caches = this.caches[title];\n//\tif(caches && caches[cacheName]) {\n//\t\treturn caches[cacheName];\n//\t} else {\n//\t\tif(!caches) {\n//\t\t\tcaches = Object.create(null);\n//\t\t\tthis.caches[title] = caches;\n//\t\t}\n//\t\tcaches[cacheName] = initializer();\n//\t\treturn caches[cacheName];\n//\t}\n};\n\n// Clear all caches associated with a particular tiddler\nexports.clearCache = function(title) {\n\tthis.caches = this.caches || Object.create(null);\n\tif($tw.utils.hop(this.caches,title)) {\n\t\tdelete this.caches[title];\n\t}\n};\n\nexports.initParsers = function(moduleType) {\n\t// Install the parser modules\n\t$tw.Wiki.parsers = {};\n\tvar self = this;\n\t$tw.modules.forEachModuleOfType(\"parser\",function(title,module) {\n\t\tfor(var f in module) {\n\t\t\tif($tw.utils.hop(module,f)) {\n\t\t\t\t$tw.Wiki.parsers[f] = module[f]; // Store the parser class\n\t\t\t}\n\t\t}\n\t});\n};\n\n/*\nParse a block of text of a specified MIME type\n\ttype: content type of text to be parsed\n\ttext: text\n\toptions: see below\nOptions include:\n\tparseAsInline: if true, the text of the tiddler will be parsed as an inline run\n\t_canonical_uri: optional string of the canonical URI of this content\n*/\nexports.old_parseText = function(type,text,options) {\n\toptions = options || {};\n\t// Select a parser\n\tvar Parser = $tw.Wiki.parsers[type];\n\tif(!Parser && $tw.config.fileExtensionInfo[type]) {\n\t\tParser = $tw.Wiki.parsers[$tw.config.fileExtensionInfo[type].type];\n\t}\n\tif(!Parser) {\n\t\tParser = $tw.Wiki.parsers[options.defaultType || \"text/vnd.tiddlywiki\"];\n\t}\n\tif(!Parser) {\n\t\treturn null;\n\t}\n\t// Return the parser instance\n\treturn new Parser(type,text,{\n\t\tparseAsInline: options.parseAsInline,\n\t\twiki: this,\n\t\t_canonical_uri: options._canonical_uri\n\t});\n};\n\n/*\nParse a tiddler according to its MIME type\n*/\nexports.old_parseTiddler = function(title,options) {\n\toptions = $tw.utils.extend({},options);\n\tvar cacheType = options.parseAsInline ? \"newInlineParseTree\" : \"newBlockParseTree\",\n\t\ttiddler = this.getTiddler(title),\n\t\tself = this;\n\treturn tiddler ? this.getCacheForTiddler(title,cacheType,function() {\n\t\t\tif(tiddler.hasField(\"_canonical_uri\")) {\n\t\t\t\toptions._canonical_uri = tiddler.fields._canonical_uri;\n\t\t\t}\n\t\t\treturn self.old_parseText(tiddler.fields.type,tiddler.fields.text,options);\n\t\t}) : null;\n};\n\nvar tweakMacroDefinition = function(nodeList) {\n\tif(nodeList && nodeList[0] && nodeList[0].type === \"macrodef\") {\n\t\tnodeList[0].type = \"set\";\n\t\tnodeList[0].attributes = {\n\t\t\tname: {type: \"string\", value: nodeList[0].name},\n\t\t\tvalue: {type: \"string\", value: nodeList[0].text}\n\t\t};\n\t\tnodeList[0].children = nodeList.slice(1);\n\t\tnodeList.splice(1,nodeList.length-1);\n\t\ttweakMacroDefinition(nodeList[0].children);\n\t}\n};\n\nvar tweakParser = function(parser) {\n\t// Move any macro definitions to contain the body tree\n\ttweakMacroDefinition(parser.tree);\n};\n\nexports.parseText = function(type,text,options) {\n\tvar parser = this.old_parseText(type,text,options);\n\tif(parser) {\n\t\ttweakParser(parser);\n\t}\n\treturn parser;\n};\n\nexports.parseTiddler = function(title,options) {\n\tvar parser = this.old_parseTiddler(title,options);\n\tif(parser) {\n\t\ttweakParser(parser);\n\t}\n\treturn parser;\n};\n\nexports.parseTextReference = function(title,field,index,options) {\n\tvar tiddler,text;\n\tif(options.subTiddler) {\n\t\ttiddler = this.getSubTiddler(title,options.subTiddler);\n\t} else {\n\t\ttiddler = this.getTiddler(title);\n\t\tif(field === \"text\" || (!field && !index)) {\n\t\t\tthis.getTiddlerText(title); // Force the tiddler to be lazily loaded\n\t\t\treturn this.parseTiddler(title,options);\n\t\t}\n\t}\n\tif(field === \"text\" || (!field && !index)) {\n\t\tif(tiddler && tiddler.fields) {\n\t\t\treturn this.parseText(tiddler.fields.type || \"text/vnd.tiddlywiki\",tiddler.fields.text,options);\t\t\t\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t} else if(field) {\n\t\tif(field === \"title\") {\n\t\t\ttext = title;\n\t\t} else {\n\t\t\tif(!tiddler || !tiddler.hasField(field)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttext = tiddler.fields[field];\n\t\t}\n\t\treturn this.parseText(\"text/vnd.tiddlywiki\",text.toString(),options);\n\t} else if(index) {\n\t\tthis.getTiddlerText(title); // Force the tiddler to be lazily loaded\n\t\ttext = this.extractTiddlerDataItem(tiddler,index,undefined);\n\t\tif(text === undefined) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.parseText(\"text/vnd.tiddlywiki\",text,options);\n\t}\n};\n\n/*\nMake a widget tree for a parse tree\nparser: parser object\noptions: see below\nOptions include:\ndocument: optional document to use\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.makeWidget = function(parser,options) {\n\toptions = options || {};\n\tvar widgetNode = {\n\t\t\ttype: \"widget\",\n\t\t\tchildren: []\n\t\t},\n\t\tcurrWidgetNode = widgetNode;\n\t// Create set variable widgets for each variable\n\t$tw.utils.each(options.variables,function(value,name) {\n\t\tvar setVariableWidget = {\n\t\t\ttype: \"set\",\n\t\t\tattributes: {\n\t\t\t\tname: {type: \"string\", value: name},\n\t\t\t\tvalue: {type: \"string\", value: value}\n\t\t\t},\n\t\t\tchildren: []\n\t\t};\n\t\tcurrWidgetNode.children = [setVariableWidget];\n\t\tcurrWidgetNode = setVariableWidget;\n\t});\n\t// Add in the supplied parse tree nodes\n\tcurrWidgetNode.children = parser ? parser.tree : [];\n\t// Create the widget\n\treturn new widget.widget(widgetNode,{\n\t\twiki: this,\n\t\tdocument: options.document || $tw.fakeDocument,\n\t\tparentWidget: options.parentWidget\n\t});\n};\n\n/*\nMake a widget tree for transclusion\ntitle: target tiddler title\noptions: as for wiki.makeWidget() plus:\noptions.field: optional field to transclude (defaults to \"text\")\noptions.children: optional array of children for the transclude widget\n*/\nexports.makeTranscludeWidget = function(title,options) {\n\toptions = options || {};\n\tvar parseTree = {tree: [{\n\t\t\ttype: \"element\",\n\t\t\ttag: \"div\",\n\t\t\tchildren: [{\n\t\t\t\ttype: \"transclude\",\n\t\t\t\tattributes: {\n\t\t\t\t\ttiddler: {\n\t\t\t\t\t\tname: \"tiddler\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tvalue: title}},\n\t\t\t\tisBlock: !options.parseAsInline}]}\n\t]};\n\tif(options.field) {\n\t\tparseTree.tree[0].children[0].attributes.field = {type: \"string\", value: options.field};\n\t}\n\tif(options.children) {\n\t\tparseTree.tree[0].children[0].children = options.children;\n\t}\n\treturn $tw.wiki.makeWidget(parseTree,options);\n};\n\n/*\nParse text in a specified format and render it into another format\n\toutputType: content type for the output\n\ttextType: content type of the input text\n\ttext: input text\n\toptions: see below\nOptions include:\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.renderText = function(outputType,textType,text,options) {\n\toptions = options || {};\n\tvar parser = this.parseText(textType,text,options),\n\t\twidgetNode = this.makeWidget(parser,options);\n\tvar container = $tw.fakeDocument.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn outputType === \"text/html\" ? container.innerHTML : container.textContent;\n};\n\n/*\nParse text from a tiddler and render it into another format\n\toutputType: content type for the output\n\ttitle: title of the tiddler to be rendered\n\toptions: see below\nOptions include:\nvariables: hashmap of variables to set\nparentWidget: optional parent widget for the root node\n*/\nexports.renderTiddler = function(outputType,title,options) {\n\toptions = options || {};\n\tvar parser = this.parseTiddler(title,options),\n\t\twidgetNode = this.makeWidget(parser,options);\n\tvar container = $tw.fakeDocument.createElement(\"div\");\n\twidgetNode.render(container,null);\n\treturn outputType === \"text/html\" ? container.innerHTML : (outputType === \"text/plain-formatted\" ? container.formattedTextContent : container.textContent);\n};\n\n/*\nReturn an array of tiddler titles that match a search string\n\ttext: The text string to search for\n\toptions: see below\nOptions available:\n\tsource: an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)\n\texclude: An array of tiddler titles to exclude from the search\n\tinvert: If true returns tiddlers that do not contain the specified string\n\tcaseSensitive: If true forces a case sensitive search\n\tliteral: If true, searches for literal string, rather than separate search terms\n\tfield: If specified, restricts the search to the specified field\n*/\nexports.search = function(text,options) {\n\toptions = options || {};\n\tvar self = this,\n\t\tt,\n\t\tinvert = !!options.invert;\n\t// Convert the search string into a regexp for each term\n\tvar terms, searchTermsRegExps,\n\t\tflags = options.caseSensitive ? \"\" : \"i\";\n\tif(options.literal) {\n\t\tif(text.length === 0) {\n\t\t\tsearchTermsRegExps = null;\n\t\t} else {\n\t\t\tsearchTermsRegExps = [new RegExp(\"(\" + $tw.utils.escapeRegExp(text) + \")\",flags)];\n\t\t}\n\t} else {\n\t\tterms = text.split(/ +/);\n\t\tif(terms.length === 1 && terms[0] === \"\") {\n\t\t\tsearchTermsRegExps = null;\n\t\t} else {\n\t\t\tsearchTermsRegExps = [];\n\t\t\tfor(t=0; t<terms.length; t++) {\n\t\t\t\tsearchTermsRegExps.push(new RegExp(\"(\" + $tw.utils.escapeRegExp(terms[t]) + \")\",flags));\n\t\t\t}\n\t\t}\n\t}\n\t// Function to check a given tiddler for the search term\n\tvar searchTiddler = function(title) {\n\t\tif(!searchTermsRegExps) {\n\t\t\treturn true;\n\t\t}\n\t\tvar tiddler = self.getTiddler(title);\n\t\tif(!tiddler) {\n\t\t\ttiddler = new $tw.Tiddler({title: title, text: \"\", type: \"text/vnd.tiddlywiki\"});\n\t\t}\n\t\tvar contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type] || $tw.config.contentTypeInfo[\"text/vnd.tiddlywiki\"],\n\t\t\tmatch;\n\t\tfor(var t=0; t<searchTermsRegExps.length; t++) {\n\t\t\tmatch = false;\n\t\t\tif(options.field) {\n\t\t\t\tmatch = searchTermsRegExps[t].test(tiddler.getFieldString(options.field));\n\t\t\t} else {\n\t\t\t\t// Search title, tags and body\n\t\t\t\tif(contentTypeInfo.encoding === \"utf8\") {\n\t\t\t\t\tmatch = match || searchTermsRegExps[t].test(tiddler.fields.text);\n\t\t\t\t}\n\t\t\t\tvar tags = tiddler.fields.tags ? tiddler.fields.tags.join(\"\\0\") : \"\";\n\t\t\t\tmatch = match || searchTermsRegExps[t].test(tags) || searchTermsRegExps[t].test(tiddler.fields.title);\n\t\t\t}\n\t\t\tif(!match) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t};\n\t// Loop through all the tiddlers doing the search\n\tvar results = [],\n\t\tsource = options.source || this.each;\n\tsource(function(tiddler,title) {\n\t\tif(searchTiddler(title) !== options.invert) {\n\t\t\tresults.push(title);\n\t\t}\n\t});\n\t// Remove any of the results we have to exclude\n\tif(options.exclude) {\n\t\tfor(t=0; t<options.exclude.length; t++) {\n\t\t\tvar p = results.indexOf(options.exclude[t]);\n\t\t\tif(p !== -1) {\n\t\t\t\tresults.splice(p,1);\n\t\t\t}\n\t\t}\n\t}\n\treturn results;\n};\n\n/*\nTrigger a load for a tiddler if it is skinny. Returns the text, or undefined if the tiddler is missing, null if the tiddler is being lazily loaded.\n*/\nexports.getTiddlerText = function(title,defaultText) {\n\tvar tiddler = this.getTiddler(title);\n\t// Return undefined if the tiddler isn't found\n\tif(!tiddler) {\n\t\treturn defaultText;\n\t}\n\tif(tiddler.fields.text !== undefined) {\n\t\t// Just return the text if we've got it\n\t\treturn tiddler.fields.text;\n\t} else {\n\t\t// Tell any listeners about the need to lazily load this tiddler\n\t\tthis.dispatchEvent(\"lazyLoad\",title);\n\t\t// Indicate that the text is being loaded\n\t\treturn null;\n\t}\n};\n\n/*\nRead an array of browser File objects, invoking callback(tiddlerFieldsArray) once they're all read\n*/\nexports.readFiles = function(files,callback) {\n\tvar result = [],\n\t\toutstanding = files.length;\n\tfor(var f=0; f<files.length; f++) {\n\t\tthis.readFile(files[f],function(tiddlerFieldsArray) {\n\t\t\tresult.push.apply(result,tiddlerFieldsArray);\n\t\t\tif(--outstanding === 0) {\n\t\t\t\tcallback(result);\n\t\t\t}\n\t\t});\n\t}\n\treturn files.length;\n};\n\n/*\nRead a browser File object, invoking callback(tiddlerFieldsArray) with an array of tiddler fields objects\n*/\nexports.readFile = function(file,callback) {\n\t// Get the type, falling back to the filename extension\n\tvar self = this,\n\t\ttype = file.type;\n\tif(type === \"\" || !type) {\n\t\tvar dotPos = file.name.lastIndexOf(\".\");\n\t\tif(dotPos !== -1) {\n\t\t\tvar fileExtensionInfo = $tw.config.fileExtensionInfo[file.name.substr(dotPos)];\n\t\t\tif(fileExtensionInfo) {\n\t\t\t\ttype = fileExtensionInfo.type;\n\t\t\t}\n\t\t}\n\t}\n\t// Figure out if we're reading a binary file\n\tvar contentTypeInfo = $tw.config.contentTypeInfo[type],\n\t\tisBinary = contentTypeInfo ? contentTypeInfo.encoding === \"base64\" : false;\n\t// Log some debugging information\n\tif($tw.log.IMPORT) {\n\t\tconsole.log(\"Importing file '\" + file.name + \"', type: '\" + type + \"', isBinary: \" + isBinary);\n\t}\n\t// Create the FileReader\n\tvar reader = new FileReader();\n\t// Onload\n\treader.onload = function(event) {\n\t\t// Deserialise the file contents\n\t\tvar text = event.target.result,\n\t\t\ttiddlerFields = {title: file.name || \"Untitled\", type: type};\n\t\t// Are we binary?\n\t\tif(isBinary) {\n\t\t\t// The base64 section starts after the first comma in the data URI\n\t\t\tvar commaPos = text.indexOf(\",\");\n\t\t\tif(commaPos !== -1) {\n\t\t\t\ttiddlerFields.text = text.substr(commaPos+1);\n\t\t\t\tcallback([tiddlerFields]);\n\t\t\t}\n\t\t} else {\n\t\t\t// Check whether this is an encrypted TiddlyWiki file\n\t\t\tvar encryptedJson = $tw.utils.extractEncryptedStoreArea(text);\n\t\t\tif(encryptedJson) {\n\t\t\t\t// If so, attempt to decrypt it with the current password\n\t\t\t\t$tw.utils.decryptStoreAreaInteractive(encryptedJson,function(tiddlers) {\n\t\t\t\t\tcallback(tiddlers);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Otherwise, just try to deserialise any tiddlers in the file\n\t\t\t\tcallback(self.deserializeTiddlers(type,text,tiddlerFields));\n\t\t\t}\n\t\t}\n\t};\n\t// Kick off the read\n\tif(isBinary) {\n\t\treader.readAsDataURL(file);\n\t} else {\n\t\treader.readAsText(file);\n\t}\n};\n\n/*\nFind any existing draft of a specified tiddler\n*/\nexports.findDraft = function(targetTitle) {\n\tvar draftTitle = undefined;\n\tthis.forEachTiddler({includeSystem: true},function(title,tiddler) {\n\t\tif(tiddler.fields[\"draft.title\"] && tiddler.fields[\"draft.of\"] === targetTitle) {\n\t\t\tdraftTitle = title;\n\t\t}\n\t});\n\treturn draftTitle;\n}\n\n/*\nCheck whether the specified draft tiddler has been modified\n*/\nexports.isDraftModified = function(title) {\n\tvar tiddler = this.getTiddler(title);\n\tif(!tiddler.isDraft()) {\n\t\treturn false;\n\t}\n\tvar ignoredFields = [\"created\", \"modified\", \"title\", \"draft.title\", \"draft.of\"],\n\t\torigTiddler = this.getTiddler(tiddler.fields[\"draft.of\"]);\n\tif(!origTiddler) {\n\t\treturn tiddler.fields.text !== \"\";\n\t}\n\treturn tiddler.fields[\"draft.title\"] !== tiddler.fields[\"draft.of\"] || !tiddler.isEqual(origTiddler,ignoredFields);\n};\n\n/*\nAdd a new record to the top of the history stack\ntitle: a title string or an array of title strings\nfromPageRect: page coordinates of the origin of the navigation\nhistoryTitle: title of history tiddler (defaults to $:/HistoryList)\n*/\nexports.addToHistory = function(title,fromPageRect,historyTitle) {\n\thistoryTitle = historyTitle || \"$:/HistoryList\";\n\tvar titles = $tw.utils.isArray(title) ? title : [title];\n\t// Add a new record to the top of the history stack\n\tvar historyList = this.getTiddlerData(historyTitle,[]);\n\t$tw.utils.each(titles,function(title) {\n\t\thistoryList.push({title: title, fromPageRect: fromPageRect});\n\t});\n\tthis.setTiddlerData(historyTitle,historyList,{\"current-tiddler\": titles[titles.length-1]});\n};\n\n/*\nInvoke the available upgrader modules\ntitles: array of tiddler titles to be processed\ntiddlers: hashmap by title of tiddler fields of pending import tiddlers. These can be modified by the upgraders. An entry with no fields indicates a tiddler that was pending import has been suppressed. When entries are added to the pending import the tiddlers hashmap may have entries that are not present in the titles array\nReturns a hashmap of messages keyed by tiddler title.\n*/\nexports.invokeUpgraders = function(titles,tiddlers) {\n\t// Collect up the available upgrader modules\n\tvar self = this;\n\tif(!this.upgraderModules) {\n\t\tthis.upgraderModules = [];\n\t\t$tw.modules.forEachModuleOfType(\"upgrader\",function(title,module) {\n\t\t\tif(module.upgrade) {\n\t\t\t\tself.upgraderModules.push(module);\n\t\t\t}\n\t\t});\n\t}\n\t// Invoke each upgrader in turn\n\tvar messages = {};\n\tfor(var t=0; t<this.upgraderModules.length; t++) {\n\t\tvar upgrader = this.upgraderModules[t],\n\t\t\tupgraderMessages = upgrader.upgrade(this,titles,tiddlers);\n\t\t$tw.utils.extend(messages,upgraderMessages);\n\t}\n\treturn messages;\n};\n\n})();\n",
"title": "$:/core/modules/wiki.js",
"type": "application/javascript",
"module-type": "wikimethod"
},
"$:/palettes/Blanca": {
"title": "$:/palettes/Blanca",
"name": "Blanca",
"description": "A clean white palette to let you focus",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #66cccc\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #ffffff\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #7897f3\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ccc\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #ffffff\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #7897f3\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #fffffffff\ntab-background: #eeeeee\ntab-border-selected: #cccccc\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ffeedd\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: #eee\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #ff9900\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/palettes/Blue": {
"title": "$:/palettes/Blue",
"name": "Blue",
"description": "A blue theme",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #fff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour foreground>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333353\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #ddddff\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ffffff\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: <<colour page-background>>\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #5959c0\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: <<colour background>>\ntab-background: #ccccdd\ntab-border-selected: #ccccdd\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #eeeeff\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #666666\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #ffffff\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #ffffff\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #5959c0\ntoolbar-new-button: #5eb95e\ntoolbar-options-button: rgb(128, 88, 165)\ntoolbar-save-button: #0e90d2\ntoolbar-info-button: #0e90d2\ntoolbar-edit-button: rgb(243, 123, 29)\ntoolbar-close-button: #dd514c\ntoolbar-delete-button: #dd514c\ntoolbar-cancel-button: rgb(243, 123, 29)\ntoolbar-done-button: #5eb95e\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/palettes/Muted": {
"title": "$:/palettes/Muted",
"name": "Muted",
"description": "Bright tiddlers on a muted background",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #bbb\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #6f6f70\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #29a6ee\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #c2c1c2\nsidebar-foreground-shadow: rgba(255,255,255,0)\nsidebar-foreground: #d3d2d4\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #6f6f70\nsidebar-tab-background: #666667\nsidebar-tab-border-selected: #999\nsidebar-tab-border: #515151\nsidebar-tab-divider: #999\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: #999\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #d1d0d2\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #d5ad34\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button: \ntoolbar-options-button: \ntoolbar-save-button: \ntoolbar-info-button: \ntoolbar-edit-button: \ntoolbar-close-button: \ntoolbar-delete-button: \ntoolbar-cancel-button: \ntoolbar-done-button: \nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/palettes/Contrast": {
"title": "$:/palettes/Contrast",
"name": "Contrast",
"description": "High contrast and unambiguous",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #000000\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ffffff\nsidebar-foreground-shadow: rgba(255,0,0, 0.5)\nsidebar-foreground: #ffffff\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #ececec\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #999999\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #d5ad34\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/palettes/Rocker": {
"title": "$:/palettes/Rocker",
"name": "Rocker",
"description": "A dark theme",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #999999\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #000\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #cc0000\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #ffffff\nsidebar-foreground-shadow: rgba(255,255,255, 0.0)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #000\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: <<colour tab-divider>>\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #ffbb99\nsidebar-tiddler-link-foreground: #cc0000\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ffbb99\ntag-foreground: #000\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #cc0000\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/palettes/Vanilla": {
"title": "$:/palettes/Vanilla",
"name": "Vanilla",
"description": "Pale and unobtrusive",
"tags": "$:/tags/Palette",
"type": "application/x-tiddler-dictionary",
"text": "alert-background: #ffe476\nalert-border: #b99e2f\nalert-highlight: #881122\nalert-muted-foreground: #b99e2f\nbackground: #ffffff\nblockquote-bar: <<colour muted-foreground>>\ncode-background: #f7f7f9\ncode-border: #e1e1e8\ncode-foreground: #dd1144\ndirty-indicator: #ff0000\ndownload-background: #34c734\ndownload-foreground: <<colour background>>\ndragger-background: <<colour foreground>>\ndragger-foreground: <<colour background>>\ndropdown-background: <<colour background>>\ndropdown-border: <<colour muted-foreground>>\ndropdown-tab-background-selected: #fff\ndropdown-tab-background: #ececec\ndropzone-background: rgba(0,200,0,0.7)\nexternal-link-background-hover: inherit\nexternal-link-background-visited: inherit\nexternal-link-background: inherit\nexternal-link-foreground-hover: inherit\nexternal-link-foreground-visited: #0000aa\nexternal-link-foreground: #0000ee\nforeground: #333333\nmessage-background: #ecf2ff\nmessage-border: #cfd6e6\nmessage-foreground: #547599\nmodal-backdrop: <<colour foreground>>\nmodal-background: <<colour background>>\nmodal-border: #999999\nmodal-footer-background: #f5f5f5\nmodal-footer-border: #dddddd\nmodal-header-border: #eeeeee\nmuted-foreground: #bbb\nnotification-background: #ffffdd\nnotification-border: #999999\npage-background: #ececec\npre-background: #f5f5f5\npre-border: #cccccc\nprimary: #5778d8\nsidebar-button-foreground: <<colour foreground>>\nsidebar-controls-foreground-hover: #000000\nsidebar-controls-foreground: #aaaaaa\nsidebar-foreground-shadow: rgba(255,255,255, 0.8)\nsidebar-foreground: #acacac\nsidebar-muted-foreground-hover: #444444\nsidebar-muted-foreground: #c0c0c0\nsidebar-tab-background-selected: #ececec\nsidebar-tab-background: <<colour tab-background>>\nsidebar-tab-border-selected: <<colour tab-border-selected>>\nsidebar-tab-border: <<colour tab-border>>\nsidebar-tab-divider: #e4e4e4\nsidebar-tab-foreground-selected: \nsidebar-tab-foreground: <<colour tab-foreground>>\nsidebar-tiddler-link-foreground-hover: #444444\nsidebar-tiddler-link-foreground: #999999\nstatic-alert-foreground: #aaaaaa\ntab-background-selected: #ffffff\ntab-background: #d8d8d8\ntab-border-selected: #d8d8d8\ntab-border: #cccccc\ntab-divider: #d8d8d8\ntab-foreground-selected: <<colour tab-foreground>>\ntab-foreground: #666666\ntable-border: #dddddd\ntable-footer-background: #a8a8a8\ntable-header-background: #f0f0f0\ntag-background: #ec6\ntag-foreground: #ffffff\ntiddler-background: <<colour background>>\ntiddler-border: <<colour background>>\ntiddler-controls-foreground-hover: #888888\ntiddler-controls-foreground-selected: #444444\ntiddler-controls-foreground: #cccccc\ntiddler-editor-background: #f8f8f8\ntiddler-editor-border-image: #ffffff\ntiddler-editor-border: #cccccc\ntiddler-editor-fields-even: #e0e8e0\ntiddler-editor-fields-odd: #f0f4f0\ntiddler-info-background: #f8f8f8\ntiddler-info-border: #dddddd\ntiddler-info-tab-background: #f8f8f8\ntiddler-link-background: <<colour background>>\ntiddler-link-foreground: <<colour primary>>\ntiddler-subtitle-foreground: #c0c0c0\ntiddler-title-foreground: #182955\ntoolbar-new-button:\ntoolbar-options-button:\ntoolbar-save-button:\ntoolbar-info-button:\ntoolbar-edit-button:\ntoolbar-close-button:\ntoolbar-delete-button:\ntoolbar-cancel-button:\ntoolbar-done-button:\nuntagged-background: #999999\nvery-muted-foreground: #888888\n"
},
"$:/core/readme": {
"title": "$:/core/readme",
"text": "This plugin contains TiddlyWiki's core components, comprising:\n\n* JavaScript code modules\n* Icons\n* Templates needed to create TiddlyWiki's user interface\n* British English (''en-GB'') translations of the localisable strings used by the core\n"
},
"$:/core/templates/MOTW.html": {
"title": "$:/core/templates/MOTW.html",
"text": "\\rules only filteredtranscludeinline transcludeinline entity\n<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->\n<!-- saved from url=(0021)http://tiddlywiki.com --> "
},
"$:/core/templates/alltiddlers.template.html": {
"title": "$:/core/templates/alltiddlers.template.html",
"type": "text/vnd.tiddlywiki-html",
"text": "<!-- This template is provided for backwards compatibility with older versions of TiddlyWiki -->\n\n<$set name=\"exportFilter\" value=\"[!is[system]sort[title]]\">\n\n{{$:/core/templates/exporters/StaticRiver}}\n\n</$set>\n"
},
"$:/core/templates/canonical-uri-external-image": {
"title": "$:/core/templates/canonical-uri-external-image",
"text": "<!--\n\nThis template is used to assign the ''_canonical_uri'' field to external images.\n\nChange the `./images/` part to a different base URI. The URI can be relative or absolute.\n\n-->\n./images/<$view field=\"title\" format=\"doubleurlencoded\"/>"
},
"$:/core/templates/css-tiddler": {
"title": "$:/core/templates/css-tiddler",
"text": "<!--\n\nThis template is used for saving CSS tiddlers as a style tag with data attributes representing the tiddler fields.\n\n-->`<style`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/css\">`<$view field=\"text\" format=\"text\" />`</style>`"
},
"$:/core/templates/exporters/CsvFile": {
"title": "$:/core/templates/exporters/CsvFile",
"tags": "$:/tags/Exporter",
"description": "{{$:/language/Exporters/CsvFile}}",
"extension": ".csv",
"text": "\\define renderContent()\n<$text text=<<csvtiddlers filter:\"\"\"$(exportFilter)$\"\"\" format:\"quoted-comma-sep\">>/>\n\\end\n<<renderContent>>\n"
},
"$:/core/templates/exporters/JsonFile": {
"title": "$:/core/templates/exporters/JsonFile",
"tags": "$:/tags/Exporter",
"description": "{{$:/language/Exporters/JsonFile}}",
"extension": ".json",
"text": "\\define renderContent()\n<$text text=<<jsontiddlers filter:\"\"\"$(exportFilter)$\"\"\">>/>\n\\end\n<<renderContent>>\n"
},
"$:/core/templates/exporters/StaticRiver": {
"title": "$:/core/templates/exporters/StaticRiver",
"tags": "$:/tags/Exporter",
"description": "{{$:/language/Exporters/StaticRiver}}",
"extension": ".html",
"text": "\\define tv-wikilink-template() #$uri_encoded$\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<style type=\"text/css\">\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n</style>\n</head>\n<body class=\"tc-body\">\n{{$:/StaticBanner||$:/core/templates/html-tiddler}}\n<section class=\"tc-story-river\">\n{{$:/core/templates/exporters/StaticRiver/Content||$:/core/templates/html-tiddler}}\n</section>\n</body>\n</html>\n"
},
"$:/core/templates/exporters/StaticRiver/Content": {
"title": "$:/core/templates/exporters/StaticRiver/Content",
"text": "\\define renderContent()\n{{{ $(exportFilter)$ ||$:/core/templates/static-tiddler}}}\n\\end\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n<<renderContent>>\n</$importvariables>\n"
},
"$:/core/templates/exporters/TidFile": {
"title": "$:/core/templates/exporters/TidFile",
"tags": "$:/tags/Exporter",
"description": "{{$:/language/Exporters/TidFile}}",
"extension": ".tid",
"text": "\\define renderContent()\n{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}\n\\end\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\"><<renderContent>></$importvariables>"
},
"$:/core/templates/html-div-tiddler": {
"title": "$:/core/templates/html-div-tiddler",
"text": "<!--\n\nThis template is used for saving tiddlers as an HTML DIV tag with attributes representing the tiddler fields.\n\n-->`<div`<$fields template=' $name$=\"$encoded_value$\"'></$fields>`>\n<pre>`<$view field=\"text\" format=\"htmlencoded\" />`</pre>\n</div>`\n"
},
"$:/core/templates/html-tiddler": {
"title": "$:/core/templates/html-tiddler",
"text": "<!--\n\nThis template is used for saving tiddlers as raw HTML\n\n--><$view field=\"text\" format=\"htmlwikified\" />"
},
"$:/core/templates/javascript-tiddler": {
"title": "$:/core/templates/javascript-tiddler",
"text": "<!--\n\nThis template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields.\n\n-->`<script`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/javascript\">`<$view field=\"text\" format=\"text\" />`</script>`"
},
"$:/core/templates/module-tiddler": {
"title": "$:/core/templates/module-tiddler",
"text": "<!--\n\nThis template is used for saving JavaScript tiddlers as a script tag with data attributes representing the tiddler fields. The body of the tiddler is wrapped in a call to the `$tw.modules.define` function in order to define the body of the tiddler as a module\n\n-->`<script`<$fields template=' data-tiddler-$name$=\"$encoded_value$\"'></$fields>` type=\"text/javascript\" data-module=\"yes\">$tw.modules.define(\"`<$view field=\"title\" format=\"jsencoded\" />`\",\"`<$view field=\"module-type\" format=\"jsencoded\" />`\",function(module,exports,require) {`<$view field=\"text\" format=\"text\" />`});\n</script>`"
},
"$:/core/templates/plain-text-tiddler": {
"title": "$:/core/templates/plain-text-tiddler",
"text": "<$view field=\"text\" format=\"text\" />"
},
"$:/core/save/all": {
"title": "$:/core/save/all",
"text": "\\define saveTiddlerFilter()\n[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]\n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
},
"$:/core/save/empty": {
"title": "$:/core/save/empty",
"text": "\\define saveTiddlerFilter()\n[is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]\n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
},
"$:/core/save/lazy-images": {
"title": "$:/core/save/lazy-images",
"text": "\\define saveTiddlerFilter()\n[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]] \n\\end\n{{$:/core/templates/tiddlywiki5.html}}\n"
},
"$:/core/templates/split-recipe": {
"title": "$:/core/templates/split-recipe",
"text": "<$list filter=\"[!is[system]]\">\ntiddler: <$view field=\"title\" format=\"urlencoded\"/>.tid\n</$list>\n"
},
"$:/core/templates/static-tiddler": {
"title": "$:/core/templates/static-tiddler",
"text": "<a name=<<currentTiddler>>>\n<$transclude tiddler=\"$:/core/ui/ViewTemplate\"/>\n</a>"
},
"$:/core/templates/static.area": {
"title": "$:/core/templates/static.area",
"text": "<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n{{$:/core/templates/static.content||$:/core/templates/html-tiddler}}\n</$reveal>\n<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\nThis file contains an encrypted ~TiddlyWiki. Enable ~JavaScript and enter the decryption password when prompted.\n</$reveal>\n"
},
"$:/core/templates/static.content": {
"title": "$:/core/templates/static.content",
"type": "text/vnd.tiddlywiki",
"text": "<!-- For Google, and people without JavaScript-->\nThis [[TiddlyWiki|http://tiddlywiki.com]] contains the following tiddlers:\n\n<ul>\n<$list filter=<<saveTiddlerFilter>>>\n<li><$view field=\"title\" format=\"text\"></$view></li>\n</$list>\n</ul>\n"
},
"$:/core/templates/static.template.css": {
"title": "$:/core/templates/static.template.css",
"text": "{{$:/boot/boot.css||$:/core/templates/plain-text-tiddler}}\n\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n"
},
"$:/core/templates/static.template.html": {
"title": "$:/core/templates/static.template.html",
"type": "text/vnd.tiddlywiki-html",
"text": "\\define tv-wikilink-template() static/$uri_doubleencoded$.html\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<style type=\"text/css\">\n{{$:/core/ui/PageStylesheet||$:/core/templates/wikified-tiddler}}\n</style>\n</head>\n<body class=\"tc-body\">\n{{$:/StaticBanner||$:/core/templates/html-tiddler}}\n{{$:/core/ui/PageTemplate||$:/core/templates/html-tiddler}}\n</body>\n</html>\n"
},
"$:/core/templates/static.tiddler.html": {
"title": "$:/core/templates/static.tiddler.html",
"text": "\\define tv-wikilink-template() $uri_doubleencoded$.html\n\\define tv-config-toolbar-icons() no\n\\define tv-config-toolbar-text() no\n\\define tv-config-toolbar-class() tc-btn-invisible\n`<!doctype html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"`{{$:/core/templates/version}}`\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"format-detection\" content=\"telephone=no\">\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<link rel=\"stylesheet\" href=\"static.css\">\n<title>`{{$:/core/wiki/title}}`</title>\n</head>\n<body class=\"tc-body\">\n`{{$:/StaticBanner||$:/core/templates/html-tiddler}}`\n<section class=\"tc-story-river\">\n`<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n<$view tiddler=\"$:/core/ui/ViewTemplate\" format=\"htmlwikified\"/>\n</$importvariables>`\n</section>\n</body>\n</html>\n`"
},
"$:/core/templates/store.area.template.html": {
"title": "$:/core/templates/store.area.template.html",
"text": "<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n`<div id=\"storeArea\" style=\"display:none;\">`\n<$list filter=<<saveTiddlerFilter>> template=\"$:/core/templates/html-div-tiddler\"/>\n`</div>`\n</$reveal>\n<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\n`<!--~~ Encrypted tiddlers ~~-->`\n`<pre id=\"encryptedStoreArea\" type=\"text/plain\" style=\"display:none;\">`\n<$encrypt filter=<<saveTiddlerFilter>>/>\n`</pre>`\n</$reveal>"
},
"$:/core/templates/tid-tiddler": {
"title": "$:/core/templates/tid-tiddler",
"text": "<!--\n\nThis template is used for saving tiddlers in TiddlyWeb *.tid format\n\n--><$fields exclude='text bag' template='$name$: $value$\n'></$fields>`\n`<$view field=\"text\" format=\"text\" />"
},
"$:/core/templates/tiddler-metadata": {
"title": "$:/core/templates/tiddler-metadata",
"text": "<!--\n\nThis template is used for saving tiddler metadata *.meta files\n\n--><$fields exclude='text bag' template='$name$: $value$\n'></$fields>"
},
"$:/core/templates/tiddlywiki5.html": {
"title": "$:/core/templates/tiddlywiki5.html",
"text": "\\rules only filteredtranscludeinline transcludeinline\n<!doctype html>\n{{$:/core/templates/MOTW.html}}<html>\n<head>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\t\t<!-- Force IE standards mode for Intranet and HTA - should be the first meta -->\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n<meta name=\"application-name\" content=\"TiddlyWiki\" />\n<meta name=\"generator\" content=\"TiddlyWiki\" />\n<meta name=\"tiddlywiki-version\" content=\"{{$:/core/templates/version}}\" />\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n<meta name=\"format-detection\" content=\"telephone=no\" />\n<meta name=\"copyright\" content=\"{{$:/core/copyright.txt}}\" />\n<link id=\"faviconLink\" rel=\"shortcut icon\" href=\"favicon.ico\">\n<title>{{$:/core/wiki/title}}</title>\n<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->\n\n<!--~~ Raw markup ~~-->\n{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}\n</head>\n<body class=\"tc-body\">\n<!--~~ Static styles ~~-->\n<div id=\"styleArea\">\n{{$:/boot/boot.css||$:/core/templates/css-tiddler}}\n</div>\n<!--~~ Static content for Google and browsers without JavaScript ~~-->\n<noscript>\n<div id=\"splashArea\">\n{{$:/core/templates/static.area}}\n</div>\n</noscript>\n<!--~~ Ordinary tiddlers ~~-->\n{{$:/core/templates/store.area.template.html}}\n<!--~~ Library modules ~~-->\n<div id=\"libraryModules\" style=\"display:none;\">\n{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/javascript-tiddler}}}\n</div>\n<!--~~ Boot kernel prologue ~~-->\n<div id=\"bootKernelPrefix\" style=\"display:none;\">\n{{ $:/boot/bootprefix.js ||$:/core/templates/javascript-tiddler}}\n</div>\n<!--~~ Boot kernel ~~-->\n<div id=\"bootKernel\" style=\"display:none;\">\n{{ $:/boot/boot.js ||$:/core/templates/javascript-tiddler}}\n</div>\n</body>\n</html>\n"
},
"$:/core/templates/version": {
"title": "$:/core/templates/version",
"text": "<<version>>"
},
"$:/core/templates/wikified-tiddler": {
"title": "$:/core/templates/wikified-tiddler",
"text": "<$transclude />"
},
"$:/core/ui/AdvancedSearch/Filter": {
"title": "$:/core/ui/AdvancedSearch/Filter",
"tags": "$:/tags/AdvancedSearch",
"caption": "{{$:/language/Search/Filter/Caption}}",
"text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo Filter/Hint>>\n\n<div class=\"tc-search tc-advanced-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$button popup=<<qualify \"$:/state/filterDropdown\">> class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n<$macrocall $name=\"exportButton\" exportFilter={{$:/temp/advancedsearch}} lingoBase=\"$:/language/Buttons/ExportTiddlers/\"/>\n</$reveal>\n</div>\n\n<div class=\"tc-block-dropdown-wrapper\">\n<$reveal state=<<qualify \"$:/state/filterDropdown\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Filter]]\"><$link to={{!!filter}}><$transclude field=\"description\"/></$link>\n</$list>\n</div>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$set name=\"resultCount\" value=\"\"\"<$count filter={{$:/temp/advancedsearch}}/>\"\"\">\n<div class=\"tc-search-results\">\n<<lingo Filter/Matches>>\n<$list filter={{$:/temp/advancedsearch}} template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$set>\n</$reveal>\n"
},
"$:/core/ui/AdvancedSearch/Shadows": {
"title": "$:/core/ui/AdvancedSearch/Shadows",
"tags": "$:/tags/AdvancedSearch",
"caption": "{{$:/language/Search/Shadows/Caption}}",
"text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo Shadows/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]]\"/>\"\"\">\n\n<div class=\"tc-search-results\">\n\n<<lingo Shadows/Matches>>\n\n<$list filter=\"[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n</div>\n\n</$set>\n\n</$reveal>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"match\" text=\"\">\n\n</$reveal>\n"
},
"$:/core/ui/AdvancedSearch/Standard": {
"title": "$:/core/ui/AdvancedSearch/Standard",
"tags": "$:/tags/AdvancedSearch",
"caption": "{{$:/language/Search/Standard/Caption}}",
"text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo Standard/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$set name=\"searchTiddler\" value=\"$:/temp/advancedsearch\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]\" emptyMessage=\"\"\"\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\">\n<$transclude/>\n</$list>\n\"\"\">\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\" default={{$:/config/SearchResults/Default}}/>\n</$list>\n</$set>\n</$reveal>\n"
},
"$:/core/ui/AdvancedSearch/System": {
"title": "$:/core/ui/AdvancedSearch/System",
"tags": "$:/tags/AdvancedSearch",
"caption": "{{$:/language/Search/System/Caption}}",
"text": "\\define lingo-base() $:/language/Search/\n<$linkcatcher to=\"$:/temp/advancedsearch\">\n\n<<lingo System/Hint>>\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/advancedsearch\" type=\"search\" tag=\"input\"/>\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $field=\"text\" $value=\"\"/>\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n</div>\n\n</$linkcatcher>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"nomatch\" text=\"\">\n\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]]\"/>\"\"\">\n\n<div class=\"tc-search-results\">\n\n<<lingo System/Matches>>\n\n<$list filter=\"[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n</div>\n\n</$set>\n\n</$reveal>\n\n<$reveal state=\"$:/temp/advancedsearch\" type=\"match\" text=\"\">\n\n</$reveal>\n"
},
"$:/AdvancedSearch": {
"title": "$:/AdvancedSearch",
"icon": "$:/core/images/advanced-search-button",
"text": "<div class=\"tc-advanced-search\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]\" \"$:/core/ui/AdvancedSearch/System\">>\n</div>\n"
},
"$:/core/ui/AlertTemplate": {
"title": "$:/core/ui/AlertTemplate",
"text": "<div class=\"tc-alert\">\n<div class=\"tc-alert-toolbar\">\n<$button message=\"tm-delete-tiddler\" class=\"tc-btn-invisible\">\n{{$:/core/images/delete-button}}</$button>\n</div>\n<div class=\"tc-alert-subtitle\">\n<$view field=\"component\"/> - <$view field=\"modified\" format=\"date\" template=\"0hh:0mm:0ss DD MM YYYY\"/> <$reveal type=\"nomatch\" state=\"!!count\" text=\"\"><span class=\"tc-alert-highlight\">(count: <$view field=\"count\"/>)</span></$reveal>\n</div>\n<div class=\"tc-alert-body\">\n\n<$transclude/>\n\n</div>\n</div>\n"
},
"$:/core/ui/BinaryWarning": {
"title": "$:/core/ui/BinaryWarning",
"text": "\\define lingo-base() $:/language/BinaryWarning/\n<div class=\"tc-binary-warning\">\n\n<<lingo Prompt>>\n\n</div>\n"
},
"$:/core/ui/Components/tag-link": {
"title": "$:/core/ui/Components/tag-link",
"text": "<$link>\n<$set name=\"backgroundColor\" value={{!!color}}>\n<span style=<<tag-styles>> class=\"tc-tag-label\">\n<$view field=\"title\" format=\"text\"/>\n</span>\n</$set>\n</$link>"
},
"$:/core/ui/ControlPanel/Advanced": {
"title": "$:/core/ui/ControlPanel/Advanced",
"tags": "$:/tags/ControlPanel/Info",
"caption": "{{$:/language/ControlPanel/Advanced/Caption}}",
"text": "{{$:/language/ControlPanel/Advanced/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Advanced]!has[draft.of]]\" \"$:/core/ui/ControlPanel/TiddlerFields\">>\n</div>\n"
},
"$:/core/ui/ControlPanel/Appearance": {
"title": "$:/core/ui/ControlPanel/Appearance",
"tags": "$:/tags/ControlPanel",
"caption": "{{$:/language/ControlPanel/Appearance/Caption}}",
"text": "{{$:/language/ControlPanel/Appearance/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Appearance]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Theme\">>\n</div>\n"
},
"$:/core/ui/ControlPanel/Basics": {
"title": "$:/core/ui/ControlPanel/Basics",
"tags": "$:/tags/ControlPanel/Info",
"caption": "{{$:/language/ControlPanel/Basics/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Basics/\n\n\\define show-filter-count(filter)\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" $value=\"\"\"$filter$\"\"\"/>\n<$action-setfield $tiddler=\"$:/state/tab--1498284803\" $value=\"$:/core/ui/AdvancedSearch/Filter\"/>\n<$action-navigate $to=\"$:/AdvancedSearch\"/>\n''<$count filter=\"\"\"$filter$\"\"\"/>''\n{{$:/core/images/advanced-search-button}}\n</$button>\n\\end\n\n|<<lingo Version/Prompt>> |''<<version>>'' |\n|<$link to=\"$:/SiteTitle\"><<lingo Title/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteTitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/SiteSubtitle\"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler=\"$:/SiteSubtitle\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/status/UserName\"><<lingo Username/Prompt>></$link> |<$edit-text tiddler=\"$:/status/UserName\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/config/AnimationDuration\"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler=\"$:/config/AnimationDuration\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/DefaultTiddlers\"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit-text tag=\"textarea\" tiddler=\"$:/DefaultTiddlers\"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |\n|<$link to=\"$:/config/NewJournal/Title\"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler=\"$:/config/NewJournal/Title\" default=\"\" tag=\"input\"/> |\n|<$link to=\"$:/config/NewJournal/Tags\"><<lingo NewJournal/Tags/Prompt>></$link> |<$edit-text tiddler=\"$:/config/NewJournal/Tags\" default=\"\" tag=\"input\"/> |\n|<<lingo Language/Prompt>> |{{$:/snippets/minilanguageswitcher}} |\n|<<lingo Tiddlers/Prompt>> |<<show-filter-count \"[!is[system]sort[title]]\">> |\n|<<lingo Tags/Prompt>> |<<show-filter-count \"[tags[]sort[title]]\">> |\n|<<lingo SystemTiddlers/Prompt>> |<<show-filter-count \"[is[system]sort[title]]\">> |\n|<<lingo ShadowTiddlers/Prompt>> |<<show-filter-count \"[all[shadows]sort[title]]\">> |\n|<<lingo OverriddenShadowTiddlers/Prompt>> |<<show-filter-count \"[is[tiddler]is[shadow]sort[title]]\">> |\n"
},
"$:/core/ui/ControlPanel/EditorTypes": {
"title": "$:/core/ui/ControlPanel/EditorTypes",
"tags": "$:/tags/ControlPanel/Advanced",
"caption": "{{$:/language/ControlPanel/EditorTypes/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/EditorTypes/\n\n<<lingo Hint>>\n\n<table>\n<tbody>\n<tr>\n<th><<lingo Type/Caption>></th>\n<th><<lingo Editor/Caption>></th>\n</tr>\n<$list filter=\"[all[shadows+tiddlers]prefix[$:/config/EditorTypeMappings/]sort[title]]\">\n<tr>\n<td>\n<$link>\n<$list filter=\"[all[current]removeprefix[$:/config/EditorTypeMappings/]]\">\n<$text text={{!!title}}/>\n</$list>\n</$link>\n</td>\n<td>\n<$view field=\"text\"/>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n"
},
"$:/core/ui/ControlPanel/Info": {
"title": "$:/core/ui/ControlPanel/Info",
"tags": "$:/tags/ControlPanel",
"caption": "{{$:/language/ControlPanel/Info/Caption}}",
"text": "{{$:/language/ControlPanel/Info/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Info]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Basics\">>\n</div>\n"
},
"$:/core/ui/ControlPanel/LoadedModules": {
"title": "$:/core/ui/ControlPanel/LoadedModules",
"tags": "$:/tags/ControlPanel/Advanced",
"caption": "{{$:/language/ControlPanel/LoadedModules/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/\n<<lingo LoadedModules/Hint>>\n\n{{$:/snippets/modules}}\n"
},
"$:/core/ui/ControlPanel/Palette": {
"title": "$:/core/ui/ControlPanel/Palette",
"tags": "$:/tags/ControlPanel/Appearance",
"caption": "{{$:/language/ControlPanel/Palette/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Palette/\n\n{{$:/snippets/paletteswitcher}}\n\n<$reveal type=\"nomatch\" state=\"$:/state/ShowPaletteEditor\" text=\"yes\">\n\n<$button set=\"$:/state/ShowPaletteEditor\" setTo=\"yes\"><<lingo ShowEditor/Caption>></$button>\n\n</$reveal>\n\n<$reveal type=\"match\" state=\"$:/state/ShowPaletteEditor\" text=\"yes\">\n\n<$button set=\"$:/state/ShowPaletteEditor\" setTo=\"no\"><<lingo HideEditor/Caption>></$button>\n{{$:/snippets/paletteeditor}}\n\n</$reveal>\n\n"
},
"$:/core/ui/ControlPanel/Plugins": {
"title": "$:/core/ui/ControlPanel/Plugins",
"tags": "$:/tags/ControlPanel",
"caption": "{{$:/language/ControlPanel/Plugins/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Plugins/\n\\define popup-state-macro()\n$(qualified-state)$-$(currentTiddler)$\n\\end\n\\define tabs-state-macro()\n$(popup-state)$-$(pluginInfoType)$\n\\end\n\\define plugin-icon-title()\n$(currentTiddler)$/icon\n\\end\n\\define plugin-disable-title()\n$:/config/Plugins/Disabled/$(currentTiddler)$\n\\end\n\\define plugin-table-body(type,disabledMessage)\n<div class=\"tc-plugin-info-chunk\">\n<$reveal type=\"nomatch\" state=<<popup-state>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"yes\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<popup-state>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<popup-state>> setTo=\"no\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<plugin-icon-title>>>\n<$transclude tiddler=\"$:/core/images/plugin-generic-$type$\"/>\n</$transclude>\n</div>\n<div class=\"tc-plugin-info-chunk\">\n<div>\n''<$view field=\"description\"><$view field=\"title\"/></$view>'' $disabledMessage$\n</div>\n<div>\n<$view field=\"title\"/>\n</div>\n<div>\n<$view field=\"version\"/>\n</div>\n</div>\n\\end\n\\define plugin-table(type)\n<$set name=\"qualified-state\" value=<<qualify \"$:/state/plugin-info\">>>\n<$list filter=\"[!has[draft.of]plugin-type[$type$]sort[description]]\" emptyMessage=<<lingo \"Empty/Hint\">>>\n<$set name=\"popup-state\" value=<<popup-state-macro>>>\n<$reveal type=\"nomatch\" state=<<plugin-disable-title>> text=\"yes\">\n<$link to={{!!title}} class=\"tc-plugin-info\">\n<<plugin-table-body type:\"$type$\">>\n</$link>\n</$reveal>\n<$reveal type=\"match\" state=<<plugin-disable-title>> text=\"yes\">\n<$link to={{!!title}} class=\"tc-plugin-info tc-plugin-info-disabled\">\n<<plugin-table-body type:\"$type$\" disabledMessage:\"<$macrocall $name='lingo' title='Disabled/Status'/>\">>\n</$link>\n</$reveal>\n<$reveal type=\"match\" text=\"yes\" state=<<popup-state>>>\n<div class=\"tc-plugin-info-dropdown\">\n<$list filter=\"[all[current]] -[[$:/core]]\">\n<div style=\"float:right;\">\n<$reveal type=\"nomatch\" state=<<plugin-disable-title>> text=\"yes\">\n<$button set=<<plugin-disable-title>> setTo=\"yes\" tooltip={{$:/language/ControlPanel/Plugins/Disable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Disable/Caption}}>\n<<lingo Disable/Caption>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<plugin-disable-title>> text=\"yes\">\n<$button set=<<plugin-disable-title>> setTo=\"no\" tooltip={{$:/language/ControlPanel/Plugins/Enable/Hint}} aria-label={{$:/language/ControlPanel/Plugins/Enable/Caption}}>\n<<lingo Enable/Caption>>\n</$button>\n</$reveal>\n</div>\n</$list>\n<$reveal type=\"nomatch\" text=\"\" state=\"!!list\">\n<$macrocall $name=\"tabs\" state=<<tabs-state-macro>> tabsList={{!!list}} default=\"readme\" template=\"$:/core/ui/PluginInfo\"/>\n</$reveal>\n<$reveal type=\"match\" text=\"\" state=\"!!list\">\nNo information provided\n</$reveal>\n</div>\n</$reveal>\n</$set>\n</$list>\n</$set>\n\\end\n\n! <<lingo Plugin/Prompt>>\n\n<<plugin-table plugin>>\n\n! <<lingo Theme/Prompt>>\n\n<<plugin-table theme>>\n\n! <<lingo Language/Prompt>>\n\n<<plugin-table language>>\n"
},
"$:/core/ui/ControlPanel/Saving": {
"title": "$:/core/ui/ControlPanel/Saving",
"tags": "$:/tags/ControlPanel",
"caption": "{{$:/language/ControlPanel/Saving/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Saving/\n\\define backupURL()\nhttp://$(userName)$.tiddlyspot.com/backup/\n\\end\n\\define backupLink()\n<$reveal type=\"nomatch\" state=\"$:/UploadName\" text=\"\">\n<$set name=\"userName\" value={{$:/UploadName}}>\n<a href=<<backupURL>>><$macrocall $name=\"backupURL\" $type=\"text/plain\" $output=\"text/plain\"/></a>\n</$set>\n</$reveal>\n\\end\n! <<lingo TiddlySpot/Heading>>\n\n<<lingo TiddlySpot/Description>>\n\n|<<lingo TiddlySpot/UserName>> |<$edit-text tiddler=\"$:/UploadName\" default=\"\" tag=\"input\"/> |\n|<<lingo TiddlySpot/Password>> |<$password name=\"upload\"/> |\n|<<lingo TiddlySpot/Backups>> |<<backupLink>> |\n\n''<<lingo TiddlySpot/Advanced/Heading>>''\n\n|<<lingo TiddlySpot/ServerURL>> |<$edit-text tiddler=\"$:/UploadURL\" default=\"\" tag=\"input\"/> |\n|<<lingo TiddlySpot/Filename>> |<$edit-text tiddler=\"$:/UploadFilename\" default=\"index.html\" tag=\"input\"/> |\n|<<lingo TiddlySpot/UploadDir>> |<$edit-text tiddler=\"$:/UploadDir\" default=\".\" tag=\"input\"/> |\n|<<lingo TiddlySpot/BackupDir>> |<$edit-text tiddler=\"$:/UploadBackupDir\" default=\".\" tag=\"input\"/> |\n\n<<lingo TiddlySpot/Hint>>\n\n"
},
"$:/core/ui/ControlPanel/Settings/AutoSave": {
"title": "$:/core/ui/ControlPanel/Settings/AutoSave",
"tags": "$:/tags/ControlPanel/Settings",
"caption": "{{$:/language/ControlPanel/Settings/AutoSave/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Settings/AutoSave/\n\n<$link to=\"$:/config/AutoSave\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/AutoSave\" value=\"yes\"> <<lingo Enabled/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/AutoSave\" value=\"no\"> <<lingo Disabled/Description>> </$radio>\n"
},
"$:/core/ui/ControlPanel/Settings/NavigationAddressBar": {
"title": "$:/core/ui/ControlPanel/Settings/NavigationAddressBar",
"tags": "$:/tags/ControlPanel/Settings",
"caption": "{{$:/language/ControlPanel/Settings/NavigationAddressBar/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Settings/NavigationAddressBar/\n\n<$link to=\"$:/config/Navigation/UpdateAddressBar\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"permaview\"> <<lingo Permaview/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"permalink\"> <<lingo Permalink/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateAddressBar\" value=\"no\"> <<lingo No/Description>> </$radio>\n"
},
"$:/core/ui/ControlPanel/Settings/NavigationHistory": {
"title": "$:/core/ui/ControlPanel/Settings/NavigationHistory",
"tags": "$:/tags/ControlPanel/Settings",
"caption": "{{$:/language/ControlPanel/Settings/NavigationHistory/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Settings/NavigationHistory/\n<$link to=\"$:/config/Navigation/UpdateHistory\"><<lingo Hint>></$link>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateHistory\" value=\"yes\"> <<lingo Yes/Description>> </$radio>\n\n<$radio tiddler=\"$:/config/Navigation/UpdateHistory\" value=\"no\"> <<lingo No/Description>> </$radio>\n"
},
"$:/core/ui/ControlPanel/Settings/ToolbarButtons": {
"title": "$:/core/ui/ControlPanel/Settings/ToolbarButtons",
"tags": "$:/tags/ControlPanel/Settings",
"caption": "{{$:/language/ControlPanel/Settings/ToolbarButtons/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtons/\n<<lingo Hint>>\n\n<$checkbox tiddler=\"$:/config/Toolbar/Icons\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"yes\"> <$link to=\"$:/config/Toolbar/Icons\"><<lingo Icons/Description>></$link> </$checkbox>\n\n<$checkbox tiddler=\"$:/config/Toolbar/Text\" field=\"text\" checked=\"yes\" unchecked=\"no\" default=\"no\"> <$link to=\"$:/config/Toolbar/Text\"><<lingo Text/Description>></$link> </$checkbox>\n"
},
"$:/core/ui/ControlPanel/Settings": {
"title": "$:/core/ui/ControlPanel/Settings",
"tags": "$:/tags/ControlPanel",
"caption": "{{$:/language/ControlPanel/Settings/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/Settings/\n\n<<lingo Hint>>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]\">\n\n<div style=\"border-top:1px solid #eee;\">\n\n!! <$link><$transclude field=\"caption\"/></$link>\n\n<$transclude/>\n\n</div>\n\n</$list>\n"
},
"$:/core/ui/ControlPanel/StoryView": {
"title": "$:/core/ui/ControlPanel/StoryView",
"tags": "$:/tags/ControlPanel/Appearance",
"caption": "{{$:/language/ControlPanel/StoryView/Caption}}",
"text": "{{$:/snippets/viewswitcher}}\n"
},
"$:/core/ui/ControlPanel/Theme": {
"title": "$:/core/ui/ControlPanel/Theme",
"tags": "$:/tags/ControlPanel/Appearance",
"caption": "{{$:/language/ControlPanel/Theme/Caption}}",
"text": "{{$:/snippets/themeswitcher}}\n"
},
"$:/core/ui/ControlPanel/TiddlerFields": {
"title": "$:/core/ui/ControlPanel/TiddlerFields",
"tags": "$:/tags/ControlPanel/Advanced",
"caption": "{{$:/language/ControlPanel/TiddlerFields/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/\n\n<<lingo TiddlerFields/Hint>>\n\n{{$:/snippets/allfields}}"
},
"$:/core/ui/ControlPanel/Toolbars/EditToolbar": {
"title": "$:/core/ui/ControlPanel/Toolbars/EditToolbar",
"tags": "$:/tags/ControlPanel/Toolbars",
"caption": "{{$:/language/ControlPanel/Toolbars/EditToolbar/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n\\define config-title()\n$:/config/EditToolbarButtons/Visibility/$(listItem)$\n\\end\n\n{{$:/language/ControlPanel/Toolbars/EditToolbar/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]\" variable=\"listItem\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>> field=\"caption\"/> <i class=\"tc-muted\">-- <$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</$list>\n\n</$set>\n\n</$set>\n"
},
"$:/core/ui/ControlPanel/Toolbars/PageControls": {
"title": "$:/core/ui/ControlPanel/Toolbars/PageControls",
"tags": "$:/tags/ControlPanel/Toolbars",
"caption": "{{$:/language/ControlPanel/Toolbars/PageControls/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n\n{{$:/language/ControlPanel/Toolbars/PageControls/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>> field=\"caption\"/> <i class=\"tc-muted\">-- <$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</$list>\n\n</$set>\n\n</$set>\n"
},
"$:/core/ui/ControlPanel/Toolbars/ViewToolbar": {
"title": "$:/core/ui/ControlPanel/Toolbars/ViewToolbar",
"tags": "$:/tags/ControlPanel/Toolbars",
"caption": "{{$:/language/ControlPanel/Toolbars/ViewToolbar/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n\n{{$:/language/ControlPanel/Toolbars/ViewToolbar/Hint}}\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]\" variable=\"listItem\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>> field=\"caption\"/> <i class=\"tc-muted\">-- <$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</$list>\n\n</$set>\n\n</$set>\n"
},
"$:/core/ui/ControlPanel/Toolbars": {
"title": "$:/core/ui/ControlPanel/Toolbars",
"tags": "$:/tags/ControlPanel/Appearance",
"caption": "{{$:/language/ControlPanel/Toolbars/Caption}}",
"text": "{{$:/language/ControlPanel/Toolbars/Hint}}\n\n<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Toolbars]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Toolbars/ViewToolbar\" \"$:/state/tabs/controlpanel/toolbars\" \"tc-vertical\">>\n</div>\n"
},
"$:/ControlPanel": {
"title": "$:/ControlPanel",
"icon": "$:/core/images/options-button",
"text": "<div class=\"tc-control-panel\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/ControlPanel]!has[draft.of]]\" \"$:/core/ui/ControlPanel/Info\">>\n</div>\n"
},
"$:/core/ui/DefaultSearchResultList": {
"title": "$:/core/ui/DefaultSearchResultList",
"tags": "$:/tags/SearchResults",
"caption": "{{$:/language/Search/DefaultResults/Caption}}",
"text": "\\define searchResultList()\n<$set name=\"resultCount\" value=\"\"\"<$count filter=\"[!is[system]search{$(searchTiddler)$}]\"/>\"\"\">\n\n{{$:/language/Search/Matches}}\n\n</$set>\n\n//<small>Title matches:</small>//\n\n<$list filter=\"[!is[system]search:title{$(searchTiddler)$}sort[title]limit[250]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\n//<small>All matches:</small>//\n\n<$list filter=\"[!is[system]search{$(searchTiddler)$}sort[title]limit[250]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n\\end\n<<searchResultList>>\n"
},
"$:/core/ui/EditTemplate/body": {
"title": "$:/core/ui/EditTemplate/body",
"tags": "$:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/EditTemplate/Body/\n<$list filter=\"[is[current]has[_canonical_uri]]\">\n\n<div class=\"tc-message-box\">\n\n<<lingo External/Hint>>\n\n<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>\n\n<$edit-text field=\"_canonical_uri\" class=\"tc-edit-fields\"></$edit-text>\n\n</div>\n\n</$list>\n\n<$list filter=\"[is[current]!has[_canonical_uri]]\">\n\n<$reveal state=\"$:/state/showeditpreview\" type=\"match\" text=\"yes\">\n\n<em class=\"tc-edit\"><<lingo Hint>></em> <$button type=\"set\" set=\"$:/state/showeditpreview\" setTo=\"no\"><<lingo Preview/Button/Hide>></$button>\n\n<div class=\"tc-tiddler-preview\">\n<div class=\"tc-tiddler-preview-preview\">\n\n<$transclude />\n\n</div>\n\n<div class=\"tc-tiddler-preview-edit\">\n<$edit field=\"text\" class=\"tc-edit-texteditor\" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>\n\n</div>\n\n</div>\n\n</$reveal>\n\n<$reveal state=\"$:/state/showeditpreview\" type=\"nomatch\" text=\"yes\">\n\n<em class=\"tc-edit\"><<lingo Hint>></em> <$button type=\"set\" set=\"$:/state/showeditpreview\" setTo=\"yes\"><<lingo Preview/Button/Show>></$button>\n<$edit field=\"text\" class=\"tc-edit-texteditor\" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>\n\n</$reveal>\n\n</$list>\n"
},
"$:/core/ui/EditTemplate/controls": {
"title": "$:/core/ui/EditTemplate/controls",
"tags": "$:/tags/EditTemplate",
"text": "\\define config-title()\n$:/config/EditToolbarButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-tiddler-title tc-tiddler-edit-title\">\n<$view field=\"title\"/>\n<span class=\"tc-tiddler-controls tc-titlebar\"><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]\" variable=\"listItem\"><$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\"><$transclude tiddler=<<listItem>>/></$reveal></$list></span>\n<div style=\"clear: both;\"></div>\n</div>\n"
},
"$:/core/ui/EditTemplate/fields": {
"title": "$:/core/ui/EditTemplate/fields",
"tags": "$:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/EditTemplate/\n\\define config-title()\n$:/config/EditTemplateFields/Visibility/$(currentField)$\n\\end\n\n\\define config-filter()\n[[hide]] -[title{$(config-title)$}]\n\\end\n\n\\define new-field(name,value)\n<$reveal type=\"nomatch\" text=\"\" default=\"\"\"$name$\"\"\">\n<$button>\n<$action-sendmessage $message=\"tm-add-field\" $name$=\"\"\"$value$\"\"\"/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldname\"/>\n<$action-deletetiddler $tiddler=\"$:/temp/newfieldvalue\"/>\n<<lingo Fields/Add/Button>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" text=\"\" default=\"\"\"$name$\"\"\">\n<$button>\n<<lingo Fields/Add/Button>>\n</$button>\n</$reveal>\n\\end\n\n<div class=\"tc-edit-fields\">\n<table class=\"tc-edit-fields\">\n<tbody>\n<$list filter=\"[all[current]fields[]] +[sort[title]]\" variable=\"currentField\">\n<$list filter=<<config-filter>> variable=\"temp\">\n<tr class=\"tc-edit-field\">\n<td class=\"tc-edit-field-name\">\n<$text text=<<currentField>>/>:</td>\n<td class=\"tc-edit-field-value\">\n<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>\n</td>\n<td class=\"tc-edit-field-remove\">\n<$button class=\"tc-btn-invisible\" tooltip={{$:/language/EditTemplate/Field/Remove/Hint}} aria-label={{$:/language/EditTemplate/Field/Remove/Caption}}>\n<$action-deletefield $field=<<currentField>>/>\n{{$:/core/images/delete-button}}\n</$button>\n</td>\n</tr>\n</$list>\n</$list>\n</tbody>\n</table>\n</div>\n\n<$fieldmangler>\n<div class=\"tc-edit-field-add\">\n<em class=\"tc-edit\">\n<<lingo Fields/Add/Prompt>>\n</em>\n<span class=\"tc-edit-field-add-name\">\n<$edit-text tiddler=\"$:/temp/newfieldname\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} class=\"tc-edit-texteditor\"/>\n</span>\n<span class=\"tc-edit-field-add-value\">\n<$edit-text tiddler=\"$:/temp/newfieldvalue\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class=\"tc-edit-texteditor\"/>\n</span>\n<span class=\"tc-edit-field-add-button\">\n<$macrocall $name=\"new-field\" name={{$:/temp/newfieldname}} value={{$:/temp/newfieldvalue}}/>\n</span>\n</div>\n</$fieldmangler>\n\n"
},
"$:/core/ui/EditTemplate/shadow": {
"title": "$:/core/ui/EditTemplate/shadow",
"tags": "$:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/EditTemplate/Shadow/\n<$list filter=\"[all[current]get[draft.of]is[shadow]!is[tiddler]]\">\n<div class=\"tc-message-box\">\n\n<<lingo Warning>>\n\n</div>\n</$list>\n\n<$list filter=\"[all[current]get[draft.of]is[shadow]is[tiddler]]\">\n<div class=\"tc-message-box\">\n\n<<lingo OverriddenWarning>>\n\n</div>\n</$list>\n"
},
"$:/core/ui/EditTemplate/tags": {
"title": "$:/core/ui/EditTemplate/tags",
"tags": "$:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/EditTemplate/\n\\define tag-styles()\nbackground-color:$(backgroundColor)$;\n\\end\n<div class=\"tc-edit-tags\">\n<$fieldmangler>\n<$list filter=\"[all[current]tags[]sort[title]]\" storyview=\"pop\"><$set name=\"backgroundColor\" value={{!!color}}><span style=<<tag-styles>> class=\"tc-tag-label\">\n<$view field=\"title\" format=\"text\" />\n<$button message=\"tm-remove-tag\" param={{!!title}} class=\"tc-btn-invisible tc-remove-tag-button\">×</$button></span>\n</$set>\n</$list>\n\n<div class=\"tc-edit-add-tag\">\n<span class=\"tc-add-tag-name\">\n<$edit-text tiddler=\"$:/temp/NewTagName\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify \"$:/state/popup/tags-auto-complete\">> class=\"tc-edit-texteditor tc-popup-handle\"/>\n</span> <$button popup=<<qualify \"$:/state/popup/tags-auto-complete\">> class=\"tc-btn-invisible tc-btn-dropdown\" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <span class=\"tc-add-tag-button\">\n<$button message=\"tm-add-tag\" param={{$:/temp/NewTagName}} set=\"$:/temp/NewTagName\" setTo=\"\" class=\"\">\n<<lingo Tags/Add/Button>>\n</$button>\n</span>\n</div>\n\n<div class=\"tc-block-dropdown-wrapper\">\n<$reveal state=<<qualify \"$:/state/popup/tags-auto-complete\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown\">\n<$linkcatcher set=\"$:/temp/NewTagName\" setTo=\"\" message=\"tm-add-tag\">\n<$list filter=\"[tags[]search:title{$:/temp/NewTagName}sort[]]\">\n{{||$:/core/ui/Components/tag-link}}\n</$list>\n<hr>\n<$list filter=\"[!is[system]search:title{$:/temp/NewTagName}sort[]]\">\n{{||$:/core/ui/Components/tag-link}}\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>\n</div>\n</$fieldmangler>\n</div>"
},
"$:/core/ui/EditTemplate/title": {
"title": "$:/core/ui/EditTemplate/title",
"tags": "$:/tags/EditTemplate",
"text": "<$edit-text field=\"draft.title\" class=\"tc-titlebar tc-edit-texteditor\" focus=\"true\"/>"
},
"$:/core/ui/EditTemplate/type": {
"title": "$:/core/ui/EditTemplate/type",
"tags": "$:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/EditTemplate/\n<div class=\"tc-type-selector\"><$fieldmangler>\n<em class=\"tc-edit\"><<lingo Type/Prompt>></em> <$edit-text field=\"type\" tag=\"input\" default=\"\" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify \"$:/state/popup/type-dropdown\">> class=\"tc-edit-typeeditor tc-popup-handle\"/> <$button popup=<<qualify \"$:/state/popup/type-dropdown\">> class=\"tc-btn-invisible tc-btn-dropdown\" tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <$button message=\"tm-remove-field\" param=\"type\" class=\"tc-btn-invisible tc-btn-icon\" tooltip={{$:/language/EditTemplate/Type/Delete/Hint}} aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}>{{$:/core/images/delete-button}}</$button>\n</$fieldmangler></div>\n\n<div class=\"tc-block-dropdown-wrapper\">\n<$reveal state=<<qualify \"$:/state/popup/type-dropdown\">> type=\"nomatch\" text=\"\" default=\"\">\n<div class=\"tc-block-dropdown tc-edit-type-dropdown\">\n<$linkcatcher to=\"!!type\">\n<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>\n<div class=\"tc-dropdown-item\">\n<$text text={{!!group}}/>\n</div>\n<$list filter=\"[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]]\"><$link to={{!!name}}><$view field=\"description\"/> (<$view field=\"name\"/>)</$link>\n</$list>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>\n</div>"
},
"$:/core/ui/EditTemplate": {
"title": "$:/core/ui/EditTemplate",
"text": "\\define frame-classes()\ntc-tiddler-frame tc-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$\n\\end\n<div class=<<frame-classes>>>\n<$set name=\"storyTiddler\" value=<<currentTiddler>>>\n<$keyboard key=\"escape\" message=\"tm-cancel-tiddler\">\n<$keyboard key=\"ctrl+enter\" message=\"tm-save-tiddler\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]\" variable=\"listItem\">\n<$transclude tiddler=<<listItem>>/>\n</$list>\n</$keyboard>\n</$keyboard>\n</$set>\n</div>\n"
},
"$:/core/ui/Buttons/cancel": {
"title": "$:/core/ui/Buttons/cancel",
"tags": "$:/tags/EditToolbar",
"caption": "{{$:/core/images/cancel-button}} {{$:/language/Buttons/Cancel/Caption}}",
"description": "{{$:/language/Buttons/Cancel/Hint}}",
"text": "<$button message=\"tm-cancel-tiddler\" tooltip={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/cancel-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Cancel/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/delete": {
"title": "$:/core/ui/Buttons/delete",
"tags": "$:/tags/EditToolbar",
"caption": "{{$:/core/images/delete-button}} {{$:/language/Buttons/Delete/Caption}}",
"description": "{{$:/language/Buttons/Delete/Hint}}",
"text": "<$button message=\"tm-delete-tiddler\" tooltip={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/delete-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Delete/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/save": {
"title": "$:/core/ui/Buttons/save",
"tags": "$:/tags/EditToolbar",
"caption": "{{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}}",
"description": "{{$:/language/Buttons/Save/Hint}}",
"text": "<$button message=\"tm-save-tiddler\" tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/done-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Save/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/Filters/AllTags": {
"title": "$:/core/Filters/AllTags",
"tags": "$:/tags/Filter",
"filter": "[tags[]!is[system]sort[title]]",
"description": "{{$:/language/Filters/AllTags}}",
"text": ""
},
"$:/core/Filters/AllTiddlers": {
"title": "$:/core/Filters/AllTiddlers",
"tags": "$:/tags/Filter",
"filter": "[!is[system]sort[title]]",
"description": "{{$:/language/Filters/AllTiddlers}}",
"text": ""
},
"$:/core/Filters/Drafts": {
"title": "$:/core/Filters/Drafts",
"tags": "$:/tags/Filter",
"filter": "[has[draft.of]sort[title]]",
"description": "{{$:/language/Filters/Drafts}}",
"text": ""
},
"$:/core/Filters/Missing": {
"title": "$:/core/Filters/Missing",
"tags": "$:/tags/Filter",
"filter": "[all[missing]sort[title]]",
"description": "{{$:/language/Filters/Missing}}",
"text": ""
},
"$:/core/Filters/Orphans": {
"title": "$:/core/Filters/Orphans",
"tags": "$:/tags/Filter",
"filter": "[all[orphans]sort[title]]",
"description": "{{$:/language/Filters/Orphans}}",
"text": ""
},
"$:/core/Filters/OverriddenShadowTiddlers": {
"title": "$:/core/Filters/OverriddenShadowTiddlers",
"tags": "$:/tags/Filter",
"filter": "[is[shadow]]",
"description": "{{$:/language/Filters/OverriddenShadowTiddlers}}",
"text": ""
},
"$:/core/Filters/RecentSystemTiddlers": {
"title": "$:/core/Filters/RecentSystemTiddlers",
"tags": "$:/tags/Filter",
"filter": "[has[modified]!sort[modified]limit[50]]",
"description": "{{$:/language/Filters/RecentSystemTiddlers}}",
"text": ""
},
"$:/core/Filters/RecentTiddlers": {
"title": "$:/core/Filters/RecentTiddlers",
"tags": "$:/tags/Filter",
"filter": "[!is[system]has[modified]!sort[modified]limit[50]]",
"description": "{{$:/language/Filters/RecentTiddlers}}",
"text": ""
},
"$:/core/Filters/ShadowTiddlers": {
"title": "$:/core/Filters/ShadowTiddlers",
"tags": "$:/tags/Filter",
"filter": "[all[shadows]sort[title]]",
"description": "{{$:/language/Filters/ShadowTiddlers}}",
"text": ""
},
"$:/core/Filters/SystemTags": {
"title": "$:/core/Filters/SystemTags",
"tags": "$:/tags/Filter",
"filter": "[all[shadows+tiddlers]tags[]is[system]sort[title]]",
"description": "{{$:/language/Filters/SystemTags}}",
"text": ""
},
"$:/core/Filters/SystemTiddlers": {
"title": "$:/core/Filters/SystemTiddlers",
"tags": "$:/tags/Filter",
"filter": "[is[system]sort[title]]",
"description": "{{$:/language/Filters/SystemTiddlers}}",
"text": ""
},
"$:/core/ui/ImportListing": {
"title": "$:/core/ui/ImportListing",
"text": "\\define lingo-base() $:/language/Import/\n\\define messageField()\nmessage-$(payloadTiddler)$\n\\end\n\\define selectionField()\nselection-$(payloadTiddler)$\n\\end\n\\define previewPopupState()\n$(currentTiddler)$!!popup-$(payloadTiddler)$\n\\end\n<table>\n<tbody>\n<tr>\n<th>\n<<lingo Listing/Select/Caption>>\n</th>\n<th>\n<<lingo Listing/Title/Caption>>\n</th>\n<th>\n<<lingo Listing/Status/Caption>>\n</th>\n</tr>\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" variable=\"payloadTiddler\">\n<tr>\n<td>\n<$checkbox field=<<selectionField>> checked=\"checked\" unchecked=\"unchecked\" default=\"checked\"/>\n</td>\n<td>\n<$reveal type=\"nomatch\" state=<<previewPopupState>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<previewPopupState>> setTo=\"yes\">\n{{$:/core/images/right-arrow}} <$text text=<<payloadTiddler>>/>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<previewPopupState>> text=\"yes\">\n<$button class=\"tc-btn-invisible tc-btn-dropdown\" set=<<previewPopupState>> setTo=\"no\">\n{{$:/core/images/down-arrow}} <$text text=<<payloadTiddler>>/>\n</$button>\n</$reveal>\n</td>\n<td>\n<$view field=<<messageField>>/>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">\n<$reveal type=\"match\" text=\"yes\" state=<<previewPopupState>>>\n<$transclude subtiddler=<<payloadTiddler>> mode=\"block\"/>\n</$reveal>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n"
},
"$:/core/ui/ListItemTemplate": {
"title": "$:/core/ui/ListItemTemplate",
"text": "<div class=\"tc-menu-list-item\">\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</div>"
},
"$:/core/ui/MissingTemplate": {
"title": "$:/core/ui/MissingTemplate",
"text": "<div class=\"tc-tiddler-missing\">\n<$button popup=<<qualify \"$:/state/popup/missing\">> class=\"tc-btn-invisible tc-missing-tiddler-label\">\n<$view field=\"title\" format=\"text\" />\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/missing\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n<hr>\n<$list filter=\"[all[current]backlinks[]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$reveal>\n</div>\n"
},
"$:/core/ui/MoreSideBar/All": {
"title": "$:/core/ui/MoreSideBar/All",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/All/Caption}}",
"text": "<$list filter=\"[!is[system]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/Drafts": {
"title": "$:/core/ui/MoreSideBar/Drafts",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Drafts/Caption}}",
"text": "<$list filter=\"[has[draft.of]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/Missing": {
"title": "$:/core/ui/MoreSideBar/Missing",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Missing/Caption}}",
"text": "<$list filter=\"[all[missing]sort[title]]\" template=\"$:/core/ui/MissingTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/Orphans": {
"title": "$:/core/ui/MoreSideBar/Orphans",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Orphans/Caption}}",
"text": "<$list filter=\"[all[orphans]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/Recent": {
"title": "$:/core/ui/MoreSideBar/Recent",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Recent/Caption}}",
"text": "<$macrocall $name=\"timeline\" format={{$:/language/RecentChanges/DateFormat}}/>\n"
},
"$:/core/ui/MoreSideBar/Shadows": {
"title": "$:/core/ui/MoreSideBar/Shadows",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Shadows/Caption}}",
"text": "<$list filter=\"[all[shadows]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/System": {
"title": "$:/core/ui/MoreSideBar/System",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/System/Caption}}",
"text": "<$list filter=\"[is[system]sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/MoreSideBar/Tags": {
"title": "$:/core/ui/MoreSideBar/Tags",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Tags/Caption}}",
"text": "<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n{{$:/core/ui/Buttons/tag-manager}}\n\n</$set>\n\n</$set>\n\n</$set>\n\n<$list filter=\"[tags[]!is[system]sort[title]]\">\n\n<$transclude tiddler=\"$:/core/ui/TagTemplate\"/> <small class=\"tc-menu-list-count\"><$count filter=\"[all[current]tagging[]]\"/></small>\n\n</$list>\n\n<hr class=\"tc-untagged-separator\">\n\n{{$:/core/ui/UntaggedTemplate}} <small class=\"tc-menu-list-count\"><$count filter=\"[untagged[]!is[system]] -[tags[]]\"/></small>\n"
},
"$:/core/ui/MoreSideBar/Types": {
"title": "$:/core/ui/MoreSideBar/Types",
"tags": "$:/tags/MoreSideBar",
"caption": "{{$:/language/SideBar/Types/Caption}}",
"text": "<$list filter=\"[!is[system]has[type]each[type]sort[type]] -[type[text/vnd.tiddlywiki]]\">\n<div class=\"tc-menu-list-item\">\n<$view field=\"type\"/>\n<$list filter=\"[type{!!type}!is[system]sort[title]]\">\n<div class=\"tc-menu-list-subitem\">\n<$link to={{!!title}}><$view field=\"title\"/></$link>\n</div>\n</$list>\n</div>\n</$list>\n"
},
"$:/core/ui/Buttons/advanced-search": {
"title": "$:/core/ui/Buttons/advanced-search",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/advanced-search-button}} {{$:/language/Buttons/AdvancedSearch/Caption}}",
"description": "{{$:/language/Buttons/AdvancedSearch/Hint}}",
"text": "<$button to=\"$:/AdvancedSearch\" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/advanced-search-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/AdvancedSearch/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/close-all": {
"title": "$:/core/ui/Buttons/close-all",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/close-all-button}} {{$:/language/Buttons/CloseAll/Caption}}",
"description": "{{$:/language/Buttons/CloseAll/Hint}}",
"text": "<$button message=\"tm-close-all-tiddlers\" tooltip={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-all-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/CloseAll/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/control-panel": {
"title": "$:/core/ui/Buttons/control-panel",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/options-button}} {{$:/language/Buttons/ControlPanel/Caption}}",
"description": "{{$:/language/Buttons/ControlPanel/Hint}}",
"text": "<$button to=\"$:/ControlPanel\" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/options-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/ControlPanel/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/encryption": {
"title": "$:/core/ui/Buttons/encryption",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/locked-padlock}} {{$:/language/Buttons/Encryption/Caption}}",
"description": "{{$:/language/Buttons/Encryption/Hint}}",
"text": "<$reveal type=\"match\" state=\"$:/isEncrypted\" text=\"yes\">\n<$button message=\"tm-clear-password\" tooltip={{$:/language/Buttons/Encryption/ClearPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/ClearPassword/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/locked-padlock}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Encryption/ClearPassword/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/isEncrypted\" text=\"yes\">\n<$button message=\"tm-set-password\" tooltip={{$:/language/Buttons/Encryption/SetPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/SetPassword/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/unlocked-padlock}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Encryption/SetPassword/Caption}}/></span>\n</$list>\n</$button>\n</$reveal>"
},
"$:/core/ui/Buttons/export-page": {
"title": "$:/core/ui/Buttons/export-page",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/export-button}} {{$:/language/Buttons/ExportPage/Caption}}",
"description": "{{$:/language/Buttons/ExportPage/Hint}}",
"text": "<$macrocall $name=\"exportButton\" exportFilter=\"[!is[system]sort[title]]\" lingoBase=\"$:/language/Buttons/ExportPage/\"/>"
},
"$:/core/ui/Buttons/full-screen": {
"title": "$:/core/ui/Buttons/full-screen",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/full-screen-button}} {{$:/language/Buttons/FullScreen/Caption}}",
"description": "{{$:/language/Buttons/FullScreen/Hint}}",
"text": "<$button message=\"tm-full-screen\" tooltip={{$:/language/Buttons/FullScreen/Hint}} aria-label={{$:/language/Buttons/FullScreen/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/full-screen-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/FullScreen/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/home": {
"title": "$:/core/ui/Buttons/home",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/home-button}} {{$:/language/Buttons/Home/Caption}}",
"description": "{{$:/language/Buttons/Home/Hint}}",
"text": "<$button message=\"tm-home\" tooltip={{$:/language/Buttons/Home/Hint}} aria-label={{$:/language/Buttons/Home/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/home-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Home/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/import": {
"title": "$:/core/ui/Buttons/import",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/import-button}} {{$:/language/Buttons/Import/Caption}}",
"description": "{{$:/language/Buttons/Import/Hint}}",
"text": "<div class=\"tc-file-input-wrapper\">\n<$button tooltip={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/import-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Import/Caption}}/></span>\n</$list>\n</$button>\n<$browse tooltip={{$:/language/Buttons/Import/Hint}}/>\n</div>"
},
"$:/core/ui/Buttons/language": {
"title": "$:/core/ui/Buttons/language",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}}",
"description": "{{$:/language/Buttons/Language/Hint}}",
"text": "\\define flag-title()\n$(languagePluginTitle)$/icon\n\\end\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/language\">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n<span class=\"tc-image-button\">\n<$set name=\"languagePluginTitle\" value={{$:/language}}>\n<$image source=<<flag-title>>/>\n</$set>\n</span>\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Language/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/language\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down tc-drop-down-language-chooser\">\n<$linkcatcher to=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[description]]\">\n<$link>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/language\" text=<<currentTiddler>>>\n•\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/language\" text=<<currentTiddler>>>\n \n</$reveal>\n</span>\n<span class=\"tc-image-button\">\n<$set name=\"languagePluginTitle\" value=<<currentTiddler>>>\n<$transclude subtiddler=<<flag-title>>>\n<$list filter=\"[all[current]field:title[$:/languages/en-GB]]\">\n<$transclude tiddler=\"$:/languages/en-GB/icon\"/>\n</$list>\n</$transclude>\n</$set>\n</span>\n<$view field=\"description\">\n<$view field=\"name\">\n<$view field=\"title\"/>\n</$view>\n</$view>\n</$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
},
"$:/core/ui/Buttons/more-page-actions": {
"title": "$:/core/ui/Buttons/more-page-actions",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}",
"description": "{{$:/language/Buttons/More/Hint}}",
"text": "\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n<$button popup=<<qualify \"$:/state/popup/more\">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/down-arrow}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/More/Caption}}/></span>\n</$list>\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/more\">> type=\"popup\" position=\"below\" animate=\"yes\">\n\n<div class=\"tc-drop-down\">\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"tc-btn-invisible\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]\" variable=\"listItem\">\n\n<$reveal type=\"match\" state=<<config-title>> text=\"hide\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$reveal>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</div>\n\n</$reveal>"
},
"$:/core/ui/Buttons/new-journal": {
"title": "$:/core/ui/Buttons/new-journal",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}",
"description": "{{$:/language/Buttons/NewJournal/Hint}}",
"text": "\\define journalButton()\n<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" title=<<now \"$(journalTitleTemplate)$\">> tags=\"$(journalTags)$\"/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-journal-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<$set name=\"journalTitleTemplate\" value={{$:/config/NewJournal/Title}}>\n<$set name=\"journalTags\" value={{$:/config/NewJournal/Tags}}>\n<<journalButton>>\n</$set></$set>"
},
"$:/core/ui/Buttons/new-tiddler": {
"title": "$:/core/ui/Buttons/new-tiddler",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/new-button}} {{$:/language/Buttons/NewTiddler/Caption}}",
"description": "{{$:/language/Buttons/NewTiddler/Hint}}",
"text": "<$button message=\"tm-new-tiddler\" tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/refresh": {
"title": "$:/core/ui/Buttons/refresh",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/refresh-button}} {{$:/language/Buttons/Refresh/Caption}}",
"description": "{{$:/language/Buttons/Refresh/Hint}}",
"text": "<$button message=\"tm-browser-refresh\" tooltip={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/refresh-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Refresh/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/save-wiki": {
"title": "$:/core/ui/Buttons/save-wiki",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/save-button}} {{$:/language/Buttons/SaveWiki/Caption}}",
"description": "{{$:/language/Buttons/SaveWiki/Hint}}",
"text": "<$button message=\"tm-save-wiki\" param={{$:/config/SaveWikiButton/Template}} tooltip={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class=<<tv-config-toolbar-class>>>\n<span class=\"tc-dirty-indicator\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/save-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/SaveWiki/Caption}}/></span>\n</$list>\n</span>\n</$button>"
},
"$:/core/ui/Buttons/storyview": {
"title": "$:/core/ui/Buttons/storyview",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/storyview-classic}} {{$:/language/Buttons/StoryView/Caption}}",
"description": "{{$:/language/Buttons/StoryView/Hint}}",
"text": "\\define icon()\n$:/core/images/storyview-$(storyview)$\n\\end\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/storyview\">> tooltip={{$:/language/Buttons/StoryView/Hint}} aria-label={{$:/language/Buttons/StoryView/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n<$set name=\"storyview\" value={{$:/view}}>\n<$transclude tiddler=<<icon>>/>\n</$set>\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/StoryView/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/storyview\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$:/view\">\n<$list filter=\"[storyviews[]]\" variable=\"storyview\">\n<$link to=<<storyview>>>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/view\" text=<<storyview>>>\n•\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/view\" text=<<storyview>>>\n \n</$reveal>\n</span>\n<$transclude tiddler=<<icon>>/>\n<$text text=<<storyview>>/></$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
},
"$:/core/ui/Buttons/tag-manager": {
"title": "$:/core/ui/Buttons/tag-manager",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/tag-button}} {{$:/language/Buttons/TagManager/Caption}}",
"description": "{{$:/language/Buttons/TagManager/Hint}}",
"text": "<$button to=\"$:/TagManager\" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/tag-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/TagManager/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/theme": {
"title": "$:/core/ui/Buttons/theme",
"tags": "$:/tags/PageControls",
"caption": "{{$:/core/images/theme-button}} {{$:/language/Buttons/Theme/Caption}}",
"description": "{{$:/language/Buttons/Theme/Hint}}",
"text": "<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/theme\">> tooltip={{$:/language/Buttons/Theme/Hint}} aria-label={{$:/language/Buttons/Theme/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/theme-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Theme/Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/theme\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\" variable=\"themeTitle\">\n<$link to=<<themeTitle>>>\n<span class=\"tc-drop-down-bullet\">\n<$reveal type=\"match\" state=\"$:/theme\" text=<<themeTitle>>>\n•\n</$reveal>\n<$reveal type=\"nomatch\" state=\"$:/theme\" text=<<themeTitle>>>\n \n</$reveal>\n</span>\n<$view tiddler=<<themeTitle>> field=\"name\"/>\n</$link>\n</$list>\n</$linkcatcher>\n</div>\n</$reveal>"
},
"$:/core/ui/PageTemplate/pagecontrols": {
"title": "$:/core/ui/PageTemplate/pagecontrols",
"text": "\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-page-controls\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n<$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\">\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n</$reveal>\n</$list>\n</div>\n\n"
},
"$:/core/ui/PageStylesheet": {
"title": "$:/core/ui/PageStylesheet",
"text": "<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Stylesheet]!has[draft.of]]\">\n<$transclude mode=\"block\"/>\n</$list>\n\n</$importvariables>\n"
},
"$:/core/ui/PageTemplate/alerts": {
"title": "$:/core/ui/PageTemplate/alerts",
"tags": "$:/tags/PageTemplate",
"text": "<div class=\"tc-alerts\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Alert]!has[draft.of]]\" template=\"$:/core/ui/AlertTemplate\" storyview=\"pop\"/>\n\n</div>\n"
},
"$:/core/ui/PageTemplate/sidebar": {
"title": "$:/core/ui/PageTemplate/sidebar",
"tags": "$:/tags/PageTemplate",
"text": "<$scrollable fallthrough=\"no\" class=\"tc-sidebar-scrollable\">\n\n<div class=\"tc-sidebar-header\">\n\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"yes\" default=\"yes\" retain=\"yes\">\n\n<h1 class=\"tc-site-title\">\n\n<$transclude tiddler=\"$:/SiteTitle\" mode=\"inline\"/>\n\n</h1>\n\n<div class=\"tc-site-subtitle\">\n\n<$transclude tiddler=\"$:/SiteSubtitle\" mode=\"inline\"/>\n\n</div>\n\n{{||$:/core/ui/PageTemplate/pagecontrols}}\n\n<$transclude tiddler=\"$:/core/ui/SideBarLists\" mode=\"inline\"/>\n\n</$reveal>\n\n</div>\n\n</$scrollable>"
},
"$:/core/ui/PageTemplate/story": {
"title": "$:/core/ui/PageTemplate/story",
"tags": "$:/tags/PageTemplate",
"text": "<section class=\"tc-story-river\">\n\n<section class=\"story-backdrop\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/AboveStory]!has[draft.of]]\">\n\n<$transclude/>\n\n</$list>\n\n</section>\n\n<$list filter=\"[list[$:/StoryList]]\" history=\"$:/HistoryList\" template=\"$:/core/ui/ViewTemplate\" editTemplate=\"$:/core/ui/EditTemplate\" storyview={{$:/view}} />\n\n<section class=\"story-frontdrop\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/BelowStory]!has[draft.of]]\">\n\n<$transclude/>\n\n</$list>\n\n</section>\n\n</section>\n"
},
"$:/core/ui/PageTemplate/topleftbar": {
"title": "$:/core/ui/PageTemplate/topleftbar",
"tags": "$:/tags/PageTemplate",
"text": "<span class=\"tc-topbar tc-topbar-left\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopLeftBar]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>\n\n</span>\n"
},
"$:/core/ui/PageTemplate/toprightbar": {
"title": "$:/core/ui/PageTemplate/toprightbar",
"tags": "$:/tags/PageTemplate",
"text": "<span class=\"tc-topbar tc-topbar-right\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TopRightBar]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>> mode=\"inline\"/>\n\n</$list>\n\n</span>\n"
},
"$:/core/ui/PageTemplate": {
"title": "$:/core/ui/PageTemplate",
"text": "\\define containerClasses()\ntc-page-container tc-page-view-$(themeTitle)$ tc-language-$(languageTitle)$\n\\end\n\n<$importvariables filter=\"[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]\">\n\n<$set name=\"tv-config-toolbar-icons\" value={{$:/config/Toolbar/Icons}}>\n\n<$set name=\"tv-config-toolbar-text\" value={{$:/config/Toolbar/Text}}>\n\n<$set name=\"tv-config-toolbar-class\" value=\"tc-btn-invisible\">\n\n<$set name=\"themeTitle\" value={{$:/view}}>\n\n<$set name=\"currentTiddler\" value={{$:/language}}>\n\n<$set name=\"languageTitle\" value={{!!name}}>\n\n<$set name=\"currentTiddler\" value=\"\">\n\n<div class=<<containerClasses>>>\n\n<$navigator story=\"$:/StoryList\" history=\"$:/HistoryList\">\n\n<$dropzone>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]\" variable=\"listItem\">\n\n<$transclude tiddler=<<listItem>>/>\n\n</$list>\n\n</$dropzone>\n\n</$navigator>\n\n</div>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$set>\n\n</$importvariables>\n"
},
"$:/core/ui/PluginInfo": {
"title": "$:/core/ui/PluginInfo",
"text": "\\define localised-info-tiddler-title()\n$(currentTiddler)$/$(languageTitle)$/$(currentTab)$\n\\end\n\\define info-tiddler-title()\n$(currentTiddler)$/$(currentTab)$\n\\end\n<$transclude tiddler=<<localised-info-tiddler-title>> mode=\"block\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<localised-info-tiddler-title>> mode=\"block\">\n<$transclude tiddler=<<currentTiddler>> subtiddler=<<info-tiddler-title>> mode=\"block\">\nNo ''\"<$text text=<<currentTab>>/>\"'' found\n</$transclude>\n</$transclude>\n</$transclude>\n"
},
"$:/core/ui/SearchResults": {
"title": "$:/core/ui/SearchResults",
"text": "<div class=\"tc-search-results\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]\" emptyMessage=\"\"\"\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\">\n<$transclude mode=\"block\"/>\n</$list>\n\"\"\">\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]\" default={{$:/config/SearchResults/Default}}/>\n</$list>\n\n</div>\n"
},
"$:/core/ui/SideBar/More": {
"title": "$:/core/ui/SideBar/More",
"tags": "$:/tags/SideBar",
"caption": "{{$:/language/SideBar/More/Caption}}",
"text": "<div class=\"tc-more-sidebar\">\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]\" \"$:/core/ui/MoreSideBar/Tags\" \"$:/state/tab/moresidebar\" \"tc-vertical\">>\n</div>\n"
},
"$:/core/ui/SideBar/Open": {
"title": "$:/core/ui/SideBar/Open",
"tags": "$:/tags/SideBar",
"caption": "{{$:/language/SideBar/Open/Caption}}",
"text": "\\define lingo-base() $:/language/CloseAll/\n<$list filter=\"[list[$:/StoryList]]\" history=\"$:/HistoryList\" storyview=\"pop\">\n\n<$button message=\"tm-close-tiddler\" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=\"tc-btn-invisible tc-btn-mini\">×</$button> <$link to={{!!title}}><$view field=\"title\"/></$link>\n\n</$list>\n\n<$button message=\"tm-close-all-tiddlers\" class=\"tc-btn-invisible tc-btn-mini\"><<lingo Button>></$button>\n"
},
"$:/core/ui/SideBar/Recent": {
"title": "$:/core/ui/SideBar/Recent",
"tags": "$:/tags/SideBar",
"caption": "{{$:/language/SideBar/Recent/Caption}}",
"text": "<$macrocall $name=\"timeline\" format={{$:/language/RecentChanges/DateFormat}}/>\n"
},
"$:/core/ui/SideBar/Tools": {
"title": "$:/core/ui/SideBar/Tools",
"tags": "$:/tags/SideBar",
"caption": "{{$:/language/SideBar/Tools/Caption}}",
"text": "\\define lingo-base() $:/language/ControlPanel/\n\\define config-title()\n$:/config/PageControlButtons/Visibility/$(listItem)$\n\\end\n\n<<lingo Basics/Version/Prompt>> <<version>>\n\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]]\" variable=\"listItem\">\n\n<div style=\"position:relative;\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>>/> <i class=\"tc-muted\"><$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</div>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n"
},
"$:/core/ui/SideBarLists": {
"title": "$:/core/ui/SideBarLists",
"text": "<div class=\"tc-sidebar-lists\">\n\n<div class=\"tc-search\">\n<$edit-text tiddler=\"$:/temp/search\" type=\"search\" tag=\"input\" focus=\"true\"/>\n<$reveal state=\"$:/temp/search\" type=\"nomatch\" text=\"\">\n<$button tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/advancedsearch\" text={{$:/temp/search}}/>\n<$action-setfield $tiddler=\"$:/temp/search\" text=\"\"/>\n<$action-navigate $to=\"$:/AdvancedSearch\"/>\n{{$:/core/images/advanced-search-button}}\n</$button>\n<$button class=\"tc-btn-invisible\">\n<$action-setfield $tiddler=\"$:/temp/search\" text=\"\" />\n{{$:/core/images/close-button}}\n</$button>\n</$reveal>\n<$reveal state=\"$:/temp/search\" type=\"match\" text=\"\">\n<$button to=\"$:/AdvancedSearch\" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=\"tc-btn-invisible\">\n{{$:/core/images/advanced-search-button}}\n</$button>\n</$reveal>\n</div>\n\n<$reveal state=\"$:/temp/search\" type=\"nomatch\" text=\"\">\n\n<$set name=\"searchTiddler\" value=\"$:/temp/search\">\n{{$:/core/ui/SearchResults}}\n</$set>\n\n</$reveal>\n\n<$reveal state=\"$:/temp/search\" type=\"match\" text=\"\">\n\n<<tabs \"[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]\" \"$:/core/ui/SideBar/Open\" \"$:/state/tab/sidebar\">>\n\n</$reveal>\n\n</div>\n"
},
"$:/TagManager": {
"title": "$:/TagManager",
"icon": "$:/core/images/tag-button",
"text": "\\define lingo-base() $:/language/TagManager/\n\\define iconEditorTab(type)\n<$list filter=\"[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[sort[title]] +[$type$is[system]]\">\n<$link to={{!!title}}>\n<$transclude/> <$view field=\"title\"/>\n</$link>\n</$list>\n\\end\n\\define iconEditor(title)\n<div class=\"tc-drop-down-wrapper\">\n<$button popup=<<qualify \"$:/state/popup/icon/$title$\">> class=\"tc-btn-invisible tc-btn-dropdown\">{{$:/core/images/down-arrow}}</$button>\n<$reveal state=<<qualify \"$:/state/popup/icon/$title$\">> type=\"popup\" position=\"belowleft\" text=\"\" default=\"\">\n<div class=\"tc-drop-down\">\n<$linkcatcher to=\"$title$!!icon\">\n<<iconEditorTab type:\"!\">>\n<hr/>\n<<iconEditorTab type:\"\">>\n</$linkcatcher>\n</div>\n</$reveal>\n</div>\n\\end\n\\define qualifyTitle(title)\n$title$$(currentTiddler)$\n\\end\n\\define toggleButton(state)\n<$reveal state=\"$state$\" type=\"match\" text=\"closed\" default=\"closed\">\n<$button set=\"$state$\" setTo=\"open\" class=\"tc-btn-invisible tc-btn-dropdown\" selectedClass=\"tc-selected\">\n{{$:/core/images/info-button}}\n</$button>\n</$reveal>\n<$reveal state=\"$state$\" type=\"match\" text=\"open\" default=\"closed\">\n<$button set=\"$state$\" setTo=\"closed\" class=\"tc-btn-invisible tc-btn-dropdown\" selectedClass=\"tc-selected\">\n{{$:/core/images/info-button}}\n</$button>\n</$reveal>\n\\end\n<table class=\"tc-tag-manager-table\">\n<tbody>\n<tr>\n<th><<lingo Colour/Heading>></th>\n<th class=\"tc-tag-manager-tag\"><<lingo Tag/Heading>></th>\n<th><<lingo Icon/Heading>></th>\n<th><<lingo Info/Heading>></th>\n</tr>\n<$list filter=\"[tags[]!is[system]sort[title]]\">\n<tr>\n<td><$edit-text field=\"color\" tag=\"input\" type=\"color\"/></td>\n<td><$transclude tiddler=\"$:/core/ui/TagTemplate\"/></td>\n<td>\n<$macrocall $name=\"iconEditor\" title={{!!title}}/>\n</td>\n<td>\n<$macrocall $name=\"toggleButton\" state=<<qualifyTitle \"$:/state/tag-manager/\">> /> \n</td>\n</tr>\n<tr>\n<td></td>\n<td>\n<$reveal state=<<qualifyTitle \"$:/state/tag-manager/\">> type=\"match\" text=\"open\" default=\"\">\n<table>\n<tbody>\n<tr><td><<lingo Colour/Heading>></td><td><$edit-text field=\"color\" tag=\"input\" type=\"text\" size=\"9\"/></td></tr>\n<tr><td><<lingo Icon/Heading>></td><td><$edit-text field=\"icon\" tag=\"input\" size=\"45\"/></td></tr>\n</tbody>\n</table>\n</$reveal>\n</td>\n<td></td>\n<td></td>\n</tr>\n</$list>\n</tbody>\n</table>\n"
},
"$:/core/ui/TagTemplate": {
"title": "$:/core/ui/TagTemplate",
"text": "\\define tag-styles()\nbackground-color:$(backgroundColor)$;\nfill:$(foregroundColor)$;\ncolor:$(foregroundColor)$;\n\\end\n\n\\define tag-body-inner(colour,fallbackTarget,colourA,colourB)\n<$set name=\"foregroundColor\" value=<<contrastcolour target:\"\"\"$colour$\"\"\" fallbackTarget:\"\"\"$fallbackTarget$\"\"\" colourA:\"\"\"$colourA$\"\"\" colourB:\"\"\"$colourB$\"\"\">>>\n<$set name=\"backgroundColor\" value=\"\"\"$colour$\"\"\">\n<$button popup=<<qualify \"$:/state/popup/tag\">> class=\"tc-btn-invisible tc-tag-label\" style=<<tag-styles>>>\n<$transclude tiddler={{!!icon}}/> <$view field=\"title\" format=\"text\" />\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/tag\">> type=\"popup\" position=\"below\" animate=\"yes\"><div class=\"tc-drop-down\"><$transclude tiddler=\"$:/core/ui/ListItemTemplate\"/>\n<hr>\n<$list filter=\"[all[current]tagging[]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$reveal>\n</$set>\n</$set>\n\\end\n\n\\define tag-body(colour,palette)\n<span class=\"tc-tag-list-item\">\n<$macrocall $name=\"tag-body-inner\" colour=\"\"\"$colour$\"\"\" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}}/>\n</span>\n\\end\n\n<$macrocall $name=\"tag-body\" colour={{!!color}} palette={{$:/palette}}/>\n"
},
"$:/core/ui/TiddlerFieldTemplate": {
"title": "$:/core/ui/TiddlerFieldTemplate",
"text": "<tr class=\"tc-view-field\">\n<td class=\"tc-view-field-name\">\n<$text text=<<listItem>>/>\n</td>\n<td class=\"tc-view-field-value\">\n<$view field=<<listItem>>/>\n</td>\n</tr>"
},
"$:/core/ui/TiddlerFields": {
"title": "$:/core/ui/TiddlerFields",
"text": "<table class=\"tc-view-field-table\">\n<tbody>\n<$list filter=\"[all[current]fields[]sort[title]] -text\" template=\"$:/core/ui/TiddlerFieldTemplate\" variable=\"listItem\"/>\n</tbody>\n</table>\n"
},
"$:/core/ui/TiddlerInfo/Advanced/PluginInfo": {
"title": "$:/core/ui/TiddlerInfo/Advanced/PluginInfo",
"tags": "$:/tags/TiddlerInfo/Advanced",
"text": "\\define lingo-base() $:/language/TiddlerInfo/Advanced/PluginInfo/\n<$list filter=\"[all[current]has[plugin-type]]\">\n\n! <<lingo Heading>>\n\n<<lingo Hint>>\n<ul>\n<$list filter=\"[all[current]plugintiddlers[]sort[title]]\" emptyMessage=<<lingo Empty/Hint>>>\n<li>\n<$link to={{!!title}}>\n<$view field=\"title\"/>\n</$link>\n</li>\n</$list>\n</ul>\n\n</$list>\n"
},
"$:/core/ui/TiddlerInfo/Advanced/ShadowInfo": {
"title": "$:/core/ui/TiddlerInfo/Advanced/ShadowInfo",
"tags": "$:/tags/TiddlerInfo/Advanced",
"text": "\\define lingo-base() $:/language/TiddlerInfo/Advanced/ShadowInfo/\n<$set name=\"infoTiddler\" value=<<currentTiddler>>>\n\n''<<lingo Heading>>''\n\n<$list filter=\"[all[current]!is[shadow]]\">\n\n<<lingo NotShadow/Hint>>\n\n</$list>\n\n<$list filter=\"[all[current]is[shadow]]\">\n\n<<lingo Shadow/Hint>>\n\n<$list filter=\"[all[current]shadowsource[]]\">\n\n<$set name=\"pluginTiddler\" value=<<currentTiddler>>>\n<<lingo Shadow/Source>>\n</$set>\n\n</$list>\n\n<$list filter=\"[all[current]is[shadow]is[tiddler]]\">\n\n<<lingo OverriddenShadow/Hint>>\n\n</$list>\n\n\n</$list>\n</$set>\n"
},
"$:/core/ui/TiddlerInfo/Advanced": {
"title": "$:/core/ui/TiddlerInfo/Advanced",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/Advanced/Caption}}",
"text": "<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo/Advanced]!has[draft.of]]\" variable=\"listItem\">\n<$transclude tiddler=<<listItem>>/>\n\n</$list>\n"
},
"$:/core/ui/TiddlerInfo/Fields": {
"title": "$:/core/ui/TiddlerInfo/Fields",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/Fields/Caption}}",
"text": "<$transclude tiddler=\"$:/core/ui/TiddlerFields\"/>\n"
},
"$:/core/ui/TiddlerInfo/List": {
"title": "$:/core/ui/TiddlerInfo/List",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/List/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[list{!!title}]\" emptyMessage=<<lingo List/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/TiddlerInfo/Listed": {
"title": "$:/core/ui/TiddlerInfo/Listed",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/Listed/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]listed[]!is[system]]\" emptyMessage=<<lingo Listed/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/TiddlerInfo/References": {
"title": "$:/core/ui/TiddlerInfo/References",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/References/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]backlinks[]sort[title]]\" emptyMessage=<<lingo References/Empty>> template=\"$:/core/ui/ListItemTemplate\">\n</$list>\n"
},
"$:/core/ui/TiddlerInfo/Tagging": {
"title": "$:/core/ui/TiddlerInfo/Tagging",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/Tagging/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n<$list filter=\"[all[current]tagging[]]\" emptyMessage=<<lingo Tagging/Empty>> template=\"$:/core/ui/ListItemTemplate\"/>\n"
},
"$:/core/ui/TiddlerInfo/Tools": {
"title": "$:/core/ui/TiddlerInfo/Tools",
"tags": "$:/tags/TiddlerInfo",
"caption": "{{$:/language/TiddlerInfo/Tools/Caption}}",
"text": "\\define lingo-base() $:/language/TiddlerInfo/\n\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n\n<$set name=\"tv-config-toolbar-class\" value=\"\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]\" variable=\"listItem\">\n\n<$checkbox tiddler=<<config-title>> field=\"text\" checked=\"show\" unchecked=\"hide\" default=\"show\"/> <$transclude tiddler=<<listItem>>/> <i class=\"tc-muted\"><$transclude tiddler=<<listItem>> field=\"description\"/></i>\n\n</$list>\n\n</$set>\n\n</$set>\n\n</$set>\n"
},
"$:/core/ui/TiddlerInfo": {
"title": "$:/core/ui/TiddlerInfo",
"text": "<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/TiddlerInfo]!has[draft.of]]\" default={{$:/config/TiddlerInfo/Default}}/>"
},
"$:/core/ui/TopBar/menu": {
"title": "$:/core/ui/TopBar/menu",
"tags": "$:/tags/TopRightBar",
"text": "<$reveal state=\"$:/state/sidebar\" type=\"nomatch\" text=\"no\">\n<$button set=\"$:/state/sidebar\" setTo=\"no\" tooltip={{$:/language/Buttons/HideSideBar/Hint}} aria-label={{$:/language/Buttons/HideSideBar/Caption}} class=\"tc-btn-invisible\">{{$:/core/images/chevron-right}}</$button>\n</$reveal>\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"no\">\n<$button set=\"$:/state/sidebar\" setTo=\"yes\" tooltip={{$:/language/Buttons/ShowSideBar/Hint}} aria-label={{$:/language/Buttons/ShowSideBar/Caption}} class=\"tc-btn-invisible\">{{$:/core/images/chevron-left}}</$button>\n</$reveal>\n"
},
"$:/core/ui/UntaggedTemplate": {
"title": "$:/core/ui/UntaggedTemplate",
"text": "\\define lingo-base() $:/language/SideBar/\n<$button popup=<<qualify \"$:/state/popup/tag\">> class=\"tc-btn-invisible tc-untagged-label tc-tag-label\">\n<<lingo Tags/Untagged/Caption>>\n</$button>\n<$reveal state=<<qualify \"$:/state/popup/tag\">> type=\"popup\" position=\"below\">\n<div class=\"tc-drop-down\">\n<$list filter=\"[untagged[]!is[system]] -[tags[]] +[sort[title]]\" template=\"$:/core/ui/ListItemTemplate\"/>\n</div>\n</$reveal>\n"
},
"$:/core/ui/ViewTemplate/body": {
"title": "$:/core/ui/ViewTemplate/body",
"tags": "$:/tags/ViewTemplate",
"text": "<div class=\"tc-tiddler-body\">\n\n<$list filter=\"[all[current]!has[plugin-type]!field:hide-body[yes]]\">\n\n<$transclude>\n\n<$transclude tiddler=\"$:/language/MissingTiddler/Hint\"/>\n\n</$transclude>\n\n</$list>\n\n</div>\n"
},
"$:/core/ui/ViewTemplate/classic": {
"title": "$:/core/ui/ViewTemplate/classic",
"tags": "$:/tags/ViewTemplate $:/tags/EditTemplate",
"text": "\\define lingo-base() $:/language/ClassicWarning/\n<$list filter=\"[all[current]type[text/x-tiddlywiki]]\">\n<div class=\"tc-message-box\">\n\n<<lingo Hint>>\n\n<$button set=\"!!type\" setTo=\"text/vnd.tiddlywiki\"><<lingo Upgrade/Caption>></$button>\n\n</div>\n</$list>\n"
},
"$:/core/ui/ViewTemplate/import": {
"title": "$:/core/ui/ViewTemplate/import",
"tags": "$:/tags/ViewTemplate",
"text": "\\define lingo-base() $:/language/Import/\n\n<$list filter=\"[all[current]field:plugin-type[import]]\">\n\n<div class=\"tc-import\">\n\n<<lingo Listing/Hint>>\n\n{{||$:/core/ui/ImportListing}}\n\n<$button message=\"tm-delete-tiddler\" param=<<currentTiddler>>><<lingo Listing/Cancel/Caption>></$button>\n<$button message=\"tm-perform-import\" param=<<currentTiddler>>><<lingo Listing/Import/Caption>></$button>\n\n</div>\n\n</$list>\n"
},
"$:/core/ui/ViewTemplate/plugin": {
"title": "$:/core/ui/ViewTemplate/plugin",
"tags": "$:/tags/ViewTemplate",
"text": "<$list filter=\"[all[current]has[plugin-type]] -[all[current]field:plugin-type[import]]\">\n\n{{||$:/core/ui/TiddlerInfo/Advanced/PluginInfo}}\n\n</$list>\n"
},
"$:/core/ui/ViewTemplate/subtitle": {
"title": "$:/core/ui/ViewTemplate/subtitle",
"tags": "$:/tags/ViewTemplate",
"text": "<div class=\"tc-subtitle\">\n<$link to={{!!modifier}}>\n<$view field=\"modifier\"/>\n</$link> <$view field=\"modified\" format=\"relativedate\"/>\n</div>\n"
},
"$:/core/ui/ViewTemplate/tags": {
"title": "$:/core/ui/ViewTemplate/tags",
"tags": "$:/tags/ViewTemplate",
"text": "<div class=\"tc-tags-wrapper\"><$list filter=\"[all[current]tags[]sort[title]]\" template=\"$:/core/ui/TagTemplate\" storyview=\"pop\"/></div>\n"
},
"$:/core/ui/ViewTemplate/title": {
"title": "$:/core/ui/ViewTemplate/title",
"tags": "$:/tags/ViewTemplate",
"text": "\\define title-styles()\nfill:$(foregroundColor)$;\n\\end\n\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<div class=\"tc-tiddler-title\">\n<div class=\"tc-titlebar\">\n<span class=\"tc-tiddler-controls\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]\" variable=\"listItem\"><$reveal type=\"nomatch\" state=<<config-title>> text=\"hide\"><$transclude tiddler=<<listItem>>/></$reveal></$list>\n</span>\n<$set name=\"foregroundColor\" value={{!!color}}>\n<span class=\"tc-tiddler-title-icon\" style=<<title-styles>>>\n<$transclude tiddler={{!!icon}}/>\n</span>\n</$set>\n<$list filter=\"[all[current]removeprefix[$:/]]\">\n<h2 class=\"tc-title\" title={{$:/language/SystemTiddler/Tooltip}}>\n<span class=\"tc-system-title-prefix\">$:/</span><$text text=<<currentTiddler>>/>\n</h2>\n</$list>\n<$list filter=\"[all[current]!prefix[$:/]]\">\n<h2 class=\"tc-title\">\n<$view field=\"title\"/>\n</h2>\n</$list>\n</div>\n\n<$reveal type=\"nomatch\" text=\"\" default=\"\" state=<<tiddlerInfoState>> class=\"tc-tiddler-info tc-popup-handle\" animate=\"yes\" retain=\"yes\">\n\n<$transclude tiddler=\"$:/core/ui/TiddlerInfo\"/>\n\n</$reveal>\n</div>"
},
"$:/core/ui/ViewTemplate": {
"title": "$:/core/ui/ViewTemplate",
"text": "\\define frame-classes()\ntc-tiddler-frame tc-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ $(tiddlerTagClasses)$\n\\end\n<$set name=\"storyTiddler\" value=<<currentTiddler>>><$set name=\"tiddlerInfoState\" value=<<qualify \"$:/state/popup/tiddler-info\">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]\" variable=\"listItem\"><$transclude tiddler=<<listItem>>/></$list>\n</div>\n</$tiddler></$set></$set>\n"
},
"$:/core/ui/Buttons/clone": {
"title": "$:/core/ui/Buttons/clone",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/clone-button}} {{$:/language/Buttons/Clone/Caption}}",
"description": "{{$:/language/Buttons/Clone/Hint}}",
"text": "<$button message=\"tm-new-tiddler\" param=<<currentTiddler>> tooltip={{$:/language/Buttons/Clone/Hint}} aria-label={{$:/language/Buttons/Clone/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/clone-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Clone/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/close-others": {
"title": "$:/core/ui/Buttons/close-others",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/close-others-button}} {{$:/language/Buttons/CloseOthers/Caption}}",
"description": "{{$:/language/Buttons/CloseOthers/Hint}}",
"text": "<$button message=\"tm-close-other-tiddlers\" param=<<currentTiddler>> tooltip={{$:/language/Buttons/CloseOthers/Hint}} aria-label={{$:/language/Buttons/CloseOthers/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-others-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/CloseOthers/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/close": {
"title": "$:/core/ui/Buttons/close",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/close-button}} {{$:/language/Buttons/Close/Caption}}",
"description": "{{$:/language/Buttons/Close/Hint}}",
"text": "<$button message=\"tm-close-tiddler\" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/close-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Close/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/edit": {
"title": "$:/core/ui/Buttons/edit",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/edit-button}} {{$:/language/Buttons/Edit/Caption}}",
"description": "{{$:/language/Buttons/Edit/Hint}}",
"text": "<$button message=\"tm-edit-tiddler\" tooltip={{$:/language/Buttons/Edit/Hint}} aria-label={{$:/language/Buttons/Edit/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/edit-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Edit/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/export-tiddler": {
"title": "$:/core/ui/Buttons/export-tiddler",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/export-button}} {{$:/language/Buttons/ExportTiddler/Caption}}",
"description": "{{$:/language/Buttons/ExportTiddler/Hint}}",
"text": "\\define makeExportFilter()\n[[$(currentTiddler)$]]\n\\end\n<$macrocall $name=\"exportButton\" exportFilter=<<makeExportFilter>> lingoBase=\"$:/language/Buttons/ExportTiddler/\" baseFilename=<<currentTiddler>>/>"
},
"$:/core/ui/Buttons/info": {
"title": "$:/core/ui/Buttons/info",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/info-button}} {{$:/language/Buttons/Info/Caption}}",
"description": "{{$:/language/Buttons/Info/Hint}}",
"text": "<$button popup=<<tiddlerInfoState>> tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/info-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Info/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/more-tiddler-actions": {
"title": "$:/core/ui/Buttons/more-tiddler-actions",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}}",
"description": "{{$:/language/Buttons/More/Hint}}",
"text": "\\define config-title()\n$:/config/ViewToolbarButtons/Visibility/$(listItem)$\n\\end\n<$button popup=<<qualify \"$:/state/popup/more\">> tooltip={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/down-arrow}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/More/Caption}}/></span>\n</$list>\n</$button><$reveal state=<<qualify \"$:/state/popup/more\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$set name=\"tv-config-toolbar-icons\" value=\"yes\">\n<$set name=\"tv-config-toolbar-text\" value=\"yes\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]\" variable=\"listItem\">\n<$reveal type=\"match\" state=<<config-title>> text=\"hide\">\n<$transclude tiddler=<<listItem>>/>\n</$reveal>\n</$list>\n</$set>\n</$set>\n</div>\n</$reveal>"
},
"$:/core/ui/Buttons/new-here": {
"title": "$:/core/ui/Buttons/new-here",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/new-here-button}} {{$:/language/Buttons/NewHere/Caption}}",
"description": "{{$:/language/Buttons/NewHere/Hint}}",
"text": "\\define newHereButtonTags()\n[[$(currentTiddler)$]]\n\\end\n\\define newHereButton()\n<$button tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" tags=<<newHereButtonTags>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-here-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewHere/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<<newHereButton>>"
},
"$:/core/ui/Buttons/new-journal-here": {
"title": "$:/core/ui/Buttons/new-journal-here",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournalHere/Caption}}",
"description": "{{$:/language/Buttons/NewJournalHere/Hint}}",
"text": "\\define journalButtonTags()\n[[$(currentTiddlerTag)$]] $(journalTags)$\n\\end\n\\define journalButton()\n<$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}} aria-label={{$:/language/Buttons/NewJournalHere/Caption}} class=<<tv-config-toolbar-class>>>\n<$action-sendmessage $message=\"tm-new-tiddler\" title=<<now \"$(journalTitleTemplate)$\">> tags=<<journalButtonTags>>/>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/new-journal-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/NewJournalHere/Caption}}/></span>\n</$list>\n</$button>\n\\end\n<$set name=\"journalTitleTemplate\" value={{$:/config/NewJournal/Title}}>\n<$set name=\"journalTags\" value={{$:/config/NewJournal/Tags}}>\n<$set name=\"currentTiddlerTag\" value=<<currentTiddler>>>\n<<journalButton>>\n</$set></$set></$set>"
},
"$:/core/ui/Buttons/permalink": {
"title": "$:/core/ui/Buttons/permalink",
"tags": "$:/tags/ViewToolbar",
"caption": "{{$:/core/images/permalink-button}} {{$:/language/Buttons/Permalink/Caption}}",
"description": "{{$:/language/Buttons/Permalink/Hint}}",
"text": "<$button message=\"tm-permalink\" tooltip={{$:/language/Buttons/Permalink/Hint}} aria-label={{$:/language/Buttons/Permalink/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/permalink-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Permalink/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/core/ui/Buttons/permaview": {
"title": "$:/core/ui/Buttons/permaview",
"tags": "$:/tags/ViewToolbar $:/tags/PageControls",
"caption": "{{$:/core/images/permaview-button}} {{$:/language/Buttons/Permaview/Caption}}",
"description": "{{$:/language/Buttons/Permaview/Hint}}",
"text": "<$button message=\"tm-permaview\" tooltip={{$:/language/Buttons/Permaview/Hint}} aria-label={{$:/language/Buttons/Permaview/Caption}} class=<<tv-config-toolbar-class>>>\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/permaview-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$:/language/Buttons/Permaview/Caption}}/></span>\n</$list>\n</$button>"
},
"$:/DefaultTiddlers": {
"title": "$:/DefaultTiddlers",
"text": "GettingStarted\n"
},
"$:/temp/advancedsearch": {
"title": "$:/temp/advancedsearch",
"text": ""
},
"$:/snippets/allfields": {
"title": "$:/snippets/allfields",
"text": "\\define renderfield(title)\n<tr class=\"tc-view-field\"><td class=\"tc-view-field-name\">''$title$'':</td><td class=\"tc-view-field-value\">//{{$:/language/Docs/Fields/$title$}}//</td></tr>\n\\end\n<table class=\"tc-view-field-table\"><tbody><$list filter=\"[fields[]sort[title]]\" variable=\"listItem\"><$macrocall $name=\"renderfield\" title=<<listItem>>/></$list>\n</tbody></table>\n"
},
"$:/config/AnimationDuration": {
"title": "$:/config/AnimationDuration",
"text": "400"
},
"$:/config/AutoSave": {
"title": "$:/config/AutoSave",
"text": "yes"
},
"$:/config/BitmapEditor/Colour": {
"title": "$:/config/BitmapEditor/Colour",
"text": "#ff0"
},
"$:/config/BitmapEditor/LineWidth": {
"title": "$:/config/BitmapEditor/LineWidth",
"text": "3"
},
"$:/config/EditTemplateFields/Visibility/title": {
"title": "$:/config/EditTemplateFields/Visibility/title",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/tags": {
"title": "$:/config/EditTemplateFields/Visibility/tags",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/text": {
"title": "$:/config/EditTemplateFields/Visibility/text",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/creator": {
"title": "$:/config/EditTemplateFields/Visibility/creator",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/created": {
"title": "$:/config/EditTemplateFields/Visibility/created",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/modified": {
"title": "$:/config/EditTemplateFields/Visibility/modified",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/modifier": {
"title": "$:/config/EditTemplateFields/Visibility/modifier",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/type": {
"title": "$:/config/EditTemplateFields/Visibility/type",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/draft.title": {
"title": "$:/config/EditTemplateFields/Visibility/draft.title",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/draft.of": {
"title": "$:/config/EditTemplateFields/Visibility/draft.of",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/revision": {
"title": "$:/config/EditTemplateFields/Visibility/revision",
"text": "hide"
},
"$:/config/EditTemplateFields/Visibility/bag": {
"title": "$:/config/EditTemplateFields/Visibility/bag",
"text": "hide"
},
"$:/config/EditorTypeMappings/image/gif": {
"title": "$:/config/EditorTypeMappings/image/gif",
"text": "bitmap"
},
"$:/config/EditorTypeMappings/image/jpeg": {
"title": "$:/config/EditorTypeMappings/image/jpeg",
"text": "bitmap"
},
"$:/config/EditorTypeMappings/image/jpg": {
"title": "$:/config/EditorTypeMappings/image/jpg",
"text": "bitmap"
},
"$:/config/EditorTypeMappings/image/png": {
"title": "$:/config/EditorTypeMappings/image/png",
"text": "bitmap"
},
"$:/config/EditorTypeMappings/image/x-icon": {
"title": "$:/config/EditorTypeMappings/image/x-icon",
"text": "bitmap"
},
"$:/config/EditorTypeMappings/text/vnd.tiddlywiki": {
"title": "$:/config/EditorTypeMappings/text/vnd.tiddlywiki",
"text": "text"
},
"$:/config/Navigation/UpdateAddressBar": {
"title": "$:/config/Navigation/UpdateAddressBar",
"text": "no"
},
"$:/config/Navigation/UpdateHistory": {
"title": "$:/config/Navigation/UpdateHistory",
"text": "no"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/advanced-search": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/advanced-search",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/close-all": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/close-all",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/encryption": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/encryption",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/export-page": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/export-page",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/full-screen": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/full-screen",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/refresh",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/import",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/language": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/language",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/tag-manager": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/tag-manager",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/more-page-actions": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/more-page-actions",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-journal": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/new-journal",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/permaview": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/permaview",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/storyview",
"text": "hide"
},
"$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/theme": {
"title": "$:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/theme",
"text": "hide"
},
"$:/config/SaveWikiButton/Template": {
"title": "$:/config/SaveWikiButton/Template",
"text": "$:/core/save/all"
},
"$:/config/SaverFilter": {
"title": "$:/config/SaverFilter",
"text": "[all[]] -[[$:/HistoryList]] -[[$:/StoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[[$:/UploadName]] -[prefix[$:/state]] -[prefix[$:/temp]]"
},
"$:/config/SearchResults/Default": {
"title": "$:/config/SearchResults/Default",
"text": "$:/core/ui/DefaultSearchResultList"
},
"$:/config/SyncFilter": {
"title": "$:/config/SyncFilter",
"text": "[is[tiddler]] -[[$:/HistoryList]] -[[$:/StoryList]] -[[$:/Import]] -[[$:/isEncrypted]] -[prefix[$:/status]] -[prefix[$:/state]] -[prefix[$:/temp]]"
},
"$:/config/TiddlerInfo/Default": {
"title": "$:/config/TiddlerInfo/Default",
"text": "$:/core/ui/TiddlerInfo/Fields"
},
"$:/config/Toolbar/Icons": {
"title": "$:/config/Toolbar/Icons",
"text": "yes"
},
"$:/config/Toolbar/Text": {
"title": "$:/config/Toolbar/Text",
"text": "no"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/clone",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/close-others": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/close-others",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/export-tiddler": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/export-tiddler",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/info",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/more-tiddler-actions",
"text": "show"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-here",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-journal-here": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/new-journal-here",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permalink": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permalink",
"text": "hide"
},
"$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permaview": {
"title": "$:/config/ViewToolbarButtons/Visibility/$:/core/ui/Buttons/permaview",
"text": "hide"
},
"$:/snippets/currpalettepreview": {
"title": "$:/snippets/currpalettepreview",
"text": "\\define swatchStyle()\nbackground-color: $(swatchColour)$;\n\\end\n\\define swatch(colour)\n<$set name=\"swatchColour\" value={{##$colour$}}>\n<div class=\"tc-swatch\" style=<<swatchStyle>>/>\n</$set>\n\\end\n<div class=\"tc-swatches-horiz\">\n<<swatch foreground>>\n<<swatch background>>\n<<swatch muted-foreground>>\n<<swatch primary>>\n<<swatch page-background>>\n<<swatch tab-background>>\n<<swatch tiddler-info-background>>\n</div>\n"
},
"$:/snippets/download-wiki-button": {
"title": "$:/snippets/download-wiki-button",
"text": "\\define lingo-base() $:/language/ControlPanel/Tools/Download/\n<$button class=\"tc-btn-big-green\">\n<$action-sendmessage $message=\"tm-download-file\" $param=\"$:/core/save/all\" filename=\"index.html\"/>\n<<lingo Full/Caption>> {{$:/core/images/save-button}}\n</$button>"
},
"$:/language": {
"title": "$:/language",
"text": "$:/languages/en-GB"
},
"$:/snippets/languageswitcher": {
"title": "$:/snippets/languageswitcher",
"text": "{{$:/language/ControlPanel/Basics/Language/Prompt}} <$select tiddler=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[description]]\">\n<option value=<<currentTiddler>>><$view field=\"description\"><$view field=\"name\"><$view field=\"title\"/></$view></$view></option>\n</$list>\n</$select>"
},
"$:/core/macros/CSS": {
"title": "$:/core/macros/CSS",
"tags": "$:/tags/Macro",
"text": "\\define colour(name)\n<$transclude tiddler={{$:/palette}} index=\"$name$\"><$transclude tiddler=\"$:/palettes/Vanilla\" index=\"$name$\"/></$transclude>\n\\end\n\n\\define color(name)\n<<colour $name$>>\n\\end\n\n\\define box-shadow(shadow)\n``\n -webkit-box-shadow: $shadow$;\n -moz-box-shadow: $shadow$;\n box-shadow: $shadow$;\n``\n\\end\n\n\\define filter(filter)\n``\n -webkit-filter: $filter$;\n -moz-filter: $filter$;\n filter: $filter$;\n``\n\\end\n\n\\define transition(transition)\n``\n -webkit-transition: $transition$;\n -moz-transition: $transition$;\n transition: $transition$;\n``\n\\end\n\n\\define transform-origin(origin)\n``\n -webkit-transform-origin: $origin$;\n -moz-transform-origin: $origin$;\n transform-origin: $origin$;\n``\n\\end\n\n\\define background-linear-gradient(gradient)\n``\nbackground-image: linear-gradient($gradient$);\nbackground-image: -o-linear-gradient($gradient$);\nbackground-image: -moz-linear-gradient($gradient$);\nbackground-image: -webkit-linear-gradient($gradient$);\nbackground-image: -ms-linear-gradient($gradient$);\n``\n\\end\n\n\\define datauri(title)\n<$macrocall $name=\"makedatauri\" type={{$title$!!type}} text={{$title$}}/>\n\\end\n\n\\define if-sidebar(text)\n<$reveal state=\"$:/state/sidebar\" type=\"match\" text=\"yes\" default=\"yes\">$text$</$reveal>\n\\end\n\n\\define if-no-sidebar(text)\n<$reveal state=\"$:/state/sidebar\" type=\"nomatch\" text=\"yes\" default=\"yes\">$text$</$reveal>\n\\end\n"
},
"$:/core/macros/export": {
"title": "$:/core/macros/export",
"tags": "$:/tags/Macro",
"text": "\\define exportButtonFilename(baseFilename)\n$baseFilename$$(extension)$\n\\end\n\n\\define exportButton(exportFilter:\"[!is[system]sort[title]]\",lingoBase,baseFilename:\"tiddlers\")\n<span class=\"tc-popup-keep\">\n<$button popup=<<qualify \"$:/state/popup/export\">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass=\"tc-selected\">\n<$list filter=\"[<tv-config-toolbar-icons>prefix[yes]]\">\n{{$:/core/images/export-button}}\n</$list>\n<$list filter=\"[<tv-config-toolbar-text>prefix[yes]]\">\n<span class=\"tc-btn-text\"><$text text={{$lingoBase$Caption}}/></span>\n</$list>\n</$button>\n</span>\n<$reveal state=<<qualify \"$:/state/popup/export\">> type=\"popup\" position=\"below\" animate=\"yes\">\n<div class=\"tc-drop-down\">\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Exporter]]\">\n<$set name=\"extension\" value={{!!extension}}>\n<$button class=\"tc-btn-invisible\">\n<$action-sendmessage $message=\"tm-download-file\" $param=<<currentTiddler>> exportFilter=\"\"\"$exportFilter$\"\"\" filename=<<exportButtonFilename \"\"\"$baseFilename$\"\"\">>/>\n<$action-deletetiddler $tiddler=<<qualify \"$:/state/popup/export\">>/>\n<$transclude field=\"description\"/>\n</$button>\n</$set>\n</$list>\n</div>\n</$reveal>\n\\end\n"
},
"$:/core/macros/lingo": {
"title": "$:/core/macros/lingo",
"tags": "$:/tags/Macro",
"text": "\\define lingo-base()\n$:/language/\n\\end\n\n\\define lingo(title)\n{{$(lingo-base)$$title$}}\n\\end\n"
},
"$:/core/macros/list": {
"title": "$:/core/macros/list",
"tags": "$:/tags/Macro",
"text": "\\define list-links(filter,type:\"ul\",subtype:\"li\",class:\"\")\n<$type$ class=\"$class$\">\n<$list filter=\"$filter$\">\n<$subtype$>\n<$link to={{!!title}}>\n<$transclude field=\"caption\">\n<$view field=\"title\"/>\n</$transclude>\n</$link>\n</$subtype$>\n</$list>\n</$type$>\n\\end\n"
},
"$:/core/macros/tabs": {
"title": "$:/core/macros/tabs",
"tags": "$:/tags/Macro",
"text": "\\define tabs(tabsList,default,state:\"$:/state/tab\",class,template)\n<div class=\"tc-tab-set $class$\">\n<div class=\"tc-tab-buttons $class$\">\n<$list filter=\"$tabsList$\" variable=\"currentTab\">\n<$button set=<<qualify \"$state$\">> setTo=<<currentTab>> default=\"$default$\" selectedClass=\"tc-tab-selected\">\n<$transclude tiddler=<<currentTab>> field=\"caption\">\n<$macrocall $name=\"currentTab\" $type=\"text/plain\" $output=\"text/plain\"/>\n</$transclude>\n</$button>\n</$list>\n</div><div class=\"tc-tab-divider $class$\"/><div class=\"tc-tab-content $class$\">\n<$list filter=\"$tabsList$\" variable=\"currentTab\">\n\n<$reveal type=\"match\" state=<<qualify \"$state$\">> text=<<currentTab>> default=\"$default$\">\n\n<$transclude tiddler=\"$template$\" mode=\"block\">\n\n<$transclude tiddler=<<currentTab>> mode=\"block\"/>\n\n</$transclude>\n\n</$reveal>\n\n</$list>\n</div>\n</div>\n\\end\n"
},
"$:/core/macros/tag": {
"title": "$:/core/macros/tag",
"tags": "$:/tags/Macro",
"text": "\\define tag(tag)\n{{$tag$||$:/core/ui/TagTemplate}}\n\\end\n"
},
"$:/core/macros/timeline": {
"created": "20141212105914482",
"modified": "20141212110330815",
"tags": "$:/tags/Macro",
"title": "$:/core/macros/timeline",
"type": "text/vnd.tiddlywiki",
"text": "\\define timeline-title()\n<!-- Override this macro with a global macro \n of the same name if you need to change \n how titles are displayed on the timeline \n -->\n<$view field=\"title\"/>\n\\end\n\\define timeline(limit:\"100\",format:\"DDth MMM YYYY\",subfilter:\"\",dateField:\"modified\")\n<div class=\"tc-timeline\">\n<$list filter=\"[!is[system]$subfilter$has[$dateField$]!sort[$dateField$]limit[$limit$]eachday[$dateField$]]\">\n<div class=\"tc-menu-list-item\">\n<$view field=\"$dateField$\" format=\"date\" template=\"$format$\"/>\n<$list filter=\"[sameday{!!$dateField$}!is[system]$subfilter$!sort[$dateField$]]\">\n<div class=\"tc-menu-list-subitem\">\n<$link to={{!!title}}>\n<<timeline-title>>\n</$link>\n</div>\n</$list>\n</div>\n</$list>\n</div>\n\\end\n"
},
"$:/core/macros/toc": {
"title": "$:/core/macros/toc",
"tags": "$:/tags/Macro",
"text": "\\define toc-caption()\n<$set name=\"tv-wikilinks\" value=\"no\">\n<$transclude field=\"caption\">\n<$view field=\"title\"/>\n</$transclude>\n</$set>\n\\end\n\n\\define toc-body(rootTag,tag,sort:\"\",itemClassFilter)\n<ol class=\"tc-toc\">\n<$list filter=\"\"\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]\"\"\">\n<$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" value=\"toc-item-selected\" emptyValue=\"toc-item\">\n<li class=<<toc-item-class>>>\n<$list filter=\"[all[current]toc-link[no]]\" emptyMessage=\"<$link><$view field='caption'><$view field='title'/></$view></$link>\">\n<<toc-caption>>\n</$list>\n<$list filter=\"\"\"[all[current]] -[[$rootTag$]]\"\"\">\n<$macrocall $name=\"toc-body\" rootTag=\"\"\"$rootTag$\"\"\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\"/>\n</$list>\n</li>\n</$set>\n</$list>\n</ol>\n\\end\n\n\\define toc(tag,sort:\"\",itemClassFilter)\n<<toc-body rootTag:\"\"\"$tag$\"\"\" tag:\"\"\"$tag$\"\"\" sort:\"\"\"$sort$\"\"\" itemClassFilter:\"\"\"itemClassFilter\"\"\">>\n\\end\n\n\\define toc-linked-expandable-body(tag,sort:\"\",itemClassFilter)\n<$set name=\"toc-state\" value=<<qualify \"$:/state/toc/$tag$-$(currentTiddler)$\">>>\n<$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" value=\"toc-item-selected\" emptyValue=\"toc-item\">\n<li class=<<toc-item-class>>>\n<$link>\n<$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n<<toc-caption>>\n</$link>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$macrocall $name=\"toc-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\"/>\n</$reveal>\n</li>\n</$set>\n</$set>\n\\end\n\n\\define toc-unlinked-expandable-body(tag,sort:\"\",itemClassFilter)\n<$set name=\"toc-state\" value=<<qualify \"$:/state/toc/$tag$-$(currentTiddler)$\">>>\n<$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" value=\"toc-item-selected\" emptyValue=\"toc-item\">\n<li class=<<toc-item-class>>>\n<$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n<<toc-caption>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n<<toc-caption>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$macrocall $name=\"toc-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\"/>\n</$reveal>\n</li>\n</$set>\n</$set>\n\\end\n\n\\define toc-expandable(tag,sort:\"\",itemClassFilter)\n<ol class=\"tc-toc toc-expandable\">\n<$list filter=\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]\">\n<$list filter=\"[all[current]toc-link[no]]\" emptyMessage=\"<<toc-linked-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>\">\n<<toc-unlinked-expandable-body tag:\"\"\"$tag$\"\"\" sort:\"\"\"$sort$\"\"\" itemClassFilter:\"\"\"itemClassFilter\"\"\">>\n</$list>\n</$list>\n</ol>\n\\end\n\n\\define toc-linked-selective-expandable-body(tag,sort:\"\",itemClassFilter)\n<$set name=\"toc-state\" value=<<qualify \"$:/state/toc/$tag$-$(currentTiddler)$\">>>\n<$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" value=\"toc-item-selected\" emptyValue=\"toc-item\">\n<li class=<<toc-item-class>>>\n<$link>\n<$list filter=\"[all[current]tagging[]limit[1]]\" variable=\"ignore\" emptyMessage=\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button>\">\n<$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n</$button>\n</$reveal>\n</$list>\n<<toc-caption>>\n</$link>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$macrocall $name=\"toc-selective-expandable\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\"/>\n</$reveal>\n</li>\n</$set>\n</$set>\n\\end\n\n\\define toc-unlinked-selective-expandable-body(tag,sort:\"\",itemClassFilter)\n<$set name=\"toc-state\" value=<<qualify \"$:/state/toc/$tag$-$(currentTiddler)$\">>>\n<$set name=\"toc-item-class\" filter=\"\"\"$itemClassFilter$\"\"\" value=\"toc-item-selected\" emptyValue=\"toc-item\">\n<li class=<<toc-item-class>>>\n<$list filter=\"[all[current]tagging[]limit[1]]\" variable=\"ignore\" emptyMessage=\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}</$button> <$view field='caption'><$view field='title'/></$view>\">\n<$reveal type=\"nomatch\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"open\" class=\"tc-btn-invisible\">\n{{$:/core/images/right-arrow}}\n<<toc-caption>>\n</$button>\n</$reveal>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$button set=<<toc-state>> setTo=\"close\" class=\"tc-btn-invisible\">\n{{$:/core/images/down-arrow}}\n<<toc-caption>>\n</$button>\n</$reveal>\n</$list>\n<$reveal type=\"match\" state=<<toc-state>> text=\"open\">\n<$macrocall $name=\"\"\"toc-selective-expandable\"\"\" tag=<<currentTiddler>> sort=\"\"\"$sort$\"\"\" itemClassFilter=\"\"\"$itemClassFilter$\"\"\"/>\n</$reveal>\n</li>\n</$set>\n</$set>\n\\end\n\n\\define toc-selective-expandable(tag,sort:\"\",itemClassFilter)\n<ol class=\"tc-toc toc-selective-expandable\">\n<$list filter=\"[all[shadows+tiddlers]tag[$tag$]!has[draft.of]$sort$]\">\n<$list filter=\"[all[current]toc-link[no]]\" variable=\"ignore\" emptyMessage=\"<<toc-linked-selective-expandable-body tag:'$tag$' sort:'$sort$' itemClassFilter:'$itemClassFilter$'>>\">\n<<toc-unlinked-selective-expandable-body tag:\"\"\"$tag$\"\"\" sort:\"\"\"$sort$\"\"\" itemClassFilter:\"\"\"$itemClassFilter$\"\"\">>\n</$list>\n</$list>\n</ol>\n\\end\n\n\\define toc-tabbed-selected-item-filter(selectedTiddler)\n[all[current]field:title{$selectedTiddler$}]\n\\end\n\n\\define toc-tabbed-external-nav(tag,sort:\"\",selectedTiddler:\"$:/temp/toc/selectedTiddler\",unselectedText,missingText,template:\"\")\n<$tiddler tiddler={{$selectedTiddler$}}>\n<div class=\"tc-tabbed-table-of-contents\">\n<$linkcatcher to=\"$selectedTiddler$\">\n<div class=\"tc-table-of-contents\">\n<$macrocall $name=\"toc-selective-expandable\" tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" itemClassFilter=<<toc-tabbed-selected-item-filter selectedTiddler:\"\"\"$selectedTiddler$\"\"\">>/>\n</div>\n</$linkcatcher>\n<div class=\"tc-tabbed-table-of-contents-content\">\n<$reveal state=\"\"\"$selectedTiddler$\"\"\" type=\"nomatch\" text=\"\">\n<$transclude mode=\"block\" tiddler=\"$template$\">\n<h1><<toc-caption>></h1>\n<$transclude mode=\"block\">$missingText$</$transclude>\n</$transclude>\n</$reveal>\n<$reveal state=\"\"\"$selectedTiddler$\"\"\" type=\"match\" text=\"\">\n$unselectedText$\n</$reveal>\n</div>\n</div>\n</$tiddler>\n\\end\n\n\\define toc-tabbed-internal-nav(tag,sort:\"\",selectedTiddler:\"$:/temp/toc/selectedTiddler\",unselectedText,missingText,template:\"\")\n<$linkcatcher to=\"\"\"$selectedTiddler$\"\"\">\n<$macrocall $name=\"toc-tabbed-external-nav\" tag=\"\"\"$tag$\"\"\" sort=\"\"\"$sort$\"\"\" selectedTiddler=\"\"\"$selectedTiddler$\"\"\" unselectedText=\"\"\"$unselectedText$\"\"\" missingText=\"\"\"$missingText$\"\"\" template=\"\"\"$template$\"\"\"/>\n</$linkcatcher>\n\\end\n\n"
},
"$:/snippets/minilanguageswitcher": {
"title": "$:/snippets/minilanguageswitcher",
"text": "<$select tiddler=\"$:/language\">\n<$list filter=\"[[$:/languages/en-GB]] [plugin-type[language]sort[title]]\">\n<option value=<<currentTiddler>>><$view field=\"description\"><$view field=\"name\"><$view field=\"title\"/></$view></$view></option>\n</$list>\n</$select>"
},
"$:/snippets/minithemeswitcher": {
"title": "$:/snippets/minithemeswitcher",
"text": "\\define lingo-base() $:/language/ControlPanel/Theme/\n<<lingo Prompt>> <$select tiddler=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\">\n<option value=<<currentTiddler>>><$view field=\"name\"><$view field=\"title\"/></$view></option>\n</$list>\n</$select>"
},
"$:/snippets/modules": {
"title": "$:/snippets/modules",
"text": "\\define describeModuleType(type)\n{{$:/language/Docs/ModuleTypes/$type$}}\n\\end\n<$list filter=\"[moduletypes[]]\">\n\n!! <$macrocall $name=\"currentTiddler\" $type=\"text/plain\" $output=\"text/plain\"/>\n\n<$macrocall $name=\"describeModuleType\" type=<<currentTiddler>>/>\n\n<ul><$list filter=\"[all[current]modules[]]\"><li><$link><<currentTiddler>></$link>\n</li>\n</$list>\n</ul>\n</$list>\n"
},
"$:/palette": {
"title": "$:/palette",
"text": "$:/palettes/Vanilla"
},
"$:/snippets/paletteeditor": {
"title": "$:/snippets/paletteeditor",
"text": "\\define lingo-base() $:/language/ControlPanel/Palette/Editor/\n\\define describePaletteColour(colour)\n{{$:/language/Docs/PaletteColours/$colour$}}\n\\end\n<$set name=\"currentTiddler\" value={{$:/palette}}>\n\n<<lingo Prompt>> <$link to={{$:/palette}}><$macrocall $name=\"currentTiddler\" $output=\"text/plain\"/></$link>\n\n<$list filter=\"[all[current]is[shadow]is[tiddler]]\" variable=\"listItem\">\n<<lingo Prompt/Modified>>\n<$button message=\"tm-delete-tiddler\" param={{$:/palette}}><<lingo Reset/Caption>></$button>\n</$list>\n\n<$list filter=\"[all[current]is[shadow]!is[tiddler]]\" variable=\"listItem\">\n<<lingo Clone/Prompt>>\n</$list>\n\n<$button message=\"tm-new-tiddler\" param={{$:/palette}}><<lingo Clone/Caption>></$button>\n\n<table>\n<tbody>\n<$list filter=\"[all[current]indexes[]]\" variable=\"colourName\">\n<tr>\n<td>\n''<$macrocall $name=\"describePaletteColour\" colour=<<colourName>>/>''<br/>\n<$macrocall $name=\"colourName\" $output=\"text/plain\"/>\n</td>\n<td>\n<$edit-text index=<<colourName>> tag=\"input\"/>\n<br>\n<$edit-text index=<<colourName>> type=\"color\" tag=\"input\"/>\n</td>\n</tr>\n</$list>\n</tbody>\n</table>\n</$set>\n"
},
"$:/snippets/palettepreview": {
"title": "$:/snippets/palettepreview",
"text": "<$set name=\"currentTiddler\" value={{$:/palette}}>\n<$transclude tiddler=\"$:/snippets/currpalettepreview\"/>\n</$set>\n"
},
"$:/snippets/paletteswitcher": {
"title": "$:/snippets/paletteswitcher",
"text": "\\define lingo-base() $:/language/ControlPanel/Palette/\n<<lingo Prompt>> <$view tiddler={{$:/palette}} field=\"name\"/>\n\n<$linkcatcher to=\"$:/palette\">\n<div class=\"tc-chooser\"><$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Palette]sort[description]]\"><div class=\"tc-chooser-item\"><$link to={{!!title}}><div><$reveal state=\"$:/palette\" type=\"match\" text={{!!title}}>•</$reveal><$reveal state=\"$:/palette\" type=\"nomatch\" text={{!!title}}> </$reveal> ''<$view field=\"name\" format=\"text\"/>'' - <$view field=\"description\" format=\"text\"/></div><$transclude tiddler=\"$:/snippets/currpalettepreview\"/></$link></div>\n</$list>\n</div>\n</$linkcatcher>"
},
"$:/temp/search": {
"title": "$:/temp/search",
"text": ""
},
"$:/tags/AdvancedSearch": {
"title": "$:/tags/AdvancedSearch",
"list": "[[$:/core/ui/AdvancedSearch/Standard]] [[$:/core/ui/AdvancedSearch/System]] [[$:/core/ui/AdvancedSearch/Shadows]] [[$:/core/ui/AdvancedSearch/Filter]]"
},
"$:/tags/ControlPanel": {
"title": "$:/tags/ControlPanel",
"list": "$:/core/ui/ControlPanel/Info $:/core/ui/ControlPanel/Appearance $:/core/ui/ControlPanel/Settings $:/core/ui/ControlPanel/Saving $:/core/ui/ControlPanel/Plugins $:/core/ui/ControlPanel/Tools $:/core/ui/ControlPanel/Internals"
},
"$:/tags/ControlPanel/Info": {
"title": "$:/tags/ControlPanel/Info",
"list": "$:/core/ui/ControlPanel/Basics $:/core/ui/ControlPanel/Advanced"
},
"$:/tags/EditTemplate": {
"title": "$:/tags/EditTemplate",
"list": "[[$:/core/ui/EditTemplate/controls]] [[$:/core/ui/EditTemplate/title]] [[$:/core/ui/EditTemplate/tags]] [[$:/core/ui/EditTemplate/shadow]] [[$:/core/ui/ViewTemplate/classic]] [[$:/core/ui/EditTemplate/body]] [[$:/core/ui/EditTemplate/type]] [[$:/core/ui/EditTemplate/fields]]"
},
"$:/tags/EditToolbar": {
"title": "$:/tags/EditToolbar",
"list": "[[$:/core/ui/Buttons/delete]] [[$:/core/ui/Buttons/cancel]] [[$:/core/ui/Buttons/save]]"
},
"$:/tags/MoreSideBar": {
"title": "$:/tags/MoreSideBar",
"list": "[[$:/core/ui/MoreSideBar/All]] [[$:/core/ui/MoreSideBar/Recent]] [[$:/core/ui/MoreSideBar/Tags]] [[$:/core/ui/MoreSideBar/Missing]] [[$:/core/ui/MoreSideBar/Drafts]] [[$:/core/ui/MoreSideBar/Orphans]] [[$:/core/ui/MoreSideBar/Types]] [[$:/core/ui/MoreSideBar/System]] [[$:/core/ui/MoreSideBar/Shadows]]",
"text": ""
},
"$:/tags/PageControls": {
"title": "$:/tags/PageControls",
"list": "[[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]"
},
"$:/tags/PageTemplate": {
"title": "$:/tags/PageTemplate",
"list": "[[$:/core/ui/PageTemplate/sidebar]] [[$:/core/ui/PageTemplate/story]] [[$:/core/ui/PageTemplate/alerts]] [[$:/core/ui/PageTemplate/topleftbar]] [[$:/core/ui/PageTemplate/toprightbar]]",
"text": ""
},
"$:/tags/SideBar": {
"title": "$:/tags/SideBar",
"list": "[[$:/core/ui/SideBar/Open]] [[$:/core/ui/SideBar/Recent]] [[$:/core/ui/SideBar/Tools]] [[$:/core/ui/SideBar/More]]",
"text": ""
},
"$:/tags/TiddlerInfo": {
"title": "$:/tags/TiddlerInfo",
"list": "[[$:/core/ui/TiddlerInfo/Tools]] [[$:/core/ui/TiddlerInfo/References]] [[$:/core/ui/TiddlerInfo/Tagging]] [[$:/core/ui/TiddlerInfo/List]] [[$:/core/ui/TiddlerInfo/Listed]] [[$:/core/ui/TiddlerInfo/Fields]]",
"text": ""
},
"$:/tags/TiddlerInfo/Advanced": {
"title": "$:/tags/TiddlerInfo/Advanced",
"list": "[[$:/core/ui/TiddlerInfo/Advanced/ShadowInfo]] [[$:/core/ui/TiddlerInfo/Advanced/PluginInfo]]"
},
"$:/tags/ViewTemplate": {
"title": "$:/tags/ViewTemplate",
"list": "[[$:/core/ui/ViewTemplate/title]] [[$:/core/ui/ViewTemplate/subtitle]] [[$:/core/ui/ViewTemplate/tags]] [[$:/core/ui/ViewTemplate/classic]] [[$:/core/ui/ViewTemplate/body]]"
},
"$:/tags/ViewToolbar": {
"title": "$:/tags/ViewToolbar",
"list": "[[$:/core/ui/Buttons/more-tiddler-actions]] [[$:/core/ui/Buttons/info]] [[$:/core/ui/Buttons/new-here]] [[$:/core/ui/Buttons/new-journal-here]] [[$:/core/ui/Buttons/clone]] [[$:/core/ui/Buttons/export-tiddler]] [[$:/core/ui/Buttons/edit]] [[$:/core/ui/Buttons/permalink]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/close-others]] [[$:/core/ui/Buttons/close]]"
},
"$:/snippets/themeswitcher": {
"title": "$:/snippets/themeswitcher",
"text": "\\define lingo-base() $:/language/ControlPanel/Theme/\n<<lingo Prompt>> <$view tiddler={{$:/theme}} field=\"name\"/>\n\n<$linkcatcher to=\"$:/theme\">\n<$list filter=\"[plugin-type[theme]sort[title]]\"><div><$reveal state=\"$:/theme\" type=\"match\" text={{!!title}}>•</$reveal><$reveal state=\"$:/theme\" type=\"nomatch\" text={{!!title}}> </$reveal> <$link to={{!!title}}>''<$view field=\"name\" format=\"text\"/>'' <$view field=\"description\" format=\"text\"/></$link></div>\n</$list>\n</$linkcatcher>"
},
"$:/core/wiki/title": {
"title": "$:/core/wiki/title",
"type": "text/vnd.tiddlywiki",
"text": "{{$:/SiteTitle}} --- {{$:/SiteSubtitle}}"
},
"$:/view": {
"title": "$:/view",
"text": "classic"
},
"$:/snippets/viewswitcher": {
"title": "$:/snippets/viewswitcher",
"text": "\\define lingo-base() $:/language/ControlPanel/StoryView/\n<<lingo Prompt>> <$select tiddler=\"$:/view\">\n<$list filter=\"[storyviews[]]\">\n<option><$view field=\"title\"/></option>\n</$list>\n</$select>"
}
}
}
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAC4a4FQuGt40KhbjRC4a47wuGuO8LhrjRC4a4jAuGuBUAAAAA
AAAAAAAAAAAAAAAAAAAAAEOSrgAAAAAAC4a4jguGuP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/wuGuP8L
hrj/C4a4jgAAAABIjKEAAAAAAAAAAAAAAAAADYa3uguGuP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/giE
t/8DgrX/BIK2/wqFt/8Nhre5AAAAAAAAAAAAAAAADYa3kAuGuP8Lhrj/C4a4/wuGuP8Lhrj/C4a4
/yyWweSu1ubl2Ovz6srl7+6SyN/nEom69QuGuI4AAAAAC4a3FQqFuP8Lhrj/C4a4/wuGuP8Lhrj/
C4a4/wB/tP/////s/v7+/////////////////7vd694IhLf/C4a4FQyGt44Lhrj/C4a4/wuGuP8L
hrj/C4a4/wuGuP8Lhrj/I5G+75LJ3+nD4e3au93r5H6+2eILhbf4C4a4/guGuIwKhbjRC4a4/wuG
uP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/wuGuP4Khbf/B4S2/waEtv8Lhrj/C4a4/wuGuP8LhrjRC4a3
7wuGuP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/gaEtv8Egrb/C4a4/wuGuP8Lhrj/C4a4/wuGuP8Lhrj/
C4a47wyGt/ALhrj/C4a4/wuGuP8Lhrj/C4a4/hOMvfjG7PvL2Oz05jucxOsKhbj/C4a4/wuGuP8L
hrj/C4a4/wuGuO8KhbjQC4a4/wuGuP8Lhrj/C4a4/wqGuf8FOE3MAAAA/8fHx97////wAH+0+AmE
t/9DqNDagMHc9gOCtvcKhbjRDYe4kQuGuP8Lhrj/C4a4/wuGuP8Lh7n/BCs7zQAAAP+0tLTZ////
+QB+s+0LjMHwAAAA6K6trd2KxNviDYa2kQ+GthUKhbj/C4a4/wuGuP8Lhrj/C4a4/iuax+nz8O/N
/////3W61uIJhbf/CIe7/GFiYsL68/DsXK7P7guGtxYAAAAADoa2lgqFuP8Lhrj/C4a4/wuGuP8L
hrj/AIC0+QB+s+wJhbf/C4a4/wuGuP4KhbfyGIy75QeDtZMAAAAAAAAAAAAAAAAPhrbACoW4/wuG
uP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/wuGuP8Lhrj/Coa4/w6Gtr8AAAAAAAAAAAAAAAAvjrEAAAAA
AA6GtpYLhrj/C4a4/wuGuP8Lhrj/C4a4/wuGuP8Lhrj/C4a4/wuGt5QAAAAAMImqAAAAAAAAAAAA
AAAAAAAAAAAAAAAAC4a4FQuGt40KhbjRC4a37wuGt+8KhrjRC4a4jAuGuBUAAAAAAAAAAAAAAAAA
AAAA+B8AAOAHAADAAwAAgAEAAIABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAAgAEAAMAD
AADgBwAA+B8AAA==
{
"tiddlers": {
"$:/plugins/rboue/SocialCalc/Languages/en-GB": {
"type": "application/json",
"title": "$:/plugins/rboue/SocialCalc/Languages/en-GB",
"text": "{\n\"\":\"Translation process :\",\n\"\":\" . Translate all messages.\",\n\"\":\" . Add tiddler to your TiddlyWiki with the title :\",\n\"\":\" $:/plugins/<not sure>/SocialCalc/Languages/<your language>\",\n\"\":\" <your language> must match with the $:/language tiddler.\",\n\"\":\" Exemple : fr-FR for French.\",\n\n\"\":\"Common error messages\",\n \"s_BrowserNotSupported\": \"Browser not supported.\",\n \"s_InternalError\": \"Internal SocialCalc error (probably an internal bug): \",\n\n\"\":\"Errors thrown on unexpected value in save file\",\n \"s_pssUnknownColType\": \"Unknown col type item\",\n \"s_pssUnknownRowType\": \"Unknown row type item\",\n \"s_pssUnknownLineType\": \"Unknown line type\",\n\n\"\":\"Error thrown on unexpected cell type\",\n \"s_cfspUnknownCellType\": \"Unknown cell type item\",\n\n\"\":\"ExecuteSheetCommand\",\n \"s_escUnknownSheetCmd\": \"Unknown sheet command: \",\n \"s_escUnknownSetCoordCmd\": \"Unknown set coord command: \",\n \"s_escUnknownCmd\": \"Unknown command: \",\n\n\"\":\"SocialCalc.CheckAndCalcCell\",\n \"s_caccCircRef\": \"Circular reference to \",\n\n\"\":\"SocialCalc.RenderContext\",\n \"s_rcMissingSheet\": \"Render Context must have a sheet object\",\n\n\"\":\"SocialCalc.EditorGetStatuslineString -- strings shown on status line\",\n \"s_statusline_executing\": \"Executing...\",\n \"s_statusline_displaying\": \"Displaying...\",\n \"s_statusline_ordering\": \"Ordering...\",\n \"s_statusline_calculating\": \"Calculating...\",\n \"s_statusline_calculatingls\": \"Calculating... Loading Sheet...\",\n \"s_statusline_doingserverfunc\": \"doing server function \",\n \"s_statusline_incell\": \" in cell \",\n \"s_statusline_calcstart\": \"Calculation start...\",\n \"s_statusline_sum\": \"SUM\",\n \"s_statusline_recalcneeded\": \"<span style=\\\"color:#999;\\\">(Recalc needed)</span>\",\n \"s_statusline_circref\": \"<span style=\\\"color:red;\\\">Circular reference: \",\n\n\"\":\"SocialCalc.InputBoxDisplayCellContents\",\n \"s_inputboxdisplaymultilinetext\": \"[Multi-line text: Click icon on right to edit]\",\n \"ietUnknownFunction\": \"Unknown function \", \"\":\"displayed when typing \\\"=unknown(\",\n \"s_CHfillAllTooltip\": \"Fill Contents and Formats Down/Right\", \"\":\"tooltip for fill all handle\",\n \"s_CHfillContentsTooltip\": \"Fill Contents Only Down/Right\", \"\":\"tooltip for fill formulas handle\",\n \"s_CHmovePasteAllTooltip\": \"Move Contents and Formats\", \"\":\"etc.\",\n \"s_CHmovePasteContentsTooltip\": \"Move Contents Only\",\n \"s_CHmoveInsertAllTooltip\": \"Slide Contents and Formats within Row/Col\",\n \"s_CHmoveInsertContentsTooltip\": \"Slide Contents within Row/Col\",\n \"s_CHindicatorOperationLookup\": {\n \"Fill\": \"Fill\", \"FillC\": \"Fill Contents\",\n \"Move\": \"Move\", \"MoveI\": \"Slide\", \n \"MoveC\": \"Move Contents\", \"MoveIC\": \"Slide Contents\"\n },\n \"s_CHindicatorDirectionLookup\": {\n \"Down\": \" Down\", \"Right\": \" Right\",\n \"Horizontal\": \" Horizontal\", \"Vertical\": \" Vertical\"\n },\n\n\"\":\"Constants for default Format tab (settings)\",\n\"\":\"\",\n\"\":\"*** EVEN THOUGH THESE DON'T START WITH s_: ***\",\n\"\":\"\",\n\"\":\"These should be carefully checked for localization. Make sure you understand what they do and how they work!\",\n\"\":\"The first part of \\\"first:second|first:second|...\\\" is what is displayed and the second is the value to be used.\",\n\"\":\"The value is normally not translated -- only the displayed part. The [cancel], [break], etc., are not translated --\",\n\"\":\"they are commands to SocialCalc.SettingsControls.PopupListInitialize\",\n\n \"SCFormatNumberFormats\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Auto w/ commas!:[,]General|[break]:|00:00|000:000|0000:0000|00000:00000|[break]:|%loc!Formula!:formula|%loc!Hidden!:hidden|[newcol]:1234:0|1,234:#,##0|1,234.5:#,##0.0|1,234.56:#,##0.00|1,234.567:#,##0.000|1,234.5678:#,##0.0000|[break]:|1,234%:#,##0%|1,234.5%:#,##0.0%|1,234.56%:#,##0.00%|[newcol]:|$1,234:$#,##0|$1,234.5:$#,##0.0|$1,234.56:$#,##0.00|[break]:|(1,234):#,##0_);(#,##0)|(1,234.5):#,##0.0_);(#,##0.0)|(1,234.56):#,##0.00_);(#,##0.00)|[break]:|($1,234):#,##0_);($#,##0)|($1,234.5):$#,##0.0_);($#,##0.0)|($1,234.56):$#,##0.00_);($#,##0.00)|[newcol]:|1/4/06:m/d/yy|01/04/2006:mm/dd/yyyy|2006-01-04:yyyy-mm-dd|4-Jan-06:d-mmm-yy|04-Jan-2006:dd-mmm-yyyy|January 4, 2006:mmmm d, yyyy|[break]:|1\\\\c23:h:mm|1\\\\c23 PM:h:mm AM/PM|1\\\\c23\\\\c45:h:mm:ss|01\\\\c23\\\\c45:hh:mm:ss|26\\\\c23 (h\\\\cm):[hh]:mm|69\\\\c45 (m\\\\cs):[mm]:ss|69 (s):[ss]|[newcol]:|2006-01-04 01\\\\c23\\\\c45:yyyy-mm-dd hh:mm:ss|January 4, 2006:mmmm d, yyyy hh:mm:ss|Wed:ddd|Wednesday:dddd|\",\n \"SCFormatTextFormats\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Plain Text!:text-plain|HTML:text-html|%loc!Wikitext!:text-wiki|%loc!Link!:text-link|%loc!Formula!:formula|%loc!Hidden!:hidden|\",\n \"SCFormatPadsizes\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!No padding!:0px|[newcol]:|1 pixel:1px|2 pixels:2px|3 pixels:3px|4 pixels:4px|5 pixels:5px|6 pixels:6px|7 pixels:7px|8 pixels:8px|[newcol]:|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|16 pixels:16px|18 pixels:18px|[newcol]:|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\n \"SCFormatFontsizes\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|X-Small:x-small|Small:small|Medium:medium|Large:large|X-Large:x-large|[newcol]:|6pt:6pt|7pt:7pt|8pt:8pt|9pt:9pt|10pt:10pt|11pt:11pt|12pt:12pt|14pt:14pt|16pt:16pt|[newcol]:|18pt:18pt|20pt:20pt|22pt:22pt|24pt:24pt|28pt:28pt|36pt:36pt|48pt:48pt|72pt:72pt|[newcol]:|8 pixels:8px|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|[newcol]:|16 pixels:16px|18 pixels:18px|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\n \"SCFormatFontfamilies\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|Verdana:Verdana,Arial,Helvetica,sans-serif|Arial:arial,helvetica,sans-serif|Courier:'Courier New',Courier,monospace|\",\n \"SCFormatFontlook\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Normal!:normal normal|%loc!Bold!:normal bold|%loc!Italic!:italic normal|%loc!Bold Italic!:italic bold\",\n \"SCFormatTextAlignhoriz\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",\n \"SCFormatNumberAlignhoriz\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",\n \"SCFormatAlignVertical\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Top!:top|%loc!Middle!:middle|%loc!Bottom!:bottom|\",\n \"SCFormatColwidth\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|20 pixels:20|40:40|60:60|80:80|100:100|120:120|140:140|160:160|[newcol]:|180 pixels:180|200:200|220:220|240:240|260:260|280:280|300:300|\",\n \"SCFormatRecalc\": \"[cancel]:|[break]:|%loc!Auto!:|%loc!Manual!:off|\",\n \"SCFormatUserMaxCol\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",\n \"SCFormatUserMaxRow\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",\n\n\"\":\"SocialCalc.SettingsControls.PopupListInitialize\",\n \"s_PopupListCancel\": \"[Cancel]\",\n \"s_PopupListCustom\": \"Custom\",\n\n\"\":\"***\",\n\"\":\"\",\n\"\":\"s_loc_ constants accessed by SocialCalc.LocalizeString and SocialCalc.LocalizeSubstrings\",\n\"\":\"\",\n\"\":\"Used extensively by socialcalcspreadsheetcontrol.js\",\n\"\":\"\",\n\"\":\"***\",\n \"s_loc_align_center\": \"Align Center\",\n \"s_loc_align_left\": \"Align Left\",\n \"s_loc_align_right\": \"Align Right\",\n \"s_loc_alignment\": \"Alignment\",\n \"s_loc_audit\": \"Audit\",\n \"s_loc_audit_trail_this_session\": \"Audit Trail This Session\",\n \"s_loc_auto\": \"Auto\",\n \"s_loc_auto_sum\": \"Auto Sum\",\n \"s_loc_auto_wX_commas\": \"Auto w/ commas\",\n \"s_loc_automatic\": \"Automatic\",\n \"s_loc_background\": \"Background\",\n \"s_loc_bold\": \"Bold\",\n \"s_loc_bold_XampX_italics\": \"Bold & Italics\",\n \"s_loc_bold_italic\": \"Bold Italic\",\n \"s_loc_borders\": \"Borders\",\n \"s_loc_borders_off\": \"Borders Off\",\n \"s_loc_borders_on\": \"Borders On\",\n \"s_loc_bottom\": \"Bottom\",\n \"s_loc_bottom_border\": \"Bottom Border\",\n \"s_loc_cell_settings\": \"CELL SETTINGS\",\n \"s_loc_csv_format\": \"CSV format\",\n \"s_loc_cancel\": \"Cancel\",\n \"s_loc_category\": \"Category\",\n \"s_loc_center\": \"Center\",\n \"s_loc_clear\": \"Clear\",\n \"s_loc_clear_socialcalc_clipboard\": \"Clear SocialCalc Clipboard\",\n \"s_loc_clipboard\": \"Clipboard\",\n \"s_loc_color\": \"Color\",\n \"s_loc_column_\": \"Column \",\n \"s_loc_comment\": \"Comment\",\n \"s_loc_copy\": \"Copy\",\n \"s_loc_custom\": \"Custom\",\n \"s_loc_cut\": \"Cut\",\n \"s_loc_default\": \"Default\",\n \"s_loc_default_alignment\": \"Default Alignment\",\n \"s_loc_default_column_width\": \"Default Column Width\",\n \"s_loc_default_font\": \"Default Font\",\n \"s_loc_default_format\": \"Default Format\",\n \"s_loc_default_padding\": \"Default Padding\",\n \"s_loc_delete\": \"Delete\",\n \"s_loc_delete_column\": \"Delete Column\",\n \"s_loc_delete_contents\": \"Delete Contents\",\n \"s_loc_delete_row\": \"Delete Row\",\n \"s_loc_description\": \"Description\",\n \"s_loc_display_clipboard_in\": \"Display Clipboard in\",\n \"s_loc_down\": \"Down\",\n \"s_loc_edit\": \"Edit\",\n \"s_loc_existing_names\": \"Existing Names\",\n \"s_loc_family\": \"Family\",\n \"s_loc_fill_down\": \"Fill Down\",\n \"s_loc_fill_right\": \"Fill Right\",\n \"s_loc_font\": \"Font\",\n \"s_loc_format\": \"Format\",\n \"s_loc_formula\": \"Formula\",\n \"s_loc_function_list\": \"Function List\",\n \"s_loc_functions\": \"Functions\",\n \"s_loc_grid\": \"Grid\",\n \"s_loc_hidden\": \"Hidden\",\n \"s_loc_hide_column\": \"Hide Column\",\n \"s_loc_hide_row\": \"Hide Row\",\n \"s_loc_horizontal\": \"Horizontal\",\n \"s_loc_insert_column\": \"Insert Column\",\n \"s_loc_insert_row\": \"Insert Row\",\n \"s_loc_italic\": \"Italic\",\n \"s_loc_last_sort\": \"Last Sort\",\n \"s_loc_left\": \"Left\",\n \"s_loc_left_border\": \"Left Border\",\n \"s_loc_link\": \"Link\",\n \"s_loc_link_input_box\": \"Link Input Box\",\n \"s_loc_list\": \"List\",\n \"s_loc_load_socialcalc_clipboard_with_this\": \"Load SocialCalc Clipboard With This\",\n \"s_loc_lock\": \"Lock\",\n \"s_loc_major_sort\": \"Major Sort\",\n \"s_loc_manual\": \"Manual\",\n \"s_loc_merge_cells\": \"Merge Cells\",\n \"s_loc_middle\": \"Middle\",\n \"s_loc_minor_sort\": \"Minor Sort\",\n \"s_loc_move_insert\": \"Move Insert\",\n \"s_loc_move_paste\": \"Move Paste\",\n \"s_loc_multiXline_input_box\": \"Multi-line Input Box\",\n \"s_loc_name\": \"Name\",\n \"s_loc_names\": \"Names\",\n \"s_loc_no_padding\": \"No padding\",\n \"s_loc_normal\": \"Normal\",\n \"s_loc_number\": \"Number\",\n \"s_loc_number_horizontal\": \"Number Horizontal\",\n \"s_loc_ok\": \"OK\",\n \"s_loc_padding\": \"Padding\",\n \"s_loc_page_name\": \"Page Name\",\n \"s_loc_paste\": \"Paste\",\n \"s_loc_paste_formats\": \"Paste Formats\",\n \"s_loc_plain_text\": \"Plain Text\",\n \"s_loc_recalc\": \"Recalc\",\n \"s_loc_recalculation\": \"Recalculation\",\n \"s_loc_redo\": \"Redo\",\n \"s_loc_right\": \"Right\",\n \"s_loc_right_border\": \"Right Border\",\n \"s_loc_sheet_settings\": \"SHEET SETTINGS\",\n \"s_loc_save\": \"Save\",\n \"s_loc_save_to\": \"Save to\",\n \"s_loc_set_cell_contents\": \"Set Cell Contents\",\n \"s_loc_set_cells_to_sort\": \"Set Cells To Sort\",\n \"s_loc_set_value_to\": \"Set Value To\",\n \"s_loc_set_to_link_format\": \"Set to Link format\",\n \"s_loc_setXclear_move_from\": \"Set/Clear Move From\",\n \"s_loc_show_cell_settings\": \"Show Cell Settings\",\n \"s_loc_show_sheet_settings\": \"Show Sheet Settings\",\n \"s_loc_show_in_new_browser_window\": \"Show in new browser window\",\n \"s_loc_size\": \"Size\",\n \"s_loc_socialcalcXsave_format\": \"SocialCalc-save format\",\n \"s_loc_sort\": \"Sort\",\n \"s_loc_sort_\": \"Sort \",\n \"s_loc_sort_cells\": \"Sort Cells\",\n \"s_loc_swap_colors\": \"Swap Colors\",\n \"s_loc_tabXdelimited_format\": \"Tab-delimited format\",\n \"s_loc_text\": \"Text\",\n \"s_loc_text_horizontal\": \"Text Horizontal\",\n \"s_loc_this_is_aXbrXsample\": \"This is a<br>sample\",\n \"s_loc_top\": \"Top\",\n \"s_loc_top_border\": \"Top Border\",\n \"s_loc_undone_steps\": \"UNDONE STEPS\",\n \"s_loc_url\": \"URL\",\n \"s_loc_undo\": \"Undo\",\n \"s_loc_unlock\": \"Unlock\",\n \"s_loc_unmerge_cells\": \"Unmerge Cells\",\n \"s_loc_up\": \"Up\",\n \"s_loc_value\": \"Value\",\n \"s_loc_vertical\": \"Vertical\",\n \"s_loc_wikitext\": \"Wikitext\",\n \"s_loc_workspace\": \"Workspace\",\n \"s_loc_XnewX\": \"[New]\",\n \"s_loc_XnoneX\": \"[None]\",\n \"s_loc_Xselect_rangeX\": \"[select range]\",\n\n\"\":\"The following constants are arrays of strings with the short (3 character) and full names of days and months\",\n \"s_FormatNumber_daynames\": [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n \"s_FormatNumber_daynames3\": [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n \"s_FormatNumber_monthnames\": [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\",\n \"October\", \"November\", \"December\"],\n \"s_FormatNumber_monthnames3\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n \"s_FormatNumber_am\": \"AM\",\n \"s_FormatNumber_am1\": \"A\",\n \"s_FormatNumber_pm\": \"PM\",\n \"s_FormatNumber_pm1\": \"P\",\n\n\"\":\"\",\n\"\":\"SocialCalc Spreadsheet Formula module, formula1.js:\",\n\"\":\"\",\n \"s_parseerrexponent\": \"Improperly formed number exponent\",\n \"s_parseerrchar\": \"Unexpected character in formula\",\n \"s_parseerrstring\": \"Improperly formed string\",\n \"s_parseerrspecialvalue\": \"Improperly formed special value\",\n \"s_parseerrtwoops\": \"Error in formula (two operators inappropriately in a row)\",\n \"s_parseerrmissingopenparen\": \"Missing open parenthesis in list with comma(s). \",\n \"s_parseerrcloseparennoopen\": \"Closing parenthesis without open parenthesis. \",\n \"s_parseerrmissingcloseparen\": \"Missing close parenthesis. \",\n \"s_parseerrmissingoperand\": \"Missing operand. \",\n \"s_parseerrerrorinformula\": \"Error in formula.\",\n \"s_calcerrerrorvalueinformula\": \"Error value in formula\",\n \"s_parseerrerrorinformulabadval\": \"Error in formula resulting in bad value\",\n \"s_formularangeresult\": \"Formula results in range value:\",\n \"s_calcerrnumericnan\": \"Formula results in an bad numeric value\",\n \"s_calcerrnumericoverflow\": \"Numeric overflow\",\n \"s_sheetunavailable\": \"Sheet unavailable:\", \"\":\"when FindSheetInCache returns null\",\n \"s_calcerrcellrefmissing\": \"Cell reference missing when expected.\",\n \"s_calcerrsheetnamemissing\": \"Sheet name missing when expected.\",\n \"s_circularnameref\": \"Circular name reference to name\",\n \"s_calcerrunknownname\": \"Unknown name\",\n \"s_calcerrincorrectargstofunction\": \"Incorrect arguments to function\",\n \"s_sheetfuncunknownfunction\": \"Unknown function\",\n \"s_sheetfunclnarg\": \"LN argument must be greater than 0\",\n \"s_sheetfunclog10arg\": \"LOG10 argument must be greater than 0\",\n \"s_sheetfunclogsecondarg\": \"LOG second argument must be numeric greater than 0\",\n \"s_sheetfunclogfirstarg\": \"LOG first argument must be greater than 0\",\n \"s_sheetfuncroundsecondarg\": \"ROUND second argument must be numeric\",\n \"s_sheetfuncddblife\": \"DDB life must be greater than 1\",\n \"s_sheetfuncslnlife\": \"SLN life must be greater than 1\",\n\n\"\":\"Function definition text\",\n \"s_fdef_ABS\": \"Absolute value function. \",\n \"s_fdef_ACOS\": \"Trigonometric arccosine function. \",\n \"s_fdef_AND\": \"True if all arguments are true. \",\n \"s_fdef_ASIN\": \"Trigonometric arcsine function. \",\n \"s_fdef_ATAN\": \"Trigonometric arctan function. \",\n \"s_fdef_ATAN2\": \"Trigonometric arc tangent function (result is in radians). \",\n \"s_fdef_AVERAGE\": \"Averages the values. \",\n \"s_fdef_CHOOSE\": \"Returns the value specified by the index. The values may be ranges of cells. \",\n \"s_fdef_COLUMNS\": \"Returns the number of columns in the range. \",\n \"s_fdef_COS\": \"Trigonometric cosine function (value is in radians). \",\n \"s_fdef_COUNT\": \"Counts the number of numeric values, not blank, text, or error. \",\n \"s_fdef_COUNTA\": \"Counts the number of non-blank values. \",\n \"s_fdef_COUNTBLANK\": \"Counts the number of blank values. (Note: \\\"\\\" is not blank.) \",\n \"s_fdef_COUNTIF\": \"Counts the number of number of cells in the range that meet the criteria. The criteria may be a value (\\\"x\\\", 15, 1+3) or a test (>25). \",\n \"s_fdef_DATE\": \"Returns the appropriate date value given numbers for year, month, and day. For example: DATE(2006,2,1) for February 1, 2006. Note: In this program, day \\\"1\\\" is December 31, 1899 and the year 1900 is not a leap year. Some programs use January 1, 1900, as day \\\"1\\\" and treat 1900 as a leap year. In both cases, though, dates on or after March 1, 1900, are the same. \",\n \"s_fdef_DAVERAGE\": \"Averages the values in the specified field in records that meet the criteria. \",\n \"s_fdef_DAY\": \"Returns the day of month for a date value. \",\n \"s_fdef_DCOUNT\": \"Counts the number of numeric values, not blank, text, or error, in the specified field in records that meet the criteria. \",\n \"s_fdef_DCOUNTA\": \"Counts the number of non-blank values in the specified field in records that meet the criteria. \",\n \"s_fdef_DDB\": \"Returns the amount of depreciation at the given period of time (the default factor is 2 for double-declining balance). \",\n \"s_fdef_DEGREES\": \"Converts value in radians into degrees. \",\n \"s_fdef_DGET\": \"Returns the value of the specified field in the single record that meets the criteria. \",\n \"s_fdef_DMAX\": \"Returns the maximum of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DMIN\": \"Returns the maximum of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DPRODUCT\": \"Returns the result of multiplying the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DSTDEV\": \"Returns the sample standard deviation of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DSTDEVP\": \"Returns the standard deviation of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DSUM\": \"Returns the sum of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DVAR\": \"Returns the sample variance of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_DVARP\": \"Returns the variance of the numeric values in the specified field in records that meet the criteria. \",\n \"s_fdef_EVEN\": \"Rounds the value up in magnitude to the nearest even integer. \",\n \"s_fdef_EXACT\": \"Returns \\\"true\\\" if the values are exactly the same, including case, type, etc. \",\n \"s_fdef_EXP\": \"Returns e raised to the value power. \",\n \"s_fdef_FACT\": \"Returns factorial of the value. \",\n \"s_fdef_FALSE\": \"Returns the logical value \\\"false\\\". \",\n \"s_fdef_FIND\": \"Returns the starting position within string2 of the first occurrence of string1 at or after \\\"start\\\". If start is omitted, 1 is assumed. \",\n \"s_fdef_FV\": \"Returns the future value of repeated payments of money invested at the given rate for the specified number of periods, with optional present value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",\n \"s_fdef_HLOOKUP\": \"Look for the matching value for the given value in the range and return the corresponding value in the cell specified by the row offset. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match<=value) instead of exact match. \",\n \"s_fdef_HOUR\": \"Returns the hour portion of a time or date/time value. \",\n \"s_fdef_IF\": \"Results in true-value if logical-expression is TRUE or non-zero, otherwise results in false-value. \",\n \"s_fdef_INDEX\": \"Returns a cell or range reference for the specified row and column in the range. If range is 1-dimensional, then only one of rownum or colnum are needed. If range is 2-dimensional and rownum or colnum are zero, a reference to the range of just the specified column or row is returned. You can use the returned reference value in a range, e.g., sum(A1:INDEX(A2:A10,4)). \",\n \"s_fdef_INT\": \"Returns the value rounded down to the nearest integer (towards -infinity). \",\n \"s_fdef_IRR\": \"Returns the interest rate at which the cash flows in the range have a net present value of zero. Uses an iterative process that will return #NUM! error if it does not converge. There may be more than one possible solution. Providing the optional guess value may help in certain situations where it does not converge or finds an inappropriate solution (the default guess is 10%). \",\n \"s_fdef_ISBLANK\": \"Returns \\\"true\\\" if the value is a reference to a blank cell. \",\n \"s_fdef_ISERR\": \"Returns \\\"true\\\" if the value is of type \\\"Error\\\" but not \\\"NA\\\". \",\n \"s_fdef_ISERROR\": \"Returns \\\"true\\\" if the value is of type \\\"Error\\\". \",\n \"s_fdef_ISLOGICAL\": \"Returns \\\"true\\\" if the value is of type \\\"Logical\\\" (true/false). \",\n \"s_fdef_ISNA\": \"Returns \\\"true\\\" if the value is the error type \\\"NA\\\". \",\n \"s_fdef_ISNONTEXT\": \"Returns \\\"true\\\" if the value is not of type \\\"Text\\\". \",\n \"s_fdef_ISNUMBER\": \"Returns \\\"true\\\" if the value is of type \\\"Number\\\" (including logical values). \",\n \"s_fdef_ISTEXT\": \"Returns \\\"true\\\" if the value is of type \\\"Text\\\". \",\n \"s_fdef_LEFT\": \"Returns the specified number of characters from the text value. If count is omitted, 1 is assumed. \",\n \"s_fdef_LEN\": \"Returns the number of characters in the text value. \",\n \"s_fdef_LN\": \"Returns the natural logarithm of the value. \",\n \"s_fdef_LOG\": \"Returns the logarithm of the value using the specified base. \",\n \"s_fdef_LOG10\": \"Returns the base 10 logarithm of the value. \",\n \"s_fdef_LOWER\": \"Returns the text value with all uppercase characters converted to lowercase. \",\n \"s_fdef_MATCH\": \"Look for the matching value for the given value in the range and return position (the first is 1) in that range. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match<=value) instead of exact match. If rangelookup is -1, act like 1 but the bracket is match>=value. \",\n \"s_fdef_MAX\": \"Returns the maximum of the numeric values. \",\n \"s_fdef_MID\": \"Returns the specified number of characters from the text value starting from the specified position. \",\n \"s_fdef_MIN\": \"Returns the minimum of the numeric values. \",\n \"s_fdef_MINUTE\": \"Returns the minute portion of a time or date/time value. \",\n \"s_fdef_MOD\": \"Returns the remainder of the first value divided by the second. \",\n \"s_fdef_MONTH\": \"Returns the month part of a date value. \",\n \"s_fdef_N\": \"Returns the value if it is a numeric value otherwise an error. \",\n \"s_fdef_NA\": \"Returns the #N/A error value which propagates through most operations. \",\n \"s_fdef_NOT\": \"Returns FALSE if value is true, and TRUE if it is false. \",\n \"s_fdef_NOW\": \"Returns the current date/time. \",\n \"s_fdef_NPER\": \"Returns the number of periods at which payments invested each period at the given rate with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period) has the given present value. \",\n \"s_fdef_NPV\": \"Returns the net present value of cash flows (which may be individual values and/or ranges) at the given rate. The flows are positive if income, negative if paid out, and are assumed at the end of each period. \",\n \"s_fdef_ODD\": \"Rounds the value up in magnitude to the nearest odd integer. \",\n \"s_fdef_OR\": \"True if any argument is true \",\n \"s_fdef_PI\": \"The value 3.1415926... \",\n \"s_fdef_PMT\": \"Returns the amount of each payment that must be invested at the given rate for the specified number of periods to have the specified present value, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",\n \"s_fdef_POWER\": \"Returns the first value raised to the second value power. \",\n \"s_fdef_PRODUCT\": \"Returns the result of multiplying the numeric values. \",\n \"s_fdef_PROPER\": \"Returns the text value with the first letter of each word converted to uppercase and the others to lowercase. \",\n \"s_fdef_PV\": \"Returns the present value of the given number of payments each invested at the given rate, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",\n \"s_fdef_RADIANS\": \"Converts value in degrees into radians. \",\n \"s_fdef_RATE\": \"Returns the rate at which the given number of payments each invested at the given rate has the specified present value, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). Uses an iterative process that will return #NUM! error if it does not converge. There may be more than one possible solution. Providing the optional guess value may help in certain situations where it does not converge or finds an inappropriate solution (the default guess is 10%). \",\n \"s_fdef_REPLACE\": \"Returns text1 with the specified number of characters starting from the specified position replaced by text2. \",\n \"s_fdef_REPT\": \"Returns the text repeated the specified number of times. \",\n \"s_fdef_RIGHT\": \"Returns the specified number of characters from the text value starting from the end. If count is omitted, 1 is assumed. \",\n \"s_fdef_ROUND\": \"Rounds the value to the specified number of decimal places. If precision is negative, then round to powers of 10. The default precision is 0 (round to integer). \",\n \"s_fdef_ROWS\": \"Returns the number of rows in the range. \",\n \"s_fdef_SECOND\": \"Returns the second portion of a time or date/time value (truncated to an integer). \",\n \"s_fdef_SIN\": \"Trigonometric sine function (value is in radians) \",\n \"s_fdef_SLN\": \"Returns the amount of depreciation at each period of time using the straight-line method. \",\n \"s_fdef_SQRT\": \"Square root of the value \",\n \"s_fdef_STDEV\": \"Returns the sample standard deviation of the numeric values. \",\n \"s_fdef_STDEVP\": \"Returns the standard deviation of the numeric values. \",\n \"s_fdef_SUBSTITUTE\": \"Returns text1 with the all occurrences of oldtext replaced by newtext. If \\\"occurrence\\\" is present, then only that occurrence is replaced. \",\n \"s_fdef_SUM\": \"Adds the numeric values. The values to the sum function may be ranges in the form similar to A1:B5. \",\n \"s_fdef_SUMIF\": \"Sums the numeric values of cells in the range that meet the criteria. The criteria may be a value (\\\"x\\\", 15, 1+3) or a test (>25). If range2 is present, then range1 is tested and the corresponding range2 value is summed. \",\n \"s_fdef_SYD\": \"Depreciation by Sum of Year\\\"s Digits method. \",\n \"s_fdef_T\": \"Returns the text value or else a null string. \",\n \"s_fdef_TAN\": \"Trigonometric tangent function (value is in radians) \",\n \"s_fdef_TIME\": \"Returns the time value given the specified hour, minute, and second. \",\n \"s_fdef_TODAY\": \"Returns the current date (an integer). Note: In this program, day \\\"1\\\" is December 31, 1899 and the year 1900 is not a leap year. Some programs use January 1, 1900, as day \\\"1\\\" and treat 1900 as a leap year. In both cases, though, dates on or after March 1, 1900, are the same. \",\n \"s_fdef_TRIM\": \"Returns the text value with leading, trailing, and repeated spaces removed. \",\n \"s_fdef_TRUE\": \"Returns the logical value \\\"true\\\". \",\n \"s_fdef_TRUNC\": \"Truncates the value to the specified number of decimal places. If precision is negative, truncate to powers of 10. \",\n \"s_fdef_UPPER\": \"Returns the text value with all lowercase characters converted to uppercase. \",\n \"s_fdef_VALUE\": \"Converts the specified text value into a numeric value. Various forms that look like numbers (including digits followed by %, forms that look like dates, etc.) are handled. This may not handle all of the forms accepted by other spreadsheets and may be locale dependent. \",\n \"s_fdef_VAR\": \"Returns the sample variance of the numeric values. \",\n \"s_fdef_VARP\": \"Returns the variance of the numeric values. \",\n \"s_fdef_VLOOKUP\": \"Look for the matching value for the given value in the range and return the corresponding value in the cell specified by the column offset. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match>=value) instead of exact match. \",\n \"s_fdef_WEEKDAY\": \"Returns the day of week specified by the date value. If type is 1 (the default), Sunday is day and Saturday is day 7. If type is 2, Monday is day 1 and Sunday is day 7. If type is 3, Monday is day 0 and Sunday is day 6. \",\n \"s_fdef_YEAR\": \"Returns the year part of a date value. \",\n \"s_fdef_SUMPRODUCT\": \"Sums the pairwise products of 2 or more ranges. The ranges must be of equal length.\",\n \"s_fdef_CEILING\": \"Rounds the given number up to the nearest integer or multiple of significance. Significance is the value to whose multiple of ten the value is to be rounded up (.01, .1, 1, 10, etc.)\",\n \"s_fdef_FLOOR\": \"Rounds the given number down to the nearest multiple of significance. Significance is the value to whose multiple of ten the number is to be rounded down (.01, .1, 1, 10, etc.)\",\n\n \"s_farg_v\": \"value\",\n \"s_farg_vn\": \"value1, value2, ...\",\n \"s_farg_xy\": \"valueX, valueY\",\n \"s_farg_choose\": \"index, value1, value2, ...\",\n \"s_farg_range\": \"range\",\n \"s_farg_rangec\": \"range, criteria\",\n \"s_farg_date\": \"year, month, day\",\n \"s_farg_dfunc\": \"databaserange, fieldname, criteriarange\",\n \"s_farg_ddb\": \"cost, salvage, lifetime, period, [factor]\",\n \"s_farg_find\": \"string1, string2, [start]\",\n \"s_farg_fv\": \"rate, n, payment, [pv, [paytype]]\",\n \"s_farg_hlookup\": \"value, range, row, [rangelookup]\",\n \"s_farg_iffunc\": \"logical-expression, true-value, [false-value]\",\n \"s_farg_index\": \"range, rownum, colnum\",\n \"s_farg_irr\": \"range, [guess]\",\n \"s_farg_tc\": \"text, count\",\n \"s_farg_log\": \"value, base\",\n \"s_farg_match\": \"value, range, [rangelookup]\",\n \"s_farg_mid\": \"text, start, length\",\n \"s_farg_nper\": \"rate, payment, pv, [fv, [paytype]]\",\n \"s_farg_npv\": \"rate, value1, value2, ...\",\n \"s_farg_pmt\": \"rate, n, pv, [fv, [paytype]]\",\n \"s_farg_pv\": \"rate, n, payment, [fv, [paytype]]\",\n \"s_farg_rate\": \"n, payment, pv, [fv, [paytype, [guess]]]\",\n \"s_farg_replace\": \"text1, start, length, text2\",\n \"s_farg_vp\": \"value, [precision]\",\n \"s_farg_valpre\": \"value, precision\",\n \"s_farg_csl\": \"cost, salvage, lifetime\",\n \"s_farg_cslp\": \"cost, salvage, lifetime, period\",\n \"s_farg_subs\": \"text1, oldtext, newtext, [occurrence]\",\n \"s_farg_sumif\": \"range1, criteria, [range2]\",\n \"s_farg_hms\": \"hour, minute, second\",\n \"s_farg_txt\": \"text\",\n \"s_farg_vlookup\": \"value, range, col, [rangelookup]\",\n \"s_farg_weekday\": \"date, [type]\",\n \"s_farg_dt\": \"date\",\n \"s_farg_rangen\": \"range1, range2, ...\",\n \"s_farg_vsig\": \"value, [significance]\",\n\n \"function_classlist\": [\"all\", \"stat\", \"lookup\", \"datetime\", \"financial\", \"test\", \"math\", \"text\"],\n\n \"s_fclass_all\": \"All\",\n \"s_fclass_stat\": \"Statistics\",\n \"s_fclass_lookup\": \"Lookup\",\n \"s_fclass_datetime\": \"Date & Time\",\n \"s_fclass_financial\": \"Financial\",\n \"s_fclass_test\": \"Test\",\n \"s_fclass_math\": \"Math\",\n \"s_fclass_text\": \"Text\",\n\n\"\":\"Graph tab\",\n \"s_loc_plain\": \"Plain\",\n \"s_loc_graph\": \"Graph\",\n \"s_loc_cells_to_graph\": \"Cells to Graph\",\n \"s_loc_set_cells_to_graph\": \"Set Cells To Graph\",\n \"s_loc_graph_type\": \"Graph Type\",\n \"s_loc_help\": \"Help\",\n \"s_loc_horizontal_bar\": \"Horizontal Bar\",\n \"s_loc_vertical_bar\": \"Vertical Bar\",\n \"s_loc_pie_chart\": \"Pie Chart\",\n \"s_loc_line_chart\": \"Line Chart\",\n \"s_loc_scatter_chart\": \"Plot Points\",\n \"s_loc_not_set\": \"Not Set\",\n \"s_loc_unknown_range_name\": \"Unknown range name\",\n \"s_loc_hide_help\": \"Hide Help\",\n \"s_loc_x\": \"X\",\n \"s_loc_y\": \"Y\",\n \"s_loc_max\": \"Max\",\n \"s_loc_min\": \"Min\",\n \"s_loc_Xselect_rangeX\": \"[select range]\",\n \"s_GraphRangeNotSelected\": \"Select a range of cells with numeric values to graph and use the OK button above to set the range as the graph range.\",\n \"s_graph_error_selection\": \"<b>Range selection error</b>.<br>You must select cells in a single row or column !\",\n \"s_graph_help_intro\": \"This is the help text for graph type: \",\n \"s_graph_VerticalBar_help\": \"The <b>Graph</b> tab displays a bar graph of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\",\n \"s_graph_HorizontalBar_help\": \"The <b>Graph</b> tab displays a bar graph of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\",\n \"s_graph_PieChart_help\": \"The <b>Graph</b> tab displays a pie chart of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\",\n \"s_graph_PieChart_error_selection\": \"<b>Selection error</b><br>You must select cells with positive value !\",\n \"s_graph_LineChart_help\": \"The <b>Graph</b> tab displays a XY profile line of the cells which have been selected (either in a single row across or column down). The row above (or column to the left) of the selection is used as X coordinates.\",\n \"s_graph_ScatterChart_help\": \"The <b>Graph</b> tab displays a XY scattered chart of the cells which have been selected (either in a single row across or column down). The row above (or column to the left) of the selection is used as X coordinates. If row below (or column to the right) have values, they are interpreted as plot dimensions.\",\n\n\"\":\"Clipboard tab\",\n \"s_loc_to\": \"to\",\n \"s_loc_tiddler\": \"Tiddler\",\n \"s_loc_import\": \"Import\",\n \"s_loc_export\": \"Export\",\n \"s_loc_XclipboardX\": \"[Clipboard]\",\n \"s_clipboard_menu_title\": \"Import/Export<br>and Clipboard\",\n \"s_clipboard_export_error_tiddler_exists\": \"Tiddler exists\",\n \"s_clipboard_export_error_tiddler_overwrite\": \"Do you want to overwrite it ?\",\n \"s_clipboard_import_error_tiddler_format\": \"Format error: tiddler's format field have incorrect value.\",\n\n\"\":\"Save sheet to tiddler\",\n \"s_loc_save_changes\": \"Save changes\",\n \"s_notification_tiddler\": \"Saved ~SocialCalc sheet\",\n\n\"\":\"End\"\n}\n"
},
"$:/plugins/rboue/SocialCalc/Languages/en-GB--save-notification": {
"title": "$:/plugins/rboue/SocialCalc/Languages/en-GB--save-notification",
"text": "Saved ~SocialCalc sheet\n"
},
"$:/plugins/rboue/SocialCalc/Languages/fr-FR": {
"type": "application/json",
"title": "$:/plugins/rboue/SocialCalc/Languages/fr-FR",
"text": "{\n\"\":\"Origin of this translation : Framasoft (http://framacalc.org)\",\n\n\"\":\"Translation process :\",\n\"\":\" . Translate all messages.\",\n\"\":\" . Add tiddler to your TiddlyWiki with the title :\",\n\"\":\" $:/plugins/<not sure>/SocialCalc/Languages/<your language>\",\n\"\":\" <your language> must match with the $:/language tiddler.\",\n\"\":\" Exemple : fr-FR for French.\",\n\n\"\":\"Common error messages\",\n \"s_BrowserNotSupported\": \"Navigateur non supporté\",\n \"s_InternalError\": \"Erreur interne de SocialCalc (probablement un bug interne) : \",\n\n\"\":\"Errors thrown on unexpected value in save file\",\n \"s_pssUnknownColType\": \"Type de champ de colonne inconnu\",\n \"s_pssUnknownRowType\": \"Type de champ de ligne inconnu\",\n \"s_pssUnknownLineType\": \"Type de ligne inconnu\",\n\n\"\":\"Error thrown on unexpected cell type\",\n \"s_cfspUnknownCellType\": \"Type de champ de cellule inconnu\", \n\n\"\":\"ExecuteSheetCommand\",\n \"s_escUnknownSheetCmd\": \"Commande sur la feuille inconnue : \",\n \"s_escUnknownSetCoordCmd\": \"Commande de saisie des coordonnées inconnue : \",\n \"s_escUnknownCmd\": \"Commande inconnue : \",\n\n\"\":\"SocialCalc.CheckAndCalcCell\",\n \"s_caccCircRef\": \"Référence circulaire à \",\n\n\"\":\"SocialCalc.RenderContext\",\n \"s_rcMissingSheet\": \"Le contexte de rendu doit avoir un objet feuille de calcul\",\n\n\"\":\"SocialCalc.EditorGetStatuslineString -- strings shown on status line\",\n \"s_statusline_executing\": \"En cours d'exécution...\",\n \"s_statusline_displaying\": \"En cours d'affichage...\",\n \"s_statusline_ordering\": \"En cours de classement...\",\n \"s_statusline_calculating\": \"Calculs en cours...\",\n \"s_statusline_calculatingls\": \"Calculs en cours... Chargement de la feuille...\",\n \"s_statusline_doingserverfunc\": \"exécute la fonction du serveur \",\n \"s_statusline_incell\": \" en cellule \",\n \"s_statusline_calcstart\": \"Début des calculs...\",\n \"s_statusline_sum\": \"SOMME\",\n \"s_statusline_recalcneeded\": \"<span style=\\\"color:#999;\\\">(Recalcul nécessaire)</span>\",\n \"s_statusline_circref\": \"<span style=\\\"color:red;\\\">Référence circulaire : \",\n\n\"\":\"SocialCalc.InputBoxDisplayCellContents\",\n \"s_inputboxdisplaymultilinetext\": \"[Multi-ligne de texte: Cliquez sur la droite de l'icône pour éditer]\",\n \"ietUnknownFunction\": \"Fonction inconnue \", \"\":\"displayed when typing \\\"=unknown(\",\n \"s_CHfillAllTooltip\": \"Remplir les contenus et les formats bas/droite\", \"\":\"tooltip for fill all handle\",\n \"s_CHfillContentsTooltip\": \"Remplir les contenus seulement bas/droite\", \"\":\"tooltip for fill formulas handle\",\n \"s_CHmovePasteAllTooltip\": \"Déplacer les contenus et les formats\", \"\":\"etc.\",\n \"s_CHmovePasteContentsTooltip\": \"Déplacer les contenus seulement\",\n \"s_CHmoveInsertAllTooltip\": \"Déplacer les contenus et les formats en ligne/colonne\",\n \"s_CHmoveInsertContentsTooltip\": \"Déplacer les contenus en ligne/colonne\",\n \"s_CHindicatorOperationLookup\": {\n \"Fill\": \"Remplir\", \"FillC\": \"Remplir le contenu\",\n \"Move\": \"Déplacer\", \"MoveI\": \"Faire glisser\",\n \"MoveC\": \"Déplacer le contenu\", \"MoveIC\": \"Faire glisser le contenu\"\n },\n \"s_CHindicatorDirectionLookup\": {\n \"Down\": \" Bas\", \"Right\": \" Droite\",\n \"Horizontal\": \" Horizontal\", \"Vertical\": \" Vertical\"\n },\n\n\"\":\"Constants for default Format tab (settings)\",\n\"\":\"\",\n\"\":\"*** EVEN THOUGH THESE DON'T START WITH s_: ***\",\n\"\":\"\",\n\"\":\"These should be carefully checked for localization. Make sure you understand what they do and how they work!\",\n\"\":\"The first part of \\\"first:second|first:second|...\\\" is what is displayed and the second is the value to be used.\",\n\"\":\"The value is normally not translated -- only the displayed part. The [cancel], [break], etc., are not translated --\",\n\"\":\"they are commands to SocialCalc.SettingsControls.PopupListInitialize\",\n\n \"SCFormatNumberFormats\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Auto w/ commas!:[,]General|[break]:|00:00|000:000|0000:0000|00000:00000|[break]:|%loc!Formula!:formula|%loc!Hidden!:hidden|[newcol]:1234:0|1,234:#,##0|1,234.5:#,##0.0|1,234.56:#,##0.00|1,234.567:#,##0.000|1,234.5678:#,##0.0000|[break]:|1,234%:#,##0%|1,234.5%:#,##0.0%|1,234.56%:#,##0.00%|[newcol]:|$1,234:$#,##0|$1,234.5:$#,##0.0|$1,234.56:$#,##0.00|[break]:|(1,234):#,##0_);(#,##0)|(1,234.5):#,##0.0_);(#,##0.0)|(1,234.56):#,##0.00_);(#,##0.00)|[break]:|($1,234):#,##0_);($#,##0)|($1,234.5):$#,##0.0_);($#,##0.0)|($1,234.56):$#,##0.00_);($#,##0.00)|[newcol]:|1/4/06:m/d/yy|01/04/2006:mm/dd/yyyy|2006-01-04:yyyy-mm-dd|4-Jan-06:d-mmm-yy|04-Jan-2006:dd-mmm-yyyy|Janvier 4, 2006:mmmm d, yyyy|[break]:|1\\\\c23:h:mm|1\\\\c23 PM:h:mm AM/PM|1\\\\c23\\\\c45:h:mm:ss|01\\\\c23\\\\c45:hh:mm:ss|26\\\\c23 (h\\\\cm):[hh]:mm|69\\\\c45 (m\\\\cs):[mm]:ss|69 (s):[ss]|[newcol]:|2006-01-04 01\\\\c23\\\\c45:yyyy-mm-dd hh:mm:ss|Janvier 4, 2006:mmmm d, yyyy hh:mm:ss|Mer:ddd|Mercredi:dddd|\",\n \"SCFormatTextFormats\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Plain Text!:text-plain|HTML:text-html|%loc!Wikitext!:text-wiki|%loc!Link!:text-link|%loc!Formula!:formula|%loc!Hidden!:hidden|\",\n \"SCFormatPadsizes\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!No padding!:0px|[newcol]:|1 pixel:1px|2 pixels:2px|3 pixels:3px|4 pixels:4px|5 pixels:5px|6 pixels:6px|7 pixels:7px|8 pixels:8px|[newcol]:|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|16 pixels:16px|18 pixels:18px|[newcol]:|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\n \"SCFormatFontsizes\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|X-Small:x-small|Small:small|Medium:medium|Large:large|X-Large:x-large|[newcol]:|6pt:6pt|7pt:7pt|8pt:8pt|9pt:9pt|10pt:10pt|11pt:11pt|12pt:12pt|14pt:14pt|16pt:16pt|[newcol]:|18pt:18pt|20pt:20pt|22pt:22pt|24pt:24pt|28pt:28pt|36pt:36pt|48pt:48pt|72pt:72pt|[newcol]:|8 pixels:8px|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|[newcol]:|16 pixels:16px|18 pixels:18px|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\n \"SCFormatFontfamilies\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|Verdana:Verdana,Arial,Helvetica,sans-serif|Arial:arial,helvetica,sans-serif|Courier:'Courier New',Courier,monospace|\",\n \"SCFormatFontlook\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Normal!:normal normal|%loc!Bold!:normal bold|%loc!Italic!:italic normal|%loc!Bold Italic!:italic bold\",\n \"SCFormatTextAlignhoriz\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",\n \"SCFormatNumberAlignhoriz\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",\n \"SCFormatAlignVertical\": \"[cancel]:|[break]:|%loc!Default!:|%loc!Top!:top|%loc!Middle!:middle|%loc!Bottom!:bottom|\",\n \"SCFormatColwidth\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|20 pixels:20|40:40|60:60|80:80|100:100|120:120|140:140|160:160|[newcol]:|180 pixels:180|200:200|220:220|240:240|260:260|280:280|300:300|\",\n \"SCFormatRecalc\": \"[cancel]:|[break]:|%loc!Auto!:|%loc!Manual!:off|\",\n \"SCFormatUserMaxCol\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",\n \"SCFormatUserMaxRow\": \"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",\n\n\"\":\"SocialCalc.SettingsControls.PopupListInitialize\",\n \"s_PopupListCancel\": \"[Annuler]\",\n \"s_PopupListCustom\": \"Personnalisé\",\n\n\"\":\"***\",\n\"\":\"\",\n\"\":\"s_loc_ constants accessed by SocialCalc.LocalizeString and SocialCalc.LocalizeSubstrings\",\n\"\":\"\",\n\"\":\"Used extensively by socialcalcspreadsheetcontrol.js\",\n\"\":\"\",\n\"\":\"***\",\n \"s_PopupListCancel\": \"[Annuler]\",\n \"s_PopupListCustom\": \"Personnalisé\",\n \"s_loc_align_center\": \"Aligner au centre\",\n \"s_loc_align_left\": \"Aligner à gauche\",\n \"s_loc_align_right\": \"Aligner à droite\",\n \"s_loc_alignment\": \"Alignement\",\n \"s_loc_audit\": \"Historique\",\n \"s_loc_audit_trail_this_session\": \"Suivi des modifications de cette session \",\n \"s_loc_auto\": \"Automatique\",\n \"s_loc_auto_sum\": \"Somme automatique\",\n \"s_loc_auto_wX_commas\": \"Auto avec virgule\",\n \"s_loc_automatic\": \"Automatique\",\n \"s_loc_background\": \"Arrière-plan\",\n \"s_loc_bold\": \"Gras\",\n \"s_loc_bold_XampX_italics\": \"Gras & Italique\",\n \"s_loc_bold_italic\": \"Gras Italique\",\n \"s_loc_borders\": \"Bordures\",\n \"s_loc_borders_off\": \"Désactiver les bordures\",\n \"s_loc_borders_on\": \"Activer les bordures\",\n \"s_loc_bottom\": \"Bas\",\n \"s_loc_bottom_border\": \"Bordure basse\",\n \"s_loc_cell_settings\": \"PARAMÈTRES DE LA CELLULE\",\n \"s_loc_csv_format\": \"Format CSV\",\n \"s_loc_cancel\": \"Annuler\",\n \"s_loc_category\": \"Catégorie\",\n \"s_loc_center\": \"Centrer\",\n \"s_loc_clear\": \"Nettoyer\",\n \"s_loc_clear_socialcalc_clipboard\": \"Nettoyer le presse-papier de SocialCalc \",\n \"s_loc_clipboard\": \"Presse-papier\",\n \"s_loc_color\": \"Couleur\",\n \"s_loc_column_\": \"Colonne \",\n \"s_loc_comment\": \"Commentaire\",\n \"s_loc_copy\": \"Copier\",\n \"s_loc_custom\": \"Personnalisé\",\n \"s_loc_cut\": \"Couper\",\n \"s_loc_default\": \"Défaut\",\n \"s_loc_default_alignment\": \"Alignement par défaut\",\n \"s_loc_default_column_width\": \"Largeur des colonnes par défaut\",\n \"s_loc_default_font\": \"Police par défaut\",\n \"s_loc_default_format\": \"Format par défaut\",\n \"s_loc_default_padding\": \"Remplissage par défaut\",\n \"s_loc_delete\": \"Effacer le contenu\",\n \"s_loc_delete_column\": \"Supprimer une colonne\",\n \"s_loc_delete_contents\": \"Supprimer le contenu\",\n \"s_loc_delete_row\": \"Supprimer une ligne\",\n \"s_loc_description\": \"Description\",\n \"s_loc_display_clipboard_in\": \"Afficher le presse-papier dans le \",\n \"s_loc_down\": \"Bas\",\n \"s_loc_edit\": \"Édition\",\n \"s_loc_existing_names\": \"Noms existants\",\n \"s_loc_family\": \"Famille\",\n \"s_loc_fill_down\": \"Dupliquer vers le bas\",\n \"s_loc_fill_right\": \"Dupliquer vers la droite\",\n \"s_loc_font\": \"Police\",\n \"s_loc_format\": \"Format\",\n \"s_loc_formula\": \"Formule\",\n \"s_loc_function_list\": \"Liste des fonctions\",\n \"s_loc_functions\": \"Fonctions\",\n \"s_loc_grid\": \"Grille\",\n \"s_loc_hidden\": \"Caché\",\n \"s_loc_hide_column\": \"Cacher une colonne\",\n \"s_loc_hide_row\": \"Cacher une ligne\",\n \"s_loc_horizontal\": \"Horizontal\",\n \"s_loc_insert_column\": \"Ajouter une colonne\",\n \"s_loc_insert_row\": \"Ajouter une ligne\",\n \"s_loc_italic\": \"Italique\",\n \"s_loc_last_sort\": \"Dernier tri\",\n \"s_loc_left\": \"Gauche\",\n \"s_loc_left_border\": \"Bordure gauche\",\n \"s_loc_link\": \"Lien\",\n \"s_loc_link_input_box\": \"Créer un lien externe\",\n \"s_loc_list\": \"Liste\",\n \"s_loc_load_socialcalc_clipboard_with_this\": \"Charger le presse-papier de Framacalc avec ceci\",\n \"s_loc_lock\": \"Verrouiller\",\n \"s_loc_major_sort\": \"Tri principal\",\n \"s_loc_manual\": \"Manuel\",\n \"s_loc_merge_cells\": \"Fusionner des cellules\",\n \"s_loc_middle\": \"Milieu\",\n \"s_loc_minor_sort\": \"Tri secondaire\",\n \"s_loc_move_insert\": \"Insérer les cellules à déplacer\",\n \"s_loc_move_paste\": \"Coller les cellules à déplacer\",\n \"s_loc_multiXline_input_box\": \"Case d'import multi-ligne\",\n \"s_loc_name\": \"Nom\",\n \"s_loc_names\": \"Noms\",\n \"s_loc_no_padding\": \"Pas de bordure\",\n \"s_loc_normal\": \"Normal\",\n \"s_loc_number\": \"Nombre\",\n \"s_loc_number_horizontal\": \"Nombre Horizontal\",\n \"s_loc_ok\": \"OK\",\n \"s_loc_padding\": \"Épaisseur\",\n \"s_loc_page_name\": \"Nom de page\",\n \"s_loc_paste\": \"Coller\",\n \"s_loc_paste_formats\": \"Coller le formatage\",\n \"s_loc_plain_text\": \"Texte brut\",\n \"s_loc_recalc\": \"Recalculer\",\n \"s_loc_recalculation\": \"Recalcul\",\n \"s_loc_redo\": \"Rétablir\",\n \"s_loc_right\": \"Droite\",\n \"s_loc_right_border\": \"Bordure droite\",\n \"s_loc_sheet_settings\": \"PARAMÈTRES DE LA FEUILLE\",\n \"s_loc_save\": \"Enregistrer\",\n \"s_loc_save_to\": \"Enregistrer les paramètres de \",\n \"s_loc_set_cell_contents\": \"Importer le contenu dans la cellule\",\n \"s_loc_set_cells_to_sort\": \"Définir les cellules à trier\",\n \"s_loc_set_value_to\": \"Définir la valeur à\",\n \"s_loc_set_to_link_format\": \"Définir le format comme lien\",\n \"s_loc_setXclear_move_from\": \"Sélectionner/Nettoyer la zone à déplacer\",\n \"s_loc_show_cell_settings\": \"Afficher les paramètres des cellules\",\n \"s_loc_show_sheet_settings\": \"Afficher les paramètres de la feuille\",\n \"s_loc_show_in_new_browser_window\": \"Afficher dans une nouvelle fenêtre de votre navigateur\",\n \"s_loc_size\": \"Taille\",\n \"s_loc_socialcalcXsave_format\": \"Format de sauvegarde de Framacalc\",\n \"s_loc_sort\": \"Trier\",\n \"s_loc_sort_\": \"Trier \",\n \"s_loc_sort_cells\": \"Trier les cellules\",\n \"s_loc_swap_colors\": \"Permuter les couleurs\",\n \"s_loc_tabXdelimited_format\": \"Format délimité par des tabulations\",\n \"s_loc_text\": \"Texte\",\n \"s_loc_text_horizontal\": \"Texte horizontal\",\n \"s_loc_this_is_aXbrXsample\": \"Visualiser<br>le rendu\",\n \"s_loc_top\": \"Haut\",\n \"s_loc_top_border\": \"Bordure haute\",\n \"s_loc_undone_steps\": \"ANNULER DES ÉTAPES\",\n \"s_loc_url\": \"URL\",\n \"s_loc_undo\": \"Annuler\",\n \"s_loc_unlock\": \"Déverrouiller\",\n \"s_loc_unmerge_cells\": \"Défaire des cellules\",\n \"s_loc_up\": \"Haut\",\n \"s_loc_value\": \"Valeur\",\n \"s_loc_vertical\": \"Vertical\",\n \"s_loc_wikitext\": \"Wiki-texte\",\n \"s_loc_workspace\": \"Espace de travail\",\n \"s_loc_XnewX\": \"[Nouveau]\",\n \"s_loc_XnoneX\": \"[Aucun]\",\n \"s_loc_Xselect_rangeX\": \"[faites une sélection]\",\n\n\"\":\"The following constants are arrays of strings with the short (3 character) and full names of days and months\",\n \"s_FormatNumber_daynames\": [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\n \"s_FormatNumber_daynames3\": [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"],\n \"s_FormatNumber_monthnames\": [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\n \"s_FormatNumber_monthnames3\": [\"Jan\", \"Fev\", \"Mar\", \"Avr\", \"Mai\", \"Jun\", \"Jul\", \"Aou\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n \"s_FormatNumber_am\": \"AM\",\n \"s_FormatNumber_am1\": \"A\",\n \"s_FormatNumber_pm\": \"PM\",\n \"s_FormatNumber_pm1\": \"P\",\n\n\"\":\"\",\n\"\":\"SocialCalc Spreadsheet Formula module, formula1.js:\",\n\"\":\"\",\n \"s_parseerrexponent\": \"Nombre en exposant incorrect\",\n \"s_parseerrchar\": \"Caractère inattendu dans la formule\",\n \"s_parseerrstring\": \"Chaîne incorrecte\",\n \"s_parseerrspecialvalue\": \"Valeur spéciale incorrecte\",\n \"s_parseerrtwoops\": \"Erreur dans la formule (deux opérateurs inopportuns dans la chaîne)\",\n \"s_parseerrmissingopenparen\": \"Parenthèse ouvrante manquante dans la liste à virgule(s). \",\n \"s_parseerrcloseparennoopen\": \"Parenthèse fermante sans parenthèse ouvrante. \",\n \"s_parseerrmissingcloseparen\": \"Parenthèse fermante manquante. \",\n \"s_parseerrmissingoperand\": \"Opérande manquant. \",\n \"s_parseerrerrorinformula\": \"Erreur dans la formule.\",\n \"s_calcerrerrorvalueinformula\": \"Valeur erronée dans la formule\",\n \"s_parseerrerrorinformulabadval\": \"Erreur dans la formule créant une mauvaise valeur\",\n \"s_formularangeresult\": \"Formule résultante de la valeur sélectionnée :\",\n \"s_calcerrnumericnan\": \"Formule causant une mauvaise valeur numérique\",\n \"s_calcerrnumericoverflow\": \"Overflow numérique\",\n \"s_sheetunavailable\": \"Feuille indisponible :\",\n \"s_calcerrcellrefmissing\": \"Référence nécessaire manquante à une cellule.\",\n \"s_calcerrsheetnamemissing\": \"Nom de la feuille nécessaire manquante.\",\n \"s_circularnameref\": \"Nom à référence circulaire\",\n \"s_calcerrunknownname\": \"Nom inconnu\",\n \"s_calcerrincorrectargstofunction\": \"Argument de la fonction incorrect\",\n \"s_sheetfuncunknownfunction\": \"Fonction inconnue\",\n \"s_sheetfunclnarg\": \"L'argument de LN doit être plus grand que 0\",\n \"s_sheetfunclog10arg\": \"L'argument de LOG10 doit être plus grand que 0\",\n \"s_sheetfunclogsecondarg\": \"Le deuxième argument de LOG doit être une valeur numérique plus quande que 0\",\n \"s_sheetfunclogfirstarg\": \"Le premier argument de LOG doit être plus grand que 0\",\n \"s_sheetfuncroundsecondarg\": \"Le deuxième argument de ROUND doit être une valeur numérique\",\n \"s_sheetfuncddblife\": \"La vie dans DDB doit être plus grande que 1\",\n \"s_sheetfuncslnlife\": \"La vie dans SLN doit être plus grande que 1\",\n\n\"\":\"Function definition text\",\n \"s_fdef_ABS\": \"Fonction valeur absolue. \",\n \"s_fdef_ACOS\": \"Fonction trigonometrique arccosinus. \",\n \"s_fdef_AND\": \"Vrai si tous les arguments sont vrais. \",\n \"s_fdef_ASIN\": \"Fonction trigonométrique arcsinus. \",\n \"s_fdef_ATAN\": \"Fonction trigonométrique arctangente. \",\n \"s_fdef_ATAN2\": \"Fonction trigonométrique arctangente (le résultat est en radians). \",\n \"s_fdef_AVERAGE\": \"Moyenne des valeurs. \",\n \"s_fdef_CHOOSE\": \"Retourne la valeur spécifiée par l'index. Les valeurs doivent être sélectionnées. \",\n \"s_fdef_COLUMNS\": \"Retourne le nombre de colonnes de la sélection. \",\n \"s_fdef_COS\": \"Fonction trigonométrique cosinus (la valeur est en radians). \",\n \"s_fdef_COUNT\": \"Compte le nombre de valeurs numériques, pas les blancs, ni les textes, ni les erreurs. \",\n \"s_fdef_COUNTA\": \"Compte le nombre de valeurs non-vides. \",\n \"s_fdef_COUNTBLANK\": \"Compte le nombre de blancs. (Note: \\\"\\\" n'est pas un blanc.) \",\n \"s_fdef_COUNTIF\": \"Compte le nombre de cellules dans la sélection qui vérifient la condition. Le critère doit être une valeur (\\\"x\\\", 15, 1+3) ou un test (>25). \",\n \"s_fdef_DATE\": \"Retourne la date appropriée étant donné les nombres de l'année du mois et du jour. Par exemple : DATE(2006,2,1) pour le 1er février 2006. Note : Dans ce programme, le jour \\\"1\\\" est le 31 décembre 1899 et l'année 1900 n'est pas une année sautée. Certains programmes utilisent le 1er janvier 1900, comme le jour \\\"1\\\" et sautent l'année 1900. Mais dans les deux cas, les dates après le 1er mars 1900 sont les mêmes. \",\n \"s_fdef_DAVERAGE\": \"Calcule la moyenne des champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DAY\": \"Retourne le jour de la semaine d'une date donnée. \",\n \"s_fdef_DCOUNT\": \"Compte le nombre de valeurs numériques, pas les blancs, ni le texte, ni les erreurs, dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DCOUNTA\": \"Compte le nombre de valeurs non-vides dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DDB\": \"Retourne la valeur de la dépréciation sur la période donnée (le facteur par défaut est 2 pour un équilibre à double décroissance). \",\n \"s_fdef_DEGREES\": \"Convertit une valeur de radians en degrés. \",\n \"s_fdef_DGET\": \"Retourne la valeur du champ spécifié dans une seule entrée qui satisfait le critère. \",\n \"s_fdef_DMAX\": \"Retourne le maximum des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DMIN\": \"Retourne le minimun des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DPRODUCT\": \"Retourne le résultat de la multiplication des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DSTDEV\": \"Retourne l'écart-type d'une population des valeurs numériques spécifiées qui satisfont le critère. \",\n \"s_fdef_DSTDEVP\": \"Retourne l'écart-type des valeurs numériques spécifiées qui satisfont le critère. \",\n \"s_fdef_DSUM\": \"Retourne la somme des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DVAR\": \"Retourne la variance d'une population des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_DVARP\": \"Retourne la variance des valeurs numériques dans les champs spécifiés qui satisfont le critère. \",\n \"s_fdef_EVEN\": \"Arrondit supérieurement la valeur à l'entier le plus proche. \",\n \"s_fdef_EXACT\": \"Retourne \\\"true\\\" si les valeurs sont exactement les mêmes, incluant la case, le type, etc. \",\n \"s_fdef_EXP\": \"Retourne e élevé à la puissance spécifiée. \",\n \"s_fdef_FACT\": \"Retourne la factorielle de la valeur. \",\n \"s_fdef_FALSE\": \"Retourne la valeur logique \\\"false\\\". \",\n \"s_fdef_FIND\": \"Retourne la position de départ de la première occurence de chaîne1 dans la chaîne chaîne2, après la position \\\"start\\\". Si \\\"start\\\" est omis, sa valeur est 1. \",\n \"s_fdef_FV\": \"Retourne la valeur future des paiements itérés d'un montant investi à un taux donné pour un nombre spécifié de périodes, avec comme option facultative la valeur présente (0 par défaut) et le type de paiement (par défaut 0 = à la fin de la période, 1 = au début de la période). \",\n \"s_fdef_HLOOKUP\": \"Cherche la valeur assortie à la valeur donnée dans la sélection et retourne la valeur correpondante dans la cellule spécifiée par la ligne de compensation. Si l'option sélection-de-recherche est égale à 1 (par défaut) et non 0, cherche une correspondance dans une fourchette numérique (valeur associée<=valeur) au lieu d'une correspondance exacte. \",\n \"s_fdef_HOUR\": \"Retourne la partie des heures dans une valeur temporelle ou d'une date et d'un horaire. \",\n \"s_fdef_IF\": \"Effectue le résultat associé à vrai si l'expression logique est \\\"TRUE\\\" ou non-nulle, sinon effectue le résultat associé à la valeur fausse. \",\n \"s_fdef_INDEX\": \"Retourne une cellule ou une sélection de référence pour une ligne et une colonne dans cette plage. Si cette plage est de dimension 1, alors seul le numéro de colonne, ou de ligne, est nécessaire. Si elle est à 2 dimensions et que le numéro de ligne ou de colonne est égal à zéro, la référence retournée contient juste la colonne ou la ligne spécifiée. Vous pouvez utiliser la référence retournée dans la syntaxe d'une plage, comme par exemple dans sum(A1:INDEX(A2:A10,4)). \",\n \"s_fdef_INT\": \"Arrondit inférieurement la valeur à l'entier le plus proche (vers -infini). \",\n \"s_fdef_IRR\": \"Retourne le taux d'intérêt auquel le flux d'argent a une valeur nette nulle. Utilise un processus itératif qui retournera une erreur #NUM! si le résultat ne converge pas. Il peut y avoir plus d'une seule possibilité. Fournir une estimation optionnelle peut aider dans certaines situations où il n'y a pas de convergence ou s'il trouve une solution inadaptée (l'estimation par défaut est de 10%). \",\n \"s_fdef_ISBLANK\": \"Retourne \\\"true\\\" si la valeur est une référence à une cellule vide. \",\n \"s_fdef_ISERR\": \"Retourne \\\"true\\\" si la valeur est une référence à une cellule vide of type \\\"Error\\\" but not \\\"NA\\\". \",\n \"s_fdef_ISERROR\": \"Retourne \\\"true\\\" si la valeur est de type \\\"Erreur\\\". \",\n \"s_fdef_ISLOGICAL\": \"Retourne \\\"true\\\" si la valeur est de type logique (\\\"Logical\\\") (vrai/faux). \",\n \"s_fdef_ISNA\": \"Retourne \\\"true\\\" si la valeur est une erreur \\\"NA\\\". \",\n \"s_fdef_ISNONTEXT\": \"Retourne \\\"true\\\" si la valeur n'est pas de type \\\"Text\\\". \",\n \"s_fdef_ISNUMBER\": \"Retourne \\\"true\\\" si la valeur est de type \\\"nombre\\\" (incluant les valeurs logiques). \",\n \"s_fdef_ISTEXT\": \"Retourne \\\"true\\\" si la valeur est de type \\\"Texte\\\". \",\n \"s_fdef_LEFT\": \"Retourne le nombre spécifié de caractères d'une chaîne de texte. Si le nombre est omis, sa valeur est 1. \",\n \"s_fdef_LEN\": \"Retourne le nombre de caractères d'une chaîne de texte. \",\n \"s_fdef_LN\": \"Retourne le logarithme naturel d'une valeur spécifiée. \",\n \"s_fdef_LOG\": \"Retourne le logarithme d'une valeur en utilisant une base spécifiée. \",\n \"s_fdef_LOG10\": \"Retourne le logarithme en base 10 d'une valeur spécifiée. \",\n \"s_fdef_LOWER\": \"Retourne la chaîne de texte avec toutes les majuscules converties en minuscules. \",\n \"s_fdef_MATCH\": \"Cherche la valeur assortie à la valeur donnée dans la sélection et retourne la position (la première est 1) dans cette plage. Si l'option sélection-de-recherche est égale à 1 (par défaut) et non 0, cherche une correspondance dans une fouchette numérique (valeur associée<=valeur) au lieu d'une correspondance exacte. Si sélection-de-recherche est égal à -1, agit comme 1 mais avec la fourchette comme valeur associée>=valeur. \",\n \"s_fdef_MAX\": \"Retourne le maximum des valeurs numériques spécifiées. \",\n \"s_fdef_MID\": \"Retourne le nombre de caractère d'une chaîne de texte en commençant à la position spécifiée. \",\n \"s_fdef_MIN\": \"Retourne le minimum des valeurs numériques spécifiées. \",\n \"s_fdef_MINUTE\": \"Retourne la partie des minutes dans une valeur temporelle ou d'une date et d'un horaire. \",\n \"s_fdef_MOD\": \"Retourne le reste d'une division (euclidienne) d'une première valeur par une autre. \",\n \"s_fdef_MONTH\": \"Retourne la partie du mois d'une date. \",\n \"s_fdef_N\": \"Retourne la valeur si elle est numérique, sinon retourne une erreur. \",\n \"s_fdef_NA\": \"Retourne l'erreur #N/A qui se propage au travers de la plupart des opérations. \",\n \"s_fdef_NOT\": \"Retourne \\\"FALSE\\\" si la valeur est \\\"true\\\", et \\\"TRUE\\\" si la valeur est \\\"false\\\". \",\n \"s_fdef_NOW\": \"Retoune la date et l'heure actuelles. \",\n \"s_fdef_NPER\": \"Retourne le nombre de périodes nécessaire pour avoir la valeur actuelle, avec des paiements investis à chaque période à un taux d'intérêt donné. On peut spécifier la valeur future (0 par défaut) et le type de paiement (par défaut 0 = à la fin de la période, 1 = au début de la période). \",\n \"s_fdef_NPV\": \"Retourne la valeur nette actuelle d'un flux de paiements (qui peuvent être des valeurs individuelles et/ou des plages de données) à un taux d'intérêt donné. Les flux sont positifs dans le cas d'un revenu, négatif s'il s'agit d'une dépense, et pris en compte à la fin de chaque période. \",\n \"s_fdef_ODD\": \"Arrondit la valeur à l'entier impair le plus proche. \",\n \"s_fdef_OR\": \"Vrai si au moins un élément est vrai \",\n \"s_fdef_PI\": \"La valeur 3.1415926… \",\n \"s_fdef_PMT\": \"Retourne le montant de chaque paiement qui doit être investi à un taux donné pour un nombre spécifié de périodes afin d'avoir la valeur actuelle donnée, avec la valeur future optionnelle (0 par défaut) et le type de paiement (par défaut 0 = à la fin de la période, 1 = au début de la période). \",\n \"s_fdef_POWER\": \"Retourne la première valeur mise à la puissance de la seconde valeur. \",\n \"s_fdef_PRODUCT\": \"Retourne le résultat de la multiplication des valeurs numériques spécifiées. \",\n \"s_fdef_PROPER\": \"Retourne la chaîne de texte avec la première lettre de chaque mot convertie en majuscule, et les autres en minuscules. \",\n \"s_fdef_PV\": \"Retourne la valeur actuelle d'un nombre donné de paiements chacuns investis à un taux spécifié, avec la valeur future optionnelle (0 par défaut) et le type de paiement (par défaut 0 = à la fin de la période, 1 = au début de la période). \",\n \"s_fdef_RADIANS\": \"Convertit une valeur de degrès en radians. \",\n \"s_fdef_RATE\": \"Retourne le taux d'intérêt auquel un nombre donné de paiements, chacuns investis à un taux spécifié, ont les valeurs actuelles données, avec la valeur future optionnelle (0 par défaut) et le type de paiement (par défaut 0 = à la fin de la période, 1 = au début de la période). Utilise un processus itératif qui retournera une erreur #NUM! si le résultat ne converge pas. Il peut y avoir plus d'une seule possibilité. Fournir une estimation optionnelle peut aider dans certaines situations où il n'y a pas de convergence ou s'il trouve une solution inadaptée (l'estimation par défaut est de 10%). \",\n \"s_fdef_REPLACE\": \"Retourne texte1 avec le nombre de caractères spécifiés remplacés par texte2, à partir de la position de départ. \",\n \"s_fdef_REPT\": \"Retourne le texte répété le nombre de fois définis. \",\n \"s_fdef_RIGHT\": \"Retourne le nombre de caractères d'une chaîne de texte en partant de la fin. Si compte est omis, la valeur 1 est prise en compte. \",\n \"s_fdef_ROUND\": \"Arrondit au nombre de décimales spécifiées. Si la précision est négative, arrondit alors aux puissances de 10. La précision par défaut est 0 (arrondit à l'entier). \",\n \"s_fdef_ROWS\": \"Retourne le nombre de lignes de la sélection. \",\n \"s_fdef_SECOND\": \"Retourne la deuxième partie d'une heure ou d'une date et d'un horaire (tronquée à un entier). \",\n \"s_fdef_SIN\": \"Fonction trigonometrique sinus (la valeur est en radians) \",\n \"s_fdef_SLN\": \"Retourne le montant de l'amortissement à chaque période en utilisant la méthode constante. \",\n \"s_fdef_SQRT\": \"Racine carrée de la valeur \",\n \"s_fdef_STDEV\": \"Retourne l'écart-type d'une population des valeurs numériques spécifiées. \",\n \"s_fdef_STDEVP\": \"Retourne l'écart-type des valeurs numériques spécifiées. \",\n \"s_fdef_SUBSTITUTE\": \"Retourne \\\"texte1\\\" avec toutes les occurences de \\\"vieux-texte\\\" remplacées par \\\"nouveau-texte\\\". Si l'option \\\"occurrence\\\" est spécifiée, alors seulement cette occurrence est remplacée. \",\n \"s_fdef_SUM\": \"Additionne les valeurs numériques. Les valeurs à sommer doivent être de la forme A1:B5. \",\n \"s_fdef_SUMIF\": \"Additionne les valeurs numériques des cellules qui satisfont le critère. Le critère doit être une valeur (\\\"x\\\", 15, 1+3) ou un test (>25). Si sélection2 n'est pas vide, alors sélection1 sert de test et la valeur correspondante dans sélection2 est sommée. \",\n \"s_fdef_SYD\": \"Amortissement par la méthode de la somme des chiffres de chaque année. \",\n \"s_fdef_T\": \"Retourne la valeur si c'est une chaîne de texte, sinon retourne une chaîne nulle. \",\n \"s_fdef_TAN\": \"Fonction trigonometrique tangente (la valeur est en radians) \",\n \"s_fdef_TIME\": \"Retourne l'heure donnée par l'heure, la minute et la seconde spécifiées. \",\n \"s_fdef_TODAY\": \"Retourne la date actuelle (en tant qu'entier). Note : Dans ce programme, le jour \\\"1\\\" est le 31 décembre 1899 et l'année 1900 n'est pas une année sautée. Certains programmes utilisent le 1er janvier 1900, comme le jour \\\"1\\\" et sautent l'année 1900. Mais dans les deux cas, les dates après le 1er mars 1900 sont les mêmes. \",\n \"s_fdef_TRIM\": \"Retourne la chaîne de texte avec les espaces répétés, de début et de fin supprimés. \",\n \"s_fdef_TRUE\": \"Retourne la valeur logique \\\"true\\\". \",\n \"s_fdef_TRUNC\": \"Tronque la valeur du nombre spécifié decimal places. Si la precision est négative, tronque aux puissances de 10. \",\n \"s_fdef_UPPER\": \"Retourne la chaîne de texte avec toutes les minuscules converties en majuscules. \",\n \"s_fdef_VALUE\": \"Convertit la chaîne de texte donnée en valeur numérique. De nombreuses formes qui ressemblent à des nombres (incluant des chiffres suivis de %, formes ressemblant à des dates, etc.) sont supportées. Cette fonction peut ne pas supporter toutes les formes acceptées par d'autres tableurs et des syntaxes non-anglophones. \",\n \"s_fdef_VAR\": \"Retourne la variance d'une population des valeurs numériques spécifiées. \",\n \"s_fdef_VARP\": \"Retourne la variance des valeurs numériques spécifiées. \",\n \"s_fdef_VLOOKUP\": \"Cherche la valeur assortie à la valeur donnée dans la sélection et retourne la valeur correpondante dans la cellule spécifiée par la colonne de compensation. Si l'option sélection-de-recherche est égale à 1 (par défaut) et non 0, cherche une correspondance dans une fouchette numérique (valeur associée<=valeur) au lieu d'une correspondance exacte. \",\n \"s_fdef_WEEKDAY\": \"Retourne le jour de la semaine de la date spécifiée. Si le type est égal à 1 (par défaut), le jour 1 est le dimanche et le samedi est le jour 7. Si le type est égal à 2, le lundi est le jour 1 et le dimanche est le jour 7. Si le type est 3, le lundi est le jour 0 et le dimanche est le jour 6. \",\n \"s_fdef_YEAR\": \"Retourne l'année d'une date entière. \",\n \"s_fdef_SUMPRODUCT\": \"Additionne les produits en regards de 2 plages de données ou plus. Les plages de données doivent être de même taille.\",\n \"s_fdef_CEILING\": \"Arrondi le nombre fourni au plus proche entier ou magnitude supérieur. La magnitude est le multiple (ou sous-multiple) de 10 supérieur auquel le nombre doit être arrondi (.01, .1, 1, 10, etc.)\",\n \"s_fdef_FLOOR\": \"Arrondi le nombre fourni au plus proche entier ou magnitude. La magnitude est le multiple (ou sous-multiple) de 10 auquel le nombre doit être arrondie (.01, .1, 1, 10, etc.)\",\n\n \"s_farg_v\": \"valeur\",\n \"s_farg_vn\": \"valeur1, valeur2, …\",\n \"s_farg_xy\": \"valeur, valeur\",\n \"s_farg_choose\": \"index, valeur1, valeur2, …\",\n \"s_farg_range\": \"sélection\",\n \"s_farg_rangec\": \"sélection, critère\",\n \"s_farg_date\": \"année, mois, jour\",\n \"s_farg_dfunc\": \"base-de-données-de-la-plage, nom-du-champ, critère-de-sélection\",\n \"s_farg_ddb\": \"coût, amortissement, durée-de-vie, période [, facteur]\",\n \"s_farg_find\": \"chaîne1, chaîne2 [, début]\",\n \"s_farg_fv\": \"taux, n, paiement, [pv, [type-de-paiement]]\",\n \"s_farg_hlookup\": \"valeur, sélection, ligne, [sélection-de-recherche]\",\n \"s_farg_iffunc\": \"expression-logique, vraie-valeur, fausse-valeur\",\n \"s_farg_index\": \"sélection, numéro-de-ligne, numéro-de-colonne\",\n \"s_farg_irr\": \"sélection, [estimation]\",\n \"s_farg_tc\": \"texte, compte\",\n \"s_farg_log\": \"valeur, base\",\n \"s_farg_match\": \"valeur, sélection, [sélection-de-recherche]\",\n \"s_farg_mid\": \"texte, début, longueur\",\n \"s_farg_nper\": \"taux, paiement, pv, [fv, [type-de-paiement]]\",\n \"s_farg_npv\": \"taux, valeur1, valeur2, …\",\n \"s_farg_pmt\": \"taux, n, pv, [fv, [type-de-paiement]]\",\n \"s_farg_pv\": \"taux, n, paiement, [fv, [type-de-paiement]]\",\n \"s_farg_rate\": \"n, paiement, pv, [fv, [type-de-paiement, [estimation]]]\",\n \"s_farg_replace\": \"texte1, début, longueur, texte2\",\n \"s_farg_vp\": \"valeur, [précision]\",\n \"s_farg_valpre\": \"valeur, precision\",\n \"s_farg_csl\": \"coût, récupération, durée-de-vie\",\n \"s_farg_cslp\": \"coût, récupération, durée-de-vie, periode\",\n \"s_farg_subs\": \"texte1, vieux-texte, nouveau-texte [, occurrence]\",\n \"s_farg_sumif\": \"sélection1, critère [, sélection2]\",\n \"s_farg_hms\": \"heure, minute, seconde\",\n \"s_farg_txt\": \"texte\",\n \"s_farg_vlookup\": \"valeur, sélection, colonne, [sélection-de-recherche]\",\n \"s_farg_weekday\": \"date, [type]\",\n \"s_farg_dt\": \"date\",\n \"s_farg_rangen\": \"sélection1, sélection2, ...\",\n \"s_farg_vsig\": \"valeur, [magnitude]\",\n\n \"function_classlist\": [\"all\", \"stat\", \"lookup\", \"datetime\", \"financial\", \"test\", \"math\", \"text\"],\n\n \"s_fclass_all\": \"Tout\",\n \"s_fclass_stat\": \"Statistiques\",\n \"s_fclass_lookup\": \"Recherche\",\n \"s_fclass_datetime\": \"Date et heure\",\n \"s_fclass_financial\": \"Financier\",\n \"s_fclass_test\": \"Test\",\n \"s_fclass_math\": \"Maths\",\n \"s_fclass_text\": \"Texte\",\n\n\"\":\"Graph tab\",\n \"s_loc_plain\": \"Plein\",\n \"s_loc_graph\": \"Graphique\",\n \"s_loc_cells_to_graph\": \"Cellules à tracer\",\n \"s_loc_set_cells_to_graph\": \"Paramétrer les cellules à tracer\",\n \"s_loc_graph_type\": \"Type de graphique\",\n \"s_loc_help\": \"Aide\",\n \"s_loc_horizontal_bar\": \"Histogramme horizontal\",\n \"s_loc_vertical_bar\": \"Histogramme vertical\",\n \"s_loc_pie_chart\": \"Diagramme circulaire (camenbert)\",\n \"s_loc_line_chart\": \"Ligne\",\n \"s_loc_scatter_chart\": \"Nuage de points\",\n \"s_loc_not_set\": \"Non défini\",\n \"s_loc_unknown_range_name\": \"Nom de sélection inconnu\",\n \"s_loc_hide_help\": \"Cacher l'aide\",\n \"s_loc_x\": \"X\",\n \"s_loc_y\": \"Y\",\n \"s_loc_max\": \"Max\",\n \"s_loc_min\": \"Min\",\n \"s_loc_Xselect_rangeX\": \"[Sélection]\",\n \"s_loc_graph_view\": \"Graph View\",\n \"s_GraphRangeNotSelected\": \"Choisissez une plage de cellules de valeurs numériques, puis utilisez le bouton OK ci-dessus pour sélectionner cette plage comme celle à tracer.\",\n\n \"s_graph_error_selection\": \"<b>Erreur de sélection</b>.<br>Vous devez sélectionner des cellules au sein d'une même ligne ou colonne !\",\n \"s_graph_help_intro\": \"Ceci est l'aide pour le type de graphique: \",\n \"s_graph_VerticalBar_help\": \"L'onglet <b>Graphique</b> affiche un histogramme vertical des cellules sélectionnées (dans une seule ligne ou colonne). Si la ligne au-dessus (ou la colonne à gauche) de la sélection a des valeurs, celles-ci sont utilisées comme labels. Sinon ce sont les coordonnées de cellule qui sont utilisées (par exemple : B5).\",\n \"s_graph_HorizontalBar_help\": \"L'onglet <b>Graphique</b> affiche un histogramme horizontal des cellules sélectionnées (dans une seule ligne ou colonne). Si la ligne au-dessus (ou la colonne à gauche) de la sélection a des valeurs, celles-ci sont utilisées comme labels. Sinon ce sont les coordonnées de cellule qui sont utilisées (par exemple : B5).\",\n \"s_graph_PieChart_help\": \"L'onglet <b>Graphique</b> affiche un diagramme circulaire (camembert) des cellules sélectionnées (dans une seule ligne ou colonne). Si la ligne au-dessus (ou la colonne à gauche) de la sélection a des valeurs, celles-ci sont utilisées comme labels. Sinon ce sont les coordonnées de cellule qui sont utilisées (par exemple : B5).\",\n \"s_graph_PieChart_error_selection\": \"<b>Erreur de sélection</b>.<br>Vous ne devez sélectionner que des cellules ayant des valeurs positives !\",\n \"s_graph_LineChart_help\": \"L'onglet <b>Graphique</b> affiche une ligne ou profile XY des cellules sélectionnées (dans une seule ligne ou colonne). La ligne au-dessus (ou la colonne à gauche) de la sélection est utilisée comme coordonnée X.\",\n \"s_graph_ScatterChart_help\": \"L'onglet <b>Graphique</b> affiche un nuage de point ou profile discret XY des cellules sélectionnées (dans une seule ligne ou colonne). La ligne au-dessus (ou la colonne à gauche) de la sélection est utilisée comme coordonnée X. Si la ligne en-dessous (ou la colonne à droite) de la sélection a des valeurs, celles-ci sont interprétées comme une dimension appliquée aux points\",\n\n\"\":\"Clipboard tab\",\n \"s_loc_to\": \"vers\",\n \"s_loc_tiddler\": \"Tiddler\",\n \"s_loc_import\": \"Import\",\n \"s_loc_export\": \"Export\",\n \"s_loc_XclipboardX\": \"[Presse-papier]\",\n \"s_clipboard_menu_title\": \"Import/Export<br> et Presse-papier\",\n \"s_clipboard_export_error_tiddler_exists\": \"Le Tiddler existe déjà\",\n \"s_clipboard_export_error_tiddler_overwrite\": \"Voulez-vous le remplacer ?\",\n \"s_clipboard_import_error_tiddler_format\": \"Erreur de format: le champ \\\"format\\\" du Tiddler a une valeur incorrecte.\",\n\n\"\":\"Save sheet to tiddler\",\n \"s_loc_save_changes\": \"Sauvegarder\",\n \"s_notification_tiddler\": \"La feuille de calcul ~SocialCalc a été sauvegardée\",\n\n\"\":\"\"\n}\n"
},
"$:/plugins/rboue/SocialCalc/Languages/fr-FR--save-notification": {
"title": "$:/plugins/rboue/SocialCalc/Languages/fr-FR--save-notification",
"text": "La feuille de calcul ~SocialCalc a été sauvegardée\n"
},
"$:/plugins/rboue/SocialCalc/Lib/socialcalc-min.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/SocialCalc/Lib/socialcalc-min.js",
"module-type": "library",
"text": "(function(){\nvar SocialCalc;SocialCalc||(SocialCalc={});\nSocialCalc.Constants={textdatadefaulttype:\"t\",s_BrowserNotSupported:\"Browser not supported.\",s_InternalError:\"Internal SocialCalc error (probably an internal bug): \",s_pssUnknownColType:\"Unknown col type item\",s_pssUnknownRowType:\"Unknown row type item\",s_pssUnknownLineType:\"Unknown line type\",s_cfspUnknownCellType:\"Unknown cell type item\",doCanonicalizeSheet:!0,s_escUnknownSheetCmd:\"Unknown sheet command: \",s_escUnknownSetCoordCmd:\"Unknown set coord command: \",s_escUnknownCmd:\"Unknown command: \",\ns_caccCircRef:\"Circular reference to \",defaultRowNameWidth:\"30\",defaultAssumedRowHeight:15,defaultCellIDPrefix:\"cell_\",defaultCellLayout:\"padding:2px 2px 1px 2px;vertical-align:top;\",defaultCellFontStyle:\"normal normal\",defaultCellFontSize:\"small\",defaultCellFontFamily:\"Verdana,Arial,Helvetica,sans-serif\",defaultPaneDividerWidth:\"2\",defaultPaneDividerHeight:\"3\",defaultGridCSS:\"1px solid #C0C0C0;\",defaultCommentClass:\"\",defaultCommentStyle:\"background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-commentbg.gif);\",\ndefaultCommentNoGridClass:\"\",defaultCommentNoGridStyle:\"\",defaultReadonlyClass:\"\",defaultReadonlyStyle:\"background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-lockbg.gif);\",defaultReadonlyNoGridClass:\"\",defaultReadonlyNoGridStyle:\"\",defaultReadonlyComment:\"Locked cell\",defaultColWidth:\"80\",defaultMinimumColWidth:10,defaultHighlightTypeCursorClass:\"\",defaultHighlightTypeCursorStyle:\"color:#FFF;backgroundColor:#A6A6A6;\",defaultHighlightTypeRangeClass:\"\",defaultHighlightTypeRangeStyle:\"color:#000;backgroundColor:#E5E5E5;\",\ndefaultColnameClass:\"\",defaultColnameStyle:\"font-size:small;text-align:center;color:#FFFFFF;background-color:#808080;cursor:e-resize;\",defaultSelectedColnameClass:\"\",defaultSelectedColnameStyle:\"font-size:small;text-align:center;color:#FFFFFF;background-color:#404040;cursor:e-resize;\",defaultRownameClass:\"\",defaultRownameStyle:\"font-size:small;text-align:right;color:#FFFFFF;background-color:#808080;direction:rtl;\",defaultSelectedRownameClass:\"\",defaultSelectedRownameStyle:\"font-size:small;text-align:right;color:#FFFFFF;background-color:#404040;\",\ndefaultUpperLeftClass:\"\",defaultUpperLeftStyle:\"font-size:small;\",defaultSkippedCellClass:\"\",defaultSkippedCellStyle:\"font-size:small;background-color:#CCC\",defaultPaneDividerClass:\"\",defaultPaneDividerStyle:\"font-size:small;background-color:#C0C0C0;padding:0px;\",defaultUnhideLeftClass:\"\",defaultUnhideLeftStyle:\"float:right;width:9px;height:12px;cursor:pointer;background-image:url(images/sc-unhideleft.gif);padding:0;\",defaultUnhideRightClass:\"\",defaultUnhideRightStyle:\"float:left;width:9px;height:12px;cursor:pointer;background-image:url(images/sc-unhideright.gif);padding:0;\",\ndefaultUnhideTopClass:\"\",defaultUnhideTopStyle:\"float:left;position:absolute;bottom:-4px;width:12px;height:9px;cursor:pointer;background-image:url(images/sc-unhidetop.gif);padding:0;\",defaultUnhideBottomClass:\"\",defaultUnhideBottomStyle:\"float:left;width:12px;height:9px;cursor:pointer;background-image:url(images/sc-unhidebottom.gif);padding:0;\",s_rcMissingSheet:\"Render Context must have a sheet object\",defaultLinkFormatString:'<span style=\"font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;\">Link</span>',\ndefaultPageLinkFormatString:'<span style=\"font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;\">Page</span>',defaultTiddlerLinkFormatString:'<span style=\"font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;\">Tiddler</span>',defaultFormatp:\"#,##0.0%\",defaultFormatc:\"[$$]#,##0.00\",defaultFormatdt:\"d-mmm-yyyy h:mm:ss\",defaultFormatd:\"d-mmm-yyyy\",defaultFormatt:\"[h]:mm:ss\",defaultDisplayTRUE:\"TRUE\",defaultDisplayFALSE:\"FALSE\",defaultImagePrefix:\"images/sc-\",\ndefaultTableEditorIDPrefix:\"te_\",defaultPageUpDnAmount:15,AllowCtrlS:!0,defaultTableControlThickness:20,cteGriddivClass:\"\",s_statusline_executing:\"Executing...\",s_statusline_displaying:\"Displaying...\",s_statusline_ordering:\"Ordering...\",s_statusline_calculating:\"Calculating...\",s_statusline_calculatingls:\"Calculating... Loading Sheet...\",s_statusline_doingserverfunc:\"doing server function \",s_statusline_incell:\" in cell \",s_statusline_calcstart:\"Calculation start...\",s_statusline_sum:\"SUM\",s_statusline_recalcneeded:'<span style=\"color:#999;\">(Recalc needed)</span>',\ns_statusline_circref:'<span style=\"color:red;\">Circular reference: ',s_inputboxdisplaymultilinetext:\"[Multi-line text: Click icon on right to edit]\",defaultInputEchoClass:\"\",defaultInputEchoStyle:\"filter:alpha(opacity=90);opacity:.9;backgroundColor:#FFD;border:1px solid #884;fontSize:small;padding:2px 10px 1px 2px;cursor:default;\",defaultInputEchoPromptClass:\"\",defaultInputEchoPromptStyle:\"filter:alpha(opacity=90);opacity:.9;backgroundColor:#FFD;borderLeft:1px solid #884;borderRight:1px solid #884;borderBottom:1px solid #884;fontSize:small;fontStyle:italic;padding:2px 10px 1px 2px;cursor:default;\",\nietUnknownFunction:\"Unknown function \",CH_radius1:29,CH_radius2:41,s_CHfillAllTooltip:\"Fill Contents and Formats Down/Right\",s_CHfillContentsTooltip:\"Fill Contents Only Down/Right\",s_CHmovePasteAllTooltip:\"Move Contents and Formats\",s_CHmovePasteContentsTooltip:\"Move Contents Only\",s_CHmoveInsertAllTooltip:\"Slide Contents and Formats within Row/Col\",s_CHmoveInsertContentsTooltip:\"Slide Contents within Row/Col\",s_CHindicatorOperationLookup:{Fill:\"Fill\",FillC:\"Fill Contents\",Move:\"Move\",MoveI:\"Slide\",\nMoveC:\"Move Contents\",MoveIC:\"Slide Contents\"},s_CHindicatorDirectionLookup:{Down:\" Down\",Right:\" Right\",Horizontal:\" Horizontal\",Vertical:\" Vertical\"},defaultTCSliderThickness:9,defaultTCButtonThickness:20,defaultTCThumbThickness:15,TCmainStyle:\"backgroundColor:#EEE;\",TCmainClass:\"\",TCendcapStyle:\"backgroundColor:#FFF;\",TCendcapClass:\"\",TCpanesliderStyle:\"backgroundColor:#CCC;\",TCpanesliderClass:\"\",s_panesliderTooltiph:\"Drag to lock pane vertically\",s_panesliderTooltipv:\"Drag to lock pane horizontally\",\nTClessbuttonStyle:\"backgroundColor:#AAA;\",TClessbuttonClass:\"\",TClessbuttonRepeatWait:300,TClessbuttonRepeatInterval:20,TCmorebuttonStyle:\"backgroundColor:#AAA;\",TCmorebuttonClass:\"\",TCmorebuttonRepeatWait:300,TCmorebuttonRepeatInterval:20,TCscrollareaStyle:\"backgroundColor:#DDD;\",TCscrollareaClass:\"\",TCscrollareaRepeatWait:500,TCscrollareaRepeatInterval:100,TCthumbClass:\"\",TCthumbStyle:\"backgroundColor:#CCC;\",TCPStrackinglineClass:\"\",TCPStrackinglineStyle:\"overflow:hidden;position:absolute;zIndex:100;\",\nTCPStrackinglineThickness:\"2px\",TCTDFSthumbstatusvClass:\"\",TCTDFSthumbstatusvStyle:\"height:20px;width:auto;border:3px solid #808080;overflow:hidden;backgroundColor:#FFF;fontSize:small;position:absolute;zIndex:100;\",TCTDFSthumbstatushClass:\"\",TCTDFSthumbstatushStyle:\"height:20px;width:auto;border:1px solid black;padding:2px;backgroundColor:#FFF;fontSize:small;position:absolute;zIndex:100;\",TCTDFSthumbstatusrownumClass:\"\",TCTDFSthumbstatusrownumStyle:\"color:#FFF;background-color:#808080;font-size:small;white-space:nowrap;padding:3px;\",\nTCTDFStopOffsetv:0,TCTDFSleftOffsetv:-80,s_TCTDFthumbstatusPrefixv:\"Row \",TCTDFStopOffseth:-30,TCTDFSleftOffseth:0,s_TCTDFthumbstatusPrefixh:\"Col \",TooltipOffsetX:2,TooltipOffsetY:10,TDpopupElementClass:\"\",TDpopupElementStyle:\"border:1px solid black;padding:1px 2px 2px 2px;textAlign:center;backgroundColor:#FFF;fontSize:7pt;fontFamily:Verdana,Arial,Helvetica,sans-serif;position:absolute;width:auto;zIndex:110;\",SCToolbarbackground:\"background-color:#404040;\",SCTabbackground:\"background-color:#CCC;\",\nSCTabselectedCSS:\"display:inline-block;font-size:small;padding:6px 16px 6px 8px;color:#FFF;background-color:#404040;cursor:default;border-right:1px solid #CCC;\",SCTabplainCSS:\"display:inline-block;font-size:small;padding:6px 16px 6px 8px;color:#FFF;background-color:#808080;cursor:default;border-right:1px solid #CCC;\",SCToolbartext:\"font-size:x-small;font-weight:bold;color:#FFF;padding-bottom:4px;\",SCFormulabarheight:30,SCStatuslineheight:20,SCStatuslineCSS:\"font-size:10px;padding:3px 0px;\",SCFormatNumberFormats:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Auto w/ commas!:[,]General|[break]:|00:00|000:000|0000:0000|00000:00000|[break]:|%loc!Formula!:formula|%loc!Hidden!:hidden|[newcol]:1234:0|1,234:#,##0|1,234.5:#,##0.0|1,234.56:#,##0.00|1,234.567:#,##0.000|1,234.5678:#,##0.0000|[break]:|1,234%:#,##0%|1,234.5%:#,##0.0%|1,234.56%:#,##0.00%|[newcol]:|$1,234:$#,##0|$1,234.5:$#,##0.0|$1,234.56:$#,##0.00|[break]:|(1,234):#,##0_);(#,##0)|(1,234.5):#,##0.0_);(#,##0.0)|(1,234.56):#,##0.00_);(#,##0.00)|[break]:|($1,234):#,##0_);($#,##0)|($1,234.5):$#,##0.0_);($#,##0.0)|($1,234.56):$#,##0.00_);($#,##0.00)|[newcol]:|1/4/06:m/d/yy|01/04/2006:mm/dd/yyyy|2006-01-04:yyyy-mm-dd|4-Jan-06:d-mmm-yy|04-Jan-2006:dd-mmm-yyyy|January 4, 2006:mmmm d, yyyy|[break]:|1\\\\c23:h:mm|1\\\\c23 PM:h:mm AM/PM|1\\\\c23\\\\c45:h:mm:ss|01\\\\c23\\\\c45:hh:mm:ss|26\\\\c23 (h\\\\cm):[hh]:mm|69\\\\c45 (m\\\\cs):[mm]:ss|69 (s):[ss]|[newcol]:|2006-01-04 01\\\\c23\\\\c45:yyyy-mm-dd hh:mm:ss|January 4, 2006:mmmm d, yyyy hh:mm:ss|Wed:ddd|Wednesday:dddd|\",\nSCFormatTextFormats:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!Automatic!:general|%loc!Plain Text!:text-plain|HTML:text-html|%loc!Wikitext!:text-wiki|%loc!Link!:text-link|%loc!Formula!:formula|%loc!Hidden!:hidden|\",SCFormatPadsizes:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|%loc!No padding!:0px|[newcol]:|1 pixel:1px|2 pixels:2px|3 pixels:3px|4 pixels:4px|5 pixels:5px|6 pixels:6px|7 pixels:7px|8 pixels:8px|[newcol]:|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|16 pixels:16px|18 pixels:18px|[newcol]:|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\nSCFormatFontsizes:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|X-Small:x-small|Small:small|Medium:medium|Large:large|X-Large:x-large|[newcol]:|6pt:6pt|7pt:7pt|8pt:8pt|9pt:9pt|10pt:10pt|11pt:11pt|12pt:12pt|14pt:14pt|16pt:16pt|[newcol]:|18pt:18pt|20pt:20pt|22pt:22pt|24pt:24pt|28pt:28pt|36pt:36pt|48pt:48pt|72pt:72pt|[newcol]:|8 pixels:8px|9 pixels:9px|10 pixels:10px|11 pixels:11px|12 pixels:12px|13 pixels:13px|14 pixels:14px|[newcol]:|16 pixels:16px|18 pixels:18px|20 pixels:20px|22 pixels:22px|24 pixels:24px|28 pixels:28px|36 pixels:36px|\",\nSCFormatFontfamilies:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|Verdana:Verdana,Arial,Helvetica,sans-serif|Arial:arial,helvetica,sans-serif|Courier:'Courier New',Courier,monospace|\",SCFormatFontlook:\"[cancel]:|[break]:|%loc!Default!:|%loc!Normal!:normal normal|%loc!Bold!:normal bold|%loc!Italic!:italic normal|%loc!Bold Italic!:italic bold\",SCFormatTextAlignhoriz:\"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",SCFormatNumberAlignhoriz:\"[cancel]:|[break]:|%loc!Default!:|%loc!Left!:left|%loc!Center!:center|%loc!Right!:right|\",\nSCFormatAlignVertical:\"[cancel]:|[break]:|%loc!Default!:|%loc!Top!:top|%loc!Middle!:middle|%loc!Bottom!:bottom|\",SCFormatColwidth:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|20 pixels:20|40:40|60:60|80:80|100:100|120:120|140:140|160:160|[newcol]:|180 pixels:180|200:200|220:220|240:240|260:260|280:280|300:300|\",SCFormatRecalc:\"[cancel]:|[break]:|%loc!Auto!:|%loc!Manual!:off|\",SCFormatUserMaxCol:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",\nSCFormatUserMaxRow:\"[cancel]:|[break]:|%loc!Default!:|[custom]:|[newcol]:|Unlimited:0|10:10|20:20|30:30|40:40|50:50|60:60|80:80|100:100|\",ISCButtonBorderNormal:\"#404040\",ISCButtonBorderHover:\"#999\",ISCButtonBorderDown:\"#FFF\",ISCButtonDownBackground:\"#888\",s_PopupListCancel:\"[Cancel]\",s_PopupListCustom:\"Custom\",s_loc_align_center:\"Align Center\",s_loc_align_left:\"Align Left\",s_loc_align_right:\"Align Right\",s_loc_alignment:\"Alignment\",s_loc_audit:\"Audit\",s_loc_audit_trail_this_session:\"Audit Trail This Session\",\ns_loc_auto:\"Auto\",s_loc_auto_sum:\"Auto Sum\",s_loc_auto_wX_commas:\"Auto w/ commas\",s_loc_automatic:\"Automatic\",s_loc_background:\"Background\",s_loc_bold:\"Bold\",s_loc_bold_XampX_italics:\"Bold & Italics\",s_loc_bold_italic:\"Bold Italic\",s_loc_borders:\"Borders\",s_loc_borders_off:\"Borders Off\",s_loc_borders_on:\"Borders On\",s_loc_bottom:\"Bottom\",s_loc_bottom_border:\"Bottom Border\",s_loc_cell_settings:\"CELL SETTINGS\",s_loc_csv_format:\"CSV format\",s_loc_cancel:\"Cancel\",s_loc_category:\"Category\",s_loc_center:\"Center\",\ns_loc_clear:\"Clear\",s_loc_clear_socialcalc_clipboard:\"Clear SocialCalc Clipboard\",s_loc_clipboard:\"Clipboard\",s_loc_color:\"Color\",s_loc_column_:\"Column \",s_loc_comment:\"Comment\",s_loc_copy:\"Copy\",s_loc_custom:\"Custom\",s_loc_cut:\"Cut\",s_loc_default:\"Default\",s_loc_default_alignment:\"Default Alignment\",s_loc_default_column_width:\"Default Column Width\",s_loc_default_font:\"Default Font\",s_loc_default_format:\"Default Format\",s_loc_default_padding:\"Default Padding\",s_loc_delete:\"Delete\",s_loc_delete_column:\"Delete Column\",\ns_loc_delete_contents:\"Delete Contents\",s_loc_delete_row:\"Delete Row\",s_loc_description:\"Description\",s_loc_display_clipboard_in:\"Display Clipboard in\",s_loc_down:\"Down\",s_loc_edit:\"Edit\",s_loc_existing_names:\"Existing Names\",s_loc_family:\"Family\",s_loc_fill_down:\"Fill Down\",s_loc_fill_right:\"Fill Right\",s_loc_font:\"Font\",s_loc_format:\"Format\",s_loc_formula:\"Formula\",s_loc_function_list:\"Function List\",s_loc_functions:\"Functions\",s_loc_grid:\"Grid\",s_loc_hidden:\"Hidden\",s_loc_hide_column:\"Hide Column\",\ns_loc_hide_row:\"Hide Row\",s_loc_horizontal:\"Horizontal\",s_loc_insert_column:\"Insert Column\",s_loc_insert_row:\"Insert Row\",s_loc_italic:\"Italic\",s_loc_last_sort:\"Last Sort\",s_loc_left:\"Left\",s_loc_left_border:\"Left Border\",s_loc_link:\"Link\",s_loc_link_input_box:\"Link Input Box\",s_loc_list:\"List\",s_loc_load_socialcalc_clipboard_with_this:\"Load SocialCalc Clipboard With This\",s_loc_lock:\"Lock\",s_loc_major_sort:\"Major Sort\",s_loc_manual:\"Manual\",s_loc_merge_cells:\"Merge Cells\",s_loc_middle:\"Middle\",s_loc_minor_sort:\"Minor Sort\",\ns_loc_move_insert:\"Move Insert\",s_loc_move_paste:\"Move Paste\",s_loc_multiXline_input_box:\"Multi-line Input Box\",s_loc_name:\"Name\",s_loc_names:\"Names\",s_loc_no_padding:\"No padding\",s_loc_normal:\"Normal\",s_loc_number:\"Number\",s_loc_number_horizontal:\"Number Horizontal\",s_loc_ok:\"OK\",s_loc_padding:\"Padding\",s_loc_page_name:\"Page Name\",s_loc_paste:\"Paste\",s_loc_paste_formats:\"Paste Formats\",s_loc_plain_text:\"Plain Text\",s_loc_recalc:\"Recalc\",s_loc_recalculation:\"Recalculation\",s_loc_redo:\"Redo\",s_loc_right:\"Right\",\ns_loc_right_border:\"Right Border\",s_loc_sheet_settings:\"SHEET SETTINGS\",s_loc_save:\"Save\",s_loc_save_to:\"Save to\",s_loc_set_cell_contents:\"Set Cell Contents\",s_loc_set_cells_to_sort:\"Set Cells To Sort\",s_loc_set_value_to:\"Set Value To\",s_loc_set_to_link_format:\"Set to Link format\",s_loc_setXclear_move_from:\"Set/Clear Move From\",s_loc_show_cell_settings:\"Show Cell Settings\",s_loc_show_sheet_settings:\"Show Sheet Settings\",s_loc_show_in_new_browser_window:\"Show in new browser window\",s_loc_size:\"Size\",\ns_loc_socialcalcXsave_format:\"SocialCalc-save format\",s_loc_sort:\"Sort\",s_loc_sort_:\"Sort \",s_loc_sort_cells:\"Sort Cells\",s_loc_swap_colors:\"Swap Colors\",s_loc_tabXdelimited_format:\"Tab-delimited format\",s_loc_text:\"Text\",s_loc_text_horizontal:\"Text Horizontal\",s_loc_this_is_aXbrXsample:\"This is a<br>sample\",s_loc_top:\"Top\",s_loc_top_border:\"Top Border\",s_loc_undone_steps:\"UNDONE STEPS\",s_loc_url:\"URL\",s_loc_undo:\"Undo\",s_loc_unlock:\"Unlock\",s_loc_unmerge_cells:\"Unmerge Cells\",s_loc_up:\"Up\",s_loc_value:\"Value\",\ns_loc_vertical:\"Vertical\",s_loc_wikitext:\"Wikitext\",s_loc_workspace:\"Workspace\",s_loc_XnewX:\"[New]\",s_loc_XnoneX:\"[None]\",s_loc_Xselect_rangeX:\"[select range]\",SVStatuslineheight:20,SVStatuslineCSS:\"font-size:10px;padding:3px 0px;\",FormatNumber_separatorchar:\",\",FormatNumber_decimalchar:\".\",FormatNumber_defaultCurrency:\"$\",s_FormatNumber_daynames:\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \"),s_FormatNumber_daynames3:\"Sun Mon Tue Wed Thu Fri Sat\".split(\" \"),s_FormatNumber_monthnames:\"January February March April May June July August September October November December\".split(\" \"),\ns_FormatNumber_monthnames3:\"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\".split(\" \"),s_FormatNumber_am:\"AM\",s_FormatNumber_am1:\"A\",s_FormatNumber_pm:\"PM\",s_FormatNumber_pm1:\"P\",s_parseerrexponent:\"Improperly formed number exponent\",s_parseerrchar:\"Unexpected character in formula\",s_parseerrstring:\"Improperly formed string\",s_parseerrspecialvalue:\"Improperly formed special value\",s_parseerrtwoops:\"Error in formula (two operators inappropriately in a row)\",s_parseerrmissingopenparen:\"Missing open parenthesis in list with comma(s). \",\ns_parseerrcloseparennoopen:\"Closing parenthesis without open parenthesis. \",s_parseerrmissingcloseparen:\"Missing close parenthesis. \",s_parseerrmissingoperand:\"Missing operand. \",s_parseerrerrorinformula:\"Error in formula.\",s_calcerrerrorvalueinformula:\"Error value in formula\",s_parseerrerrorinformulabadval:\"Error in formula resulting in bad value\",s_formularangeresult:\"Formula results in range value:\",s_calcerrnumericnan:\"Formula results in an bad numeric value\",s_calcerrnumericoverflow:\"Numeric overflow\",\ns_sheetunavailable:\"Sheet unavailable:\",s_calcerrcellrefmissing:\"Cell reference missing when expected.\",s_calcerrsheetnamemissing:\"Sheet name missing when expected.\",s_circularnameref:\"Circular name reference to name\",s_calcerrunknownname:\"Unknown name\",s_calcerrincorrectargstofunction:\"Incorrect arguments to function\",s_sheetfuncunknownfunction:\"Unknown function\",s_sheetfunclnarg:\"LN argument must be greater than 0\",s_sheetfunclog10arg:\"LOG10 argument must be greater than 0\",s_sheetfunclogsecondarg:\"LOG second argument must be numeric greater than 0\",\ns_sheetfunclogfirstarg:\"LOG first argument must be greater than 0\",s_sheetfuncroundsecondarg:\"ROUND second argument must be numeric\",s_sheetfuncddblife:\"DDB life must be greater than 1\",s_sheetfuncslnlife:\"SLN life must be greater than 1\",s_fdef_ABS:\"Absolute value function. \",s_fdef_ACOS:\"Trigonometric arccosine function. \",s_fdef_AND:\"True if all arguments are true. \",s_fdef_ASIN:\"Trigonometric arcsine function. \",s_fdef_ATAN:\"Trigonometric arctan function. \",s_fdef_ATAN2:\"Trigonometric arc tangent function (result is in radians). \",\ns_fdef_AVERAGE:\"Averages the values. \",s_fdef_CHOOSE:\"Returns the value specified by the index. The values may be ranges of cells. \",s_fdef_COLUMNS:\"Returns the number of columns in the range. \",s_fdef_COS:\"Trigonometric cosine function (value is in radians). \",s_fdef_COUNT:\"Counts the number of numeric values, not blank, text, or error. \",s_fdef_COUNTA:\"Counts the number of non-blank values. \",s_fdef_COUNTBLANK:'Counts the number of blank values. (Note: \"\" is not blank.) ',s_fdef_COUNTIF:'Counts the number of number of cells in the range that meet the criteria. The criteria may be a value (\"x\", 15, 1+3) or a test (>25). ',\ns_fdef_DATE:'Returns the appropriate date value given numbers for year, month, and day. For example: DATE(2006,2,1) for February 1, 2006. Note: In this program, day \"1\" is December 31, 1899 and the year 1900 is not a leap year. Some programs use January 1, 1900, as day \"1\" and treat 1900 as a leap year. In both cases, though, dates on or after March 1, 1900, are the same. ',s_fdef_DAVERAGE:\"Averages the values in the specified field in records that meet the criteria. \",s_fdef_DAY:\"Returns the day of month for a date value. \",\ns_fdef_DCOUNT:\"Counts the number of numeric values, not blank, text, or error, in the specified field in records that meet the criteria. \",s_fdef_DCOUNTA:\"Counts the number of non-blank values in the specified field in records that meet the criteria. \",s_fdef_DDB:\"Returns the amount of depreciation at the given period of time (the default factor is 2 for double-declining balance). \",s_fdef_DEGREES:\"Converts value in radians into degrees. \",s_fdef_DGET:\"Returns the value of the specified field in the single record that meets the criteria. \",\ns_fdef_DMAX:\"Returns the maximum of the numeric values in the specified field in records that meet the criteria. \",s_fdef_DMIN:\"Returns the maximum of the numeric values in the specified field in records that meet the criteria. \",s_fdef_DPRODUCT:\"Returns the result of multiplying the numeric values in the specified field in records that meet the criteria. \",s_fdef_DSTDEV:\"Returns the sample standard deviation of the numeric values in the specified field in records that meet the criteria. \",s_fdef_DSTDEVP:\"Returns the standard deviation of the numeric values in the specified field in records that meet the criteria. \",\ns_fdef_DSUM:\"Returns the sum of the numeric values in the specified field in records that meet the criteria. \",s_fdef_DVAR:\"Returns the sample variance of the numeric values in the specified field in records that meet the criteria. \",s_fdef_DVARP:\"Returns the variance of the numeric values in the specified field in records that meet the criteria. \",s_fdef_EVEN:\"Rounds the value up in magnitude to the nearest even integer. \",s_fdef_EXACT:'Returns \"true\" if the values are exactly the same, including case, type, etc. ',\ns_fdef_EXP:\"Returns e raised to the value power. \",s_fdef_FACT:\"Returns factorial of the value. \",s_fdef_FALSE:'Returns the logical value \"false\". ',s_fdef_FIND:'Returns the starting position within string2 of the first occurrence of string1 at or after \"start\". If start is omitted, 1 is assumed. ',s_fdef_FV:\"Returns the future value of repeated payments of money invested at the given rate for the specified number of periods, with optional present value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",\ns_fdef_HLOOKUP:\"Look for the matching value for the given value in the range and return the corresponding value in the cell specified by the row offset. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match<=value) instead of exact match. \",s_fdef_HOUR:\"Returns the hour portion of a time or date/time value. \",s_fdef_IF:\"Results in true-value if logical-expression is TRUE or non-zero, otherwise results in false-value. \",s_fdef_INDEX:\"Returns a cell or range reference for the specified row and column in the range. If range is 1-dimensional, then only one of rownum or colnum are needed. If range is 2-dimensional and rownum or colnum are zero, a reference to the range of just the specified column or row is returned. You can use the returned reference value in a range, e.g., sum(A1:INDEX(A2:A10,4)). \",\ns_fdef_INT:\"Returns the value rounded down to the nearest integer (towards -infinity). \",s_fdef_IRR:\"Returns the interest rate at which the cash flows in the range have a net present value of zero. Uses an iterative process that will return #NUM! error if it does not converge. There may be more than one possible solution. Providing the optional guess value may help in certain situations where it does not converge or finds an inappropriate solution (the default guess is 10%). \",s_fdef_ISBLANK:'Returns \"true\" if the value is a reference to a blank cell. ',\ns_fdef_ISERR:'Returns \"true\" if the value is of type \"Error\" but not \"NA\". ',s_fdef_ISERROR:'Returns \"true\" if the value is of type \"Error\". ',s_fdef_ISLOGICAL:'Returns \"true\" if the value is of type \"Logical\" (true/false). ',s_fdef_ISNA:'Returns \"true\" if the value is the error type \"NA\". ',s_fdef_ISNONTEXT:'Returns \"true\" if the value is not of type \"Text\". ',s_fdef_ISNUMBER:'Returns \"true\" if the value is of type \"Number\" (including logical values). ',s_fdef_ISTEXT:'Returns \"true\" if the value is of type \"Text\". ',\ns_fdef_LEFT:\"Returns the specified number of characters from the text value. If count is omitted, 1 is assumed. \",s_fdef_LEN:\"Returns the number of characters in the text value. \",s_fdef_LN:\"Returns the natural logarithm of the value. \",s_fdef_LOG:\"Returns the logarithm of the value using the specified base. \",s_fdef_LOG10:\"Returns the base 10 logarithm of the value. \",s_fdef_LOWER:\"Returns the text value with all uppercase characters converted to lowercase. \",s_fdef_MATCH:\"Look for the matching value for the given value in the range and return position (the first is 1) in that range. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match<=value) instead of exact match. If rangelookup is -1, act like 1 but the bracket is match>=value. \",\ns_fdef_MAX:\"Returns the maximum of the numeric values. \",s_fdef_MID:\"Returns the specified number of characters from the text value starting from the specified position. \",s_fdef_MIN:\"Returns the minimum of the numeric values. \",s_fdef_MINUTE:\"Returns the minute portion of a time or date/time value. \",s_fdef_MOD:\"Returns the remainder of the first value divided by the second. \",s_fdef_MONTH:\"Returns the month part of a date value. \",s_fdef_N:\"Returns the value if it is a numeric value otherwise an error. \",\ns_fdef_NA:\"Returns the #N/A error value which propagates through most operations. \",s_fdef_NOT:\"Returns FALSE if value is true, and TRUE if it is false. \",s_fdef_NOW:\"Returns the current date/time. \",s_fdef_NPER:\"Returns the number of periods at which payments invested each period at the given rate with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period) has the given present value. \",s_fdef_NPV:\"Returns the net present value of cash flows (which may be individual values and/or ranges) at the given rate. The flows are positive if income, negative if paid out, and are assumed at the end of each period. \",\ns_fdef_ODD:\"Rounds the value up in magnitude to the nearest odd integer. \",s_fdef_OR:\"True if any argument is true \",s_fdef_PI:\"The value 3.1415926... \",s_fdef_PMT:\"Returns the amount of each payment that must be invested at the given rate for the specified number of periods to have the specified present value, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",s_fdef_POWER:\"Returns the first value raised to the second value power. \",\ns_fdef_PRODUCT:\"Returns the result of multiplying the numeric values. \",s_fdef_PROPER:\"Returns the text value with the first letter of each word converted to uppercase and the others to lowercase. \",s_fdef_PV:\"Returns the present value of the given number of payments each invested at the given rate, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). \",s_fdef_RADIANS:\"Converts value in degrees into radians. \",s_fdef_RATE:\"Returns the rate at which the given number of payments each invested at the given rate has the specified present value, with optional future value (default 0) and payment type (default 0 = at end of period, 1 = beginning of period). Uses an iterative process that will return #NUM! error if it does not converge. There may be more than one possible solution. Providing the optional guess value may help in certain situations where it does not converge or finds an inappropriate solution (the default guess is 10%). \",\ns_fdef_REPLACE:\"Returns text1 with the specified number of characters starting from the specified position replaced by text2. \",s_fdef_REPT:\"Returns the text repeated the specified number of times. \",s_fdef_RIGHT:\"Returns the specified number of characters from the text value starting from the end. If count is omitted, 1 is assumed. \",s_fdef_ROUND:\"Rounds the value to the specified number of decimal places. If precision is negative, then round to powers of 10. The default precision is 0 (round to integer). \",\ns_fdef_ROWS:\"Returns the number of rows in the range. \",s_fdef_SECOND:\"Returns the second portion of a time or date/time value (truncated to an integer). \",s_fdef_SIN:\"Trigonometric sine function (value is in radians) \",s_fdef_SLN:\"Returns the amount of depreciation at each period of time using the straight-line method. \",s_fdef_SQRT:\"Square root of the value \",s_fdef_STDEV:\"Returns the sample standard deviation of the numeric values. \",s_fdef_STDEVP:\"Returns the standard deviation of the numeric values. \",\ns_fdef_SUBSTITUTE:'Returns text1 with the all occurrences of oldtext replaced by newtext. If \"occurrence\" is present, then only that occurrence is replaced. ',s_fdef_SUM:\"Adds the numeric values. The values to the sum function may be ranges in the form similar to A1:B5. \",s_fdef_SUMIF:'Sums the numeric values of cells in the range that meet the criteria. The criteria may be a value (\"x\", 15, 1+3) or a test (>25). If range2 is present, then range1 is tested and the corresponding range2 value is summed. ',\ns_fdef_SYD:\"Depreciation by Sum of Year's Digits method. \",s_fdef_T:\"Returns the text value or else a null string. \",s_fdef_TAN:\"Trigonometric tangent function (value is in radians) \",s_fdef_TIME:\"Returns the time value given the specified hour, minute, and second. \",s_fdef_TODAY:'Returns the current date (an integer). Note: In this program, day \"1\" is December 31, 1899 and the year 1900 is not a leap year. Some programs use January 1, 1900, as day \"1\" and treat 1900 as a leap year. In both cases, though, dates on or after March 1, 1900, are the same. ',\ns_fdef_TRIM:\"Returns the text value with leading, trailing, and repeated spaces removed. \",s_fdef_TRUE:'Returns the logical value \"true\". ',s_fdef_TRUNC:\"Truncates the value to the specified number of decimal places. If precision is negative, truncate to powers of 10. \",s_fdef_UPPER:\"Returns the text value with all lowercase characters converted to uppercase. \",s_fdef_VALUE:\"Converts the specified text value into a numeric value. Various forms that look like numbers (including digits followed by %, forms that look like dates, etc.) are handled. This may not handle all of the forms accepted by other spreadsheets and may be locale dependent. \",\ns_fdef_VAR:\"Returns the sample variance of the numeric values. \",s_fdef_VARP:\"Returns the variance of the numeric values. \",s_fdef_VLOOKUP:\"Look for the matching value for the given value in the range and return the corresponding value in the cell specified by the column offset. If rangelookup is 1 (the default) and not 0, match if within numeric brackets (match>=value) instead of exact match. \",s_fdef_WEEKDAY:\"Returns the day of week specified by the date value. If type is 1 (the default), Sunday is day and Saturday is day 7. If type is 2, Monday is day 1 and Sunday is day 7. If type is 3, Monday is day 0 and Sunday is day 6. \",\ns_fdef_YEAR:\"Returns the year part of a date value. \",s_fdef_SUMPRODUCT:\"Sums the pairwise products of 2 or more ranges. The ranges must be of equal length.\",s_fdef_CEILING:\"Rounds the given number up to the nearest integer or multiple of significance. Significance is the value to whose multiple of ten the value is to be rounded up (.01, .1, 1, 10, etc.)\",s_fdef_FLOOR:\"Rounds the given number down to the nearest multiple of significance. Significance is the value to whose multiple of ten the number is to be rounded down (.01, .1, 1, 10, etc.)\",\ns_farg_v:\"value\",s_farg_vn:\"value1, value2, ...\",s_farg_xy:\"valueX, valueY\",s_farg_choose:\"index, value1, value2, ...\",s_farg_range:\"range\",s_farg_rangec:\"range, criteria\",s_farg_date:\"year, month, day\",s_farg_dfunc:\"databaserange, fieldname, criteriarange\",s_farg_ddb:\"cost, salvage, lifetime, period, [factor]\",s_farg_find:\"string1, string2, [start]\",s_farg_fv:\"rate, n, payment, [pv, [paytype]]\",s_farg_hlookup:\"value, range, row, [rangelookup]\",s_farg_iffunc:\"logical-expression, true-value, [false-value]\",\ns_farg_index:\"range, rownum, colnum\",s_farg_irr:\"range, [guess]\",s_farg_tc:\"text, count\",s_farg_log:\"value, base\",s_farg_match:\"value, range, [rangelookup]\",s_farg_mid:\"text, start, length\",s_farg_nper:\"rate, payment, pv, [fv, [paytype]]\",s_farg_npv:\"rate, value1, value2, ...\",s_farg_pmt:\"rate, n, pv, [fv, [paytype]]\",s_farg_pv:\"rate, n, payment, [fv, [paytype]]\",s_farg_rate:\"n, payment, pv, [fv, [paytype, [guess]]]\",s_farg_replace:\"text1, start, length, text2\",s_farg_vp:\"value, [precision]\",s_farg_valpre:\"value, precision\",\ns_farg_csl:\"cost, salvage, lifetime\",s_farg_cslp:\"cost, salvage, lifetime, period\",s_farg_subs:\"text1, oldtext, newtext, [occurrence]\",s_farg_sumif:\"range1, criteria, [range2]\",s_farg_hms:\"hour, minute, second\",s_farg_txt:\"text\",s_farg_vlookup:\"value, range, col, [rangelookup]\",s_farg_weekday:\"date, [type]\",s_farg_dt:\"date\",s_farg_rangen:\"range1, range2, ...\",s_farg_vsig:\"value, [significance]\",function_classlist:\"all stat lookup datetime financial test math text\".split(\" \"),s_fclass_all:\"All\",s_fclass_stat:\"Statistics\",\ns_fclass_lookup:\"Lookup\",s_fclass_datetime:\"Date & Time\",s_fclass_financial:\"Financial\",s_fclass_test:\"Test\",s_fclass_math:\"Math\",s_fclass_text:\"Text\",s_loc_to:\"to\",s_loc_tiddler:\"Tiddler\",s_loc_import:\"Import\",s_loc_export:\"Export\",s_loc_XclipboardX:\"[Clipboard]\",s_clipboard_menu_title:\"Import/Export<br>and Clipboard\",s_clipboard_export_error_tiddler_exists:\"Tiddler exists\",s_clipboard_export_error_tiddler_overwrite:\"Do you want to overwrite it ?\",s_clipboard_import_error_tiddler_format:\"Format error: tiddler's format field have incorrect value.\",\ns_loc_save_changes:\"Save changes\",s_notification_tiddler:\"Saved ~SocialCalc sheet\",lastone:null};\nSocialCalc.ConstantsDefaultClasses={defaultComment:\"\",defaultCommentNoGrid:\"\",defaultHighlightTypeCursor:\"\",defaultHighlightTypeRange:\"\",defaultColname:\"\",defaultSelectedColname:\"\",defaultRowname:\"\",defaultSelectedRowname:\"\",defaultUpperLeft:\"\",defaultSkippedCell:\"\",defaultPaneDivider:\"\",cteGriddiv:\"\",defaultInputEcho:{classname:\"\",style:\"filter:alpha(opacity=90);opacity:.9;\"},TCmain:\"\",TCendcap:\"\",TCpaneslider:\"\",TClessbutton:\"\",TCmorebutton:\"\",TCscrollarea:\"\",TCthumb:\"\",TCPStrackingline:\"\",TCTDFSthumbstatus:\"\",\nTDpopupElement:\"\"};SocialCalc.ConstantsDefaultClasses.defaultComment={classname:\"\",style:\"background-image:url(images/sc-commentbg.gif);\"};SocialCalc.ConstantsDefaultClasses.defaultInputEcho=\"\";SocialCalc.ConstantsSetClasses=function(a){var c=SocialCalc.ConstantsDefaultClasses,b=SocialCalc.Constants,d;a=a||\"\";for(d in c)\"string\"==typeof c[d]?(b[d+\"Class\"]=a+(c[d]||d),void 0!==b[d+\"Style\"]&&(b[d+\"Style\"]=\"\")):\"object\"==typeof c[d]&&(b[d+\"Class\"]=a+(c[d].classname||d),b[d+\"Style\"]=c[d].style)};\nSocialCalc.ConstantsSetImagePrefix=function(a){var c=SocialCalc.Constants,b;for(b in c)\"string\"==typeof c[b]&&(c[b]=c[b].replace(c.defaultImagePrefix,a));c.defaultImagePrefix=a};SocialCalc||(SocialCalc={});SocialCalc.Callbacks={expand_wiki:null,expand_markup:function(a,c,b){return SocialCalc.default_expand_markup(a,c,b)},MakePageLink:null,NormalizeSheetName:null};SocialCalc.Cell=function(a){this.coord=a;this.datavalue=\"\";this.datatype=null;this.formula=\"\";this.valuetype=\"b\";this.readonly=!1};\nSocialCalc.CellProperties={coord:1,datavalue:1,datatype:1,formula:1,valuetype:1,errors:1,comment:1,readonly:1,bt:2,br:2,bb:2,bl:2,layout:2,font:2,color:2,bgcolor:2,cellformat:2,nontextvalueformat:2,textvalueformat:2,colspan:2,rowspan:2,cssc:2,csss:2,mod:2,displaystring:3,parseinfo:3,hcolspan:3,hrowspan:3};\nSocialCalc.CellPropertiesTable={bt:\"borderstyle\",br:\"borderstyle\",bb:\"borderstyle\",bl:\"borderstyle\",layout:\"layout\",font:\"font\",color:\"color\",bgcolor:\"color\",cellformat:\"cellformat\",nontextvalueformat:\"valueformat\",textvalueformat:\"valueformat\"};SocialCalc.Sheet=function(){SocialCalc.ResetSheet(this);this.statuscallbackparams=this.statuscallback=null};\nSocialCalc.ResetSheet=function(a,c){a.cells={};a.attribs={lastcol:1,lastrow:1,defaultlayout:0,usermaxcol:0,usermaxrow:0};a.rowattribs={hide:{},height:{}};a.colattribs={width:{},hide:{}};a.names={};a.layouts=[];a.layouthash={};a.fonts=[];a.fonthash={};a.colors=[];a.colorhash={};a.borderstyles=[];a.borderstylehash={};a.cellformats=[];a.cellformathash={};a.valueformats=[];a.valueformathash={};a.copiedfrom=\"\";a.changes=new SocialCalc.UndoStack;a.renderneeded=!1;a.changedrendervalues=!0;a.recalcchangedavalue=\n!1;a.hiddencolrow=\"\";a.sci=new SocialCalc.SheetCommandInfo(a)};SocialCalc.Sheet.prototype.ResetSheet=function(){SocialCalc.ResetSheet(this)};SocialCalc.Sheet.prototype.AddCell=function(a){return this.cells[a.coord]=a};SocialCalc.Sheet.prototype.GetAssuredCell=function(a){return this.cells[a]||this.AddCell(new SocialCalc.Cell(a))};SocialCalc.Sheet.prototype.ParseSheetSave=function(a){SocialCalc.ParseSheetSave(a,this)};\nSocialCalc.Sheet.prototype.CellFromStringParts=function(a,c,b){return SocialCalc.CellFromStringParts(this,a,c,b)};SocialCalc.Sheet.prototype.CreateSheetSave=function(a,c){return SocialCalc.CreateSheetSave(this,a,c)};SocialCalc.Sheet.prototype.CellToString=function(a){return SocialCalc.CellToString(this,a)};SocialCalc.Sheet.prototype.CanonicalizeSheet=function(a){return SocialCalc.CanonicalizeSheet(this,a)};\nSocialCalc.Sheet.prototype.EncodeCellAttributes=function(a){return SocialCalc.EncodeCellAttributes(this,a)};SocialCalc.Sheet.prototype.EncodeSheetAttributes=function(){return SocialCalc.EncodeSheetAttributes(this)};SocialCalc.Sheet.prototype.DecodeCellAttributes=function(a,c,b){return SocialCalc.DecodeCellAttributes(this,a,c,b)};SocialCalc.Sheet.prototype.DecodeSheetAttributes=function(a){return SocialCalc.DecodeSheetAttributes(this,a)};\nSocialCalc.Sheet.prototype.ScheduleSheetCommands=function(a,c){return SocialCalc.ScheduleSheetCommands(this,a,c)};SocialCalc.Sheet.prototype.SheetUndo=function(){return SocialCalc.SheetUndo(this)};SocialCalc.Sheet.prototype.SheetRedo=function(){return SocialCalc.SheetRedo(this)};SocialCalc.Sheet.prototype.CreateAuditString=function(){return SocialCalc.CreateAuditString(this)};SocialCalc.Sheet.prototype.GetStyleNum=function(a,c){return SocialCalc.GetStyleNum(this,a,c)};\nSocialCalc.Sheet.prototype.GetStyleString=function(a,c){return SocialCalc.GetStyleString(this,a,c)};SocialCalc.Sheet.prototype.RecalcSheet=function(){return SocialCalc.RecalcSheet(this)};\nSocialCalc.ParseSheetSave=function(a,c){var b=a.split(/\\r\\n|\\n/),d=[],e,f,g,l,h=SocialCalc.Constants;for(e=0;e<b.length;e++)switch(d=b[e],d=d.split(\":\"),d[0]){case \"cell\":g=c.GetAssuredCell(d[1]);f=2;c.CellFromStringParts(g,d,f);break;case \"col\":l=d[1];for(f=2;g=d[f++];)switch(g){case \"w\":c.colattribs.width[l]=d[f++];break;case \"hide\":c.colattribs.hide[l]=d[f++];break;default:throw h.s_pssUnknownColType+\" '\"+g+\"'\";}break;case \"row\":l=d[1]-0;for(f=2;g=d[f++];)switch(g){case \"h\":c.rowattribs.height[l]=\nd[f++]-0;break;case \"hide\":c.rowattribs.hide[l]=d[f++];break;default:throw h.s_pssUnknownRowType+\" '\"+g+\"'\";}break;case \"sheet\":l=c.attribs;for(f=1;g=d[f++];)switch(g){case \"c\":l.lastcol=d[f++]-0;break;case \"r\":l.lastrow=d[f++]-0;break;case \"w\":l.defaultcolwidth=d[f++]+\"\";break;case \"h\":l.defaultrowheight=d[f++]-0;break;case \"tf\":l.defaulttextformat=d[f++]-0;break;case \"ntf\":l.defaultnontextformat=d[f++]-0;break;case \"layout\":l.defaultlayout=d[f++]-0;break;case \"font\":l.defaultfont=d[f++]-0;break;\ncase \"tvf\":l.defaulttextvalueformat=d[f++]-0;break;case \"ntvf\":l.defaultnontextvalueformat=d[f++]-0;break;case \"color\":l.defaultcolor=d[f++]-0;break;case \"bgcolor\":l.defaultbgcolor=d[f++]-0;break;case \"circularreferencecell\":l.circularreferencecell=d[f++];break;case \"recalc\":l.recalc=d[f++];break;case \"needsrecalc\":l.needsrecalc=d[f++];break;case \"usermaxcol\":l.usermaxcol=d[f++]-0;break;case \"usermaxrow\":l.usermaxrow=d[f++]-0;break;default:f+=1}break;case \"name\":f=SocialCalc.decodeFromSave(d[1]).toUpperCase();\nc.names[f]={desc:SocialCalc.decodeFromSave(d[2])};c.names[f].definition=SocialCalc.decodeFromSave(d[3]);break;case \"layout\":d=b[e].match(/^layout\\:(\\d+)\\:(.+)$/);c.layouts[d[1]-0]=d[2];c.layouthash[d[2]]=d[1]-0;break;case \"font\":c.fonts[d[1]-0]=d[2];c.fonthash[d[2]]=d[1]-0;break;case \"color\":c.colors[d[1]-0]=d[2];c.colorhash[d[2]]=d[1]-0;break;case \"border\":c.borderstyles[d[1]-0]=d[2];c.borderstylehash[d[2]]=d[1]-0;break;case \"cellformat\":f=SocialCalc.decodeFromSave(d[2]);c.cellformats[d[1]-0]=f;\nc.cellformathash[f]=d[1]-0;break;case \"valueformat\":f=SocialCalc.decodeFromSave(d[2]);c.valueformats[d[1]-0]=f;c.valueformathash[f]=d[1]-0;break;case \"version\":break;case \"copiedfrom\":c.copiedfrom=d[1]+\":\"+d[2];break;case \"clipboardrange\":case \"clipboard\":break;case \"\":break;default:throw alert(h.s_pssUnknownLineType+\" '\"+d[0]+\"'\"),h.s_pssUnknownLineType+\" '\"+d[0]+\"'\";}};\nSocialCalc.CellFromStringParts=function(a,c,b,d){for(;a=b[d++];)switch(a){case \"v\":c.datavalue=SocialCalc.decodeFromSave(b[d++])-0;c.datatype=\"v\";c.valuetype=\"n\";break;case \"t\":c.datavalue=SocialCalc.decodeFromSave(b[d++]);c.datatype=\"t\";c.valuetype=SocialCalc.Constants.textdatadefaulttype;break;case \"vt\":a=b[d++];c.valuetype=a;\"n\"==a.charAt(0)?(c.datatype=\"v\",c.datavalue=SocialCalc.decodeFromSave(b[d++])-0):(c.datatype=\"t\",c.datavalue=SocialCalc.decodeFromSave(b[d++]));break;case \"vtf\":a=b[d++];\nc.valuetype=a;\"n\"==a.charAt(0)?c.datavalue=SocialCalc.decodeFromSave(b[d++])-0:c.datavalue=SocialCalc.decodeFromSave(b[d++]);c.formula=SocialCalc.decodeFromSave(b[d++]);c.datatype=\"f\";break;case \"vtc\":a=b[d++];c.valuetype=a;\"n\"==a.charAt(0)?c.datavalue=SocialCalc.decodeFromSave(b[d++])-0:c.datavalue=SocialCalc.decodeFromSave(b[d++]);c.formula=SocialCalc.decodeFromSave(b[d++]);c.datatype=\"c\";break;case \"ro\":ro=SocialCalc.decodeFromSave(b[d++]);c.readonly=\"yes\"==ro.toLowerCase();break;case \"e\":c.errors=\nSocialCalc.decodeFromSave(b[d++]);break;case \"b\":c.bt=b[d++]-0;c.br=b[d++]-0;c.bb=b[d++]-0;c.bl=b[d++]-0;break;case \"l\":c.layout=b[d++]-0;break;case \"f\":c.font=b[d++]-0;break;case \"c\":c.color=b[d++]-0;break;case \"bg\":c.bgcolor=b[d++]-0;break;case \"cf\":c.cellformat=b[d++]-0;break;case \"ntvf\":c.nontextvalueformat=b[d++]-0;break;case \"tvf\":c.textvalueformat=b[d++]-0;break;case \"colspan\":c.colspan=b[d++]-0;break;case \"rowspan\":c.rowspan=b[d++]-0;break;case \"cssc\":c.cssc=b[d++];break;case \"csss\":c.csss=\nSocialCalc.decodeFromSave(b[d++]);break;case \"mod\":d+=1;break;case \"comment\":c.comment=SocialCalc.decodeFromSave(b[d++]);break;default:throw SocialCalc.Constants.s_cfspUnknownCellType+\" '\"+a+\"'\";}};SocialCalc.sheetfields=\"defaultrowheight defaultcolwidth circularreferencecell recalc needsrecalc usermaxcol usermaxrow\".split(\" \");SocialCalc.sheetfieldsshort=\"h w circularreferencecell recalc needsrecalc usermaxcol usermaxrow\".split(\" \");SocialCalc.sheetfieldsxlat=\"defaulttextformat defaultnontextformat defaulttextvalueformat defaultnontextvalueformat defaultcolor defaultbgcolor defaultfont defaultlayout\".split(\" \");\nSocialCalc.sheetfieldsxlatshort=\"tf ntf tvf ntvf color bgcolor font layout\".split(\" \");SocialCalc.sheetfieldsxlatxlt=\"cellformat cellformat valueformat valueformat color color font layout\".split(\" \");\nSocialCalc.CreateSheetSave=function(a,c,b){var d,e,f,g,l,h=[];a.CanonicalizeSheet(b||SocialCalc.Constants.doCanonicalizeSheet);var m=a.xlt;e=c?SocialCalc.ParseRange(c):{cr1:{row:1,col:1},cr2:{row:m.maxrow,col:m.maxcol}};b=e.cr1;e=e.cr2;h.push(\"version:1.5\");for(f=b.row;f<=e.row;f++)for(g=b.col;g<=e.col;g++)if(l=SocialCalc.crToCoord(g,f),d=a.cells[l])d=a.CellToString(d),0!=d.length&&(d=\"cell:\"+l+d,h.push(d));for(g=1;g<=m.maxcol;g++)l=SocialCalc.rcColname(g),a.colattribs.width[l]&&h.push(\"col:\"+l+\":w:\"+\na.colattribs.width[l]),a.colattribs.hide[l]&&h.push(\"col:\"+l+\":hide:\"+a.colattribs.hide[l]);for(f=1;f<=m.maxrow;f++)a.rowattribs.height[f]&&h.push(\"row:\"+f+\":h:\"+a.rowattribs.height[f]),a.rowattribs.hide[f]&&h.push(\"row:\"+f+\":hide:\"+a.rowattribs.hide[f]);d=\"sheet:c:\"+m.maxcol+\":r:\"+m.maxrow;for(f=0;f<SocialCalc.sheetfields.length;f++)(g=SocialCalc.encodeForSave(a.attribs[SocialCalc.sheetfields[f]]))&&(d+=\":\"+SocialCalc.sheetfieldsshort[f]+\":\"+g);for(f=0;f<SocialCalc.sheetfieldsxlat.length;f++)(g=\na.attribs[SocialCalc.sheetfieldsxlat[f]])&&(d+=\":\"+SocialCalc.sheetfieldsxlatshort[f]+\":\"+m[SocialCalc.sheetfieldsxlatxlt[f]+\"sxlat\"][g]);h.push(d);for(f=1;f<m.newborderstyles.length;f++)h.push(\"border:\"+f+\":\"+m.newborderstyles[f]);for(f=1;f<m.newcellformats.length;f++)h.push(\"cellformat:\"+f+\":\"+SocialCalc.encodeForSave(m.newcellformats[f]));for(f=1;f<m.newcolors.length;f++)h.push(\"color:\"+f+\":\"+m.newcolors[f]);for(f=1;f<m.newfonts.length;f++)h.push(\"font:\"+f+\":\"+m.newfonts[f]);for(f=1;f<m.newlayouts.length;f++)h.push(\"layout:\"+\nf+\":\"+m.newlayouts[f]);for(f=1;f<m.newvalueformats.length;f++)h.push(\"valueformat:\"+f+\":\"+SocialCalc.encodeForSave(m.newvalueformats[f]));for(f=0;f<m.namesorder.length;f++)d=m.namesorder[f],h.push(\"name:\"+SocialCalc.encodeForSave(d).toUpperCase()+\":\"+SocialCalc.encodeForSave(a.names[d].desc)+\":\"+SocialCalc.encodeForSave(a.names[d].definition));c&&h.push(\"copiedfrom:\"+SocialCalc.crToCoord(b.col,b.row)+\":\"+SocialCalc.crToCoord(e.col,e.row));h.push(\"\");delete a.xlt;return h.join(\"\\n\")};\nSocialCalc.CellToString=function(a,c){var b,d,e,f,g,l;b=\"\";if(!c)return b;d=SocialCalc.encodeForSave(c.datavalue);\"v\"==c.datatype?b=\"n\"==c.valuetype?b+(\":v:\"+d):b+(\":vt:\"+c.valuetype+\":\"+d):\"t\"==c.datatype?b=c.valuetype==SocialCalc.Constants.textdatadefaulttype?b+(\":t:\"+d):b+(\":vt:\"+c.valuetype+\":\"+d):(e=SocialCalc.encodeForSave(c.formula),\"f\"==c.datatype?b+=\":vtf:\"+c.valuetype+\":\"+d+\":\"+e:\"c\"==c.datatype&&(b+=\":vtc:\"+c.valuetype+\":\"+d+\":\"+e));c.readonly&&(b+=\":ro:yes\");c.errors&&(b+=\":e:\"+SocialCalc.encodeForSave(c.errors));\nd=c.bt||\"\";e=c.br||\"\";f=c.bb||\"\";g=c.bl||\"\";if(a.xlt){l=a.xlt;if(d||e||f||g)b+=\":b:\"+l.borderstylesxlat[d||0]+\":\"+l.borderstylesxlat[e||0]+\":\"+l.borderstylesxlat[f||0]+\":\"+l.borderstylesxlat[g||0];c.layout&&(b+=\":l:\"+l.layoutsxlat[c.layout]);c.font&&(b+=\":f:\"+l.fontsxlat[c.font]);c.color&&(b+=\":c:\"+l.colorsxlat[c.color]);c.bgcolor&&(b+=\":bg:\"+l.colorsxlat[c.bgcolor]);c.cellformat&&(b+=\":cf:\"+l.cellformatsxlat[c.cellformat]);c.textvalueformat&&(b+=\":tvf:\"+l.valueformatsxlat[c.textvalueformat]);c.nontextvalueformat&&\n(b+=\":ntvf:\"+l.valueformatsxlat[c.nontextvalueformat])}else{if(d||e||f||g)b+=\":b:\"+d+\":\"+e+\":\"+f+\":\"+g;c.layout&&(b+=\":l:\"+c.layout);c.font&&(b+=\":f:\"+c.font);c.color&&(b+=\":c:\"+c.color);c.bgcolor&&(b+=\":bg:\"+c.bgcolor);c.cellformat&&(b+=\":cf:\"+c.cellformat);c.textvalueformat&&(b+=\":tvf:\"+c.textvalueformat);c.nontextvalueformat&&(b+=\":ntvf:\"+c.nontextvalueformat)}c.colspan&&(b+=\":colspan:\"+c.colspan);c.rowspan&&(b+=\":rowspan:\"+c.rowspan);c.cssc&&(b+=\":cssc:\"+c.cssc);c.csss&&(b+=\":csss:\"+SocialCalc.encodeForSave(c.csss));\nc.mod&&(b+=\":mod:\"+c.mod);c.comment&&(b+=\":comment:\"+SocialCalc.encodeForSave(c.comment));return b};\nSocialCalc.CanonicalizeSheet=function(a,c){var b,d,e,f,g,l,h,m=0,p=0,r=\"borderstyle cellformat color font layout valueformat\".split(\" \"),q={namesorder:[]};for(g in a.names)q.namesorder.push(g);q.namesorder.sort();if(SocialCalc.Constants.doCanonicalizeSheet&&c){for(f=0;f<r.length;f++)g=r[f],q[g+\"sUsed\"]={};h=q.colorsUsed;l=q.borderstylesUsed;var n=q.fontsUsed,s=q.layoutsUsed,t=q.cellformatsUsed,u=q.valueformatsUsed;for(d in a.cells)e=SocialCalc.coordToCr(d),f=a.cells[d],g=!1,f.valuetype&&\"b\"!=f.valuetype&&\n(g=!0),f.color&&(h[f.color]=1,g=!0),f.bgcolor&&(h[f.bgcolor]=1,g=!0),f.bt&&(l[f.bt]=1,g=!0),f.br&&(l[f.br]=1,g=!0),f.bb&&(l[f.bb]=1,g=!0),f.bl&&(l[f.bl]=1,g=!0),f.layout&&(s[f.layout]=1,g=!0),f.font&&(n[f.font]=1,g=!0),f.cellformat&&(t[f.cellformat]=1,g=!0),f.textvalueformat&&(u[f.textvalueformat]=1,g=!0),f.nontextvalueformat&&(u[f.nontextvalueformat]=1,g=!0),g&&(e.row>m&&(m=e.row),e.col>p&&(p=e.col));for(h=0;h<SocialCalc.sheetfieldsxlat.length;h++)(b=a.attribs[SocialCalc.sheetfieldsxlat[h]])&&(q[SocialCalc.sheetfieldsxlatxlt[h]+\n\"sUsed\"][b]=1);g={height:1,hide:1};for(b in g)for(e in a.rowattribs[b])e>m&&(m=e);g={hide:1,width:1};for(b in g)for(d in a.colattribs[b])e=SocialCalc.coordToCr(d+\"1\"),e.col>p&&(p=e.col);for(f=0;f<r.length;f++){g=r[f];d=[];e=q[g+\"sUsed\"];for(b in e)d.push(a[g+\"s\"][b]);d.sort();d.unshift(\"\");e=[\"\"];l=a[g+\"hash\"];for(h=1;h<d.length;h++)e[l[d[h]]]=h;q[g+\"sxlat\"]=e;q[\"new\"+g+\"s\"]=d}q.maxrow=m||1;q.maxcol=p||1}else{for(f=0;f<r.length;f++){g=r[f];q[\"new\"+g+\"s\"]=a[g+\"s\"];b=a[g+\"s\"].length;e=Array(b);e[0]=\n\"\";for(h=1;h<b;h++)e[h]=h;q[g+\"sxlat\"]=e}q.maxrow=a.attribs.lastrow;q.maxcol=a.attribs.lastcol}a.xlt=q};\nSocialCalc.EncodeCellAttributes=function(a,c){var b,d,e={},f=function(a){e[a]={def:!0,val:\"\"}},g=function(a){for(var b=0;b<a.length;b++)f(a[b])},l=function(a,b){e[a].def=!1;e[a].val=b||\"\"};b=function(a,b){\"*\"!=b&&(e[a].def=!1,e[a].val=b)};var h=a.GetAssuredCell(c);f(\"alignhoriz\");h.cellformat&&l(\"alignhoriz\",a.cellformats[h.cellformat]);g([\"alignvert\",\"padtop\",\"padright\",\"padbottom\",\"padleft\"]);h.layout&&(parts=a.layouts[h.layout].match(/^padding:\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+);vertical-align:\\s*(\\S+);/),\nb(\"padtop\",parts[1]),b(\"padright\",parts[2]),b(\"padbottom\",parts[3]),b(\"padleft\",parts[4]),b(\"alignvert\",parts[5]));g([\"fontfamily\",\"fontlook\",\"fontsize\"]);h.font&&(parts=a.fonts[h.font].match(/^(\\*|\\S+? \\S+?) (\\S+?) (\\S.*)$/),b(\"fontfamily\",parts[3]),b(\"fontsize\",parts[2]),b(\"fontlook\",parts[1]));f(\"textcolor\");h.color&&l(\"textcolor\",a.colors[h.color]);f(\"bgcolor\");h.bgcolor&&l(\"bgcolor\",a.colors[h.bgcolor]);g([\"numberformat\",\"textformat\"]);h.nontextvalueformat&&l(\"numberformat\",a.valueformats[h.nontextvalueformat]);\nh.textvalueformat&&l(\"textformat\",a.valueformats[h.textvalueformat]);g([\"colspan\",\"rowspan\"]);l(\"colspan\",h.colspan||1);l(\"rowspan\",h.rowspan||1);for(b=0;4>b;b++)d=\"trbl\".charAt(b),d=\"b\"+d,f(d),l(d,h[d]?a.borderstyles[h[d]]:\"\"),f(d+\"thickness\"),f(d+\"style\"),f(d+\"color\"),h[d]&&(parts=a.borderstyles[h[d]].match(/(\\S+)\\s+(\\S+)\\s+(\\S.+)/),l(d+\"thickness\",parts[1]),l(d+\"style\",parts[2]),l(d+\"color\",parts[3]));g([\"cssc\",\"csss\",\"mod\"]);l(\"cssc\",h.cssc||\"\");l(\"csss\",h.csss||\"\");l(\"mod\",h.mod||\"n\");return e};\nSocialCalc.EncodeSheetAttributes=function(a){var c=a.attribs,b={},d=function(a){b[a]={def:!0,val:\"\"}},e=function(a){for(var b=0;b<a.length;b++)d(a[b])},f=function(a,c){b[a].def=!1;b[a].val=c||void 0},g=function(a,c){\"*\"!=c&&(b[a].def=!1,b[a].val=c)};d(\"colwidth\");c.defaultcolwidth&&f(\"colwidth\",c.defaultcolwidth);d(\"rowheight\");c.rowheight&&f(\"rowheight\",c.defaultrowheight);d(\"textalignhoriz\");c.defaulttextformat&&f(\"textalignhoriz\",a.cellformats[c.defaulttextformat]);d(\"numberalignhoriz\");c.defaultnontextformat&&\nf(\"numberalignhoriz\",a.cellformats[c.defaultnontextformat]);e([\"alignvert\",\"padtop\",\"padright\",\"padbottom\",\"padleft\"]);c.defaultlayout&&(parts=a.layouts[c.defaultlayout].match(/^padding:\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+);vertical-align:\\s*(\\S+);/),g(\"padtop\",parts[1]),g(\"padright\",parts[2]),g(\"padbottom\",parts[3]),g(\"padleft\",parts[4]),g(\"alignvert\",parts[5]));e([\"fontfamily\",\"fontlook\",\"fontsize\"]);c.defaultfont&&(parts=a.fonts[c.defaultfont].match(/^(\\*|\\S+? \\S+?) (\\S+?) (\\S.*)$/),g(\"fontfamily\",\nparts[3]),g(\"fontsize\",parts[2]),g(\"fontlook\",parts[1]));d(\"textcolor\");c.defaultcolor&&f(\"textcolor\",a.colors[c.defaultcolor]);d(\"bgcolor\");c.defaultbgcolor&&f(\"bgcolor\",a.colors[c.defaultbgcolor]);e([\"numberformat\",\"textformat\"]);c.defaultnontextvalueformat&&f(\"numberformat\",a.valueformats[c.defaultnontextvalueformat]);c.defaulttextvalueformat&&f(\"textformat\",a.valueformats[c.defaulttextvalueformat]);d(\"recalc\");c.recalc&&f(\"recalc\",c.recalc);d(\"usermaxcol\");c.usermaxcol&&f(\"usermaxcol\",c.usermaxcol);\nd(\"usermaxrow\");c.usermaxrow&&f(\"usermaxrow\",c.usermaxrow);return b};\nSocialCalc.DecodeCellAttributes=function(a,c,b,d){var e,f=a.GetAssuredCell(c),g=!1,l=function(a,c,d){b[a]&&(a=b[a].def?\"\":b[a].val,a!=(c||\"\")&&m(d+\" \"+a))},h=\"\",m=function(a){h&&(h+=\"\\n\");h+=\"set \"+(d||c)+\" \"+a;g=!0};l(\"alignhoriz\",a.cellformats[f.cellformat],\"cellformat\");e=b.alignvert.def&&b.padtop.def&&b.padright.def&&b.padbottom.def&&b.padleft.def?\"\":\"padding:\"+(b.padtop.def?\"* \":b.padtop.val+\" \")+(b.padright.def?\"* \":b.padright.val+\" \")+(b.padbottom.def?\"* \":b.padbottom.val+\" \")+(b.padleft.def?\n\"*\":b.padleft.val)+\";vertical-align:\"+(b.alignvert.def?\"*;\":b.alignvert.val+\";\");e!=(a.layouts[f.layout]||\"\")&&m(\"layout \"+e);e=b.fontlook.def&&b.fontsize.def&&b.fontfamily.def?\"\":(b.fontlook.def?\"* \":b.fontlook.val+\" \")+(b.fontsize.def?\"* \":b.fontsize.val+\" \")+(b.fontfamily.def?\"*\":b.fontfamily.val);e!=(a.fonts[f.font]||\"\")&&m(\"font \"+e);l(\"textcolor\",a.colors[f.color],\"color\");l(\"bgcolor\",a.colors[f.bgcolor],\"bgcolor\");l(\"numberformat\",a.valueformats[f.nontextvalueformat],\"nontextvalueformat\");\nl(\"textformat\",a.valueformats[f.textvalueformat],\"textvalueformat\");for(i=0;4>i;i++)e=\"trbl\".charAt(i),e=\"b\"+e,l(e,a.borderstyles[f[e]],e);l(\"cssc\",f.cssc,\"cssc\");l(\"csss\",f.csss,\"csss\");b.mod&&(e=b.mod.def?\"n\":b.mod.val,e!=(f.mod||\"n\")&&(\"n\"==e&&(e=\"\"),m(\"mod \"+e)));return g?h:null};\nSocialCalc.DecodeSheetAttributes=function(a,c){var b,d=a.attribs,e=!1,f=function(a,b,d){c[a]&&(a=c[a].def?\"\":c[a].val,a!=(b||\"\")&&l(d+\" \"+a))},g=\"\",l=function(a){g&&(g+=\"\\n\");g+=\"set sheet \"+a;e=!0};f(\"colwidth\",d.defaultcolwidth,\"defaultcolwidth\");f(\"rowheight\",d.defaultrowheight,\"defaultrowheight\");f(\"textalignhoriz\",a.cellformats[d.defaulttextformat],\"defaulttextformat\");f(\"numberalignhoriz\",a.cellformats[d.defaultnontextformat],\"defaultnontextformat\");b=c.alignvert.def&&c.padtop.def&&c.padright.def&&\nc.padbottom.def&&c.padleft.def?\"\":\"padding:\"+(c.padtop.def?\"* \":c.padtop.val+\" \")+(c.padright.def?\"* \":c.padright.val+\" \")+(c.padbottom.def?\"* \":c.padbottom.val+\" \")+(c.padleft.def?\"*\":c.padleft.val)+\";vertical-align:\"+(c.alignvert.def?\"*;\":c.alignvert.val+\";\");b!=(a.layouts[d.defaultlayout]||\"\")&&l(\"defaultlayout \"+b);b=c.fontlook.def&&c.fontsize.def&&c.fontfamily.def?\"\":(c.fontlook.def?\"* \":c.fontlook.val+\" \")+(c.fontsize.def?\"* \":c.fontsize.val+\" \")+(c.fontfamily.def?\"*\":c.fontfamily.val);b!=(a.fonts[d.defaultfont]||\n\"\")&&l(\"defaultfont \"+b);f(\"textcolor\",a.colors[d.defaultcolor],\"defaultcolor\");f(\"bgcolor\",a.colors[d.defaultbgcolor],\"defaultbgcolor\");f(\"numberformat\",a.valueformats[d.defaultnontextvalueformat],\"defaultnontextvalueformat\");f(\"textformat\",a.valueformats[d.defaulttextvalueformat],\"defaulttextvalueformat\");f(\"recalc\",a.attribs.recalc,\"recalc\");f(\"usermaxcol\",a.attribs.usermaxcol,\"usermaxcol\");f(\"usermaxrow\",a.attribs.usermaxrow,\"usermaxrow\");return e?g:null};\nSocialCalc.SheetCommandInfo=function(a){this.sheetobj=a;this.timerobj=this.parseobj=null;this.firsttimerdelay=50;this.timerdelay=1;this.maxtimeslice=100;this.saveundo=!1;this.CmdExtensionCallbacks={};this.cmdextensionbusy=\"\"};\nSocialCalc.ScheduleSheetCommands=function(a,c,b){hack.log('\"'+c+'\"',hack.com,\"SocialCalc.ScheduleSheetCommands\");var d=a.sci;d.parseobj=new SocialCalc.Parse(c);d.saveundo=b;d.sheetobj.statuscallback&&a.statuscallback(d,\"cmdstart\",\"\",d.sheetobj.statuscallbackparams);d.saveundo&&d.sheetobj.changes.PushChange(\"\");d.timerobj=SocialCalc.Callbacks.broadcast?window.setTimeout(function(){var a=d.parseobj;d.parseobj=new SocialCalc.Parse(c);SocialCalc.SheetCommandsTimerRoutine(d);d.parseobj=a},d.firsttimerdelay):\nwindow.setTimeout(function(){SocialCalc.SheetCommandsTimerRoutine(d)},d.firsttimerdelay)};\nSocialCalc.SheetCommandsTimerRoutine=function(a){var c,b=new Date;for(a.timerobj=null;!a.parseobj.EOF();){(c=SocialCalc.ExecuteSheetCommand(a.sheetobj,a.parseobj,a.saveundo))&&alert(c);a.parseobj.NextLine();if(0<a.cmdextensionbusy.length){a.sheetobj.statuscallback&&a.sheetobj.statuscallback(a,\"cmdextension\",a.cmdextensionbusy,a.sheetobj.statuscallbackparams);return}if(new Date-b>=a.maxtimeslice){a.timerobj=window.setTimeout(function(){SocialCalc.SheetCommandsTimerRoutine(a)},a.timerdelay);return}}a.sheetobj.statuscallback&&\na.sheetobj.statuscallback(a,\"cmdend\",\"\",a.sheetobj.statuscallbackparams)};SocialCalc.ResumeFromCmdExtension=function(a){a.cmdextensionbusy=\"\";SocialCalc.SheetCommandsTimerRoutine(a)};\nSocialCalc.ExecuteSheetCommand=function(a,c,b){var d,e,f,g,l,h,m,p,r,q,n,s,t,u,w,v,x,y,z,C,D,G,I,E,H,B,A=a.attribs;B=a.changes;D=SocialCalc.CellProperties;w=SocialCalc.Constants;q=function(){var a=SocialCalc.ParseRange(g);p=a.cr1;r=a.cr2;r.col>A.lastcol&&(A.lastcol=r.col);r.row>A.lastrow&&(A.lastrow=r.row)};m=\"\";d=c.RestOfStringNoMove();b&&a.changes.AddDo(d);e=c.NextToken();TiddlyWiki&&(n=SocialCalc.GetSpreadsheetControlObject(),n.tiddlyWiki.monitorCallback&&n.tiddlyWiki.monitorCallback(d));switch(e){case \"set\":g=\nc.NextToken();l=c.NextToken();f=c.RestOfString();c=\"set \"+g+\" \"+l;if(\"sheet\"==g)switch(a.renderneeded=!0,l){case \"defaultcolwidth\":b&&B.AddUndo(c,A[l]);A[l]=f;break;case \"defaultcolor\":case \"defaultbgcolor\":b&&B.AddUndo(c,a.GetStyleString(\"color\",A[l]));A[l]=a.GetStyleNum(\"color\",f);break;case \"defaultlayout\":b&&B.AddUndo(c,a.GetStyleString(\"layout\",A[l]));A[l]=a.GetStyleNum(\"layout\",f);break;case \"defaultfont\":b&&B.AddUndo(c,a.GetStyleString(\"font\",A[l]));\"* * *\"==f&&(f=\"\");A[l]=a.GetStyleNum(\"font\",\nf);break;case \"defaulttextformat\":case \"defaultnontextformat\":b&&B.AddUndo(c,a.GetStyleString(\"cellformat\",A[l]));A[l]=a.GetStyleNum(\"cellformat\",f);break;case \"defaulttextvalueformat\":case \"defaultnontextvalueformat\":b&&B.AddUndo(c,a.GetStyleString(\"valueformat\",A[l]));A[l]=a.GetStyleNum(\"valueformat\",f);for(h in a.cells)delete a.cells[h].displaystring;break;case \"lastcol\":case \"lastrow\":b&&B.AddUndo(c,A[l]-0);a=f-0;\"number\"==typeof a&&(A[l]=0<a?a:1);break;case \"recalc\":b&&B.AddUndo(c,A[l]);\"off\"==\nf?A.recalc=f:delete A.recalc;break;case \"usermaxcol\":case \"usermaxrow\":b&&B.AddUndo(c,A[l]-0);a=f-0;\"number\"==typeof a&&(A[l]=0<a?a:0);break;default:m=w.s_escUnknownSheetCmd+d}else if(/^[a-z]{1,2}(:[a-z]{1,2})?$/i.test(g))for(a.renderneeded=!0,g=g.toUpperCase(),h=g.indexOf(\":\"),0<=h?(p=SocialCalc.coordToCr(g.substring(0,h)+\"1\"),r=SocialCalc.coordToCr(g.substring(h+1)+\"1\")):r=p=SocialCalc.coordToCr(g+\"1\"),c=p.col;c<=r.col;c++)\"width\"==l?(h=SocialCalc.rcColname(c),b&&B.AddUndo(\"set \"+h+\" width\",a.colattribs.width[h]),\n0<f.length?a.colattribs.width[h]=f:delete a.colattribs.width[h]):\"hide\"==l&&(a.hiddencolrow=\"col\",h=SocialCalc.rcColname(c),b&&B.AddUndo(\"set \"+h+\" hide\",a.colattribs.hide[h]),0<f.length?a.colattribs.hide[h]=f:delete a.colattribs.hide[h]);else if(/^\\d+(:\\d+)?$/i.test(g))for(a.renderneeded=!0,g=g.toUpperCase(),h=g.indexOf(\":\"),0<=h?(p=SocialCalc.coordToCr(\"A\"+g.substring(0,h)),r=SocialCalc.coordToCr(\"A\"+g.substring(h+1))):r=p=SocialCalc.coordToCr(\"A\"+g),q=p.row;q<=r.row;q++)\"height\"==l?(b&&B.AddUndo(\"set \"+\nq+\" height\",a.rowattribs.height[q]),0<f.length?a.rowattribs.height[q]=f:delete a.rowattribs.height[q]):\"hide\"==l&&(a.hiddencolrow=\"row\",b&&B.AddUndo(\"set \"+q+\" hide\",a.rowattribs.hide[q]),0<f.length?a.rowattribs.hide[q]=f:delete a.rowattribs.hide[q]);else if(/^[a-z]{1,2}\\d+(:[a-z]{1,2}\\d+)?$/i.test(g))for(q(),p.row!=r.row||p.col!=r.col||a.celldisplayneeded||a.renderneeded?(a.renderneeded=!0,a.celldisplayneeded=\"\"):a.celldisplayneeded=SocialCalc.crToCoord(p.col,p.row),q=p.row;q<=r.row;q++)for(c=p.col;c<=\nr.col;c++)h=SocialCalc.crToCoord(c,q),n=a.GetAssuredCell(h),n.readonly&&\"readonly\"!=l||(b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n)),\"value\"==l?(h=f.indexOf(\" \"),n.datavalue=f.substring(h+1)-0,delete n.errors,n.datatype=\"v\",n.valuetype=f.substring(0,h),delete n.displaystring,delete n.parseinfo,A.needsrecalc=\"yes\"):\"text\"==l?(h=f.indexOf(\" \"),n.datavalue=SocialCalc.decodeFromSave(f.substring(h+1)),delete n.errors,n.datatype=\"t\",n.valuetype=f.substring(0,h),delete n.displaystring,delete n.parseinfo,\nA.needsrecalc=\"yes\"):\"formula\"==l?(n.datavalue=0,delete n.errors,n.datatype=\"f\",n.valuetype=\"e#N/A\",n.formula=f,delete n.displaystring,delete n.parseinfo,A.needsrecalc=\"yes\"):\"constant\"==l?(h=f.indexOf(\" \"),e=f.substring(h+1).indexOf(\" \"),n.datavalue=f.substring(h+1,h+1+e)-0,n.valuetype=f.substring(0,h),\"e\"==n.valuetype.charAt(0)?n.errors=n.valuetype.substring(1):delete n.errors,n.datatype=\"c\",n.formula=f.substring(h+e+2),delete n.displaystring,delete n.parseinfo,A.needsrecalc=\"yes\"):\"empty\"==l?(n.datavalue=\n\"\",delete n.errors,n.datatype=null,n.formula=\"\",n.valuetype=\"b\",delete n.displaystring,delete n.parseinfo,A.needsrecalc=\"yes\"):\"all\"==l?(0<f.length?(n=new SocialCalc.Cell(h),a.CellFromStringParts(n,f.split(\":\"),1),a.cells[h]=n):delete a.cells[h],A.needsrecalc=\"yes\"):/^b[trbl]$/.test(l)?(n[l]=a.GetStyleNum(\"borderstyle\",f),a.renderneeded=!0):\"color\"==l||\"bgcolor\"==l?n[l]=a.GetStyleNum(\"color\",f):\"layout\"==l||\"cellformat\"==l?n[l]=a.GetStyleNum(l,f):\"font\"==l?(\"* * *\"==f&&(f=\"\"),n[l]=a.GetStyleNum(\"font\",\nf)):\"textvalueformat\"==l||\"nontextvalueformat\"==l?(n[l]=a.GetStyleNum(\"valueformat\",f),delete n.displaystring):\"cssc\"==l?(f=f.replace(/[^a-zA-Z0-9\\-]/g,\"\"),n.cssc=f):\"csss\"==l?(f=f.replace(/\\n/g,\"\"),n.csss=f):\"mod\"==l?(f=f.replace(/[^yY]/g,\"\").toLowerCase(),n.mod=f):\"comment\"==l?n.comment=SocialCalc.decodeFromSave(f):\"readonly\"==l?n.readonly=\"yes\"==f.toLowerCase():m=w.s_escUnknownSetCoordCmd+d);break;case \"merge\":a.renderneeded=!0;g=c.NextToken();f=c.RestOfString();q();n=a.GetAssuredCell(p.coord);\nif(n.readonly)break;b&&B.AddUndo(\"unmerge \"+p.coord);r.col>p.col?n.colspan=r.col-p.col+1:delete n.colspan;r.row>p.row?n.rowspan=r.row-p.row+1:delete n.rowspan;a.changedrendervalues=!0;break;case \"unmerge\":a.renderneeded=!0;g=c.NextToken();f=c.RestOfString();q();n=a.GetAssuredCell(p.coord);if(n.readonly)break;b&&B.AddUndo(\"merge \"+p.coord+\":\"+SocialCalc.crToCoord(p.col+(n.colspan||1)-1,p.row+(n.rowspan||1)-1));delete n.colspan;delete n.rowspan;a.changedrendervalues=!0;break;case \"erase\":case \"cut\":a.renderneeded=\n!0;a.changedrendervalues=!0;g=c.NextToken();f=c.RestOfString();q();b&&B.AddUndo(\"changedrendervalues\");\"cut\"==e&&(b&&B.AddUndo(\"loadclipboard\",SocialCalc.encodeForSave(SocialCalc.Clipboard.clipboard)),SocialCalc.Clipboard.clipboard=SocialCalc.CreateSheetSave(a,g));for(q=p.row;q<=r.row;q++)for(c=p.col;c<=r.col;c++)h=SocialCalc.crToCoord(c,q),n=a.GetAssuredCell(h),n.readonly||(b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n)),\"all\"==f?delete a.cells[h]:\"formulas\"==f?(n.datavalue=\"\",n.datatype=null,n.formula=\n\"\",n.valuetype=\"b\",delete n.errors,delete n.displaystring,delete n.parseinfo,n.comment&&delete n.comment):\"formats\"==f&&(l=new SocialCalc.Cell(h),l.datavalue=n.datavalue,l.datatype=n.datatype,l.formula=n.formula,l.valuetype=n.valuetype,n.comment&&(l.comment=n.comment),a.cells[h]=l));A.needsrecalc=\"yes\";break;case \"fillright\":case \"filldown\":a.renderneeded=!0;a.changedrendervalues=!0;b&&B.AddUndo(\"changedrendervalues\");g=c.NextToken();f=c.RestOfString();q();\"fillright\"==e?(e=!0,s=p.row,t=p.col+1):\n(e=!1,s=p.row+1,t=p.col);for(q=s;q<=r.row;q++)for(c=t;c<=r.col;c++)if(h=SocialCalc.crToCoord(c,q),n=a.GetAssuredCell(h),!n.readonly){b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n));e?(u=SocialCalc.crToCoord(p.col,q),w=c-t+1,d=0):(u=SocialCalc.crToCoord(c,p.row),w=0,d=q-s+1);v=a.GetAssuredCell(u);if(\"all\"==f||\"formats\"==f)for(l in D)1!=D[l]&&(void 0===typeof v[l]||3==D[l]?delete n[l]:n[l]=v[l]);if(\"all\"==f||\"formulas\"==f)n.datavalue=v.datavalue,n.datatype=v.datatype,n.valuetype=v.valuetype,n.formula=\n\"f\"==n.datatype?SocialCalc.OffsetFormulaCoords(v.formula,w,d):v.formula,delete n.parseinfo,n.errors=v.errors;delete n.displaystring}A.needsrecalc=\"yes\";break;case \"copy\":g=c.NextToken();f=c.RestOfString();b&&B.AddUndo(\"loadclipboard\",SocialCalc.encodeForSave(SocialCalc.Clipboard.clipboard));SocialCalc.Clipboard.clipboard=SocialCalc.CreateSheetSave(a,g);break;case \"loadclipboard\":f=c.RestOfString();b&&B.AddUndo(\"loadclipboard\",SocialCalc.encodeForSave(SocialCalc.Clipboard.clipboard));TiddlyWiki&&f&&\n(SocialCalc.Clipboard.clipboard=SocialCalc.decodeFromSave(f));break;case \"clearclipboard\":b&&B.AddUndo(\"loadclipboard\",SocialCalc.encodeForSave(SocialCalc.Clipboard.clipboard));SocialCalc.Clipboard.clipboard=\"\";break;case \"paste\":a.renderneeded=!0;a.changedrendervalues=!0;b&&B.AddUndo(\"changedrendervalues\");g=c.NextToken();f=c.RestOfString();q();if(!SocialCalc.Clipboard.clipboard)break;e=new SocialCalc.Sheet;e.ParseSheetSave(SocialCalc.Clipboard.clipboard);x=SocialCalc.ParseRange(e.copiedfrom);w=\np.col-x.cr1.col;d=p.row-x.cr1.row;y=Math.max(r.col-p.col+1,x.cr2.col-x.cr1.col+1);z=Math.max(r.row-p.row+1,x.cr2.row-x.cr1.row+1);p.col+y-1>A.lastcol&&(A.lastcol=p.col+y-1);p.row+z-1>A.lastrow&&(A.lastrow=p.row+z-1);for(q=p.row;q<p.row+z;q++)for(c=p.col;c<p.col+y;c++)if(h=SocialCalc.crToCoord(c,q),n=a.GetAssuredCell(h),!n.readonly){b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n));u=SocialCalc.crToCoord(x.cr1.col+(c-p.col)%(x.cr2.col-x.cr1.col+1),x.cr1.row+(q-p.row)%(x.cr2.row-x.cr1.row+1));v=e.GetAssuredCell(u);\nif(\"all\"==f||\"formats\"==f)for(l in D)1!=D[l]&&(void 0===typeof v[l]||3==D[l]?delete n[l]:(h=SocialCalc.CellPropertiesTable[l],n[l]=h&&v[l]?a.GetStyleNum(h,e.GetStyleString(h,v[l])):v[l]));if(\"all\"==f||\"formulas\"==f)n.datavalue=v.datavalue,n.datatype=v.datatype,n.valuetype=v.valuetype,n.formula=\"f\"==n.datatype?SocialCalc.OffsetFormulaCoords(v.formula,w,d):v.formula,delete n.parseinfo,n.errors=v.errors,v.comment?n.comment=v.comment:n.comment&&delete n.comment;delete n.displaystring}A.needsrecalc=\"yes\";\nbreak;case \"sort\":a.renderneeded=!0;a.changedrendervalues=!0;b&&B.AddUndo(\"changedrendervalues\");g=c.NextToken();q();d=[];G=[];for(w=I=0;3>=w;w++)d[w]=c.NextToken(),G[w]=c.NextToken(),d[w]&&(I=w);e={};l=[];E=[];H=[];for(q=p.row;q<=r.row;q++){for(c=p.col;c<=r.col;c++)h=SocialCalc.crToCoord(c,q),(n=a.cells[h])?(e[h]=a.CellToString(n),b&&B.AddUndo(\"set \"+h+\" all\",e[h])):b&&B.AddUndo(\"set \"+h+\" all\");l.push(l.length);E.push([]);H.push([]);slast=H.length-1;for(w=0;w<=I;w++)h=d[w]+q,n=a.GetAssuredCell(h),\nh=n.datavalue,c=n.valuetype.charAt(0)||\"b\",\"t\"==c&&(h=h.toLowerCase()),E[slast].push(h),H[slast].push(c)}b=function(a,b){var c,d,e,f,g;for(c=0;c<=I;c++)if(\"up\"==G[c]?(d=a,e=b):(d=b,e=a),f=H[d][c],tb=H[e][c],\"t\"==f?\"t\"==tb?(d=E[d][c],e=E[e][c],g=d>e?1:d<e?-1:0):\"n\"==tb?g=1:\"b\"==tb?g=\"up\"==G[c]?-1:1:\"e\"==tb&&(g=-1):\"n\"==f?\"t\"==tb?g=-1:\"n\"==tb?(d=E[d][c]-0,e=E[e][c]-0,g=d>e?1:d<e?-1:0):\"b\"==tb?g=\"up\"==G[c]?-1:1:\"e\"==tb&&(g=-1):\"e\"==f?\"e\"==tb?(d=E[d][c],e=E[e][c],g=d>e?1:d<e?-1:0):g=\"b\"==tb?\"up\"==G[c]?\n-1:1:1:\"b\"==f&&(g=\"b\"==tb?0:\"up\"==G[c]?1:-1),g)return g;return a>b?1:a<b?-1:0};l.sort(b);for(q=p.row;q<=r.row;q++)for(b=l[q-p.row],c=p.col;c<=r.col;c++)h=SocialCalc.crToCoord(c,q),B=SocialCalc.crToCoord(c,b+p.row),e[B]?(n=new SocialCalc.Cell(h),a.CellFromStringParts(n,e[B].split(\":\"),1),\"f\"==n.datatype&&(n.formula=SocialCalc.OffsetFormulaCoords(n.formula,0,q-p.row-b)),a.cells[h]=n):delete a.cells[h];A.needsrecalc=\"yes\";break;case \"insertcol\":case \"insertrow\":a.renderneeded=!0;a.changedrendervalues=\n!0;g=c.NextToken();f=c.RestOfString();q();\"insertcol\"==e?(w=1,f=p.col,d=0,t=1,C=s=p.col,n=1,y=A.lastrow,b&&B.AddUndo(\"deletecol \"+p.coord)):(w=0,d=f=1,t=p.row,s=1,C=A.lastcol,y=n=p.row,b&&B.AddUndo(\"deleterow \"+p.coord));for(q=A.lastrow;q>=t;q--)for(c=A.lastcol;c>=f;c--)u=SocialCalc.crToCoord(c,q),h=SocialCalc.crToCoord(c+w,q+d),a.cells[u]?a.cells[h]=a.cells[u]:delete a.cells[h];for(q=n;q<=y;q++)for(c=s;c<=C;c++)for(l in h=SocialCalc.crToCoord(c,q),n=new SocialCalc.Cell(h),a.cells[h]=n,u=SocialCalc.crToCoord(c-\nw,q-d),v=a.GetAssuredCell(u),D)2==D[l]&&(n[l]=v[l]);for(h in a.cells)(n=a.cells[h])&&\"f\"==n.datatype&&(n.formula=SocialCalc.AdjustFormulaCoords(n.formula,p.col,w,p.row,d)),n&&delete n.parseinfo;for(x in a.names)a.names[x]&&(h=a.names[x].definition,c=\"\",\"=\"==h.charAt(0)&&(c=\"=\",h=h.substring(1)),a.names[x].definition=c+SocialCalc.AdjustFormulaCoords(h,p.col,w,p.row,d));for(q=A.lastrow;q>=t&&\"insertrow\"==e;q--)for(l in b=q+d,a.rowattribs)h=a.rowattribs[l][q],a.rowattribs[l][b]!=h&&(h?a.rowattribs[l][b]=\nh:delete a.rowattribs[l][b]);for(c=A.lastcol;c>=f&&\"insertcol\"==e;c--)for(l in q=SocialCalc.rcColname(c),b=SocialCalc.rcColname(c+w),a.colattribs)h=a.colattribs[l][q],a.colattribs[l][b]!=h&&(h?a.colattribs[l][b]=h:delete a.colattribs[l][b]);A.lastcol+=w;A.lastrow+=d;A.needsrecalc=\"yes\";break;case \"deletecol\":case \"deleterow\":a.renderneeded=!0;a.changedrendervalues=!0;g=c.NextToken();f=c.RestOfString();f=A.lastcol;D=A.lastrow;q();\"deletecol\"==e?(w=p.col-r.col-1,d=0,t=r.col+1,s=1):(w=0,d=p.row-r.row-\n1,t=1,s=r.row+1);for(q=s;q<=D-d;q++)for(c=t;c<=f-w;c++)if(h=SocialCalc.crToCoord(c+w,q+d),(n=a.cells[h])&&n.readonly)return m;for(q=s;q<=D-d;q++)for(c=t;c<=f-w;c++)h=SocialCalc.crToCoord(c+w,q+d),b&&(q<s-d||c<t-w)&&((n=a.cells[h])?B.AddUndo(\"set \"+h+\" all\",a.CellToString(n)):B.AddUndo(\"erase \"+h+\" all\")),u=SocialCalc.crToCoord(c,q),(n=a.cells[u])?a.cells[h]=n:delete a.cells[h];for(h in a.cells)if(n=a.cells[h])\"f\"==n.datatype?(q=n.formula,n.formula=SocialCalc.AdjustFormulaCoords(q,p.col,w,p.row,d),\nn.formula!=q&&(delete n.parseinfo,b&&-1!=n.formula.indexOf(\"#REF!\")&&(c=SocialCalc.coordToCr(h),B.AddUndo(\"set \"+SocialCalc.rcColname(c.col-w)+(c.row-d)+\" formula \"+q)))):delete n.parseinfo;for(x in a.names)a.names[x]&&(h=a.names[x].definition,c=\"\",\"=\"==h.charAt(0)&&(c=\"=\",h=h.substring(1)),a.names[x].definition=c+SocialCalc.AdjustFormulaCoords(h,p.col,w,p.row,d));for(q=s;q<=D-d&&\"deleterow\"==e;q++)for(l in c=q+d,a.rowattribs)h=a.rowattribs[l][q],a.rowattribs[l][c]!=h&&(b&&B.AddUndo(\"set \"+c+\" \"+\nl,a.rowattribs[l][c]),h?a.rowattribs[l][c]=h:delete a.rowattribs[l][c]);for(c=t;c<=f-w&&\"deletecol\"==e;c++)for(l in q=SocialCalc.rcColname(c),n=SocialCalc.rcColname(c+w),a.colattribs)h=a.colattribs[l][q],a.colattribs[l][n]!=h&&(b&&B.AddUndo(\"set \"+n+\" \"+l,a.colattribs[l][n]),h?a.colattribs[l][n]=h:delete a.colattribs[l][n]);if(b)if(\"deletecol\"==e)for(c=p.col;c<=r.col;c++)B.AddUndo(\"insertcol \"+SocialCalc.rcColname(c));else for(q=p.row;q<=r.row;q++)B.AddUndo(\"insertrow \"+q);\"deletecol\"==e?p.col<=f&&\n(A.lastcol=r.col<=f?A.lastcol+w:p.col-1):p.row<=D&&(A.lastrow=r.row<=D?A.lastrow+d:p.row-1);A.needsrecalc=\"yes\";break;case \"movepaste\":case \"moveinsert\":var J,F;a.renderneeded=!0;a.changedrendervalues=!0;b&&B.AddUndo(\"changedrendervalues\");g=c.NextToken();n=c.NextToken();f=c.RestOfString();\"\"==f&&(f=\"all\");q();F=SocialCalc.coordToCr(n);w=F.col-p.col;d=F.row-p.row;y=r.col-p.col+1;z=r.row-p.row+1;J={};for(q=p.row;q<=r.row;q++)for(c=p.col;c<=r.col;c++)if(h=SocialCalc.crToCoord(c,q),n=a.GetAssuredCell(h),\n!n.readonly&&(b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n)),a.cells[h])){J[h]=new SocialCalc.Cell(h);for(l in D)void 0!==typeof n[l]&&(J[h][l]=n[l],\"all\"==f&&delete n[l],\"formulas\"==f&&(1!=D[l]&&3!=D[l]||delete n[l]),\"formats\"==f&&2==D[l]&&delete n[l]);\"formulas\"==f&&(n.datavalue=\"\",n.datatype=null,n.formula=\"\",n.valuetype=\"b\");\"all\"==f&&delete a.cells[h]}\"moveinsert\"==e&&(s=t=!1,0==d&&(F.col<p.col||F.col>r.col)?F.col<p.col?(C=p.col-F.col,t=-1):(--F.col,w=F.col-r.col,C=F.col-r.col,t=1):0==w&&(F.row<\np.row||F.row>r.row)?F.row<p.row?(C=p.row-F.row,s=-1):(--F.row,d=F.row-r.row,C=F.row-r.row,s=1):e=\"movepaste\");e={};if(s)for(q=0;q<C;q++)for(c=p.col;c<=r.col;c++){0>s?(u=SocialCalc.crToCoord(c,F.row+C-q-1),h=SocialCalc.crToCoord(c,r.row-q)):(u=SocialCalc.crToCoord(c,F.row-C+q+1),h=SocialCalc.crToCoord(c,p.row+q));v=a.GetAssuredCell(u);b&&B.AddUndo(\"set \"+u+\" all\",a.CellToString(v));n=a.GetAssuredCell(h);if(\"all\"==f||\"formats\"==f)for(l in D)1!=D[l]&&(void 0===typeof v[l]||3==D[l]?delete n[l]:n[l]=v[l]);\nif(\"all\"==f||\"formulas\"==f)n.datavalue=v.datavalue,n.datatype=v.datatype,n.valuetype=v.valuetype,n.formula=v.formula,delete n.parseinfo,n.errors=v.errors;delete n.displaystring;e[u]=h}if(t)for(c=0;c<C;c++)for(q=p.row;q<=r.row;q++){0>t?(u=SocialCalc.crToCoord(F.col+C-c-1,q),h=SocialCalc.crToCoord(r.col-c,q)):(u=SocialCalc.crToCoord(F.col-C+c+1,q),h=SocialCalc.crToCoord(p.col+c,q));v=a.GetAssuredCell(u);b&&B.AddUndo(\"set \"+u+\" all\",a.CellToString(v));n=a.GetAssuredCell(h);if(\"all\"==f||\"formats\"==f)for(l in D)1!=\nD[l]&&(void 0===typeof v[l]||3==D[l]?delete n[l]:n[l]=v[l]);if(\"all\"==f||\"formulas\"==f)n.datavalue=v.datavalue,n.datatype=v.datatype,n.valuetype=v.valuetype,n.formula=v.formula,delete n.parseinfo,n.errors=v.errors;delete n.displaystring;e[u]=h}F.col+y-1>A.lastcol&&(A.lastcol=F.col+y-1);F.row+z-1>A.lastrow&&(A.lastrow=F.row+z-1);for(q=p.row;q<p.row+z;q++)for(c=p.col;c<p.col+y;c++)if(h=SocialCalc.crToCoord(c+w,q+d),n=a.GetAssuredCell(h),!n.readonly)if(b&&B.AddUndo(\"set \"+h+\" all\",a.CellToString(n)),\nu=SocialCalc.crToCoord(c,q),e[u]=h,\"all\"!=f||J[u]){(v=J[u])||(v=a.GetAssuredCell(u));if(\"all\"==f||\"formats\"==f)for(l in D)1!=D[l]&&(void 0===typeof v[l]||3==D[l]?delete n[l]:n[l]=v[l]);if(\"all\"==f||\"formulas\"==f)n.datavalue=v.datavalue,n.datatype=v.datatype,n.valuetype=v.valuetype,n.formula=v.formula,delete n.parseinfo,n.errors=v.errors,v.comment?n.comment=v.comment:n.comment&&delete n.comment;delete n.displaystring}else delete a.cells[h];for(h in a.cells)if(n=a.cells[h])\"f\"==n.datatype?(q=n.formula,\nn.formula=SocialCalc.ReplaceFormulaCoords(q,e),n.formula!=q&&(delete n.parseinfo,b&&!e[h]&&B.AddUndo(\"set \"+h+\" formula \"+q))):delete n.parseinfo;for(x in a.names)a.names[x]&&(q=h=a.names[x].definition,c=\"\",\"=\"==h.charAt(0)&&(c=\"=\",h=h.substring(1)),a.names[x].definition=c+SocialCalc.ReplaceFormulaCoords(h,e),b&&a.names[x].definition!=q&&B.AddUndo(\"name define \"+x+\" \"+q));A.needsrecalc=\"yes\";break;case \"name\":g=c.NextToken();x=c.NextToken();f=c.RestOfString();x=x.toUpperCase().replace(/[^A-Z0-9_\\.]/g,\n\"\");if(\"\"==x)break;if(\"define\"==g){if(\"\"==f)break;a.names[x]?(b&&B.AddUndo(\"name define \"+x+\" \"+a.names[x].definition),a.names[x].definition=f):(b&&B.AddUndo(\"name delete \"+x),a.names[x]={definition:f,desc:\"\"})}else\"desc\"==g?a.names[x]&&(b&&B.AddUndo(\"name desc \"+x+\" \"+a.names[x].desc),a.names[x].desc=f):\"delete\"==g&&(b&&(a.names[x].desc&&B.AddUndo(\"name desc \"+x+\" \"+a.names[x].desc),B.AddUndo(\"name define \"+x+\" \"+a.names[x].definition)),delete a.names[x]);A.needsrecalc=\"yes\";break;case \"recalc\":A.needsrecalc=\n\"yes\";a.recalconce=!0;break;case \"redisplay\":a.renderneeded=!0;break;case \"changedrendervalues\":a.changedrendervalues=!0;break;case \"startcmdextension\":x=c.NextToken();(B=a.sci.CmdExtensionCallbacks[x])&&B.func(x,B.data,a,c,b);break;default:m=w.s_escUnknownCmd+d}return m};SocialCalc.SheetUndo=function(a){var c,b=a.changes.TOS(),d=\"\";for(c=b?b.undo.length-1:-1;0<=c;c--)d&&(d+=\"\\n\"),d+=b.undo[c];a.changes.Undo();a.ScheduleSheetCommands(d,!1)};\nSocialCalc.SheetRedo=function(a){var c,b;if(a.changes.Redo()){c=a.changes.TOS();var d=\"\";for(b=0;c&&b<c.command.length;b++)d&&(d+=\"\\n\"),d+=c.command[b];a.ScheduleSheetCommands(d,!1)}else a.ScheduleSheetCommands(\"\",!1)};SocialCalc.CreateAuditString=function(a){var c,b=\"\",d=a.changes.stack,e=a.changes.tos;for(a=0;a<=e;a++)for(c=0;c<d[a].command.length;c++)b+=d[a].command[c]+\"\\n\";return b};\nSocialCalc.GetStyleNum=function(a,c,b){var d;if(0==b.length)return 0;d=a[c+\"hash\"][b];d||(1>a[c+\"s\"].length&&a[c+\"s\"].push(\"\"),d=a[c+\"s\"].push(b)-1,a[c+\"hash\"][b]=d,a.changedrendervalues=!0);return d};SocialCalc.GetStyleString=function(a,c,b){return b?a[c+\"s\"][b]:null};\nSocialCalc.OffsetFormulaCoords=function(a,c,b){var d,e,f,g,l=\"\";d=SocialCalc.Formula;if(!d)return\"Need SocialCalc.Formula\";var h=d.TokenType,m=h.op,p=h.string,h=h.coord,r=d.TokenOpExpansion;a=d.ParseFormulaIntoTokens(a);for(f=0;f<a.length;f++)if(e=a[f].type,d=a[f].text,e==h){g=\"\";e=SocialCalc.coordToCr(d);\"$\"!=d.charAt(0)?e.col+=c:g+=\"$\";g+=SocialCalc.rcColname(e.col);-1==d.indexOf(\"$\",1)?e.row+=b:g+=\"$\";g+=e.row;if(1>e.row||1>e.col)g=\"#REF!\";l+=g}else l=e==p?0<=d.indexOf('\"')?l+('\"'+d.replace(/\"/,\n'\"\"')+'\"'):l+('\"'+d+'\"'):e==m?l+(r[d]||d):l+d;return l};\nSocialCalc.AdjustFormulaCoords=function(a,c,b,d,e){var f,g,l=\"\",h=!1,m=SocialCalc.Formula;if(!m)return\"Need SocialCalc.Formula\";var p=m.TokenType,r=p.op,q=p.string,p=p.coord,m=m.TokenOpExpansion;parseinfo=SocialCalc.Formula.ParseFormulaIntoTokens(a);for(g=0;g<parseinfo.length;g++){f=parseinfo[g].type;a=parseinfo[g].text;f==r&&(\"!\"==a?h=!0:\":\"!=a&&(h=!1),a=m[a]||a);if(f==p){cr=SocialCalc.coordToCr(a);(0>b&&cr.col>=c&&cr.col<c-b||0>e&&cr.row>=d&&cr.row<d-e)&&!h&&(cr.col=0,cr.row=0);h||(cr.col>=c&&(cr.col+=\nb),cr.row>=d&&(cr.row+=e));f=\"$\"==a.charAt(0)?\"$\"+SocialCalc.rcColname(cr.col):SocialCalc.rcColname(cr.col);f=-1!=a.indexOf(\"$\",1)?f+(\"$\"+cr.row):f+cr.row;if(1>cr.row||1>cr.col)f=\"#REF!\";a=f}else f==q&&(a=0<=a.indexOf('\"')?'\"'+a.replace(/\"/,'\"\"')+'\"':'\"'+a+'\"');l+=a}return l};\nSocialCalc.ReplaceFormulaCoords=function(a,c){var b,d,e,f=\"\",g=!1;d=SocialCalc.Formula;if(!d)return\"Need SocialCalc.Formula\";var l=d.TokenType,h=l.op,m=l.string,l=l.coord,p=d.TokenOpExpansion;parseinfo=SocialCalc.Formula.ParseFormulaIntoTokens(a);for(e=0;e<parseinfo.length;e++)b=parseinfo[e].type,d=parseinfo[e].text,b==h&&(\"!\"==d?g=!0:\":\"!=d&&(g=!1),d=p[d]||d),b==l?(cr=SocialCalc.coordToCr(d),b=SocialCalc.crToCoord(cr.col,cr.row),c[b]&&!g&&(cr=SocialCalc.coordToCr(c[b]),b=\"$\"==d.charAt(0)?\"$\"+SocialCalc.rcColname(cr.col):\nSocialCalc.rcColname(cr.col),d=b=-1!=d.indexOf(\"$\",1)?b+(\"$\"+cr.row):b+cr.row)):b==m&&(d=0<=d.indexOf('\"')?'\"'+d.replace(/\"/,'\"\"')+'\"':'\"'+d+'\"'),f+=d;return f};SocialCalc.RecalcInfo={sheet:null,currentState:0,state:{idle:0,start_calc:1,order:2,calc:3,start_wait:4,done_wait:5},recalctimer:null,maxtimeslice:100,timeslicedelay:1,starttime:0,queue:[],LoadSheet:function(a){return!1}};\nSocialCalc.RecalcData=function(){this.inrecalc=!0;this.celllist=[];this.celllistitem=0;this.calclist=null;this.calclistlength=0;this.nextcalc=this.lastcalc=this.firstcalc=null;this.count=0;this.checkinfo={}};SocialCalc.RecalcCheckInfo=function(){this.oldcoord=null;this.parsepos=0;this.inrangestart=this.inrange=!1;this.r=this.c=this.r2=this.r1=this.c2=this.c1=this.cr2=this.cr1=null};\nSocialCalc.RecalcSheet=function(a){hack.log(\"\",hack.recalc,\"SocialCalc.RecalcSheet\");var c=SocialCalc.RecalcInfo;c.currentState!=c.state.idle?c.queue.push(a):(delete a.attribs.circularreferencecell,SocialCalc.Formula.FreshnessInfoReset(),SocialCalc.RecalcClearTimeout(),c.sheet=a,c.currentState=c.state.start_calc,c.starttime=new Date,a.statuscallback&&a.statuscallback(c,\"calcstart\",null,a.statuscallbackparams),SocialCalc.RecalcSetTimeout())};\nSocialCalc.RecalcSetTimeout=function(){var a=SocialCalc.RecalcInfo;a.recalctimer=window.setTimeout(SocialCalc.RecalcTimerRoutine,a.timeslicedelay)};SocialCalc.RecalcClearTimeout=function(){var a=SocialCalc.RecalcInfo;a.recalctimer&&(window.clearTimeout(a.recalctimer),a.recalctimer=null)};\nSocialCalc.RecalcLoadedSheet=function(a,c,b,d,e){var f=SocialCalc.RecalcInfo,g=SocialCalc.Formula;a=SocialCalc.Formula.AddSheetToCache(a||g.SheetCache.waitingForLoading,c,d,e);b&&a&&\"off\"!=a.attribs.recalc&&(a.previousrecalcsheet=f.sheet,f.sheet=a,f.currentState=f.state.start_calc);g.SheetCache.waitingForLoading=null;SocialCalc.RecalcSetTimeout()};\nSocialCalc.RecalcTimerRoutine=function(){hack.log(\"\",hack.recalc,\"SocialCalc.RecalcTimerRoutine\");var a,c,b,d=new Date,e=0,f=SocialCalc.Formula;if(!f)return\"Need SocialCalc.Formula\";var g=SocialCalc.RecalcInfo,l=g.sheet;if(l){var h=l.recalcdata,m=function(a,b){l.statuscallback&&l.statuscallback(h,a,b,l.statuscallbackparams)};SocialCalc.RecalcClearTimeout();if(g.currentState==g.state.start_calc){h=new SocialCalc.RecalcData;l.recalcdata=h;for(b in l.cells)b&&h.celllist.push(b);h.calclist={};g.currentState=\ng.state.order}if(g.currentState==g.state.order){for(;h.celllistitem<h.celllist.length;)if(b=h.celllist[h.celllistitem++],SocialCalc.RecalcCheckCell(l,b),new Date-d>=g.maxtimeslice){m(\"calcorder\",{coord:b,total:h.celllist.length,count:h.celllistitem});SocialCalc.RecalcSetTimeout();return}m(\"calccheckdone\",h.calclistlength);h.nextcalc=h.firstcalc;g.currentState=g.state.calc;SocialCalc.RecalcSetTimeout()}else if(g.currentState==g.state.start_wait){g.currentState=g.state.done_wait;if(g.LoadSheet&&(a=\ng.LoadSheet(f.SheetCache.waitingForLoading)))return;SocialCalc.RecalcLoadedSheet(null,\"\",!1)}else if(g.currentState==g.state.done_wait)g.currentState=g.state.calc,SocialCalc.RecalcSetTimeout();else{g.currentState!=g.state.calc&&alert(\"Recalc state error: \"+g.currentState+\". Error in SocialCalc code.\");for(b=l.recalcdata.nextcalc;b;){c=l.cells[b];a=f.evaluate_parsed_formula(c.parseinfo,l,!1);if(f.SheetCache.waitingForLoading){h.nextcalc=b;h.count+=e;m(\"calcloading\",{sheetname:f.SheetCache.waitingForLoading});\ng.currentState=g.state.start_wait;SocialCalc.RecalcSetTimeout();return}if(f.RemoteFunctionInfo.waitingForServer){h.nextcalc=b;h.count+=e;m(\"calcserverfunc\",{funcname:f.RemoteFunctionInfo.waitingForServer,coord:b,total:h.calclistlength,count:h.count});g.currentState=g.state.done_wait;return}if(c.datavalue!=a.value||c.valuetype!=a.type)c.datavalue=a.value,c.valuetype=a.type,delete c.displaystring,l.recalcchangedavalue=!0;a.error&&(c.errors=a.error);e++;b=l.recalcdata.calclist[b];if(new Date-d>=g.maxtimeslice){h.nextcalc=\nb;h.count+=e;m(\"calcstep\",{coord:b,total:h.calclistlength,count:h.count});SocialCalc.RecalcSetTimeout();return}}h.inrecalc=!1;delete l.recalcdata;delete l.attribs.needsrecalc;g.sheet=l.previousrecalcsheet||null;g.sheet?(g.currentState=g.state.calc,SocialCalc.RecalcSetTimeout()):(f.FreshnessInfo.recalc_completed=!0,g.currentState=g.state.idle,m(\"calcfinished\",new Date-g.starttime),0<g.queue.length&&(l=g.queue.shift(),l.RecalcSheet()))}}};\nSocialCalc.RecalcCheckCell=function(a,c){var b,d,e,f,g,l,h,m,p=SocialCalc.Formula;if(!p)return\"Need SocialCalc.Formula\";f=p.TokenType;var r=f.op,q=f.name,n=f.coord,s=a.recalcdata,t=s.checkinfo,u=!1,w=null,v=c;a:for(;v;)if(h=a.cells[v],m=t[v],!h||\"f\"!=h.datatype||m&&\"object\"!=typeof m)v=w,t[v]&&(w=t[v].oldcoord);else{m||(m=new SocialCalc.RecalcCheckInfo,t[v]=m);h.errors&&delete h.errors;h.parseinfo||(h.parseinfo=p.ParseFormulaIntoTokens(h.formula));b=h.parseinfo;for(f=m.parsepos;f<b.length;f++){if(m.inrange){m.inrangestart&&\n(m.cr1.col>m.cr2.col?(m.c1=m.cr2.col,m.c2=m.cr1.col):(m.c1=m.cr1.col,m.c2=m.cr2.col),m.c=m.c1-1,m.cr1.row>m.cr2.row?(m.r1=m.cr2.row,m.r2=m.cr1.row):(m.r1=m.cr1.row,m.r2=m.cr2.row),m.r=m.r1,m.inrangestart=!1);m.c+=1;if(m.c>m.c2){m.r+=1;if(m.r>m.r2){m.inrange=!1;continue}m.c=m.c1}b=SocialCalc.crToCoord(m.c,m.r);m.parsepos=f;m.oldcoord=w;w=v;v=b;if(t[v]&&\"object\"==typeof t[v])return h.errors=SocialCalc.Constants.s_caccCircRef+c,t[c]=!0,s.firstcalc?s.calclist[s.lastcalc]=c:s.firstcalc=c,s.lastcalc=c,\ns.calclistlength++,a.attribs.circularreferencecell=v+\"|\"+w,h.errors;continue a}e=b[f].type;d=b[f].text;e==r&&(\"!\"==d?u=!0:\":\"!=d&&(u=!1));if(e==q)if(g=p.LookupName(a,d),\"range\"==g.type){if(l=g.value.indexOf(\"|\"),-1!=l){m.cr1=SocialCalc.coordToCr(g.value.substring(0,l));d=g.value.indexOf(\"|\",l+1);m.cr2=SocialCalc.coordToCr(g.value.substring(l+1,d));m.inrange=!0;m.inrangestart=!0;--f;continue}}else\"coord\"==g.type&&(e=n,d=g.value);if(e==n)if(2<=f&&b[f-1].type==r&&\":\"==b[f-1].text&&b[f-2].type==n&&!u)m.cr1=\nSocialCalc.coordToCr(b[f-2].text),m.cr2=SocialCalc.coordToCr(d),m.inrange=!0,m.inrangestart=!0,--f;else if(!u){-1!=d.indexOf(\"$\")&&(d=d.replace(/\\$/g,\"\"));m.parsepos=f+1;m.oldcoord=w;w=v;v=d;if(t[v]&&\"object\"==typeof t[v])return h.errors=SocialCalc.Constants.s_caccCircRef+c,t[c]=!0,s.firstcalc?s.calclist[s.lastcalc]=c:s.firstcalc=c,s.lastcalc=c,s.calclistlength++,a.attribs.circularreferencecell=v+\"|\"+w,h.errors;continue a}}u=!1;t[v]=!0;s.firstcalc?s.calclist[s.lastcalc]=v:s.firstcalc=v;s.lastcalc=\nv;s.calclistlength++;v=w;w=t[v]?t[v].oldcoord:null}return\"\"};SocialCalc.Parse=function(a){this.str=a;this.pos=0;this.delimiter=\" \";this.lineEnd=a.indexOf(\"\\n\");0>this.lineEnd&&(this.lineEnd=a.length)};SocialCalc.Parse.prototype.NextToken=function(){if(0>this.pos)return\"\";var a=this.str.indexOf(this.delimiter,this.pos),c=this.pos;a>this.lineEnd&&(a=this.lineEnd);if(0<=a)return this.pos=a+1,this.str.substring(c,a);this.pos=this.lineEnd;return this.str.substring(c,this.lineEnd)};\nSocialCalc.Parse.prototype.RestOfString=function(){var a=this.pos;if(0>this.pos||this.pos>=this.lineEnd)return\"\";this.pos=this.lineEnd;return this.str.substring(a,this.lineEnd)};SocialCalc.Parse.prototype.RestOfStringNoMove=function(){return 0>this.pos||this.pos>=this.lineEnd?\"\":this.str.substring(this.pos,this.lineEnd)};SocialCalc.Parse.prototype.NextLine=function(){this.pos=this.lineEnd+1;this.lineEnd=this.str.indexOf(\"\\n\",this.pos);0>this.lineEnd&&(this.lineEnd=this.str.length)};\nSocialCalc.Parse.prototype.EOF=function(){return 0>this.pos||this.pos>=this.str.length?!0:!1};SocialCalc.UndoStack=function(){this.stack=[];this.tos=-1;this.maxRedo=0;this.maxUndo=50};\nSocialCalc.UndoStack.prototype.PushChange=function(a){for(;0<this.stack.length&&this.stack.length-1>this.tos;)this.stack.pop();this.stack.push({command:[],type:a,undo:[]});this.maxRedo&&this.stack.length>this.maxRedo&&this.stack.shift();this.maxUndo&&this.stack.length>this.maxUndo&&(this.stack[this.stack.length-this.maxUndo-1].undo=[]);this.tos=this.stack.length-1};\nSocialCalc.UndoStack.prototype.AddDo=function(){if(this.stack[this.stack.length-1]){for(var a=[],c=0;c<arguments.length;c++)null!=arguments[c]&&a.push(arguments[c]);a=a.join(\" \");this.stack[this.stack.length-1].command.push(a)}};SocialCalc.UndoStack.prototype.AddUndo=function(){if(this.stack[this.stack.length-1]){for(var a=[],c=0;c<arguments.length;c++)null!=arguments[c]&&a.push(arguments[c]);a=a.join(\" \");this.stack[this.stack.length-1].undo.push(a)}};\nSocialCalc.UndoStack.prototype.TOS=function(){return 0<=this.tos?this.stack[this.tos]:null};SocialCalc.UndoStack.prototype.Undo=function(){return 0<=this.tos&&(!this.maxUndo||this.tos>this.stack.length-this.maxUndo-1)?(--this.tos,!0):!1};SocialCalc.UndoStack.prototype.Redo=function(){return this.tos<this.stack.length-1?(this.tos+=1,!0):!1};SocialCalc.Clipboard={clipboard:\"\"};\nSocialCalc.RenderContext=function(a){var c=a.attribs,b=SocialCalc.Constants;this.sheetobj=a;this.showRCHeaders=this.showGrid=this.hideRowsCols=!1;this.rownamewidth=b.defaultRowNameWidth;this.pixelsPerRow=b.defaultAssumedRowHeight;this.cellskip={};this.coordToCR={};this.colwidth=[];this.totalwidth=0;this.rowpanes=[];this.colpanes=[];this.colunhideleft=[];this.colunhideright=[];this.rowunhidetop=[];this.rowunhidebottom=[];this.maxrow=this.maxcol=0;this.highlights={};this.cursorsuffix=\"\";this.highlightTypes=\n{cursor:{style:b.defaultHighlightTypeCursorStyle,className:b.defaultHighlightTypeCursorClass},range:{style:b.defaultHighlightTypeRangeStyle,className:b.defaultHighlightTypeRangeClass},cursorinsertup:{style:TiddlyWiki.getModifiedCssImageStyle(\"color:#FFF;backgroundColor:#A6A6A6;backgroundRepeat:repeat-x;backgroundPosition:top left;backgroundImage:url(\"+b.defaultImagePrefix+\"cursorinsertup.gif);\"),className:b.defaultHighlightTypeCursorClass},cursorinsertleft:{style:TiddlyWiki.getModifiedCssImageStyle(\"color:#FFF;backgroundColor:#A6A6A6;backgroundRepeat:repeat-y;backgroundPosition:top left;backgroundImage:url(\"+\nb.defaultImagePrefix+\"cursorinsertleft.gif);\"),className:b.defaultHighlightTypeCursorClass},range2:{style:TiddlyWiki.getModifiedCssImageStyle(\"color:#000;backgroundColor:#FFF;backgroundImage:url(\"+b.defaultImagePrefix+\"range2.gif);\"),className:\"\"}};this.cellIDprefix=b.defaultCellIDPrefix;this.defaultlinkstyle=null;this.defaultHTMLlinkstyle={type:\"html\"};this.defaultfontstyle=b.defaultCellFontStyle;this.defaultfontsize=b.defaultCellFontSize;this.defaultfontfamily=b.defaultCellFontFamily;this.defaultlayout=\nb.defaultCellLayout;this.defaultpanedividerwidth=b.defaultPaneDividerWidth;this.defaultpanedividerheight=b.defaultPaneDividerHeight;this.gridCSS=b.defaultGridCSS;this.commentClassName=b.defaultCommentClass;this.commentCSS=b.defaultCommentStyle;this.commentNoGridClassName=b.defaultCommentNoGridClass;this.commentNoGridCSS=b.defaultCommentNoGridStyle;this.readonlyClassName=b.defaultReadonlyClass;this.readonlyCSS=b.defaultReadonlyStyle;this.readonlyNoGridClassName=b.defaultReadonlyNoGridClass;this.readonlyNoGridCSS=\nb.defaultReadonlyNoGridStyle;this.readonlyComment=b.defaultReadonlyComment;this.classnames={colname:b.defaultColnameClass,rowname:b.defaultRownameClass,selectedcolname:b.defaultSelectedColnameClass,selectedrowname:b.defaultSelectedRownameClass,upperleft:b.defaultUpperLeftClass,skippedcell:b.defaultSkippedCellClass,panedivider:b.defaultPaneDividerClass,unhideleft:b.defaultUnhideLeftClass,unhideright:b.defaultUnhideRightClass,unhidetop:b.defaultUnhideTopClass,unhidebottom:b.defaultUnhideBottomClass};\nthis.explicitStyles={colname:b.defaultColnameStyle,rowname:b.defaultRownameStyle,selectedcolname:b.defaultSelectedColnameStyle,selectedrowname:b.defaultSelectedRownameStyle,upperleft:b.defaultUpperLeftStyle,skippedcell:b.defaultSkippedCellStyle,panedivider:b.defaultPaneDividerStyle,unhideleft:b.defaultUnhideLeftStyle,unhideright:b.defaultUnhideRightStyle,unhidetop:b.defaultUnhideTopStyle,unhidebottom:b.defaultUnhideBottomStyle};this.cellskip=null;this.needcellskip=!0;this.fonts=[];this.layouts=[];\nthis.needprecompute=!0;if(c)this.rowpanes[0]={first:1,last:c.lastrow},this.colpanes[0]={first:1,last:c.lastcol},this.usermaxcol=c.usermaxcol,this.usermaxrow=c.usermaxrow;else throw b.s_rcMissingSheet;};SocialCalc.RenderContext.prototype.PrecomputeSheetFontsAndLayouts=function(){SocialCalc.PrecomputeSheetFontsAndLayouts(this)};SocialCalc.RenderContext.prototype.CalculateCellSkipData=function(){SocialCalc.CalculateCellSkipData(this)};SocialCalc.RenderContext.prototype.CalculateColWidthData=function(){SocialCalc.CalculateColWidthData(this)};\nSocialCalc.RenderContext.prototype.SetRowPaneFirstLast=function(a,c,b){this.rowpanes[a]={first:c,last:b}};SocialCalc.RenderContext.prototype.SetColPaneFirstLast=function(a,c,b){this.colpanes[a]={first:c,last:b}};SocialCalc.RenderContext.prototype.CoordInPane=function(a,c,b){return SocialCalc.CoordInPane(this,a,c,b)};SocialCalc.RenderContext.prototype.CellInPane=function(a,c,b,d){return SocialCalc.CellInPane(this,a,c,b,d)};\nSocialCalc.RenderContext.prototype.InitializeTable=function(a){SocialCalc.InitializeTable(this,a)};SocialCalc.RenderContext.prototype.RenderSheet=function(a,c){return SocialCalc.RenderSheet(this,a,c)};SocialCalc.RenderContext.prototype.RenderColGroup=function(){return SocialCalc.RenderColGroup(this)};SocialCalc.RenderContext.prototype.RenderColHeaders=function(){return SocialCalc.RenderColHeaders(this)};SocialCalc.RenderContext.prototype.RenderSizingRow=function(){return SocialCalc.RenderSizingRow(this)};\nSocialCalc.RenderContext.prototype.RenderRow=function(a,c,b){return SocialCalc.RenderRow(this,a,c,b)};SocialCalc.RenderContext.prototype.RenderSpacingRow=function(){return SocialCalc.RenderSpacingRow(this)};SocialCalc.RenderContext.prototype.RenderCell=function(a,c,b,d,e,f){return SocialCalc.RenderCell(this,a,c,b,d,e,f)};\nSocialCalc.PrecomputeSheetFontsAndLayouts=function(a){var c,b,d,e,f,g,l=a.sheetobj;e=l.attribs;e.defaultfont&&(c=l.fonts[e.defaultfont],c=c.replace(/^\\*/,SocialCalc.Constants.defaultCellFontStyle),c=c.replace(/(.+)\\*(.+)/,\"$1\"+SocialCalc.Constants.defaultCellFontSize+\"$2\"),c=c.replace(/\\*$/,SocialCalc.Constants.defaultCellFontFamily),b=c.match(/^(\\S+? \\S+?) (\\S+?) (\\S.*)$/),a.defaultfontstyle=b[1],a.defaultfontsize=b[2],a.defaultfontfamily=b[3]);for(f=1;f<l.fonts.length;f++)b=l.fonts[f],b=b.replace(/^\\*/,\na.defaultfontstyle),b=b.replace(/(.+)\\*(.+)/,\"$1\"+a.defaultfontsize+\"$2\"),b=b.replace(/\\*$/,a.defaultfontfamily),b=b.match(/^(\\S+?) (\\S+?) (\\S+?) (\\S.*)$/),a.fonts[f]={style:b[1],weight:b[2],size:b[3],family:b[4]};c=/^padding:\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+);vertical-align:\\s*(\\S+);/;d=SocialCalc.Constants.defaultCellLayout.match(c);e=e.defaultlayout?l.layouts[e.defaultlayout].match(c):\" * * * * *\".split(\" \");for(f=1;f<l.layouts.length;f++){b=l.layouts[f];b=b.match(c);for(g=1;5>=g;g++)\"*\"==b[g]&&\n(b[g]=\"*\"!=e[g]?e[g]:d[g]);a.layouts[f]=\"padding:\"+b[1]+\" \"+b[2]+\" \"+b[3]+\" \"+b[4]+\";vertical-align:\"+b[5]+\";\"}a.needprecompute=!1};\nSocialCalc.CalculateCellSkipData=function(a){var c,b,d,e,f,g,l,h,m=a.sheetobj;a.maxrow=0;a.maxcol=0;a.cellskip={};for(c=1;c<=m.attribs.lastrow;c++)for(b=1;b<=m.attribs.lastcol;b++)if(d=SocialCalc.crToCoord(b,c),e=m.cells[d],void 0!==e&&!a.cellskip[d]&&(f=e.colspan||1,e=e.rowspan||1,1<f||1<e))for(g=c;g<c+e;g++)for(l=b;l<b+f;l++)h=SocialCalc.crToCoord(l,g),h==d?a.coordToCR[d]={row:c,col:b}:a.cellskip[h]=d,g>a.maxrow&&(maxrow=g),l>a.maxcol&&(maxcol=l);a.needcellskip=!1};\nSocialCalc.CalculateColWidthData=function(a){var c,b,d,e=a.sheetobj;d=a.showRCHeaders?a.rownamewidth-0:0;for(colpane=0;colpane<a.colpanes.length;colpane++)for(c=a.colpanes[colpane].first;c<=a.colpanes[colpane].last;c++)if(b=SocialCalc.rcColname(c),\"yes\"==e.colattribs.hide[b])a.colwidth[c]=0;else{b=e.colattribs.width[b]||e.attribs.defaultcolwidth||SocialCalc.Constants.defaultColWidth;if(\"blank\"==b||\"auto\"==b)b=\"\";a.colwidth[c]=b+\"\";d+=b&&0<b-0?b-0:10}a.totalwidth=d};\nSocialCalc.InitializeTable=function(a,c){c.style.borderCollapse=\"collapse\";c.cellSpacing=\"0\";c.cellPadding=\"0\";c.style.width=a.totalwidth+\"px\"};\nSocialCalc.RenderSheet=function(a,c,b){var d,e,f,g;a.sheetobj.changedrendervalues&&(a.needcellskip=!0,a.needprecompute=!0,a.sheetobj.changedrendervalues=!1);a.needcellskip&&a.CalculateCellSkipData();a.needprecompute&&a.PrecomputeSheetFontsAndLayouts();a.CalculateColWidthData();f=document.createElement(\"table\");a.InitializeTable(f);d=a.RenderColGroup();f.appendChild(d);g=document.createElement(\"tbody\");g.appendChild(a.RenderSizingRow());a.showRCHeaders&&(d=a.RenderColHeaders())&&g.appendChild(d);for(e=\n0;e<a.rowpanes.length;e++){for(rownum=a.rowpanes[e].first;rownum<=a.rowpanes[e].last;rownum++)d=a.RenderRow(rownum,e,b),g.appendChild(d);e<a.rowpanes.length-1&&(d=a.RenderSpacingRow(),g.appendChild(d))}f.appendChild(g);c&&(a=c.parentNode)&&a.replaceChild(f,c);return f};\nSocialCalc.RenderRow=function(a,c,b,d){var e=a.sheetobj,f=document.createElement(\"tr\"),g,l,h;a.showRCHeaders&&(l=document.createElement(\"td\"),a.classnames&&(l.className=a.classnames.rowname),a.explicitStyles&&(l.style.cssText=a.explicitStyles.rowname),l.width=a.rownamewidth,l.style.verticalAlign=\"top\",l.innerHTML=c+\"\",c<a.rowpanes[a.rowpanes.length-1].last&&\"yes\"==e.rowattribs.hide[c+1]&&(h=document.createElement(\"div\"),h.style.position=\"relative\",g=document.createElement(\"div\"),a.classnames&&(g.className=\na.classnames.unhidetop),a.explicitStyles&&(g.style.cssText=a.explicitStyles.unhidetop),a.rowunhidetop[c]=g,h.appendChild(g),l.appendChild(h)),1<c&&\"yes\"==e.rowattribs.hide[c-1]&&(g=document.createElement(\"div\"),a.classnames&&(g.className=a.classnames.unhidebottom),a.explicitStyles&&(g.style.cssText=a.explicitStyles.unhidebottom),a.rowunhidebottom[c]=g,l.appendChild(g)),f.appendChild(l));for(h=0;h<a.colpanes.length;h++){for(g=a.colpanes[h].first;g<=a.colpanes[h].last;g++)(l=a.RenderCell(c,g,b,h,null,\nd))&&f.appendChild(l);h<a.colpanes.length-1&&(l=document.createElement(\"td\"),l.width=a.defaultpanedividerwidth,a.classnames.panedivider&&(l.className=a.classnames.panedivider),a.explicitStyles.panedivider&&(l.style.cssText=a.explicitStyles.panedivider),g=document.createElement(\"div\"),g.style.width=a.defaultpanedividerwidth+\"px\",g.style.overflow=\"hidden\",l.appendChild(g),f.appendChild(l))}\"yes\"==e.rowattribs.hide[c]&&(f.style.cssText+=\";display:none\");return f};\nSocialCalc.RenderSpacingRow=function(a){var c,b,d,e,f=document.createElement(\"tr\");a.showRCHeaders&&(b=document.createElement(\"td\"),b.width=a.rownamewidth,b.height=a.defaultpanedividerheight,a.classnames.panedivider&&(b.className=a.classnames.panedivider),a.explicitStyles.panedivider&&(b.style.cssText=a.explicitStyles.panedivider),f.appendChild(b));for(d=0;d<a.colpanes.length;d++){for(c=a.colpanes[d].first;c<=a.colpanes[d].last;c++){b=document.createElement(\"td\");if(e=a.colwidth[c])b.width=e;b.height=\na.defaultpanedividerheight;a.classnames.panedivider&&(b.className=a.classnames.panedivider);a.explicitStyles.panedivider&&(b.style.cssText=a.explicitStyles.panedivider);b&&f.appendChild(b)}d<a.colpanes.length-1&&(b=document.createElement(\"td\"),b.width=a.defaultpanedividerwidth,b.height=a.defaultpanedividerheight,a.classnames.panedivider&&(b.className=a.classnames.panedivider),a.explicitStyles.panedivider&&(b.style.cssText=a.explicitStyles.panedivider),f.appendChild(b))}return f};\nSocialCalc.RenderColHeaders=function(a){var c=a.sheetobj,b=document.createElement(\"tr\"),d,e;if(!a.showRCHeaders)return null;e=document.createElement(\"td\");a.classnames&&(e.className=a.classnames.upperleft);a.explicitStyles&&(e.style.cssText=a.explicitStyles.upperleft);e.width=a.rownamewidth;b.appendChild(e);for(colpane=0;colpane<a.colpanes.length;colpane++){for(d=a.colpanes[colpane].first;d<=a.colpanes[colpane].last;d++){e=document.createElement(\"td\");a.classnames&&(e.className=a.classnames.colname);\na.explicitStyles&&(e.style.cssText=a.explicitStyles.colname);\"yes\"==c.colattribs.hide[SocialCalc.rcColname(d)]&&(e.style.cssText+=\";display:none\");e.innerHTML=SocialCalc.rcColname(d);if(d<a.colpanes[a.colpanes.length-1].last&&\"yes\"==c.colattribs.hide[SocialCalc.rcColname(d+1)]){var f=document.createElement(\"div\");a.classnames&&(f.className=a.classnames.unhideleft);a.explicitStyles&&(f.style.cssText=a.explicitStyles.unhideleft);a.colunhideleft[d]=f;e.appendChild(f)}1<d&&\"yes\"==c.colattribs.hide[SocialCalc.rcColname(d-\n1)]&&(f=document.createElement(\"div\"),a.classnames&&(f.className=a.classnames.unhideright),a.explicitStyles&&(f.style.cssText=a.explicitStyles.unhideright),a.colunhideright[d]=f,e.appendChild(f));b.appendChild(e)}colpane<a.colpanes.length-1&&(e=document.createElement(\"td\"),e.width=a.defaultpanedividerwidth,a.classnames.panedivider&&(e.className=a.classnames.panedivider),a.explicitStyles.panedivider&&(e.style.cssText=a.explicitStyles.panedivider),b.appendChild(e))}return b};\nSocialCalc.RenderColGroup=function(a){var c,b,d,e,f=a.sheetobj,g=document.createElement(\"colgroup\");a.showRCHeaders&&(d=document.createElement(\"col\"),d.width=a.rownamewidth,g.appendChild(d));for(c=0;c<a.colpanes.length;c++){for(b=a.colpanes[c].first;b<=a.colpanes[c].last;b++)if(d=document.createElement(\"col\"),\"yes\"==f.colattribs.hide[SocialCalc.rcColname(b)])d.width=\"1\";else{if(e=a.colwidth[b])d.width=e;g.appendChild(d)}c<a.colpanes.length-1&&(d=document.createElement(\"col\"),d.width=a.defaultpanedividerwidth,\ng.appendChild(d))}return g};\nSocialCalc.RenderSizingRow=function(a){var c,b,d,e,f=a.sheetobj,g=document.createElement(\"tr\");a.showRCHeaders&&(d=document.createElement(\"td\"),d.style.width=a.rownamewidth+\"px\",d.height=\"1\",g.appendChild(d));for(c=0;c<a.colpanes.length;c++){for(b=a.colpanes[c].first;b<=a.colpanes[c].last;b++){d=document.createElement(\"td\");if(\"yes\"==f.colattribs.hide[SocialCalc.rcColname(b)])d.width=\"1\";else if(e=a.colwidth[b])d.width=e;d.height=\"1\";g.appendChild(d)}c<a.colpanes.length-1&&(d=document.createElement(\"td\"),\nd.width=a.defaultpanedividerwidth,d.height=\"1\",g.appendChild(d))}return g};\nSocialCalc.RenderCell=function(a,c,b,d,e,f,g){var l=a.sheetobj,h,m,p,r,q,n=\"\";c-=0;b-=0;var s=SocialCalc.crToCoord(b,c);if(a.cellskip[s]){if(a.CoordInPane(a.cellskip[s],d,e))return null;f=f?SocialCalc.CreatePseudoElement():document.createElement(\"td\");a.classnames.skippedcell&&(f.className=a.classnames.skippedcell);a.explicitStyles.skippedcell&&(f.style.cssText=a.explicitStyles.skippedcell);f.innerHTML=\" \";return f}f=f?SocialCalc.CreatePseudoElement():document.createElement(\"td\");a.cellIDprefix&&\n(f.id=a.cellIDprefix+s);(p=l.cells[s])||(p=new SocialCalc.Cell(s));q=l.attribs;scc=SocialCalc.Constants;if(1<p.colspan){for(h=m=1;h<p.colspan;h++)\"yes\"!=l.colattribs.hide[SocialCalc.rcColname(b+h)]&&a.CellInPane(c,b+h,d,e)&&m++;f.colSpan=m}if(1<p.rowspan){for(h=m=1;h<p.rowspan;h++)\"yes\"!=l.rowattribs.hide[c+h+\"\"]&&a.CellInPane(c+h,b,d,e)&&m++;f.rowSpan=m}void 0==p.displaystring&&(p.displaystring=SocialCalc.FormatValueForDisplay(l,p.datavalue,s,g||a.defaultlinkstyle));f.innerHTML=p.displaystring;n=\n(h=p.layout||q.defaultlayout)&&\"undefined\"!==typeof a.layouts[h]?n+a.layouts[h]:n+scc.defaultCellLayout;(h=p.font||q.defaultfont)&&\"undefined\"!==typeof a.fonts[h]?(g=a.fonts[h],n+=\"font-style:\"+g.style+\";font-weight:\"+g.weight+\";font-size:\"+g.size+\";font-family:\"+g.family+\";\"):(scc.defaultCellFontSize&&(n+=\"font-size:\"+scc.defaultCellFontSize+\";\"),scc.defaultCellFontFamily&&(n+=\"font-family:\"+scc.defaultCellFontFamily+\";\"));(h=p.color||q.defaultcolor)&&\"undefined\"!==typeof l.colors[h]&&(n+=\"color:\"+\nl.colors[h]+\";\");(h=p.bgcolor||q.defaultbgcolor)&&\"undefined\"!==typeof l.colors[h]&&(n+=\"background-color:\"+l.colors[h]+\";\");(h=p.cellformat)&&\"undefined\"!==typeof l.cellformats[h]?n+=\"text-align:\"+l.cellformats[h]+\";\":(g=p.valuetype.charAt(0),\"t\"==g?(h=q.defaulttextformat)&&\"undefined\"!==typeof l.cellformats[h]&&(n+=\"text-align:\"+l.cellformats[h]+\";\"):\"n\"==g?n=(h=q.defaultnontextformat)&&\"undefined\"!==typeof l.cellformats[h]?n+(\"text-align:\"+l.cellformats[h]+\";\"):n+\"text-align:right;\":n+=\"text-align:left;\");\nif(1<p.colspan||1<p.rowspan)r=l.cells[SocialCalc.crToCoord(b+(p.colspan||1)-1,c+(p.rowspan||1)-1)];(h=p.bt)&&\"undefined\"!==typeof l.borderstyles[h]&&(n+=\"border-top:\"+l.borderstyles[h]+\";\");(h=\"undefined\"!=typeof r?r.br:p.br)&&\"undefined\"!==typeof l.borderstyles[h]?n+=\"border-right:\"+l.borderstyles[h]+\";\":a.showGrid&&(g=a.CellInPane(c,b+(p.colspan||1),d,e)?SocialCalc.crToCoord(b+(p.colspan||1),c):\"nomatch\",a.cellskip[g]&&(g=a.cellskip[g]),l.cells[g]&&l.cells[g].bl||(n+=\"border-right:\"+a.gridCSS));\n(h=\"undefined\"!=typeof r?r.bb:p.bb)&&\"undefined\"!==typeof l.borderstyles[h]?n+=\"border-bottom:\"+l.borderstyles[h]+\";\":a.showGrid&&(g=a.CellInPane(c+(p.rowspan||1),b,d,e)?SocialCalc.crToCoord(b,c+(p.rowspan||1)):\"nomatch\",a.cellskip[g]&&(g=a.cellskip[g]),l.cells[g]&&l.cells[g].bt||(n+=\"border-bottom:\"+a.gridCSS));(h=p.bl)&&\"undefined\"!==typeof l.borderstyles[h]&&(n+=\"border-left:\"+l.borderstyles[h]+\";\");p.comment&&(f.title=p.comment,a.showGrid?(a.commentClassName&&(f.className=(f.className?f.className+\n\" \":\"\")+a.commentClassName),n+=a.commentCSS):(a.commentNoGridClassName&&(f.className=(f.className?f.className+\" \":\"\")+a.commentNoGridClassName),n+=a.commentNoGridCSS));p.readonly&&(p.comment||(f.title=a.readonlyComment),a.showGrid?(a.readonlyClassName&&(f.className=(f.className?f.className+\" \":\"\")+a.readonlyClassName),n+=a.readonlyCSS):(a.readonlyNoGridClassName&&(f.className=(f.className?f.className+\" \":\"\")+a.readonlyNoGridClassName),n+=a.readonlyNoGridCSS));f.style.cssText=n;if(g=a.highlights[s])\"cursor\"==\ng&&(g+=a.cursorsuffix),a.highlightTypes[g].className&&(f.className=(f.className?f.className+\" \":\"\")+a.highlightTypes[g].className),SocialCalc.setStyles(f,a.highlightTypes[g].style);\"yes\"==l.colattribs.hide[SocialCalc.rcColname(b)]&&(f.style.cssText+=\";display:none\");\"yes\"==l.rowattribs.hide[c]&&(f.style.cssText+=\";display:none\");return f};SocialCalc.CoordInPane=function(a,c,b,d){var e=a.coordToCR[c];if(!e||!e.row||!e.col)throw\"Bad coordToCR for \"+c;return a.CellInPane(e.row,e.col,b,d)};\nSocialCalc.CellInPane=function(a,c,b,d,e){var f=a.rowpanes[d];a=a.colpanes[e];if(!f||!a)throw\"CellInPane called with unknown panes \"+d+\"/\"+e;return c<f.first||c>f.last||b<a.first||b>a.last?!1:!0};SocialCalc.CreatePseudoElement=function(){return{style:{cssText:\"\"},innerHTML:\"\",className:\"\"}};SocialCalc.rcColname=function(a){702<a&&(a=702);1>a&&(a=1);var c=(a-1)%26+65;return(a=Math.floor((a-1)/26))?String.fromCharCode(a+64)+String.fromCharCode(c):String.fromCharCode(c)};SocialCalc.letters=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\nSocialCalc.crToCoord=function(a,c){1>a&&(a=1);702<a&&(a=702);1>c&&(c=1);var b=(a-1)%26,d=Math.floor((a-1)/26);return d?SocialCalc.letters[d-1]+SocialCalc.letters[b]+c:SocialCalc.letters[b]+c};SocialCalc.coordToCol={};SocialCalc.coordToRow={};\nSocialCalc.coordToCr=function(a){var c,b,d,e=SocialCalc.coordToRow[a];if(e)return{row:e,col:SocialCalc.coordToCol[a]};for(b=e=c=0;b<a.length;b++)d=a.charCodeAt(b),36!=d&&(57>=d?e=10*e+d-48:97<=d?c=26*c+d-96:65<=d&&(c=26*c+d-64));SocialCalc.coordToCol[a]=c;SocialCalc.coordToRow[a]=e;return{row:e,col:c}};\nSocialCalc.ParseRange=function(a){var c,b,d;a||(a=\"A1:A1\");a=a.toUpperCase();c=a.indexOf(\":\");0<=c?(b=a.substring(0,c),d=SocialCalc.coordToCr(b),d.coord=b,b=a.substring(c+1),c=SocialCalc.coordToCr(b),c.coord=b):(d=SocialCalc.coordToCr(a),d.coord=a,c=SocialCalc.coordToCr(a),c.coord=a);return{cr1:d,cr2:c}};SocialCalc.decodeFromSave=function(a){if(\"string\"!=typeof a||-1==a.indexOf(\"\\\\\"))return a;a=a.replace(/\\\\c/g,\":\");a=a.replace(/\\\\n/g,\"\\n\");return a.replace(/\\\\b/g,\"\\\\\")};\nSocialCalc.decodeFromAjax=function(a){if(\"string\"!=typeof a||-1==a.indexOf(\"\\\\\"))return a;a=a.replace(/\\\\c/g,\":\");a=a.replace(/\\\\n/g,\"\\n\");a=a.replace(/\\\\e/g,\"]]\");return a.replace(/\\\\b/g,\"\\\\\")};SocialCalc.encodeForSave=function(a){if(\"string\"!=typeof a)return a;-1!=a.indexOf(\"\\\\\")&&(a=a.replace(/\\\\/g,\"\\\\b\"));-1!=a.indexOf(\":\")&&(a=a.replace(/:/g,\"\\\\c\"));-1!=a.indexOf(\"\\n\")&&(a=a.replace(/\\n/g,\"\\\\n\"));return a};\nSocialCalc.special_chars=function(a){/[&<>\"]/.test(a)&&(a=a.replace(/&/g,\"&\"),a=a.replace(/</g,\"<\"),a=a.replace(/>/g,\">\"),a=a.replace(/\"/g,\""\"));return a};SocialCalc.Lookup=function(a,c){for(i=0;i<c.length;i++)if(c[i]>a)return 0<i?i-1:null;return c.length-1};\nSocialCalc.setStyles=function(a,c){var b,d,e,f;if(c)for(b=c.split(\";\"),d=0;d<b.length;d++)if(e=b[d].indexOf(\":\"),-1!=e&&(f=b[d].substring(0,e),e=b[d].substring(e+1),f&&e)){if(TiddlyWiki&&\"backgroundImage\"==f){var g=TiddlyWiki.pathImages;if(e.match(\".*?url(.+).*\")){var l=/.*?url[(][\"]?.*?images\\/(.+?)[\"]?[)].*$/.exec(e);!l||2>l.length||(e=(g=TiddlyWiki.getRawTiddlerImage(g+\"/\"+l[1]))?e.replace(/url[(].+?[)]/,\"url(\"+g+\")\"):e)}}a.style[f]=e}};\nSocialCalc.GetViewportInfo=function(){var a={};window.innerWidth?(a.width=window.innerWidth,a.height=window.innerHeight,a.horizontalScroll=window.pageXOffset,a.verticalScroll=window.pageYOffset):document.documentElement&&document.documentElement.clientWidth?(a.width=document.documentElement.clientWidth,a.height=document.documentElement.clientHeight,a.horizontalScroll=document.documentElement.scrollLeft,a.verticalScroll=document.documentElement.scrollTop):document.body.clientWidth&&(a.width=document.body.clientWidth,\na.height=document.body.clientHeight,a.horizontalScroll=document.body.scrollLeft,a.verticalScroll=document.body.scrollTop);return a};SocialCalc.GetElementPosition=function(a){for(var c=0,b=0;a&&\"relative\"!=SocialCalc.GetComputedStyle(a,\"position\");)c+=a.offsetLeft,b+=a.offsetTop,a=a.offsetParent;return{left:c,top:b}};\nSocialCalc.GetElementPositionWithScroll=function(a){a=a.getBoundingClientRect();return{left:a.left,right:a.right,top:a.top,bottom:a.bottom,width:a.width?a.width:a.right-a.left,height:a.height?a.height:a.bottom-a.top}};SocialCalc.GetElementFixedParent=function(a){for(;a&&\"HTML\"!=a.tagName;){if(\"fixed\"==SocialCalc.GetComputedStyle(a,\"position\"))return a;a=a.parentNode}return!1};\nSocialCalc.GetComputedStyle=function(a,c){return(\"undefined\"!=typeof a.currentStyle?a.currentStyle:document.defaultView.getComputedStyle(a,null))[c]};SocialCalc.LookupElement=function(a,c){var b;for(b=0;b<c.length;b++)if(c[b].element==a)return c[b];return null};SocialCalc.AssignID=function(a,c,b){a.idPrefix&&(c.id=a.idPrefix+b)};\nSocialCalc.GetCellContents=function(a,c){var b=\"\",d=a.cells[c];if(d)switch(d.datatype){case \"v\":b=d.datavalue+\"\";break;case \"t\":b=\"'\"+d.datavalue;break;case \"f\":b=\"=\"+d.formula;break;case \"c\":b=d.formula}return b};\nSocialCalc.FormatValueForDisplay=function(a,c,b,d){var e,f=a.attribs,g=a.cells[b];g||(g=new SocialCalc.Cell(b));b=g.valuetype||\"\";e=b.substring(1);b=b.charAt(0);if(g.errors||\"e\"==b)return c=g.errors||e||\"Error in cell\";if(\"t\"==b){b=a.valueformats[g.textvalueformat-0]||a.valueformats[f.defaulttextvalueformat-0]||\"\";if(\"formula\"==b)return c=\"f\"==g.datatype?SocialCalc.special_chars(\"=\"+g.formula)||\" \":\"c\"==g.datatype?SocialCalc.special_chars(\"'\"+g.formula)||\" \":SocialCalc.special_chars(\"'\"+\nc)||\" \";c=SocialCalc.format_text_for_display(c,g.valuetype,b,a,d,g.nontextvalueformat)}else if(\"n\"==b){b=g.nontextvalueformat;if(null==b||\"\"==b)b=f.defaultnontextvalueformat;b=a.valueformats[b-0];if(null==b||\"none\"==b)b=\"\";if(\"formula\"==b)return c=\"f\"==g.datatype?SocialCalc.special_chars(\"=\"+g.formula)||\" \":\"c\"==g.datatype?SocialCalc.special_chars(\"'\"+g.formula)||\" \":SocialCalc.special_chars(\"'\"+c)||\" \";if(\"forcetext\"==b)return c=\"f\"==g.datatype?SocialCalc.special_chars(\"=\"+g.formula)||\n\" \":\"c\"==g.datatype?SocialCalc.special_chars(g.formula)||\" \":SocialCalc.special_chars(c)||\" \";c=SocialCalc.format_number_for_display(c,g.valuetype,b)}else c=\" \";return c};\nSocialCalc.format_text_for_display=function(a,c,b,d,e,f){var g,l,h;g=c.substring(1);h=a;if(\"none\"==b||null==b)b=\"\";/^(text-|custom|hidden)/.test(b)||(b=\"\");if(\"\"==b||\"General\"==b){\"h\"==g&&(b=\"text-html\");if(\"w\"==g||\"r\"==g)b=\"text-wiki\";\"l\"==g&&(b=\"text-link\");g||(b=\"text-plain\")}\"text-html\"!=b&&(SocialCalc.Callbacks.expand_wiki&&/^text-wiki/.test(b)?h=SocialCalc.Callbacks.expand_wiki(h,d,e,b):\"text-wiki\"==b?h=SocialCalc.Callbacks.expand_markup&&SocialCalc.Callbacks.expand_markup(h,d,e)||SocialCalc.special_chars(\"wiki-text:\"+\nh):\"text-url\"==b?(a=SocialCalc.special_chars(h),c=encodeURI(h),h='<a href=\"'+c+'\">'+a+\"</a>\"):\"text-link\"==b?h=SocialCalc.expand_text_link(h,d,e,b):\"text-image\"==b?(c=encodeURI(h),h='<img src=\"'+c+'\">'):\"text-custom:\"==b.substring(0,12)?(a=SocialCalc.special_chars(h),a=a.replace(/ /g,\" \"),a=a.replace(/\\n/g,\"<br>\"),c=encodeURI(h),l={},l.r=h,l.s=a,l.u=c,h=b.substring(12),h=h.replace(/@(r|s|u)/g,function(a,b){return l[b]})):\"custom\"==b.substring(0,6)?(h=SocialCalc.special_chars(h),h=h.replace(/ /g,\n\" \"),h=h.replace(/\\n/g,\"<br>\"),h+=\" (custom format)\"):\"hidden\"==b?h=\" \":null!=f&&\"\"!=f&&\"none\"!=d.valueformats[f-0]&&\"\"!=d.valueformats[f-0]?(b=d.valueformats[f],h=SocialCalc.format_number_for_display(a,c,b)):(h=SocialCalc.special_chars(h),h=h.replace(/ /g,\" \"),h=h.replace(/\\n/g,\"<br>\")));return h};\nSocialCalc.format_number_for_display=function(a,c,b){var d,e=SocialCalc.Constants;d=a-0;c=c.substring(1);if(\"Auto\"==b||\"\"==b)b=\"%\"==c?e.defaultFormatp:\"$\"==c?e.defaultFormatc:\"dt\"==c?e.defaultFormatdt:\"d\"==c?e.defaultFormatd:\"t\"==c?e.defaultFormatt:\"l\"==c?\"logical\":\"General\";return\"logical\"==b?d?e.defaultDisplayTRUE:e.defaultDisplayFALSE:\"hidden\"==b?\" \":SocialCalc.FormatNumber.formatNumberWithFormat(a,b,\"\")};\nSocialCalc.DetermineValueType=function(a){var c=a+\"\",b=\"t\",d,e;d=c.replace(/^\\s+/,\"\");d=d.replace(/\\s+$/,\"\");0==c.length?b=\"\":c.match(/^\\s+$/)||(d.match(/^[-+]?\\d*(?:\\.)?\\d*(?:[eE][-+]?\\d+)?$/)?(c=d-0,isNaN(c)?c=a+\"\":b=\"n\"):d.match(/^[-+]?\\d*(?:\\.)?\\d*\\s*%$/)?(c=(d.slice(0,-1)-0)/100,b=\"n%\"):d.match(/^[-+]?\\$\\s*\\d*(?:\\.)?\\d*\\s*$/)&&d.match(/\\d/)?(c=d.replace(/\\$/,\"\")-0,b=\"n$\"):d.match(/^[-+]?(\\d*,\\d*)+(?:\\.)?\\d*$/)?(c=d.replace(/,/g,\"\")-0,b=\"n\"):d.match(/^[-+]?(\\d*,\\d*)+(?:\\.)?\\d*\\s*%$/)?(c=(d.replace(/[%,]/g,\n\"\")-0)/100,b=\"n%\"):d.match(/^[-+]?\\$\\s*(\\d*,\\d*)+(?:\\.)?\\d*$/)&&d.match(/\\d/)?(c=d.replace(/[\\$,]/g,\"\")-0,b=\"n$\"):(a=c.match(/^(\\d{1,2})[\\/\\-](\\d{1,2})[\\/\\-](\\d{1,4})\\s*$/))?(c=a[3]-0,c=SocialCalc.FormatNumber.convert_date_gregorian_to_julian(1E3>c?c+2E3:c,a[1]-0,a[2]-0)-2415019,b=\"nd\"):(a=c.match(/^(\\d{4})[\\/\\-](\\d{1,2})[\\/\\-](\\d{1,2})\\s*$/))?(c=a[1]-0,c=1E3>c?c+2E3:c,c=SocialCalc.FormatNumber.convert_date_gregorian_to_julian(c,a[2]-0,a[3]-0)-2415019,b=\"nd\"):(a=c.match(/^(\\d{1,2}):(\\d{1,2})\\s*$/))?\n(d=a[1]-0,e=a[2]-0,24>d&&60>e&&(c=d/24+e/1440,b=\"nt\")):(a=c.match(/^(\\d{1,2}):(\\d{1,2}):(\\d{1,2})\\s*$/))?(d=a[1]-0,e=a[2]-0,a=a[3]-0,24>d&&60>e&&60>a&&(c=d/24+e/1440+a/86400,b=\"nt\")):(a=c.match(/^\\s*([-+]?\\d+) (\\d+)\\/(\\d+)\\s*$/))?(e=a[1]-0,d=a[2]-0,(a=a[3]-0)&&0<a&&(c=e+(0>e?-d/a:d/a),b=\"n\")):(a=SocialCalc.InputConstants[c.toUpperCase()])?(d=a.indexOf(\",\"),c=a.substring(0,d)-0,b=a.substring(d+1)):7<d.length&&\"http://\"==d.substring(0,7).toLowerCase()?(c=d,b=\"tl\"):d.match(/<([A-Z][A-Z0-9]*)\\b[^>]*>[\\s\\S]*?<\\/\\1>/i)&&\n(c=d,b=\"th\"));return{value:c,type:b}};SocialCalc.InputConstants={TRUE:\"1,nl\",FALSE:\"0,nl\",\"#N/A\":\"0,e#N/A\",\"#NULL!\":\"0,e#NULL!\",\"#NUM!\":\"0,e#NUM!\",\"#DIV/0!\":\"0,e#DIV/0!\",\"#VALUE!\":\"0,e#VALUE!\",\"#REF!\":\"0,e#REF!\",\"#NAME?\":\"0,e#NAME?\"};SocialCalc.default_expand_markup=function(a,c,b){a=SocialCalc.special_chars(a);a=a.replace(/ /g,\" \");return a=a.replace(/\\n/g,\"<br>\")};\nSocialCalc.expand_text_link=function(a,c,b,d){var e;e=SocialCalc.Constants;var f=\"\";c=SocialCalc.ParseCellLinkText(a+\"\");hack.log(\"desc=\"+c.desc+\", url=\"+c.url+\", pagename=\"+c.pagename,hack.url,\"SocialCalc.expand_text_link\");e=c.desc?SocialCalc.special_chars(c.desc):c.pagename?e.defaultPageLinkFormatString:e.defaultLinkFormatString;7<a.length&&\"http://\"==a.substring(0,7).toLowerCase()&&\">\"!=a.charAt(a.length-1)&&(e=e.substring(7));a=c.newwin||!b?' target=\"_blank\"':\"\";c.pagename?SocialCalc.Callbacks.MakePageLink&&\n(f=SocialCalc.Callbacks.MakePageLink(c.pagename,c.workspacename,b,d)):f=encodeURI(c.url);b='<a href=\"'+f+'\"'+a+\">\"+e+\"</a>\";TiddlyWiki&&(d=SocialCalc.GetSpreadsheetControlObject(),a=null,c.pagename||c.url.match(/^tw:/))&&(c.desc&&(e=SocialCalc.special_chars(c.desc)),c.pagename?(a=c.pagename,c.desc||(e=c.pagename)):(a=c.url.replace(/^tw:/,\"\"),c.desc||(e=a)),a=d.tiddlyWiki.resolvePath(a),b='<a href=\"javascript:void(0);\" title=\"'+a+'\" onclick=\"TiddlyWiki.navigateToTiddler(\\''+a+\"');\\\">\"+e+\"</a>\");hack.log(\"html = \"+\nb,hack.url,\"SocialCalc.expand_text_link\");return b};\nSocialCalc.ParseCellLinkText=function(a){var c={url:\"\",desc:\"\",newwin:!1,pagename:\"\",workspace:\"\"},b=!1,d=a.length-1,e=0,f=a.lastIndexOf(\"<\"),g=a.lastIndexOf(\"[\"),l=a.lastIndexOf(\"{\"),h=-1;\">\"==a.charAt(d)&&-1!=f||\"]\"==a.charAt(d)&&-1!=g||!(\"}\"!=a.charAt(d)||\"]\"!=a.charAt(d-1)||-1==l||-1==g||g<l)?(\">\"==a.charAt(d)?(h=f-1,0<f&&\"<\"==a.charAt(h)&&\">\"==a.charAt(d-1)&&(h--,d--,c.newwin=!0)):\"]\"==a.charAt(d)?(h=g-1,b=!0,0<g&&\"[\"==a.charAt(h)&&\"]\"==a.charAt(d-1)&&(h--,d--,c.newwin=!0)):\"}\"==a.charAt(d)&&\n(h=l-1,b=!0,wsend=g,d--,0<g&&\"[\"==a.charAt(g-1)&&\"]\"==a.charAt(d-1)&&(wsend=g-1,d--,c.newwin=!0),\" \"==a.charAt(wsend-1)&&wsend--,c.workspace=a.substring(l+1,wsend)||\"\"),\" \"==a.charAt(h)&&h--,'\"'==a.charAt(e)&&'\"'==a.charAt(h)&&(e++,h--)):(d++,h=d);b?c.pagename=a.substring(g+1,d)||\"\":c.url=a.substring(f+1,d)||\"\";h>=e&&(c.desc=a.substring(e,h+1));return c};\nSocialCalc.ConvertSaveToOtherFormat=function(a,c,b){var d,e,f,g;e=\"\";if(\"scsave\"==c)return a;if(\"\"==a)return\"\";d=new SocialCalc.Sheet;d.ParseSheetSave(a);if(b)throw\"SocialCalc.ConvertSaveToOtherFormat: Not doing recalc.\";a=d.copiedfrom?SocialCalc.ParseRange(d.copiedfrom):{cr1:{row:1,col:1},cr2:{row:d.attribs.lastrow,col:d.attribs.lastcol}};if(\"html\"==c)return e=new SocialCalc.RenderContext(d),d.copiedfrom&&(e.rowpanes[0]={first:a.cr1.row,last:a.cr2.row},e.colpanes[0]={first:a.cr1.col,last:a.cr2.col}),\nc=document.createElement(\"div\"),a=e.RenderSheet(null,e.defaultHTMLlinkstyle),c.appendChild(a),delete e,delete d,e=c.innerHTML,delete a,delete c,e;for(b=a.cr1.row;b<=a.cr2.row;b++){for(f=a.cr1.col;f<=a.cr2.col;f++)g=SocialCalc.crToCoord(f,b),g=d.GetAssuredCell(g),g=g.errors?g.errors:g.datavalue+\"\",\"csv\"==c?(-1!=g.indexOf('\"')&&(g=g.replace(/\"/g,'\"\"')),/[, \\n\"]/.test(g)&&(g='\"'+g+'\"'),f>a.cr1.col&&(g=\",\"+g)):\"tab\"==c&&(-1!=g.indexOf(\"\\n\")&&(-1!=g.indexOf('\"')&&(g=g.replace(/\"/g,'\"\"')),g='\"'+g+'\"'),\nf>a.cr1.col&&(g=\"\\t\"+g)),e+=g;e+=\"\\n\"}return e};\nSocialCalc.ConvertOtherFormatToSave=function(a,c){var b,d,e,f,g,l,h,m,p,r,q,n,s=\"\",t=function(){r++;r>n&&(n=r);q=SocialCalc.crToCoord(r,p);SocialCalc.SetConvertedCell(b,q,g);g=\"\"};if(\"scsave\"==c)return a;b=new SocialCalc.Sheet;d=a.split(/\\r\\n|\\n/);n=0;if(\"csv\"==c){p=0;l=!1;for(e=0;e<d.length&&(e!=d.length-1||\"\"!=d[e]);e++)for(l?g+=\"\\n\":(g=\"\",p++,r=0),f=d[e],h=0;h<f.length;h++)m=f.charAt(h),'\"'==m?l?h<f.length-1&&'\"'==f.charAt(h+1)?(h++,g+='\"'):(l=!1,h==f.length-1&&t()):l=!0:(\",\"!=m||l?g+=m:t(),h!=\nf.length-1||l||t());0<n&&(b.attribs.lastrow=p,b.attribs.lastcol=n,s=b.CreateSheetSave(\"A1:\"+SocialCalc.crToCoord(n,p)))}if(\"tab\"==c){p=0;l=!1;for(e=0;e<d.length&&(e!=d.length-1||\"\"!=d[e]);e++)for(l?g+=\"\\n\":(g=\"\",p++,r=0),f=d[e],h=0;h<f.length;h++){m=f.charAt(h);if('\"'==m){if(l){h<f.length-1?'\"'==f.charAt(h+1)?(h++,g+='\"'):\"\\t\"==f.charAt(h+1)&&(h++,l=!1,t()):(l=!1,t());continue}if(\"\"==g){l=!0;continue}}\"\\t\"!=m||l?g+=m:t();h!=f.length-1||l||t()}0<n&&(b.attribs.lastrow=p,b.attribs.lastcol=n,s=b.CreateSheetSave(\"A1:\"+\nSocialCalc.crToCoord(n,p)))}return s};SocialCalc.SetConvertedCell=function(a,c,b){a=a.GetAssuredCell(c);c=SocialCalc.DetermineValueType(b);\"n\"==c.type&&c.value==b?(a.datatype=\"v\",a.valuetype=\"n\",a.datavalue=c.value):\"t\"==c.type.charAt(0)?(a.datatype=\"t\",a.valuetype=c.type,a.datavalue=c.value):(a.datatype=\"c\",a.valuetype=c.type,a.datavalue=c.value,a.formula=b)};SocialCalc||(SocialCalc={});\nSocialCalc.TableEditor=function(a){var c=SocialCalc.Constants;this.context=a;this.fullgrid=this.toplevel=null;this.noEdit=!1;this.timeout=this.cellhandles=this.logo=this.horizontaltablecontrol=this.verticaltablecontrol=this.inputEcho=this.inputBox=this.tableheight=this.height=this.tablewidth=this.width=null;this.ensureecell=this.busy=!1;this.deferredCommands=[];this.lastvisiblecol=this.lastnonscrollingcol=this.firstscrollingcolleft=this.firstscrollingcol=this.lastvisiblerow=this.lastnonscrollingrow=\nthis.firstscrollingrowtop=this.firstscrollingrow=this.headposition=this.gridposition=null;this.rowpositions=[];this.colpositions=[];this.rowheight=[];this.colwidth=[];this.ecell=null;this.state=\"start\";this.workingvalues={};this.imageprefix=c.defaultImagePrefix;this.idPrefix=c.defaultTableEditorIDPrefix;this.pageUpDnAmount=c.defaultPageUpDnAmount;this.recalcFunction=function(a){if(a.context.sheetobj.RecalcSheet)a.context.sheetobj.RecalcSheet(SocialCalc.EditorSheetStatusCallback,a);else return null};\nthis.ctrlkeyFunction=function(a,c){var e,f,g,l;switch(c){case \"[ctrl-c]\":case \"[ctrl-x]\":e=a.pasteTextarea;e.value=\"\";if(f=SocialCalc.GetEditorCellElement(a,a.ecell.row,a.ecell.col))f=SocialCalc.GetElementPosition(f.element),e.style.left=f.left-1+\"px\",e.style.top=f.top-1+\"px\";l=a.range.hasrange?SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom):a.ecell.coord;f=SocialCalc.ConvertSaveToOtherFormat(SocialCalc.CreateSheetSave(a.context.sheetobj,l),\"tab\");\ng=\"[ctrl-c]\"==c||a.noEdit||a.ECellReadonly()?\"copy \"+l+\" formulas\":\"cut \"+l+\" formulas\";a.EditorScheduleSheetCommands(g,!0,!1);e.style.display=\"block\";e.value=f;e.focus();e.select();window.setTimeout(function(){var c=a.pasteTextarea;c.blur();c.style.display=\"none\";SocialCalc.KeyboardFocus()},200);break;case \"[ctrl-v]\":if(a.noEdit||a.ECellReadonly())break;e=a.pasteTextarea;e.value=\"\";if(f=SocialCalc.GetEditorCellElement(a,a.ecell.row,a.ecell.col))f=SocialCalc.GetElementPosition(f.element),e.style.left=\nf.left-1+\"px\",e.style.top=f.top-1+\"px\";e.style.display=\"block\";e.value=\"\";e.focus();window.setTimeout(function(){var c=a.pasteTextarea,d=c.value;c.blur();c.style.display=\"none\";var c=\"\",e=SocialCalc.ConvertSaveToOtherFormat(SocialCalc.Clipboard.clipboard,\"tab\"),d=d.replace(/\\r\\n/g,\"\\n\");d==e||1==d.length-e.length&&d.substring(0,d.length-1)==e||(c=\"loadclipboard \"+SocialCalc.encodeForSave(SocialCalc.ConvertOtherFormatToSave(d,\"tab\"))+\"\\n\");d=a.range.hasrange?SocialCalc.crToCoord(a.range.left,a.range.top):\na.ecell.coord;a.EditorScheduleSheetCommands(c+(\"paste \"+d+\" formulas\"),!0,!1);SocialCalc.KeyboardFocus()},200);break;case \"[ctrl-z]\":return a.EditorScheduleSheetCommands(\"undo\",!0,!1),!1;case \"[ctrl-s]\":if(!SocialCalc.Constants.AllowCtrlS)break;TiddlyWiki&&(e=SocialCalc.GetSpreadsheetControlObject(),TiddlyWiki.executeExtensionCmd(e,\"tiddlywiki-save\"),SocialCalc.KeyboardFocus());return!1;case \"[ctrl-j]\":if(!SocialCalc.Constants.AllowCtrlJ)break;window.setTimeout(function(){var c=a.context.sheetobj,\nd=c.GetAssuredCell(a.ecell.coord),c=window.prompt(\"Advanced Feature:\\n\\nCustom Numeric Format or Command\",d.nontextvalueformat?c.valueformats[d.nontextvalueformat-0]||\"\":\"\");if(null!=c){if(c.match(/^cmd:/))g=c.substring(4);else{if(c.match(/^edit:/)){g=c.substring(5);SocialCalc.CtrlSEditor&&SocialCalc.CtrlSEditor(g);return}l=a.range.hasrange?SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom):a.ecell.coord;g=\"set \"+l+\" nontextvalueformat \"+c}a.EditorScheduleSheetCommands(g,\n!0,!1)}},200);return!1}return!0};a.sheetobj.statuscallback=SocialCalc.EditorSheetStatusCallback;a.sheetobj.statuscallbackparams=this;this.StatusCallback={};this.MoveECellCallback={};this.RangeChangeCallback={};this.SettingsCallbacks={};this.ecell={coord:\"A1\",row:1,col:1};a.highlights[this.ecell.coord]=\"cursor\";this.range={hasrange:!1};this.range2={hasrange:!1}};SocialCalc.TableEditor.prototype.CreateTableEditor=function(a,c){return SocialCalc.CreateTableEditor(this,a,c)};\nSocialCalc.TableEditor.prototype.ResizeTableEditor=function(a,c){return SocialCalc.ResizeTableEditor(this,a,c)};SocialCalc.TableEditor.prototype.SaveEditorSettings=function(){return SocialCalc.SaveEditorSettings(this)};SocialCalc.TableEditor.prototype.LoadEditorSettings=function(a,c){return SocialCalc.LoadEditorSettings(this,a,c)};SocialCalc.TableEditor.prototype.EditorRenderSheet=function(){SocialCalc.EditorRenderSheet(this)};\nSocialCalc.TableEditor.prototype.EditorScheduleSheetCommands=function(a,c,b){SocialCalc.EditorScheduleSheetCommands(this,a,c,b)};SocialCalc.TableEditor.prototype.ScheduleSheetCommands=function(a,c){this.context.sheetobj.ScheduleSheetCommands(a,c)};SocialCalc.TableEditor.prototype.SheetUndo=function(){this.context.sheetobj.SheetUndo()};SocialCalc.TableEditor.prototype.SheetRedo=function(){this.context.sheetobj.SheetRedo()};\nSocialCalc.TableEditor.prototype.EditorStepSet=function(a,c){SocialCalc.EditorStepSet(this,a,c)};SocialCalc.TableEditor.prototype.GetStatuslineString=function(a,c,b){return SocialCalc.EditorGetStatuslineString(this,a,c,b)};SocialCalc.TableEditor.prototype.EditorMouseRegister=function(){return SocialCalc.EditorMouseRegister(this)};SocialCalc.TableEditor.prototype.EditorMouseUnregister=function(){return SocialCalc.EditorMouseUnregister(this)};\nSocialCalc.TableEditor.prototype.EditorMouseRange=function(a){return SocialCalc.EditorMouseRange(this,a)};SocialCalc.TableEditor.prototype.EditorProcessKey=function(a,c){return SocialCalc.EditorProcessKey(this,a,c)};SocialCalc.TableEditor.prototype.EditorAddToInput=function(a,c){return SocialCalc.EditorAddToInput(this,a,c)};SocialCalc.TableEditor.prototype.DisplayCellContents=function(){return SocialCalc.EditorDisplayCellContents(this)};\nSocialCalc.TableEditor.prototype.EditorSaveEdit=function(a){return SocialCalc.EditorSaveEdit(this,a)};SocialCalc.TableEditor.prototype.EditorApplySetCommandsToRange=function(a,c){return SocialCalc.EditorApplySetCommandsToRange(this,a,c)};SocialCalc.TableEditor.prototype.MoveECellWithKey=function(a){return SocialCalc.MoveECellWithKey(this,a)};SocialCalc.TableEditor.prototype.MoveECell=function(a){return SocialCalc.MoveECell(this,a)};\nSocialCalc.TableEditor.prototype.ReplaceCell=function(a,c,b){SocialCalc.ReplaceCell(this,a,c,b)};SocialCalc.TableEditor.prototype.UpdateCellCSS=function(a,c,b){SocialCalc.UpdateCellCSS(this,a,c,b)};SocialCalc.TableEditor.prototype.SetECellHeaders=function(a){SocialCalc.SetECellHeaders(this,a)};SocialCalc.TableEditor.prototype.EnsureECellVisible=function(){SocialCalc.EnsureECellVisible(this)};SocialCalc.TableEditor.prototype.ECellReadonly=function(a){return SocialCalc.ECellReadonly(this,a)};\nSocialCalc.TableEditor.prototype.RangeAnchor=function(a){SocialCalc.RangeAnchor(this,a)};SocialCalc.TableEditor.prototype.RangeExtend=function(a){SocialCalc.RangeExtend(this,a)};SocialCalc.TableEditor.prototype.RangeRemove=function(){SocialCalc.RangeRemove(this)};SocialCalc.TableEditor.prototype.Range2Remove=function(){SocialCalc.Range2Remove(this)};SocialCalc.TableEditor.prototype.FitToEditTable=function(){SocialCalc.FitToEditTable(this)};\nSocialCalc.TableEditor.prototype.CalculateEditorPositions=function(){SocialCalc.CalculateEditorPositions(this)};SocialCalc.TableEditor.prototype.ScheduleRender=function(){SocialCalc.ScheduleRender(this)};SocialCalc.TableEditor.prototype.DoRenderStep=function(){SocialCalc.DoRenderStep(this)};SocialCalc.TableEditor.prototype.SchedulePositionCalculations=function(){SocialCalc.SchedulePositionCalculations(this)};SocialCalc.TableEditor.prototype.DoPositionCalculations=function(){SocialCalc.DoPositionCalculations(this)};\nSocialCalc.TableEditor.prototype.CalculateRowPositions=function(a,c,b){return SocialCalc.CalculateRowPositions(this,a,c,b)};SocialCalc.TableEditor.prototype.CalculateColPositions=function(a,c,b){return SocialCalc.CalculateColPositions(this,a,c,b)};SocialCalc.TableEditor.prototype.ScrollRelative=function(a,c){SocialCalc.ScrollRelative(this,a,c)};SocialCalc.TableEditor.prototype.ScrollRelativeBoth=function(a,c){SocialCalc.ScrollRelativeBoth(this,a,c)};\nSocialCalc.TableEditor.prototype.PageRelative=function(a,c){SocialCalc.PageRelative(this,a,c)};SocialCalc.TableEditor.prototype.LimitLastPanes=function(){SocialCalc.LimitLastPanes(this)};SocialCalc.TableEditor.prototype.ScrollTableUpOneRow=function(){return SocialCalc.ScrollTableUpOneRow(this)};SocialCalc.TableEditor.prototype.ScrollTableDownOneRow=function(){return SocialCalc.ScrollTableDownOneRow(this)};SocialCalc.TableEditor.prototype.ScrollTableLeftOneCol=function(){return SocialCalc.ScrollTableLeftOneCol(this)};\nSocialCalc.TableEditor.prototype.ScrollTableRightOneCol=function(){return SocialCalc.ScrollTableRightOneCol(this)};\nSocialCalc.CreateTableEditor=function(a,c,b){var d=SocialCalc.Constants,e=SocialCalc.AssignID;a.toplevel=document.createElement(\"div\");a.toplevel.style.position=\"relative\";e(a,a.toplevel,\"toplevel\");a.width=c;a.height=b;a.griddiv=document.createElement(\"div\");a.tablewidth=Math.max(0,c-d.defaultTableControlThickness);a.tableheight=Math.max(0,b-d.defaultTableControlThickness);a.griddiv.style.width=a.tablewidth+\"px\";a.griddiv.style.height=a.tableheight+\"px\";a.griddiv.style.overflow=\"hidden\";a.griddiv.style.cursor=\n\"default\";d.cteGriddivClass&&(a.griddiv.className=d.cteGriddivClass);e(a,a.griddiv,\"griddiv\");a.FitToEditTable();a.EditorRenderSheet();a.griddiv.appendChild(a.fullgrid);a.verticaltablecontrol=new SocialCalc.TableControl(a,!0,a.tableheight);a.verticaltablecontrol.CreateTableControl();e(a,a.verticaltablecontrol.main,\"tablecontrolv\");a.horizontaltablecontrol=new SocialCalc.TableControl(a,!1,a.tablewidth);a.horizontaltablecontrol.CreateTableControl();e(a,a.horizontaltablecontrol.main,\"tablecontrolh\");\nc=document.createElement(\"table\");a.layouttable=c;c.cellSpacing=0;c.cellPadding=0;e(a,c,\"layouttable\");d=document.createElement(\"tbody\");c.appendChild(d);c=document.createElement(\"tr\");d.appendChild(c);b=document.createElement(\"td\");b.appendChild(a.griddiv);c.appendChild(b);b=document.createElement(\"td\");b.appendChild(a.verticaltablecontrol.main);c.appendChild(b);c=document.createElement(\"tr\");d.appendChild(c);b=document.createElement(\"td\");b.appendChild(a.horizontaltablecontrol.main);c.appendChild(b);\nb=document.createElement(\"td\");d=\"url(\"+a.imageprefix+\"logo.gif) no-repeat center center\";TiddlyWiki&&(d=TiddlyWiki.getModifiedCssImageStyle(d));b.style.background=d;d=\"<div style='cursor:pointer;font-size:1px;'><img src='\"+a.imageprefix+\"1x1.gif' border='0' width='18' height='18'></div>\";if(TiddlyWiki)for(var f=/['][.]?[/]?images\\/(.+?)[']/g,g;g=f.exec(d);){var l=TiddlyWiki.getModifiedImgSrc(g[0].replace(/\\'/g,\"\"));l&&(d=d.replace(g[0],'\"'+l+'\"'))}b.innerHTML=d;c.appendChild(b);a.logo=b;e(a,a.logo,\n\"logo\");SocialCalc.TooltipRegister(b.firstChild.firstChild,\"SocialCalc\",null,a.toplevel);a.toplevel.appendChild(a.layouttable);a.noEdit||(a.inputEcho=new SocialCalc.InputEcho(a),e(a,a.inputEcho.main,\"inputecho\"));a.cellhandles=new SocialCalc.CellHandles(a);c=document.createElement(\"textarea\");SocialCalc.setStyles(c,\"display:none;position:absolute;height:1px;width:1px;opacity:0;filter:alpha(opacity=0);\");c.value=\"\";a.pasteTextarea=c;e(a,a.pasteTextarea,\"pastetextarea\");navigator.userAgent.match(/Safari\\//)&&\n!navigator.userAgent.match(/Chrome\\//)&&(window.removeEventListener(\"beforepaste\",SocialCalc.SafariPasteFunction,!1),window.addEventListener(\"beforepaste\",SocialCalc.SafariPasteFunction,!1),window.removeEventListener(\"beforecopy\",SocialCalc.SafariPasteFunction,!1),window.addEventListener(\"beforecopy\",SocialCalc.SafariPasteFunction,!1),window.removeEventListener(\"beforecut\",SocialCalc.SafariPasteFunction,!1),window.addEventListener(\"beforecut\",SocialCalc.SafariPasteFunction,!1));a.toplevel.appendChild(a.pasteTextarea);\nSocialCalc.MouseWheelRegister(a.toplevel,{WheelMove:SocialCalc.EditorProcessMouseWheel,editor:a});SocialCalc.KeyboardSetFocus(a);SocialCalc.EditorSheetStatusCallback(null,\"startup\",null,a);return a.toplevel};SocialCalc.SafariPasteFunction=function(a){a.preventDefault()};\nSocialCalc.ResizeTableEditor=function(a,c,b){var d=SocialCalc.Constants;a.width=c;a.height=b;a.toplevel.style.width=c+\"px\";a.toplevel.style.height=b+\"px\";a.tablewidth=Math.max(0,c-d.defaultTableControlThickness);a.tableheight=Math.max(0,b-d.defaultTableControlThickness);a.griddiv.style.width=a.tablewidth+\"px\";a.griddiv.style.height=a.tableheight+\"px\";a.verticaltablecontrol.main.style.height=a.tableheight+\"px\";a.horizontaltablecontrol.main.style.width=a.tablewidth+\"px\";a.FitToEditTable();a.ScheduleRender()};\nSocialCalc.SaveEditorSettings=function(a){var c,b,d=a.context,e=a.range,f;f=\"version:1.0\\n\";for(c=0;c<d.rowpanes.length;c++)f+=\"rowpane:\"+c+\":\"+d.rowpanes[c].first+\":\"+d.rowpanes[c].last+\"\\n\";for(c=0;c<d.colpanes.length;c++)f+=\"colpane:\"+c+\":\"+d.colpanes[c].first+\":\"+d.colpanes[c].last+\"\\n\";a.ecell&&(f+=\"ecell:\"+a.ecell.coord+\"\\n\");e.hasrange&&(f+=\"range:\"+e.anchorcoord+\":\"+e.top+\":\"+e.bottom+\":\"+e.left+\":\"+e.right+\"\\n\");for(b in a.SettingsCallbacks)f+=a.SettingsCallbacks[b].save(a,b);return f};\nSocialCalc.LoadEditorSettings=function(a,c,b){c=c.split(/\\r\\n|\\n/);var d=[],e,f,g,l=a.context,h,m;l.rowpanes=[{first:1,last:1}];l.colpanes=[{first:1,last:1}];a.ecell=null;a.range={hasrange:!1};a.range2={hasrange:!1};m=a.range;l.highlights={};h=l.highlights;for(f=0;f<c.length;f++)switch(e=c[f],d=e.split(\":\"),g=d[0],g){case \"version\":break;case \"rowpane\":l.rowpanes[d[1]-0]={first:d[2]-0,last:d[3]-0};break;case \"colpane\":l.colpanes[d[1]-0]={first:d[2]-0,last:d[3]-0};break;case \"ecell\":a.ecell=SocialCalc.coordToCr(d[1]);\na.ecell.coord=d[1];h[d[1]]=\"cursor\";break;case \"range\":m.hasrange=!0;m.anchorcoord=d[1];e=SocialCalc.coordToCr(m.anchorcoord);m.anchorrow=e.row;m.anchorcol=e.col;m.top=d[2]-0;m.bottom=d[3]-0;m.left=d[4]-0;m.right=d[5]-0;for(d=m.top;d<=m.bottom;d++)for(e=m.left;e<=m.right;e++)g=SocialCalc.crToCoord(e,d),\"cursor\"!=h[g]&&(h[g]=\"range\");break;default:a.SettingsCallbacks[g]&&a.SettingsCallbacks[g].load(a,g,e,b)}};\nSocialCalc.EditorRenderSheet=function(a){a.EditorMouseUnregister();a.fullgrid=a.context.RenderSheet(a.fullgrid);a.ecell&&a.SetECellHeaders(\"selected\");SocialCalc.AssignID(a,a.fullgrid,\"fullgrid\");a.EditorMouseRegister()};\nSocialCalc.EditorScheduleSheetCommands=function(a,c,b,d){if(\"start\"==a.state||d)if(a.busy&&!d)a.deferredCommands.push({cmdstr:c,saveundo:b});else switch(c){case \"recalc\":case \"redisplay\":a.context.sheetobj.ScheduleSheetCommands(c,!1);break;case \"undo\":a.SheetUndo();break;case \"redo\":a.SheetRedo();break;default:a.context.sheetobj.ScheduleSheetCommands(c,b)}};\nSocialCalc.EditorSheetStatusCallback=function(a,c,b,d){var e;a=d.context.sheetobj;var f=function(a){for(e in d.StatusCallback)d.StatusCallback[e].func&&d.StatusCallback[e].func(d,a,b,d.StatusCallback[e].params)};switch(c){case \"startup\":break;case \"cmdstart\":d.busy=!0;a.celldisplayneeded=\"\";break;case \"cmdextension\":break;case \"cmdend\":f(c);a.changedrendervalues&&(d.context.PrecomputeSheetFontsAndLayouts(),d.context.CalculateCellSkipData(),a.changedrendervalues=!1);a.celldisplayneeded&&!a.renderneeded&&\n(cr=SocialCalc.coordToCr(a.celldisplayneeded),c=SocialCalc.GetEditorCellElement(d,cr.row,cr.col),d.ReplaceCell(c,cr.row,cr.col));if(d.deferredCommands.length){a=d.deferredCommands.shift();d.EditorScheduleSheetCommands(a.cmdstr,a.saveundo,!0);return}a.attribs.needsrecalc&&(\"off\"!=a.attribs.recalc||a.recalconce)&&d.recalcFunction?(d.FitToEditTable(),a.renderneeded=!1,a.recalconce&&delete a.recalconce,d.recalcFunction(d)):a.renderneeded?(d.FitToEditTable(),a.renderneeded=!1,d.ScheduleRender()):d.SchedulePositionCalculations();\nif(\"col\"==a.hiddencolrow){for(c=d.ecell.col;\"yes\"==a.colattribs.hide[SocialCalc.rcColname(c)];)c++;c=SocialCalc.crToCoord(c,d.ecell.row);d.MoveECell(c);a.hiddencolrow=\"\"}if(\"row\"==a.hiddencolrow){for(c=d.ecell.row;\"yes\"==a.rowattribs.hide[c];)c++;c=SocialCalc.crToCoord(d.ecell.col,c);d.MoveECell(c);a.hiddencolrow=\"\"}return;case \"calcstart\":d.busy=!0;break;case \"calccheckdone\":case \"calcorder\":case \"calcstep\":case \"calcloading\":case \"calcserverfunc\":break;case \"calcfinished\":f(c);d.ScheduleRender();\nreturn;case \"schedrender\":d.busy=!0;break;case \"renderdone\":break;case \"schedposcalc\":d.busy=!0;break;case \"doneposcalc\":d.deferredCommands.length?(f(c),a=d.deferredCommands.shift(),d.EditorScheduleSheetCommands(a.cmdstr,a.saveundo,!0)):(d.busy=!1,f(c),\"start\"==d.state&&d.DisplayCellContents());return;default:addmsg(\"Unknown status: \"+c)}f(c)};\nSocialCalc.EditorGetStatuslineString=function(a,c,b,d){var e=SocialCalc.Constants,f,g,l;f=\"\";switch(c){case \"moveecell\":case \"rangechange\":case \"startup\":break;case \"cmdstart\":d.command=!0;document.body.style.cursor=\"progress\";a.griddiv.style.cursor=\"progress\";f=e.s_statusline_executing;break;case \"cmdextension\":f=\"Command Extension: \"+b;break;case \"cmdend\":d.command=!1;break;case \"schedrender\":f=e.s_statusline_displaying;break;case \"renderdone\":f=\" \";break;case \"schedposcalc\":f=e.s_statusline_displaying;\nbreak;case \"cmdendnorender\":case \"doneposcalc\":document.body.style.cursor=\"default\";a.griddiv.style.cursor=\"default\";break;case \"calcorder\":f=e.s_statusline_ordering+Math.floor(100*b.count/(b.total||1))+\"%\";break;case \"calcstep\":f=e.s_statusline_calculating+Math.floor(100*b.count/(b.total||1))+\"%\";break;case \"calcloading\":f=e.s_statusline_calculatingls+\": \"+b.sheetname;break;case \"calcserverfunc\":f=e.s_statusline_calculating+Math.floor(100*b.count/(b.total||1))+\"%, \"+e.s_statusline_doingserverfunc+\nb.funcname+e.s_statusline_incell+b.coord;break;case \"calcstart\":d.calculating=!0;document.body.style.cursor=\"progress\";a.griddiv.style.cursor=\"progress\";f=e.s_statusline_calcstart;break;case \"calccheckdone\":break;case \"calcfinished\":d.calculating=!1;break;default:f=c}!f&&d.calculating&&(f=e.s_statusline_calculating);if(!(d.calculating||d.command||f||!a.range.hasrange||a.range.left==a.range.right&&a.range.top==a.range.bottom)){c=0;for(b=a.range.top;b<=a.range.bottom;b++)for(g=a.range.left;g<=a.range.right;g++)(l=\na.context.sheetobj.cells[SocialCalc.crToCoord(g,b)])&&l.valuetype&&\"n\"==l.valuetype.charAt(0)&&(c+=l.datavalue-0);c=SocialCalc.FormatNumber.formatNumberWithFormat(c,\"[,]General\",\"\");b=SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom);f=b+\" (\"+(a.range.right-a.range.left+1)+\"x\"+(a.range.bottom-a.range.top+1)+\") \"+e.s_statusline_sum+\"=\"+c+\" \"+f}f=a.ecell.coord+\" \"+f;d.calculating||\"yes\"!=a.context.sheetobj.attribs.needsrecalc||(f+=\" \"+\ne.s_statusline_recalcneeded);if(a=a.context.sheetobj.attribs.circularreferencecell)a=a.replace(/\\|/,\" referenced by \"),f+=\" \"+e.s_statusline_circref+a+\"</span>\";return f};SocialCalc.EditorMouseInfo={registeredElements:[],editor:null,element:null,ignore:!1,mousedowncoord:\"\",mouselastcoord:\"\",mouseresizecol:\"\",mouseresizeclientx:null,mouseresizedisplay:null};\nSocialCalc.EditorMouseRegister=function(a){var c=SocialCalc.EditorMouseInfo,b=a.fullgrid,d;for(d=0;d<c.registeredElements.length;d++)if(c.registeredElements[d].editor==a){if(c.registeredElements[d].element==b)return;break}d<c.registeredElements.length?c.registeredElements[d].element=b:c.registeredElements.push({element:b,editor:a});if(b.addEventListener)b.addEventListener(\"mousedown\",SocialCalc.ProcessEditorMouseDown,!1),b.addEventListener(\"dblclick\",SocialCalc.ProcessEditorDblClick,!1);else if(b.attachEvent)b.attachEvent(\"onmousedown\",\nSocialCalc.ProcessEditorMouseDown),b.attachEvent(\"ondblclick\",SocialCalc.ProcessEditorDblClick);else throw\"Browser not supported\";c.ignore=!1};\nSocialCalc.EditorMouseUnregister=function(a){var c=SocialCalc.EditorMouseInfo,b;for(b=0;b<c.registeredElements.length&&c.registeredElements[b].editor!=a;b++);b<c.registeredElements.length&&(a=c.registeredElements[b].element,a.removeEventListener?(a.removeEventListener(\"mousedown\",SocialCalc.ProcessEditorMouseDown,!1),a.removeEventListener(\"dblclick\",SocialCalc.ProcessEditorDblClick,!1)):a.detachEvent&&(a.detachEvent(\"onmousedown\",SocialCalc.ProcessEditorMouseDown),a.detachEvent(\"ondblclick\",SocialCalc.ProcessEditorDblClick)),\nc.registeredElements.splice(b,1))};\nSocialCalc.ProcessEditorMouseDown=function(a){var c,b,d,e=a||window.event,f=SocialCalc.EditorMouseInfo,g=e.target||e.srcElement;if(!f.ignore){for(c=null;!c&&g;g=g.parentNode)c=SocialCalc.LookupElement(g,f.registeredElements);if(c){if(c=c.editor,f.element=g,d=c.range,b=SocialCalc.GetElementPositionWithScroll(c.toplevel),b=SocialCalc.GridMousePosition(c,e.clientX-b.left,e.clientY-b.top))f.editor=c,b.rowheader&&b.rowtounhide?SocialCalc.ProcessEditorRowsizeMouseDown(a,g,b):b.colheader&&b.coltoresize?\nSocialCalc.ProcessEditorColsizeMouseDown(a,g,b):b.coord&&(d.hasrange||a.shiftKey&&c.RangeAnchor(),b=c.MoveECell(b.coord),d.hasrange&&(a.shiftKey?c.RangeExtend():c.RangeRemove()),f.mousedowncoord=b,f.mouselastcoord=b,c.EditorMouseRange(b),SocialCalc.KeyboardSetFocus(c),\"start\"!=c.state&&c.inputBox&&c.inputBox.element.focus(),TiddlyWiki&&(a=SocialCalc.GetSpreadsheetControlObject(),a.inputView&&a.inputView.focus()),document.addEventListener?(document.addEventListener(\"mousemove\",SocialCalc.ProcessEditorMouseMove,\n!0),document.addEventListener(\"mouseup\",SocialCalc.ProcessEditorMouseUp,!0)):g.attachEvent&&(g.setCapture(),g.attachEvent(\"onmousemove\",SocialCalc.ProcessEditorMouseMove),g.attachEvent(\"onmouseup\",SocialCalc.ProcessEditorMouseUp),g.attachEvent(\"onlosecapture\",SocialCalc.ProcessEditorMouseUp)),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1)}else f.editor=null}};\nSocialCalc.EditorMouseRange=function(a,c){var b,d,e=a.range;switch(a.state){case \"input\":b=a.inputBox.GetText();d=a.workingvalues;if(0<=\"(+-*/,:!&<>=^\".indexOf(b.slice(-1))&&\"=\"==b.slice(0,1)||\"=\"==b)d.partialexpr=b;d.partialexpr?c&&(e.hasrange?a.inputBox.SetText(d.partialexpr+SocialCalc.crToCoord(e.left,e.top)+\":\"+SocialCalc.crToCoord(e.right,e.bottom)):a.inputBox.SetText(d.partialexpr+c)):(a.inputBox.Blur(),a.inputBox.ShowInputBox(!1),a.state=\"start\",a.cellhandles.ShowCellHandles(!0),a.EditorSaveEdit(),\na.inputBox.DisplayCellContents(null));break;case \"inputboxdirect\":a.inputBox.Blur(),a.inputBox.ShowInputBox(!1),a.state=\"start\",a.cellhandles.ShowCellHandles(!0),a.EditorSaveEdit(),a.inputBox.DisplayCellContents(null)}};\nSocialCalc.ProcessEditorMouseMove=function(a){var c,b,d=a||window.event,e=SocialCalc.EditorMouseInfo;(c=e.editor)&&!e.ignore&&(b=SocialCalc.GetElementPositionWithScroll(c.toplevel),b=SocialCalc.GridMousePosition(c,d.clientX-b.left,d.clientY-b.top))&&(b&&!b.coord?SocialCalc.SetDragAutoRepeat(c,b):(SocialCalc.SetDragAutoRepeat(c,null),b.coord&&(b.coord!=e.mouselastcoord&&(a.shiftKey||c.range.hasrange||c.RangeAnchor(e.mousedowncoord),c.MoveECell(b.coord),c.RangeExtend()),e.mouselastcoord=b.coord,c.EditorMouseRange(b.coord),\nd.stopPropagation?d.stopPropagation():d.cancelBubble=!0,d.preventDefault?d.preventDefault():d.returnValue=!1)))};\nSocialCalc.ProcessEditorMouseUp=function(a){var c,b,d=a||window.event,e=SocialCalc.EditorMouseInfo;if((a=e.editor)&&!e.ignore&&(c=e.element,b=SocialCalc.GetElementPositionWithScroll(a.toplevel),b=SocialCalc.GridMousePosition(a,d.clientX-b.left,d.clientY-b.top),SocialCalc.SetDragAutoRepeat(a,null),b))return b.coord||(b.coord=a.ecell.coord),a.range.hasrange?(a.MoveECell(b.coord),a.RangeExtend()):b.coord&&b.coord!=e.mousedowncoord&&(a.RangeAnchor(e.mousedowncoord),a.MoveECell(b.coord),a.RangeExtend()),\na.EditorMouseRange(b.coord),d.stopPropagation?d.stopPropagation():d.cancelBubble=!0,d.preventDefault?d.preventDefault():d.returnValue=!1,document.removeEventListener?(document.removeEventListener(\"mousemove\",SocialCalc.ProcessEditorMouseMove,!0),document.removeEventListener(\"mouseup\",SocialCalc.ProcessEditorMouseUp,!0)):c.detachEvent&&(c.detachEvent(\"onlosecapture\",SocialCalc.ProcessEditorMouseUp),c.detachEvent(\"onmouseup\",SocialCalc.ProcessEditorMouseUp),c.detachEvent(\"onmousemove\",SocialCalc.ProcessEditorMouseMove),\nc.releaseCapture()),e.editor=null,!1};\nSocialCalc.ProcessEditorColsizeMouseDown=function(a,c,b){a=a||window.event;c=SocialCalc.EditorMouseInfo;var d=c.editor,e=SocialCalc.GetElementPositionWithScroll(d.toplevel),e=a.clientX-e.left;c.mouseresizecolnum=b.coltoresize;c.mouseresizecol=SocialCalc.rcColname(b.coltoresize);c.mousedownclientx=e;c.mousecoltounhide=b.coltounhide;c.mousecoltounhide||(e=document.createElement(\"div\"),c.mouseresizedisplay=e,e.style.width=\"auto\",e.style.position=\"absolute\",e.style.zIndex=100,e.style.top=d.headposition.top+\n\"px\",e.style.left=d.colpositions[b.coltoresize]+\"px\",e.innerHTML='<table cellpadding=\"0\" cellspacing=\"0\"><tr><td style=\"height:100px;border:1px dashed black;background-color:white;width:'+(d.context.colwidth[c.mouseresizecolnum]-2)+'px;\"> </td><td><div style=\"font-size:small;color:white;background-color:gray;padding:4px;\">'+d.context.colwidth[c.mouseresizecolnum]+\"</div></td></tr></table>\",SocialCalc.setStyles(e.firstChild.lastChild.firstChild.childNodes[0],\"filter:alpha(opacity=85);opacity:.85;\"),\nd.toplevel.appendChild(e));document.addEventListener?(document.addEventListener(\"mousemove\",SocialCalc.ProcessEditorColsizeMouseMove,!0),document.addEventListener(\"mouseup\",SocialCalc.ProcessEditorColsizeMouseUp,!0)):d.toplevel.attachEvent&&(d.toplevel.setCapture(),d.toplevel.attachEvent(\"onmousemove\",SocialCalc.ProcessEditorColsizeMouseMove),d.toplevel.attachEvent(\"onmouseup\",SocialCalc.ProcessEditorColsizeMouseUp),d.toplevel.attachEvent(\"onlosecapture\",SocialCalc.ProcessEditorColsizeMouseUp));a.stopPropagation?\na.stopPropagation():a.cancelBubble=!0;a.preventDefault?a.preventDefault():a.returnValue=!1};\nSocialCalc.ProcessEditorColsizeMouseMove=function(a){a=a||window.event;var c=SocialCalc.EditorMouseInfo,b=c.editor;if(b){if(!c.mousecoltounhide){var d=SocialCalc.GetElementPositionWithScroll(b.toplevel),b=b.context.colwidth[c.mouseresizecolnum]-0+(a.clientX-d.left-c.mousedownclientx);b<SocialCalc.Constants.defaultMinimumColWidth&&(b=SocialCalc.Constants.defaultMinimumColWidth);c=c.mouseresizedisplay;c.innerHTML='<table cellpadding=\"0\" cellspacing=\"0\"><tr><td style=\"height:100px;border:1px dashed black;background-color:white;width:'+\n(b-2)+'px;\"> </td><td><div style=\"font-size:small;color:white;background-color:gray;padding:4px;\">'+b+\"</div></td></tr></table>\";SocialCalc.setStyles(c.firstChild.lastChild.firstChild.childNodes[0],\"filter:alpha(opacity=85);opacity:.85;\")}a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;a.preventDefault?a.preventDefault():a.returnValue=!1}};\nSocialCalc.ProcessEditorColsizeMouseUp=function(a){var c=a||window.event;a=SocialCalc.EditorMouseInfo;var b=a.editor;if(b){element=a.element;var d=SocialCalc.GetElementPositionWithScroll(b.toplevel),d=c.clientX-d.left;c.stopPropagation?c.stopPropagation():c.cancelBubble=!0;c.preventDefault?c.preventDefault():c.returnValue=!1;document.removeEventListener?(document.removeEventListener(\"mousemove\",SocialCalc.ProcessEditorColsizeMouseMove,!0),document.removeEventListener(\"mouseup\",SocialCalc.ProcessEditorColsizeMouseUp,\n!0)):b.toplevel.detachEvent&&(b.toplevel.detachEvent(\"onlosecapture\",SocialCalc.ProcessEditorColsizeMouseUp),b.toplevel.detachEvent(\"onmouseup\",SocialCalc.ProcessEditorColsizeMouseUp),b.toplevel.detachEvent(\"onmousemove\",SocialCalc.ProcessEditorColsizeMouseMove),b.toplevel.releaseCapture());a.mousecoltounhide?b.EditorScheduleSheetCommands(\"set \"+SocialCalc.rcColname(a.mousecoltounhide)+\" hide\",!0,!1):(c=b.context.colwidth[a.mouseresizecolnum]-0+(d-a.mousedownclientx),c<SocialCalc.Constants.defaultMinimumColWidth&&\n(c=SocialCalc.Constants.defaultMinimumColWidth),b.EditorScheduleSheetCommands(\"set \"+a.mouseresizecol+\" width \"+c,!0,!1),b.timeout&&window.clearTimeout(b.timeout),b.timeout=window.setTimeout(SocialCalc.FinishColsize,1));return!1}};SocialCalc.FinishColsize=function(){var a=SocialCalc.EditorMouseInfo,c=a.editor;c&&(c.toplevel.removeChild(a.mouseresizedisplay),a.mouseresizedisplay=null,a.editor=null)};\nSocialCalc.ProcessEditorRowsizeMouseDown=function(a,c,b){a=a||window.event;c=SocialCalc.EditorMouseInfo;var d=c.editor;SocialCalc.GetElementPositionWithScroll(d.toplevel);c.mouserowtounhide=b.rowtounhide;document.addEventListener?(document.addEventListener(\"mousemove\",SocialCalc.ProcessEditorRowsizeMouseMove,!0),document.addEventListener(\"mouseup\",SocialCalc.ProcessEditorRowsizeMouseUp,!0)):d.toplevel.attachEvent&&(d.toplevel.setCapture(),d.toplevel.attachEvent(\"onmousemove\",SocialCalc.ProcessEditorRowsizeMouseMove),\nd.toplevel.attachEvent(\"onmouseup\",SocialCalc.ProcessEditorRowsizeMouseUp),d.toplevel.attachEvent(\"onlosecapture\",SocialCalc.ProcessEditorRowsizeMouseUp));a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;a.preventDefault?a.preventDefault():a.returnValue=!1};SocialCalc.ProcessEditorRowsizeMouseMove=function(a){a=a||window.event;SocialCalc.EditorMouseInfo.editor&&(a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1)};\nSocialCalc.ProcessEditorRowsizeMouseUp=function(a){a=a||window.event;var c=SocialCalc.EditorMouseInfo,b=c.editor;if(b)return element=c.element,SocialCalc.GetElementPositionWithScroll(b.toplevel),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1,document.removeEventListener?(document.removeEventListener(\"mousemove\",SocialCalc.ProcessEditorRowsizeMouseMove,!0),document.removeEventListener(\"mouseup\",SocialCalc.ProcessEditorRowsizeMouseUp,!0)):\nb.toplevel.detachEvent&&(b.toplevel.detachEvent(\"onlosecapture\",SocialCalc.ProcessEditorRowsizeMouseUp),b.toplevel.detachEvent(\"onmouseup\",SocialCalc.ProcessEditorRowsizeMouseUp),b.toplevel.detachEvent(\"onmousemove\",SocialCalc.ProcessEditorRowsizeMouseMove),b.toplevel.releaseCapture()),c.mouserowtounhide&&b.EditorScheduleSheetCommands(\"set \"+c.mouserowtounhide+\" hide\",!0,!1),!1};SocialCalc.AutoRepeatInfo={timer:null,mouseinfo:null,repeatinterval:1E3,editor:null,repeatcallback:null};\nSocialCalc.SetDragAutoRepeat=function(a,c,b){var d=SocialCalc.AutoRepeatInfo;d.repeatcallback=b;if(c){d.editor=a;d.mouseinfo&&(c.rowheader||c.rowfooter?c.row!=d.mouseinfo.row&&(b=SocialCalc.crToCoord(a.ecell.col,c.row),d.repeatcallback?(a=c.row<d.mouseinfo.row?\"left\":c.row>d.mouseinfo.row?\"right\":\"\",d.repeatcallback(b,a)):(a.MoveECell(b),a.MoveECell(b),a.RangeExtend(),a.EditorMouseRange(b))):(c.colheader||c.colfooter)&&c.col!=d.mouseinfo.col&&(b=SocialCalc.crToCoord(c.col,a.ecell.row),d.repeatcallback?\n(a=c.row<d.mouseinfo.row?\"left\":c.row>d.mouseinfo.row?\"right\":\"\",d.repeatcallback(b,a)):(a.MoveECell(b),a.RangeExtend(),a.EditorMouseRange(b))));d.mouseinfo=c;if(5>c.distance)d.repeatinterval=333;else if(10>c.distance)d.repeatinterval=250;else if(25>c.distance)d.repeatinterval=100;else if(35>c.distance)d.repeatinterval=75;else{d.timer&&(window.clearTimeout(d.timer),d.timer=null);return}d.timer||(d.timer=window.setTimeout(SocialCalc.DragAutoRepeat,d.repeatinterval))}else d.timer&&(window.clearTimeout(d.timer),\nd.timer=null),d.mouseinfo=null};\nSocialCalc.DragAutoRepeat=function(){var a=SocialCalc.AutoRepeatInfo,c=a.mouseinfo,b;c.rowheader?b=\"left\":c.rowfooter?b=\"right\":c.colheader?b=\"up\":c.colfooter&&(b=\"down\");a.repeatcallback?(c=SocialCalc.coordToCr(a.editor.ecell.coord),\"left\"==b&&1<c.col?c.col--:\"right\"==b?c.col++:\"up\"==b&&1<c.row?c.row--:\"down\"==b&&c.row++,c=SocialCalc.crToCoord(c.col,c.row),a.repeatcallback(c,b)):(c=a.editor.MoveECellWithKey(\"[a\"+b+\"]shifted\"))&&a.editor.EditorMouseRange(c);a.timer=window.setTimeout(SocialCalc.DragAutoRepeat,\na.repeatinterval)};\nSocialCalc.ProcessEditorDblClick=function(a){var c,b;a=a||window.event;var d=SocialCalc.EditorMouseInfo,e=a.target||a.srcElement;if(!d.ignore){for(c=null;!c&&e;e=e.parentNode)c=SocialCalc.LookupElement(e,d.registeredElements);if(c){if(c=c.editor,b=SocialCalc.GetElementPositionWithScroll(c.toplevel),(b=SocialCalc.GridMousePosition(c,a.clientX-b.left,a.clientY-b.top))&&b.coord){d.editor=c;d.element=e;sheetobj=c.context.sheetobj;switch(c.state){case \"start\":SocialCalc.EditorOpenCellEdit(c)}a.stopPropagation?a.stopPropagation():\na.cancelBubble=!0;a.preventDefault?a.preventDefault():a.returnValue=!1}}else d.editor=null}};SocialCalc.EditorOpenCellEdit=function(a){var c;if(!a.ecell||!a.inputBox||a.inputBox.element.disabled)return!0;a.inputBox.ShowInputBox(!0);a.inputBox.Focus();a.state=\"inputboxdirect\";a.inputBox.SetText(\"\");a.inputBox.DisplayCellContents();a.inputBox.Select(\"end\");c=a.workingvalues;c.partialexpr=\"\";c.ecoord=a.ecell.coord;c.erow=a.ecell.row;c.ecol=a.ecell.col};\nSocialCalc.EditorProcessKey=function(a,c,b){hack.log(\"editor.state = \"+a.state+\", ch = \"+c,hack.keyboard,\"SocialCalc.EditorProcessKey\");var d=SocialCalc.GetSpreadsheetControlObject();TiddlyWiki&&(d.tiddlyWiki.saveTodo.flagStart=!0);var e,f=a.workingvalues,g=a.range;\"string\"!=typeof c&&(c=\"\");switch(a.state){case \"start\":b.shiftKey&&\"[a\"==c.substr(0,2)&&(c+=\"shifted\");\"[enter]\"==c&&(c=\"[adown]\");\"[tab]\"==c&&(c=b.shiftKey?\"[aleft]\":\"[aright]\");if(\"[a\"==c.substr(0,2)||\"[pg\"==c.substr(0,3)||\"[home]\"==\nc)return a=a.MoveECellWithKey(c),!a;if(TiddlyWiki&&d.tiddlyWiki.flagView)break;if(\"[del]\"==c||\"[backspace]\"==c){a.noEdit||a.ECellReadonly()||a.EditorApplySetCommandsToRange(\"empty\",\"\");break}if(\"[esc]\"==c){if(g.hasrange)for(e in a.RangeRemove(),a.MoveECell(g.anchorcoord),a.StatusCallback)a.StatusCallback[e].func(a,\"specialkey\",c,a.StatusCallback[e].params);break}if(\"[f2]\"==c){if(a.noEdit||a.ECellReadonly())return!0;SocialCalc.EditorOpenCellEdit(a);break}if(1<c.length&&\"[\"==c.substr(0,1)||0==c.length)return a.ctrlkeyFunction&&\n0<c.length?a.ctrlkeyFunction(a,c):!0;if(!a.ecell||!a.inputBox||a.ECellReadonly())return!0;a.inputBox.element.disabled=!1;a.state=\"input\";a.inputBox.ShowInputBox(!0);a.inputBox.Focus();a.inputBox.SetText(c);a.inputBox.Select(\"end\");f.partialexpr=\"\";f.ecoord=a.ecell.coord;f.erow=a.ecell.row;f.ecol=a.ecell.col;a.RangeRemove();break;case \"input\":d=a.inputBox.GetText();if(a.inputBox.skipOne)break;if(\"[esc]\"==c||\"[enter]\"==c||\"[tab]\"==c||c&&\"[a\"==c.substr(0,2)){if(0<=\"(+-*/,:!&<>=^\".indexOf(d.slice(-1))&&\n\"=\"==d.slice(0,1)||\"=\"==d)f.partialexpr=d;if(f.partialexpr&&(b.shiftKey&&\"[a\"==c.substr(0,2)&&(c+=\"shifted\"),d=a.MoveECellWithKey(c))){g.hasrange?a.inputBox.SetText(f.partialexpr+SocialCalc.crToCoord(g.left,g.top)+\":\"+SocialCalc.crToCoord(g.right,g.bottom)):a.inputBox.SetText(f.partialexpr+d);break}a.inputBox.Blur();a.inputBox.ShowInputBox(!1);a.state=\"start\";a.cellhandles.ShowCellHandles(!0);\"[esc]\"!=c?(a.EditorSaveEdit(),a.ecell.coord!=f.ecoord&&a.MoveECell(f.ecoord),\"[enter]\"==c&&(c=\"[adown]\"),\n\"[tab]\"==c&&(c=b.shiftKey?\"[aleft]\":\"[aright]\"),\"[a\"==c.substr(0,2)&&a.MoveECellWithKey(c)):(a.inputBox.DisplayCellContents(),a.RangeRemove(),a.MoveECell(f.ecoord));break}if(f.partialexpr&&\"[backspace]\"==c){a.inputBox.SetText(f.partialexpr);f.partialexpr=\"\";a.RangeRemove();a.MoveECell(f.ecoord);a.inputBox.ShowInputBox(!0);break}if(\"[f2]\"==c)break;g.hasrange&&a.RangeRemove();a.MoveECell(f.ecoord);f.partialexpr&&(a.inputBox.ShowInputBox(!0),f.partialexpr=\"\");return!0;case \"inputboxdirect\":a.inputBox.GetText();\nif(\"[esc]\"==c||\"[enter]\"==c||\"[tab]\"==c){a.inputBox.Blur();a.inputBox.ShowInputBox(!1);a.state=\"start\";a.cellhandles.ShowCellHandles(!0);\"[esc]\"==c?a.inputBox.DisplayCellContents():(a.EditorSaveEdit(),a.ecell.coord!=f.ecoord&&a.MoveECell(f.ecoord),\"[enter]\"==c&&(c=\"[adown]\"),\"[tab]\"==c&&(c=b.shiftKey?\"[aleft]\":\"[aright]\"),\"[a\"==c.substr(0,2)&&a.MoveECellWithKey(c));break}if(\"[f2]\"==c)break;return!0;case \"skip-and-start\":a.state=\"start\";a.cellhandles.ShowCellHandles(!0);break;default:return!0}return!1};\nSocialCalc.EditorAddToInput=function(a,c,b){var d=a.workingvalues;if(!a.noEdit&&!a.ECellReadonly())switch(a.state){case \"start\":a.state=\"input\";a.inputBox.ShowInputBox(!0);a.inputBox.element.disabled=!1;a.inputBox.Focus();a.inputBox.SetText((b||\"\")+c);a.inputBox.Select(\"end\");d.partialexpr=\"\";d.ecoord=a.ecell.coord;d.erow=a.ecell.row;d.ecol=a.ecell.col;a.RangeRemove();break;case \"input\":case \"inputboxdirect\":a.inputBox.element.focus(),d.partialexpr&&(a.inputBox.SetText(d.partialexpr),d.partialexpr=\n\"\",a.RangeRemove(),a.MoveECell(d.ecoord)),a.inputBox.SetText(a.inputBox.GetText()+c)}};SocialCalc.EditorDisplayCellContents=function(a){a.inputBox&&a.inputBox.DisplayCellContents()};\nSocialCalc.EditorSaveEdit=function(a,c){var b,d,e;b=a.context.sheetobj;var f=a.workingvalues;e=\"string\"==typeof c?c:a.inputBox.GetText();b=SocialCalc.GetCellContents(b,f.ecoord)+\"\";e!=b&&(b=e.charAt(0),\"=\"==b&&-1==e.indexOf(\"\\n\")?(d=\"formula\",e=e.substring(1)):\"'\"==b?(d=\"text t\",e=e.substring(1),b=SocialCalc.DetermineValueType(e),\"t\"==b.type.charAt(0)&&(d=\"text \"+b.type)):0==e.length?d=\"empty\":(b=SocialCalc.DetermineValueType(e),d=\"n\"==b.type&&e==b.value+\"\"?\"value n\":\"t\"==b.type.charAt(0)?\"text \"+\nb.type:\"\"==b.type?\"text t\":\"constant \"+b.type+\" \"+b.value),\"t\"==d.charAt(0)&&(e=SocialCalc.encodeForSave(e)),e=\"set \"+f.ecoord+\" \"+d+\" \"+e,a.EditorScheduleSheetCommands(e,!0,!1))};SocialCalc.EditorApplySetCommandsToRange=function(a,c){var b;b=a.ecell;var d=a.range;d.hasrange?(coord=SocialCalc.crToCoord(d.left,d.top)+\":\"+SocialCalc.crToCoord(d.right,d.bottom),b=\"set \"+coord+\" \"+c):b=\"set \"+b.coord+\" \"+c;a.EditorScheduleSheetCommands(b,!0,!1);a.DisplayCellContents()};\nSocialCalc.EditorProcessMouseWheel=function(a,c,b,d){d.functionobj.editor.busy||(0<c&&d.functionobj.editor.ScrollRelative(!0,Math.floor(1.5*-c)),0>c&&d.functionobj.editor.ScrollRelative(!0,Math.ceil(1.5*-c)))};\nSocialCalc.GridMousePosition=function(a,c,b){var d,e,f={};for(d=1;d<a.rowpositions.length&&!(a.rowheight[d]&&a.rowpositions[d]+a.rowheight[d]>b);d++);for(e=1;e<a.colpositions.length&&!(a.colwidth[e]&&a.colpositions[e]+a.colwidth[e]>c);e++);f.row=d;f.col=e;if(a.headposition){if(c<a.headposition.left&&c>=a.gridposition.left){f.rowheader=!0;f.distance=a.headposition.left-c;f.rowtounhide=\"\";if(unhide=a.context.rowunhidetop[d])pos=SocialCalc.GetElementPosition(unhide),c>=pos.left&&c<pos.left+unhide.offsetWidth&&\nb>=pos.top&&b<pos.top+unhide.offsetHeight&&(f.rowtounhide=d+1);if(unhide=a.context.rowunhidebottom[d])pos=SocialCalc.GetElementPosition(unhide),c>=pos.left&&c<pos.left+unhide.offsetWidth&&b>=pos.top&&b<pos.top+unhide.offsetHeight&&(f.rowtounhide=d-1)}else if(b<a.headposition.top&&b>a.gridposition.top){f.colheader=!0;f.distance=a.headposition.top-b;f.coltoresize=e-(a.colpositions[e]+a.colwidth[e]/2>c?1:0)||1;if(unhide=a.context.colunhideleft[e])pos=SocialCalc.GetElementPosition(unhide),c>=pos.left&&\nc<pos.left+unhide.offsetWidth&&b>=pos.top&&b<pos.top+unhide.offsetHeight&&(f.coltounhide=e+1);if(unhide=a.context.colunhideright[e])pos=SocialCalc.GetElementPosition(unhide),c>=pos.left&&c<pos.left+unhide.offsetWidth&&b>=pos.top&&b<pos.top+unhide.offsetHeight&&(f.coltounhide=e-1);for(c=0;c<a.context.colpanes.length;c++)if(f.coltoresize>=a.context.colpanes[c].first&&f.coltoresize<=a.context.colpanes[c].last)return f;delete f.coltoresize}else c>=a.verticaltablecontrol.controlborder?(f.rowfooter=!0,\nf.distance=c-a.verticaltablecontrol.controlborder):b>=a.horizontaltablecontrol.controlborder?(f.colfooter=!0,f.distance=b-a.horizontaltablecontrol.controlborder):c<a.gridposition.left?(f.rowheader=!0,f.distance=a.headposition.left-c):b<=a.gridposition.top?(f.colheader=!0,f.distance=a.headposition.top-b):(f.coord=SocialCalc.crToCoord(f.col,f.row),a.context.cellskip[f.coord]&&(f.coord=a.context.cellskip[f.coord]));return f}return null};\nSocialCalc.GetEditorCellElement=function(a,c,b){var d,e,f,g,l=0,h=0;for(d=0;d<a.context.rowpanes.length;d++){if(c>=a.context.rowpanes[d].first&&c<=a.context.rowpanes[d].last)for(e=0;e<a.context.colpanes.length;e++){if(b>=a.context.colpanes[e].first&&b<=a.context.colpanes[e].last){l+=c-a.context.rowpanes[d].first+2;for(f=a.context.colpanes[e].first;f<=b;f++)(g=a.context.cellskip[SocialCalc.crToCoord(f,c)])&&a.context.CoordInPane(g,d,e)||h++;return{element:a.griddiv.firstChild.lastChild.childNodes[l].childNodes[h],\nrowpane:d,colpane:e}}for(f=a.context.colpanes[e].first;f<=a.context.colpanes[e].last;f++)(g=a.context.cellskip[SocialCalc.crToCoord(f,c)])&&a.context.CoordInPane(g,d,e)||h++;h+=1}l+=a.context.rowpanes[d].last-a.context.rowpanes[d].first+2}return null};\nSocialCalc.MoveECellWithKey=function(a,c){var b,d,e,f=!1,g=1;if(!a.ecell)return null;\"shifted\"==c.slice(-7)&&(c=c.slice(0,-7),f=!0);b=a.ecell.row;d=a.ecell.col;e=a.context.sheetobj.cells[a.ecell.coord];switch(c){case \"[adown]\":b+=e&&e.rowspan||1;break;case \"[aup]\":b--;g=-1;break;case \"[pgdn]\":b+=a.pageUpDnAmount-1+(e&&e.rowspan||1);break;case \"[pgup]\":b-=a.pageUpDnAmount;g=-1;break;case \"[aright]\":d+=e&&e.colspan||1;break;case \"[aleft]\":d--;g=-1;break;case \"[home]\":d=b=1;break;default:return null}a.context.sheetobj.attribs.usermaxcol&&\n(d=Math.min(a.context.sheetobj.attribs.usermaxcol,d));for(a.context.sheetobj.attribs.usermaxrow&&(b=Math.min(a.context.sheetobj.attribs.usermaxrow,b));\"yes\"==a.context.sheetobj.colattribs.hide[SocialCalc.rcColname(d)];)d+=g,1>d&&(g=-g,d=1);for(;\"yes\"==a.context.sheetobj.rowattribs.hide[b];)b+=g,1>b&&(g=-g,b=1);a.range.hasrange||f&&a.RangeAnchor();b=a.MoveECell(SocialCalc.crToCoord(d,b));a.range.hasrange&&(f?a.RangeExtend():a.RangeRemove());return b};\nSocialCalc.MoveECell=function(a,c){var b,d,e=a.context.highlights;b=SocialCalc.coordToCr(c);a.context.sheetobj.attribs.usermaxcol&&b.col>a.context.sheetobj.attribs.usermaxcol&&(b.col=a.context.sheetobj.attribs.usermaxcol);a.context.sheetobj.attribs.usermaxrow&&b.row>a.context.sheetobj.attribs.usermaxrow&&(b.row=a.context.sheetobj.attribs.usermaxrow);c=SocialCalc.crToCoord(b.col,b.row);if(a.ecell){if(a.ecell.coord==c)return c;b=SocialCalc.GetEditorCellElement(a,a.ecell.row,a.ecell.col);delete e[a.ecell.coord];\na.range2.hasrange&&a.ecell.row>=a.range2.top&&a.ecell.row<=a.range2.bottom&&a.ecell.col>=a.range2.left&&a.ecell.col<=a.range2.right&&(e[a.ecell.coord]=\"range2\");a.UpdateCellCSS(b,a.ecell.row,a.ecell.col);a.SetECellHeaders(\"\");a.cellhandles.ShowCellHandles(!1)}c=a.context.cellskip[c]||c;a.ecell=SocialCalc.coordToCr(c);a.ecell.coord=c;b=SocialCalc.GetEditorCellElement(a,a.ecell.row,a.ecell.col);e[c]=\"cursor\";for(d in a.MoveECellCallback)a.MoveECellCallback[d](a);a.UpdateCellCSS(b,a.ecell.row,a.ecell.col);\na.SetECellHeaders(\"selected\");for(d in a.StatusCallback)a.StatusCallback[d].func(a,\"moveecell\",c,a.StatusCallback[d].params);a.busy?a.ensureecell=!0:(a.ensureecell=!1,a.EnsureECellVisible());return c};\nSocialCalc.EnsureECellVisible=function(a){var c=0,b=0;a.ecell.row>a.lastnonscrollingrow&&(a.ecell.row<a.firstscrollingrow?c=a.ecell.row-a.firstscrollingrow:a.ecell.row>a.lastvisiblerow&&(c=a.ecell.row-a.lastvisiblerow));a.ecell.col>a.lastnonscrollingcol&&(a.ecell.col<a.firstscrollingcol?b=a.ecell.col-a.firstscrollingcol:a.ecell.col>a.lastvisiblecol&&(b=a.ecell.col-a.lastvisiblecol));0!=c||0!=b?a.ScrollRelativeBoth(c,b):a.cellhandles.ShowCellHandles(!0)};\nSocialCalc.ReplaceCell=function(a,c,b,d){var e;if(c&&(a=a.context.RenderCell(b,d,c.rowpane,c.colpane,!0,null)))for(e in c.element.innerHTML=a.innerHTML,c.element.style.cssText=\"\",c.element.className=a.className,a.style)\"cssText\"!=a.style[e]&&(c.element.style[e]=a.style[e])};\nSocialCalc.UpdateCellCSS=function(a,c,b,d){var e;if(c&&(a=a.context.RenderCell(b,d,c.rowpane,c.colpane,!0,null)))for(e in c.element.style.cssText=\"\",c.element.className=a.className,a.style)\"cssText\"!=a.style[e]&&(c.element.style[e]=a.style[e])};\nSocialCalc.SetECellHeaders=function(a,c){var b=a.ecell,d=a.context,e,f,g,l=0,h=0,m;if(b){for(;\"yes\"==d.sheetobj.colattribs.hide[SocialCalc.rcColname(b.col)];)b.col++;for(;\"yes\"==d.sheetobj.rowattribs.hide[b.row];)b.row++;b.coord=SocialCalc.crToCoord(b.col,b.row);for(e=0;e<d.rowpanes.length;e++)f=d.rowpanes[e].first,g=d.rowpanes[e].last,b.row>=f&&b.row<=g&&(m=a.fullgrid.childNodes[1].childNodes[2+l+b.row-f].childNodes[0])&&(d.classnames&&(m.className=d.classnames[c+\"rowname\"]),d.explicitStyles&&(m.style.cssText=\nd.explicitStyles[c+\"rowname\"]),m.style.verticalAlign=\"top\"),l+=g-f+2;for(e=0;e<d.colpanes.length;e++)f=d.colpanes[e].first,g=d.colpanes[e].last,b.col>=f&&b.col<=g&&(m=a.fullgrid.childNodes[1].childNodes[1].childNodes[1+h+b.col-f])&&(d.classnames&&(m.className=d.classnames[c+\"colname\"]),d.explicitStyles&&(m.style.cssText=d.explicitStyles[c+\"colname\"])),h+=g-f+2}};SocialCalc.ECellReadonly=function(a,c){!c&&a.ecell&&(c=a.ecell.coord);if(!c)return!1;var b=a.context.sheetobj.cells[c];return b&&b.readonly};\nSocialCalc.RangeAnchor=function(a,c){a.range.hasrange&&a.RangeRemove();a.RangeExtend(c)};\nSocialCalc.RangeExtend=function(a,c){var b,d,e,f,g,l,h=a.context.highlights;b=a.range;d=a.range2;c?(f=SocialCalc.coordToCr(c),f.coord=c):f=a.ecell;if(f){b.hasrange||(b.anchorcoord=f.coord,b.anchorrow=f.row,b.top=f.row,b.bottom=f.row,b.anchorcol=f.col,b.left=f.col,b.right=f.col,b.hasrange=!0);b.anchorrow<f.row?(b.top=b.anchorrow,b.bottom=f.row):(b.top=f.row,b.bottom=b.anchorrow);b.anchorcol<f.col?(b.left=b.anchorcol,b.right=f.col):(b.left=f.col,b.right=b.anchorcol);for(e in h)switch(h[e]){case \"range\":h[e]=\n\"unrange\";break;case \"range2\":h[e]=\"unrange2\"}for(f=b.top;f<=b.bottom;f++)for(g=b.left;g<=b.right;g++)switch(e=SocialCalc.crToCoord(g,f),h[e]){case \"unrange\":h[e]=\"range\";break;case \"cursor\":break;default:h[e]=\"newrange\"}for(f=d.top;d.hasrange&&f<=d.bottom;f++)for(g=d.left;g<=d.right;g++)switch(e=SocialCalc.crToCoord(g,f),h[e]){case \"unrange2\":h[e]=\"range2\";break;case \"range\":case \"newrange\":case \"cursor\":break;default:h[e]=\"newrange2\"}for(e in h){switch(h[e]){case \"unrange\":delete h[e];break;case \"newrange\":h[e]=\n\"range\";break;case \"newrange2\":h[e]=\"range2\";break;case \"range\":case \"range2\":case \"cursor\":continue}d=SocialCalc.coordToCr(e);b=SocialCalc.GetEditorCellElement(a,d.row,d.col);a.UpdateCellCSS(b,d.row,d.col)}for(l in a.RangeChangeCallback)a.RangeChangeCallback[l](a);e=SocialCalc.crToCoord(a.range.left,a.range.top);if(a.range.left!=a.range.right||a.range.top!=a.range.bottom)e+=\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom);for(l in a.StatusCallback)a.StatusCallback[l].func(a,\"rangechange\",e,\na.StatusCallback[l].params)}};\nSocialCalc.RangeRemove=function(a){var c,b,d,e,f=a.context.highlights,g=a.range,l=a.range2;if(g.hasrange||l.hasrange){for(c=l.top;l.hasrange&&c<=l.bottom;c++)for(b=l.left;b<=l.right;b++)switch(d=SocialCalc.crToCoord(b,c),f[d]){case \"range\":f[d]=\"newrange2\";break;case \"range2\":case \"cursor\":break;default:f[d]=\"newrange2\"}for(d in f){switch(f[d]){case \"range\":delete f[d];break;case \"newrange2\":f[d]=\"range2\";break;case \"cursor\":continue}b=SocialCalc.coordToCr(d);c=SocialCalc.GetEditorCellElement(a,b.row,\nb.col);a.UpdateCellCSS(c,b.row,b.col)}g.hasrange=!1;for(e in a.RangeChangeCallback)a.RangeChangeCallback[e](a);for(e in a.StatusCallback)a.StatusCallback[e].func(a,\"rangechange\",\"\",a.StatusCallback[e].params)}};\nSocialCalc.Range2Remove=function(a){var c,b,d,e=a.context.highlights,f=a.range2;if(f.hasrange){for(d in e){switch(e[d]){case \"range2\":delete e[d];break;case \"range\":case \"cursor\":continue}b=SocialCalc.coordToCr(d);c=SocialCalc.GetEditorCellElement(a,b.row,b.col);a.UpdateCellCSS(c,b.row,b.col)}f.hasrange=!1}};\nSocialCalc.FitToEditTable=function(a){var c,b,d,e=a.context,f=e.sheetobj;d=e.showRCHeaders?e.rownamewidth-0:0;for(colpane=0;colpane<e.colpanes.length-1;colpane++)for(c=e.colpanes[colpane].first;c<=e.colpanes[colpane].last;c++)if(b=SocialCalc.rcColname(c),\"yes\"!=f.colattribs.hide[b]){b=f.colattribs.width[b]||f.attribs.defaultcolwidth||SocialCalc.Constants.defaultColWidth;if(\"blank\"==b||\"auto\"==b)b=\"\";d+=b&&0<b-0?b-0:10}for(c=e.colpanes[colpane].first;1E4>=c;c++){b=SocialCalc.rcColname(c);if(\"yes\"!=\nf.colattribs.hide[b]){b=f.colattribs.width[b]||f.attribs.defaultcolwidth||SocialCalc.Constants.defaultColWidth;if(\"blank\"==b||\"auto\"==b)b=\"\";d+=b&&0<b-0?b-0:10}if(d>a.tablewidth)break}e.colpanes[colpane].last=e.sheetobj.attribs.usermaxcol||c;d=e.showRCHeaders?1:0;for(c=0;c<e.rowpanes.length-1;c++)for(d+=e.rowpanes[c].last-e.rowpanes[c].first+1,b=e.rowpanes[c].first;b<=e.rowpanes[c].last;b++)\"yes\"==f.rowattribs.hide[b]&&d--;a=a.tableheight-d*e.pixelsPerRow;e.rowpanes[c].last=e.sheetobj.attribs.usermaxrow||\ne.rowpanes[c].first+Math.floor(a/e.pixelsPerRow)+1};\nSocialCalc.CalculateEditorPositions=function(a){var c;a.gridposition=SocialCalc.GetElementPosition(a.griddiv);c=a.griddiv.firstChild.lastChild.childNodes[1].childNodes[0];a.headposition=SocialCalc.GetElementPosition(c);a.headposition.left+=c.offsetWidth;a.headposition.top+=c.offsetHeight;a.rowpositions=[];for(c=0;c<a.context.rowpanes.length;c++)a.CalculateRowPositions(c,a.rowpositions,a.rowheight);for(c=0;c<a.rowpositions.length&&!(a.rowpositions[c]>a.gridposition.top+a.tableheight);c++);a.lastvisiblerow=\nc-1;a.colpositions=[];for(c=0;c<a.context.colpanes.length;c++)a.CalculateColPositions(c,a.colpositions,a.colwidth);for(c=0;c<a.colpositions.length&&!(a.colpositions[c]>a.gridposition.left+a.tablewidth);c++);a.lastvisiblecol=c-1;for(a.firstscrollingrow=a.context.rowpanes[a.context.rowpanes.length-1].first;\"yes\"==a.context.sheetobj.rowattribs.hide[a.firstscrollingrow];)a.firstscrollingrow++;a.firstscrollingrowtop=a.rowpositions[a.firstscrollingrow]||a.headposition.top;a.lastnonscrollingrow=0<a.context.rowpanes.length-\n1?a.context.rowpanes[a.context.rowpanes.length-2].last:0;for(a.firstscrollingcol=a.context.colpanes[a.context.colpanes.length-1].first;\"yes\"==a.context.sheetobj.colattribs.hide[SocialCalc.rcColname(a.firstscrollingcol)];)a.firstscrollingcol++;a.firstscrollingcolleft=a.colpositions[a.firstscrollingcol]||a.headposition.left;a.lastnonscrollingcol=0<a.context.colpanes.length-1?a.context.colpanes[a.context.colpanes.length-2].last:0;a.verticaltablecontrol.ComputeTableControlPositions();a.horizontaltablecontrol.ComputeTableControlPositions()};\nSocialCalc.ScheduleRender=function(a){a.timeout&&window.clearTimeout(a.timeout);SocialCalc.EditorSheetStatusCallback(null,\"schedrender\",null,a);a.timeout=window.setTimeout(function(){SocialCalc.DoRenderStep(a)},1)};SocialCalc.DoRenderStep=function(a){a.timeout=null;a.EditorRenderSheet();SocialCalc.EditorSheetStatusCallback(null,\"renderdone\",null,a);SocialCalc.EditorSheetStatusCallback(null,\"schedposcalc\",null,a);a.timeout=window.setTimeout(function(){SocialCalc.DoPositionCalculations(a)},1)};\nSocialCalc.SchedulePositionCalculations=function(a){SocialCalc.EditorSheetStatusCallback(null,\"schedposcalc\",null,a);a.timeout=window.setTimeout(function(){SocialCalc.DoPositionCalculations(a)},1)};\nSocialCalc.DoPositionCalculations=function(a){a.timeout=null;a.CalculateEditorPositions();a.verticaltablecontrol.PositionTableControlElements();a.horizontaltablecontrol.PositionTableControlElements();SocialCalc.EditorSheetStatusCallback(null,\"doneposcalc\",null,a);a.ensureecell&&a.ecell&&!a.deferredCommands.length&&(a.ensureecell=!1,a.EnsureECellVisible());a.cellhandles.ShowCellHandles(!0)};\nSocialCalc.CalculateRowPositions=function(a,c,b,d){var e,f,g,l,h=a.context,m;if(!h.showRCHeaders)throw\"Needs showRCHeaders=true\";m=a.fullgrid.lastChild;a=2;for(e=0;e<c;e++)a+=h.rowpanes[e].last-h.rowpanes[e].first+2;f=0;for(c=h.rowpanes[e].first;c<=h.rowpanes[e].last;c++)g=m.childNodes[a+f],f++,l=SocialCalc.GetElementPosition(g.firstChild),b[c]||(b[c]=l.top,d[c]=g.firstChild.offsetHeight)};\nSocialCalc.CalculateColPositions=function(a,c,b,d){var e,f,g,l,h=a.context;if(!h.showRCHeaders)throw\"Needs showRCHeaders=true\";f=a.fullgrid.lastChild;a=1;for(e=0;e<c;e++)a+=h.colpanes[e].last-h.colpanes[e].first+2;g=f.childNodes[1];f=0;for(c=h.colpanes[e].first;c<=h.colpanes[e].last;c++)l=SocialCalc.GetElementPosition(g.childNodes[a+f]),b[c]||(b[c]=l.left,g.childNodes[a+f]&&(d[c]=g.childNodes[a+f].offsetWidth)),f++};\nSocialCalc.ScrollRelative=function(a,c,b){c?a.ScrollRelativeBoth(b,0):a.ScrollRelativeBoth(0,b)};\nSocialCalc.ScrollRelativeBoth=function(a,c,b){var d=a.context,e=0<c?1:-1,f=0<b?1:-1,g=d.rowpanes.length,l=1<g?d.rowpanes[g-2].last+1:1;d.rowpanes[g-1].first+c<l&&(c=-d.rowpanes[g-1].first+l);var l=d.colpanes.length,h=1<l?d.colpanes[l-2].last+1:1;for(d.colpanes[l-1].first+b<h&&(b=-d.colpanes[l-1].first+h);\"yes\"==d.sheetobj.colattribs.hide[SocialCalc.rcColname(d.colpanes[l-1].first+b)];)if(b+=f,1>b){b=0;break}for(;\"yes\"==d.sheetobj.rowattribs.hide[d.rowpanes[g-1].first+c];)if(c+=e,1>c){c=0;break}if((1==\nc||-1==c)&&0==b)1==c?a.ScrollTableUpOneRow():a.ScrollTableDownOneRow(),a.ecell&&a.SetECellHeaders(\"selected\"),a.SchedulePositionCalculations();else if(0!=c||0!=b)d.rowpanes[g-1].first+=c,d.rowpanes[g-1].last+=c,d.colpanes[l-1].first+=b,d.colpanes[l-1].last+=b,a.LimitLastPanes(),a.FitToEditTable(),a.ScheduleRender()};\nSocialCalc.PageRelative=function(a,c,b){var d=a.context,e=c?\"rowpanes\":\"colpanes\",d=d[e][d[e].length-1],f=c?\"lastvisiblerow\":\"lastvisiblecol\",e=c?a.rowheight:a.colwidth,g=c?SocialCalc.Constants.defaultAssumedRowHeight:SocialCalc.Constants.defaultColWidth;if(0<b)c=a[f],c==d.first&&(c+=1);else{b=c?a.tableheight-(a.firstscrollingrowtop-a.gridposition.top):a.tablewidth-(a.firstscrollingcolleft-a.gridposition.left);b-=0<e[a[f]]?e[a[f]]:g;for(c=d.first-1;0<c;c--){f=0<e[c]?e[c]:g;if(b<f)break;b-=f}e=d.first;\nc>=e&&(c=e-1);1>c&&(c=1)}d.first=c;d.last=c+1;a.LimitLastPanes();a.FitToEditTable();a.ScheduleRender()};\nSocialCalc.LimitLastPanes=function(a){a=a.context;var c;c=a.rowpanes.length;1<c&&a.rowpanes[c-1].first<=a.rowpanes[c-2].last&&(a.rowpanes[c-1].first=a.rowpanes[c-2].last+1);a.sheetobj.attribs.usermaxrow&&a.rowpanes[c-1].first>a.sheetobj.attribs.usermaxrow&&(a.rowpanes[c-1].first=a.sheetobj.attribs.usermaxrow);c=a.colpanes.length;1<c&&a.colpanes[c-1].first<=a.colpanes[c-2].last&&(a.colpanes[c-1].first=a.colpanes[c-2].last+1);a.sheetobj.attribs.usermaxcol&&a.colpanes[c-1].first>a.sheetobj.attribs.usermaxcol&&\n(a.colpanes[c-1].first=a.sheetobj.attribs.usermaxcol)};\nSocialCalc.ScrollTableUpOneRow=function(a){var c,b,d,e,f,g,l={},h=a.context,m=h.sheetobj,p=a.fullgrid,r;r=p.lastChild;c=h.showRCHeaders?2:1;for(b=0;b<h.rowpanes.length-1;b++)c+=h.rowpanes[b].last-h.rowpanes[b].first+2;if(h.sheetobj.attribs.usermaxrow&&1>h.sheetobj.attribs.usermaxrow-h.rowpanes[b].first)return p;r.removeChild(r.childNodes[c]);h.rowpanes[b].first++;h.rowpanes[b].last++;a.FitToEditTable();h.CalculateColWidthData();h.sheetobj.attribs.usermaxrow&&h.rowpanes[b].last==h.sheetobj.attribs.usermaxrow||\n(a=h.RenderRow(h.rowpanes[b].last,b),r.appendChild(a));maxrowspan=1;a=h.rowpanes[b].first-1;for(f=0;f<h.colpanes.length;f++)for(e=h.colpanes[f].first;e<=h.colpanes[f].last;e++)coord=SocialCalc.crToCoord(e,a),h.cellskip[coord]||(g=m.cells[coord])&&g.rowspan>maxrowspan&&(maxrowspan=g.rowspan);if(1<maxrowspan)for(d=1;d<maxrowspan&&!(d+a>=h.rowpanes[b].last);d++)e=h.RenderRow(d+a,b),f=r.childNodes[c+d-1],r.replaceChild(e,f);a=h.rowpanes[b].last;for(f=0;f<h.colpanes.length;f++)for(e=h.colpanes[f].first;e<=\nh.colpanes[f].last;e++)if(coord=h.cellskip[SocialCalc.crToCoord(e,a)])d=h.coordToCR[coord].row-0,d==h.rowpanes[b].last||d<h.rowpanes[b].first||(g=m.cells[coord])&&1<g.rowspan&&(l[d]=!0);for(d in l)e=h.RenderRow(d,b),f=r.childNodes[c+(d-h.rowpanes[b].first)],r.replaceChild(e,f);return p};\nSocialCalc.ScrollTableDownOneRow=function(a){var c,b,d,e,f,g,l={},h=a.context,m=h.sheetobj,p=a.fullgrid,r;r=p.lastChild;c=h.showRCHeaders?2:1;for(b=0;b<h.rowpanes.length-1;b++)c+=h.rowpanes[b].last-h.rowpanes[b].first+2;h.sheetobj.attribs.usermaxrow||r.removeChild(r.childNodes[c+(h.rowpanes[b].last-h.rowpanes[b].first)]);h.rowpanes[b].first--;h.rowpanes[b].last--;a.FitToEditTable();h.CalculateColWidthData();e=h.RenderRow(h.rowpanes[b].first,b);r.insertBefore(e,r.childNodes[c]);maxrowspan=1;a=h.rowpanes[b].first;\nfor(f=0;f<h.colpanes.length;f++)for(e=h.colpanes[f].first;e<=h.colpanes[f].last;e++)coord=SocialCalc.crToCoord(e,a),h.cellskip[coord]||(g=m.cells[coord])&&g.rowspan>maxrowspan&&(maxrowspan=g.rowspan);if(1<maxrowspan)for(d=1;d<maxrowspan&&!(d+a>h.rowpanes[b].last);d++)e=h.RenderRow(d+a,b),f=r.childNodes[c+d],r.replaceChild(e,f);a=h.rowpanes[b].last;for(f=0;f<h.colpanes.length;f++)for(e=h.colpanes[f].first;e<=h.colpanes[f].last;e++)if(coord=SocialCalc.crToCoord(e,a),(g=m.cells[coord])&&1<g.rowspan)l[a]=\n!0;else if(coord=h.cellskip[SocialCalc.crToCoord(e,a)])d=h.coordToCR[coord].row-0,d==a||d<h.rowpanes[b].first||(g=m.cells[coord])&&1<g.rowspan&&(l[d]=!0);for(d in l)e=h.RenderRow(d,b),f=r.childNodes[c+(d-h.rowpanes[b].first)],r.replaceChild(e,f);return p};SocialCalc.InputBox=function(a,c){a&&(this.element=a,this.editor=c,this.inputEcho=null,c.inputBox=this,a.onmousedown=SocialCalc.InputBoxOnMouseDown,c.MoveECellCallback.formulabar=function(a){\"start\"==a.state&&c.inputBox.DisplayCellContents(a.ecell.coord)})};\nSocialCalc.InputBox.prototype.DisplayCellContents=function(a){SocialCalc.InputBoxDisplayCellContents(this,a)};SocialCalc.InputBox.prototype.ShowInputBox=function(a){this.editor.inputEcho.ShowInputEcho(a)};SocialCalc.InputBox.prototype.GetText=function(){return this.element.value};SocialCalc.InputBox.prototype.SetText=function(a){this.element&&(this.element.value=a,this.editor.inputEcho.SetText(a+\"_\"))};SocialCalc.InputBox.prototype.Focus=function(){SocialCalc.InputBoxFocus(this)};\nSocialCalc.InputBox.prototype.Blur=function(){return this.element.blur()};\nSocialCalc.InputBox.prototype.Select=function(a){if(this.element)switch(a){case \"end\":if(document.selection&&document.selection.createRange)try{var c=document.selection.createRange().duplicate();c.moveToElementText(this.element);c.collapse(!1);c.select()}catch(b){void 0!=this.element.selectionStart&&(this.element.selectionStart=this.element.value.length,this.element.selectionEnd=this.element.value.length)}else void 0!=this.element.selectionStart&&(this.element.selectionStart=this.element.value.length,\nthis.element.selectionEnd=this.element.value.length)}};SocialCalc.InputBoxDisplayCellContents=function(a,c){var b=SocialCalc.Constants;if(a){c||(c=a.editor.ecell.coord);var d=SocialCalc.GetCellContents(a.editor.context.sheetobj,c);-1!=d.indexOf(\"\\n\")?(d=b.s_inputboxdisplaymultilinetext,a.element.disabled=!0):a.editor.ECellReadonly()?a.element.disabled=!0:a.element.disabled=!1;a.SetText(d)}};\nSocialCalc.InputBoxFocus=function(a){if(a){a.element.focus();a=a.editor;a.state=\"input\";var c=a.workingvalues;c.partialexpr=\"\";c.ecoord=a.ecell.coord;c.erow=a.ecell.row;c.ecol=a.ecell.col}};\nSocialCalc.InputBoxOnMouseDown=function(a){a=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!a)return!0;var c=a.workingvalues;switch(a.state){case \"start\":a.state=\"inputboxdirect\";c.partialexpr=\"\";c.ecoord=a.ecell.coord;c.erow=a.ecell.row;c.ecol=a.ecell.col;a.inputEcho.ShowInputEcho(!0);break;case \"input\":c.partialexpr=\"\",a.MoveECell(c.ecoord),a.state=\"inputboxdirect\",SocialCalc.KeyboardFocus()}};\nSocialCalc.InputEcho=function(a){var c=SocialCalc.Constants;this.editor=a;this.text=\"\";this.functionbox=this.prompt=this.main=this.container=this.interval=null;this.container=document.createElement(\"div\");SocialCalc.setStyles(this.container,\"display:none;position:absolute;zIndex:10;\");this.main=document.createElement(\"div\");c.defaultInputEchoClass&&(this.main.className=c.defaultInputEchoClass);c.defaultInputEchoStyle&&SocialCalc.setStyles(this.main,c.defaultInputEchoStyle);this.main.innerHTML=\" \";\nthis.container.appendChild(this.main);this.prompt=document.createElement(\"div\");c.defaultInputEchoPromptClass&&(this.prompt.className=c.defaultInputEchoPromptClass);c.defaultInputEchoPromptStyle&&SocialCalc.setStyles(this.prompt,c.defaultInputEchoPromptStyle);this.prompt.innerHTML=\"\";this.container.appendChild(this.prompt);SocialCalc.DragRegister(this.main,!0,!0,{MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null,\npositionobj:this.container},this.editor.toplevel);a.toplevel.appendChild(this.container)};SocialCalc.InputEcho.prototype.ShowInputEcho=function(a){return SocialCalc.ShowInputEcho(this,a)};SocialCalc.InputEcho.prototype.SetText=function(a){return SocialCalc.SetInputEchoText(this,a)};\nSocialCalc.ShowInputEcho=function(a,c){var b;if(b=a.editor)if(c){b.cellhandles.ShowCellHandles(!1);if(b=SocialCalc.GetEditorCellElement(b,b.ecell.row,b.ecell.col))b=SocialCalc.GetElementPosition(b.element),a.container.style.left=b.left-1+\"px\",a.container.style.top=b.top-1+\"px\";a.container.style.display=\"block\";a.interval&&window.clearInterval(a.interval);a.interval=window.setInterval(SocialCalc.InputEchoHeartbeat,50)}else a.interval&&window.clearInterval(a.interval),a.container.style.display=\"none\"};\nSocialCalc.SetInputEchoText=function(a,c){var b=SocialCalc.Constants,d;d=SocialCalc.special_chars(c);d=d.replace(/\\n/g,\"<br>\");a.text!=d&&(a.main.innerHTML=d,a.text=d);d=c.match(/.*[\\+\\-\\*\\/\\&\\^\\<\\>\\=\\,\\(]([A-Za-z][A-Za-z][\\w\\.]*?)\\([^\\)]*$/);\"=\"==c.charAt(0)&&d?(d=d[1].toUpperCase(),SocialCalc.Formula.FunctionList[d]?(SocialCalc.Formula.FillFunctionInfo(),b=SocialCalc.special_chars(d+\"(\"+SocialCalc.Formula.FunctionArgString(d)+\")\")):b=b.ietUnknownFunction+d,a.prompt.innerHTML!=b&&(a.prompt.innerHTML=\nb,a.prompt.style.display=\"block\")):\"none\"!=a.prompt.style.display&&(a.prompt.innerHTML=\"\",a.prompt.style.display=\"none\")};SocialCalc.InputEchoHeartbeat=function(){var a=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!a)return!0;a.inputEcho.SetText(a.inputBox.GetText()+\"_\")};SocialCalc.InputEchoMouseDown=function(a){a=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!a)return!0;a.inputBox.element.focus()};\nSocialCalc.CellHandles=function(a){if(!a.noEdit){this.editor=a;this.movedmouse=this.noCursorSuffix=!1;this.draghandle=document.createElement(\"div\");SocialCalc.setStyles(this.draghandle,\"display:none;position:absolute;zIndex:8;border:1px solid white;width:4px;height:4px;fontSize:1px;backgroundColor:#0E93D8;cursor:default;\");TiddlyWiki&&(this.draghandle.style.width=\"6px\",this.draghandle.style.height=\"6px\");this.draghandle.innerHTML=\" \";a.toplevel.appendChild(this.draghandle);SocialCalc.AssignID(a,\nthis.draghandle,\"draghandle\");var c=\"png\";navigator.userAgent.match(/MSIE 6\\.0/)&&(c=\"gif\");this.dragpalette=document.createElement(\"div\");SocialCalc.setStyles(this.dragpalette,\"display:none;position:absolute;zIndex:8;width:90px;height:90px;fontSize:1px;textAlign:center;cursor:default;backgroundImage:url(\"+SocialCalc.Constants.defaultImagePrefix+\"drag-handles.\"+c+\");\");this.dragpalette.innerHTML=\" \";a.toplevel.appendChild(this.dragpalette);SocialCalc.AssignID(a,this.dragpalette,\"dragpalette\");\nthis.dragtooltip=document.createElement(\"div\");SocialCalc.setStyles(this.dragtooltip,\"display:none;position:absolute;zIndex:9;border:1px solid black;width:100px;height:auto;fontSize:10px;backgroundColor:#FFFFFF;\");this.dragtooltip.innerHTML=\" \";a.toplevel.appendChild(this.dragtooltip);SocialCalc.AssignID(a,this.dragtooltip,\"dragtooltip\");this.fillinghandle=document.createElement(\"div\");SocialCalc.setStyles(this.fillinghandle,\"display:none;position:absolute;zIndex:9;border:1px solid black;width:auto;height:14px;fontSize:10px;backgroundColor:#FFFFFF;\");\nthis.fillinghandle.innerHTML=\" \";a.toplevel.appendChild(this.fillinghandle);SocialCalc.AssignID(a,this.fillinghandle,\"fillinghandle\");if(this.draghandle.addEventListener)this.draghandle.addEventListener(\"mousemove\",SocialCalc.CellHandlesMouseMoveOnHandle,!1),this.dragpalette.addEventListener(\"mousedown\",SocialCalc.CellHandlesMouseDown,!1),this.dragpalette.addEventListener(\"mousemove\",SocialCalc.CellHandlesMouseMoveOnHandle,!1);else if(this.draghandle.attachEvent)this.draghandle.attachEvent(\"onmousemove\",\nSocialCalc.CellHandlesMouseMoveOnHandle),this.dragpalette.attachEvent(\"onmousedown\",SocialCalc.CellHandlesMouseDown),this.dragpalette.attachEvent(\"onmousemove\",SocialCalc.CellHandlesMouseMoveOnHandle);else throw\"Browser not supported\";}};SocialCalc.CellHandles.prototype.ShowCellHandles=function(a,c){return SocialCalc.ShowCellHandles(this,a,c)};\nSocialCalc.ShowCellHandles=function(a,c,b){var d=a.editor,e=!1,f,g,l=1,h=1;if(d){if(c&&(f=d.ecell.row,g=d.ecell.col,\"start\"==d.state&&!(f>=d.lastvisiblerow||g>=d.lastvisiblecol||f<d.firstscrollingrow||g<d.firstscrollingcol))){for(;\"yes\"==d.context.sheetobj.colattribs.hide[SocialCalc.rcColname(g+l)];)l++;for(;\"yes\"==d.context.sheetobj.rowattribs.hide[f+h];)h++;c=d.context.sheetobj.cells[SocialCalc.crToCoord(g+l-1,f+h-1)];\"undefined\"!=typeof c&&(l+=(c.colspan||1)-1,h+=(c.rowspan||1)-1);d.rowpositions[f+\nh]+20>d.horizontaltablecontrol.controlborder||d.rowpositions[f+h]-10<d.headposition.top||d.colpositions[g+l]+20>d.verticaltablecontrol.controlborder||d.colpositions[g+l]-30<d.headposition.left||(a.draghandle.style.left=d.colpositions[g+l]-1+\"px\",a.draghandle.style.top=d.rowpositions[f+h]-1+\"px\",a.draghandle.style.display=\"block\",b&&(a.draghandle.style.display=\"none\",a.dragpalette.style.left=d.colpositions[g+l]-45+\"px\",a.dragpalette.style.top=d.rowpositions[f+h]-45+\"px\",a.dragpalette.style.display=\n\"block\",a.dragtooltip.style.left=d.colpositions[g+l]-45+\"px\",a.dragtooltip.style.top=d.rowpositions[f+h]+45+\"px\",a.dragtooltip.style.display=\"none\"),e=!0)}e||(a.draghandle.style.display=\"none\");b||(a.dragpalette.style.display=\"none\",a.dragtooltip.style.display=\"none\")}};\nSocialCalc.CellHandlesMouseMoveOnHandle=function(a){var c=SocialCalc.Constants,b=a||window.event,d=b.target||b.srcElement,e=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!e)return!0;a=e.cellhandles;if(!a.editor)return!0;var f=SocialCalc.GetElementPositionWithScroll(e.toplevel),g=b.clientX-f.left,b=b.clientY-f.top;if(!e.cellhandles.mouseDown){e.cellhandles.ShowCellHandles(!0,!0);if(d==a.dragpalette){c=SocialCalc.SegmentDivHit([c.CH_radius1,c.CH_radius2],e.cellhandles.dragpalette,\ng,b);if(0==c){SocialCalc.CellHandlesHoverTimeout();return}a.tooltipstimer&&(window.clearTimeout(a.tooltipstimer),a.tooltipstimer=null);a.tooltipswhichhandle=c;a.tooltipstimer=window.setTimeout(SocialCalc.CellHandlesTooltipsTimeout,700)}a.timer&&(window.clearTimeout(a.timer),a.timer=null);a.timer=window.setTimeout(SocialCalc.CellHandlesHoverTimeout,3E3)}};\nSocialCalc.SegmentDivHit=function(a,c,b,d){var e=c.offsetWidth,f=c.offsetHeight,g=c.offsetLeft;c=c.offsetTop;var l=0,h=a,m=Math.sqrt(Math.pow(b-g-(e/2-.5),2)+Math.pow(d-c-(f/2-.5),2));if(2==h.length)return b>=g&&b<g+e/2&&d>=c&&d<c+f/2&&(m<=a[0]?l=-1:m<=a[1]&&(l=1)),b>=g+e/2&&b<g+e&&d>=c&&d<c+f/2&&(m<=a[0]?l=-2:m<=a[1]&&(l=2)),b>=g+e/2&&b<g+e&&d>=c+f/2&&d<c+f&&(m<=a[0]?l=-3:m<=a[1]&&(l=3)),b>=g&&b<g+e/2&&d>=c+f/2&&d<c+f&&(m<=a[0]?l=-4:m<=a[1]&&(l=4)),l;for(;;)if(b>=g&&b<g+e/2&&d>=c&&d<c+f/2){quadrant+=\n\"1\";l=h[0];if(\"number\"==typeof l)break;h=l;e/=2;f/=2}else if(b>=g+e/2&&b<g+e&&d>=c&&d<c+f/2){quadrant+=\"2\";l=h[1];if(\"number\"==typeof l)break;h=l;e/=2;g+=e;f/=2}else if(b>=g+e/2&&b<g+e&&d>=c+f/2&&d<c+f){quadrant+=\"3\";l=h[2];if(\"number\"==typeof l)break;h=l;e/=2;g+=e;f/=2;c+=f}else if(b>=g&&b<g+e/2&&d>=c+f/2&&d<c+f){quadrant+=\"4\";l=h[3];if(\"number\"==typeof l)break;h=l;e/=2;f/=2;c+=f}else return 0;return l};\nSocialCalc.CellHandlesHoverTimeout=function(){editor=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!editor)return!0;var a=editor.cellhandles;a.timer&&(window.clearTimeout(a.timer),a.timer=null);a.tooltipstimer&&(window.clearTimeout(a.tooltipstimer),a.tooltipstimer=null);editor.cellhandles.ShowCellHandles(!0,!1)};\nSocialCalc.CellHandlesTooltipsTimeout=function(){editor=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!editor)return!0;var a=editor.cellhandles;a.tooltipstimer&&(window.clearTimeout(a.tooltipstimer),a.tooltipstimer=null);var c=a.tooltipswhichhandle;if(0==c)SocialCalc.CellHandlesHoverTimeout();else{if(-3==c)a.dragtooltip.innerHTML=scc.s_CHfillAllTooltip;else if(3==c)a.dragtooltip.innerHTML=scc.s_CHfillContentsTooltip;else if(-2==c)a.dragtooltip.innerHTML=scc.s_CHmovePasteAllTooltip;\nelse if(-4==c)a.dragtooltip.innerHTML=scc.s_CHmoveInsertAllTooltip;else if(2==c)a.dragtooltip.innerHTML=scc.s_CHmovePasteContentsTooltip;else if(4==c)a.dragtooltip.innerHTML=scc.s_CHmoveInsertContentsTooltip;else{a.dragtooltip.innerHTML=\" \";a.dragtooltip.style.display=\"none\";return}a.dragtooltip.style.display=\"block\"}};\nSocialCalc.CellHandlesMouseDown=function(a){var c=SocialCalc.Constants,b,d=a||window.event,e=SocialCalc.EditorMouseInfo;a=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;if(!a)return!0;if(!a.busy){var f=a.cellhandles;f.movedmouse=!1;var g=SocialCalc.GetElementPositionWithScroll(a.toplevel),l=d.clientX-g.left,g=d.clientY-g.top;f.timer&&(window.clearTimeout(f.timer),f.timer=null);f.tooltipstimer&&(window.clearTimeout(f.tooltipstimer),f.tooltipstimer=null);f.dragtooltip.innerHTML=\" \";\nf.dragtooltip.style.display=\"none\";b=a.range;var h=SocialCalc.SegmentDivHit([c.CH_radius1,c.CH_radius2],a.cellhandles.dragpalette,l,g);if(1==h||-1==h||0==h)f.ShowCellHandles(!0,!1);else{e.ignore=!0;-3==h?(f.dragtype=\"Fill\",f.noCursorSuffix=!1):3==h?(f.dragtype=\"FillC\",f.noCursorSuffix=!1):-2==h?(f.dragtype=\"Move\",f.noCursorSuffix=!0):-4==h?(f.dragtype=\"MoveI\",f.noCursorSuffix=!1):2==h?(f.dragtype=\"MoveC\",f.noCursorSuffix=!0):4==h&&(f.dragtype=\"MoveIC\",f.noCursorSuffix=!1);f.filltype=null;switch(f.dragtype){case \"Fill\":case \"FillC\":b.hasrange||\na.RangeAnchor();break;case \"Move\":case \"MoveI\":case \"MoveC\":case \"MoveIC\":b.hasrange||a.RangeAnchor();a.range2.top=a.range.top;a.range2.right=a.range.right;a.range2.bottom=a.range.bottom;a.range2.left=a.range.left;a.range2.hasrange=!0;a.RangeRemove();break;default:return}f.fillinghandle.style.left=l+\"px\";f.fillinghandle.style.top=g-17+\"px\";f.fillinghandle.innerHTML=c.s_CHindicatorOperationLookup[f.dragtype]+(c.s_CHindicatorDirectionLookup[a.cellhandles.filltype]||\"\");f.fillinghandle.style.display=\n\"block\";f.ShowCellHandles(!0,!1);f.mouseDown=!0;e.editor=a;c=a.ecell.coord;f.startingcoord=c;f.startingX=l;f.startingY=g;e.mouselastcoord=c;SocialCalc.KeyboardSetFocus(a);document.addEventListener?(document.addEventListener(\"mousemove\",SocialCalc.CellHandlesMouseMove,!0),document.addEventListener(\"mouseup\",SocialCalc.CellHandlesMouseUp,!0)):f.draghandle.attachEvent&&(f.draghandle.setCapture(),f.draghandle.attachEvent(\"onmousemove\",SocialCalc.CellHandlesMouseMove),f.draghandle.attachEvent(\"onmouseup\",\nSocialCalc.CellHandlesMouseUp),f.draghandle.attachEvent(\"onlosecapture\",SocialCalc.CellHandlesMouseUp));d.stopPropagation?d.stopPropagation():d.cancelBubble=!0;d.preventDefault?d.preventDefault():d.returnValue=!1}}};\nSocialCalc.CellHandlesMouseMove=function(a){var c=SocialCalc.Constants,b,d,e,f=a||window.event,g=SocialCalc.EditorMouseInfo;if(a=g.editor){var l=a.cellhandles;b=SocialCalc.GetElementPositionWithScroll(a.toplevel);var h=f.clientX-b.left,m=f.clientY-b.top;if(b=SocialCalc.GridMousePosition(a,h,m))if(b&&!b.coord)SocialCalc.SetDragAutoRepeat(a,b,SocialCalc.CellHandlesDragAutoRepeat);else if(SocialCalc.SetDragAutoRepeat(a,null),b.coord){d=SocialCalc.coordToCr(a.cellhandles.startingcoord);e=SocialCalc.coordToCr(b.coord);\nl.movedmouse=!0;switch(l.dragtype){case \"Fill\":case \"FillC\":b.coord==l.startingcoord?(l.filltype=null,l.startingX=h,l.startingY=m):l.filltype?\"Down\"==l.filltype?(e.col=d.col,e.row<d.row&&(e.row=d.row)):(e.row=d.row,e.col<d.col&&(e.col=d.col)):(10<Math.abs(m-l.startingY)?l.filltype=\"Down\":10<Math.abs(h-l.startingX)&&(l.filltype=\"Right\"),e.col=d.col,e.row=d.row);b.coord=SocialCalc.crToCoord(e.col,e.row);b.coord!=g.mouselastcoord&&(a.MoveECell(b.coord),a.RangeExtend());break;case \"Move\":case \"MoveC\":b.coord!=\ng.mouselastcoord&&(a.MoveECell(b.coord),d=a.range2.right-a.range2.left+b.col,e=a.range2.bottom-a.range2.top+b.row,a.RangeAnchor(SocialCalc.crToCoord(d,e)),a.RangeExtend());break;case \"MoveI\":case \"MoveIC\":b.coord==l.startingcoord?(l.filltype=null,l.startingX=h,l.startingY=m):l.filltype?\"Vertical\"==l.filltype?(e.col=a.range2.left,e.row>=a.range2.top&&e.row<=a.range2.bottom+1&&(e.row=a.range2.bottom+2)):(e.row=a.range2.top,e.col>=a.range2.left&&e.col<=a.range2.right+1&&(e.col=a.range2.right+2)):(10<\nMath.abs(m-l.startingY)?l.filltype=\"Vertical\":10<Math.abs(h-l.startingX)&&(l.filltype=\"Horizontal\"),e.col=d.col,e.row=d.row),b.coord=SocialCalc.crToCoord(e.col,e.row),b.coord!=g.mouselastcoord&&(a.MoveECell(b.coord),l.filltype?(d=a.range2.right-a.range2.left+e.col,e=a.range2.bottom-a.range2.top+e.row,a.RangeAnchor(SocialCalc.crToCoord(d,e)),a.RangeExtend()):a.RangeRemove())}l.fillinghandle.style.left=h+\"px\";l.fillinghandle.style.top=m-17+\"px\";l.fillinghandle.innerHTML=c.s_CHindicatorOperationLookup[l.dragtype]+\n(c.s_CHindicatorDirectionLookup[a.cellhandles.filltype]||\"\");l.fillinghandle.style.display=\"block\";g.mouselastcoord=b.coord;f.stopPropagation?f.stopPropagation():f.cancelBubble=!0;f.preventDefault?f.preventDefault():f.returnValue=!1}}};\nSocialCalc.CellHandlesDragAutoRepeat=function(a,c){var b=SocialCalc.EditorMouseInfo,d=b.editor;if(d){var e=d.cellhandles,f=SocialCalc.coordToCr(d.cellhandles.startingcoord),g=SocialCalc.coordToCr(a),l,h=0,m=0;\"left\"==c?m=-1:\"right\"==c?m=1:\"up\"==c?h=-1:\"down\"==c&&(h=1);d.ScrollRelativeBoth(h,m);switch(e.dragtype){case \"Fill\":case \"FillC\":e.filltype?\"Down\"==e.filltype?(g.col=f.col,g.row<f.row&&(g.row=f.row)):(g.row=f.row,g.col<f.col&&(g.col=f.col)):(g.col=f.col,g.row=f.row);l=SocialCalc.crToCoord(g.col,\ng.row);l!=b.mouselastcoord&&(d.MoveECell(a),d.RangeExtend());break;case \"Move\":case \"MoveC\":a!=b.mouselastcoord&&(d.MoveECell(a),e=d.range2.right-d.range2.left+d.ecell.col,g=d.range2.bottom-d.range2.top+d.ecell.row,d.RangeAnchor(SocialCalc.crToCoord(e,g)),d.RangeExtend());break;case \"MoveI\":case \"MoveIC\":e.filltype?\"Vertical\"==e.filltype?(g.col=d.range2.left,g.row>=d.range2.top&&g.row<=d.range2.bottom+1&&(g.row=d.range2.bottom+2)):(g.row=d.range2.top,g.col>=d.range2.left&&g.col<=d.range2.right+1&&\n(g.col=d.range2.right+2)):(g.col=f.col,g.row=f.row),l=SocialCalc.crToCoord(g.col,g.row),l!=b.mouselastcoord&&(d.MoveECell(l),e=d.range2.right-d.range2.left+g.col,g=d.range2.bottom-d.range2.top+g.row,d.RangeAnchor(SocialCalc.crToCoord(e,g)),d.RangeExtend())}b.mouselastcoord=l}};\nSocialCalc.CellHandlesMouseUp=function(a){var c,b,d,e,f,g=a||window.event,l=SocialCalc.EditorMouseInfo;if(a=l.editor){var h=a.cellhandles;l.ignore=!1;c=SocialCalc.GetElementPositionWithScroll(a.toplevel);c=SocialCalc.GridMousePosition(a,g.clientX-c.left,g.clientY-c.top);SocialCalc.SetDragAutoRepeat(a,null);h.mouseDown=!1;h.noCursorSuffix=!1;h.fillinghandle.style.display=\"none\";c||(c={});c.coord||(c.coord=a.ecell.coord);switch(h.dragtype){case \"Fill\":case \"Move\":case \"MoveI\":b=\" all\";break;case \"FillC\":case \"MoveC\":case \"MoveIC\":b=\n\" formulas\"}h.movedmouse||(h.dragtype=\"Nothing\");switch(h.dragtype){case \"Nothing\":a.Range2Remove();a.RangeRemove();break;case \"Fill\":case \"FillC\":d=SocialCalc.coordToCr(h.startingcoord);e=SocialCalc.coordToCr(c.coord);h.filltype&&(\"Down\"==h.filltype?e.col=d.col:e.row=d.row);c.coord=SocialCalc.crToCoord(e.col,e.row);a.MoveECell(c.coord);a.RangeExtend();c=\"Right\"==a.cellhandles.filltype?\"right\":\"down\";b=\"fill\"+c+\" \"+SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,\na.range.bottom)+b;a.EditorScheduleSheetCommands(b,!0,!1);break;case \"Move\":case \"MoveC\":a.context.cursorsuffix=\"\";b=\"movepaste \"+SocialCalc.crToCoord(a.range2.left,a.range2.top)+\":\"+SocialCalc.crToCoord(a.range2.right,a.range2.bottom)+\" \"+a.ecell.coord+b;a.EditorScheduleSheetCommands(b,!0,!1);a.Range2Remove();break;case \"MoveI\":case \"MoveIC\":a.context.cursorsuffix=\"\",c=a.range2.right-a.range2.left,d=a.range2.bottom-a.range2.top,e=a.ecell.col-a.range2.left,f=a.ecell.row-a.range2.top,b=\"moveinsert \"+\nSocialCalc.crToCoord(a.range2.left,a.range2.top)+\":\"+SocialCalc.crToCoord(a.range2.right,a.range2.bottom)+\" \"+a.ecell.coord+b,a.EditorScheduleSheetCommands(b,!0,!1),a.Range2Remove(),a.RangeRemove(),\" Horizontal\"==a.cellhandles.filltype&&0<e?a.MoveECell(SocialCalc.crToCoord(a.ecell.col-c-1,a.ecell.row)):\" Vertical\"==a.cellhandles.filltype&&0<f&&a.MoveECell(SocialCalc.crToCoord(a.ecell.col,a.ecell.row-d-1)),a.RangeAnchor(SocialCalc.crToCoord(a.ecell.col+c,a.ecell.row+d)),a.RangeExtend()}g.stopPropagation?\ng.stopPropagation():g.cancelBubble=!0;g.preventDefault?g.preventDefault():g.returnValue=!1;document.removeEventListener?(document.removeEventListener(\"mousemove\",SocialCalc.CellHandlesMouseMove,!0),document.removeEventListener(\"mouseup\",SocialCalc.CellHandlesMouseUp,!0)):h.draghandle.detachEvent&&(h.draghandle.detachEvent(\"onlosecapture\",SocialCalc.CellHandlesMouseUp),h.draghandle.detachEvent(\"onmouseup\",SocialCalc.CellHandlesMouseUp),h.draghandle.detachEvent(\"onmousemove\",SocialCalc.CellHandlesMouseMove),\nh.draghandle.releaseCapture());l.editor=null;return!1}};\nSocialCalc.TableControl=function(a,c,b){var d=SocialCalc.Constants;this.editor=a;this.vertical=c;this.size=b;this.thumbpos=this.scrollareasize=this.scrollareaend=this.scrollareastart=this.morebuttonstart=this.lessbuttonstart=this.panesliderstart=this.endcapstart=this.controlborder=this.thumb=this.scrollarea=this.morebutton=this.lessbutton=this.paneslider=this.endcap=this.main=null;this.controlthickness=d.defaultTableControlThickness;this.sliderthickness=d.defaultTCSliderThickness;this.buttonthickness=\nd.defaultTCButtonThickness;this.thumbthickness=d.defaultTCThumbThickness;this.minscrollingpanesize=this.buttonthickness+this.buttonthickness+this.thumbthickness+20};SocialCalc.TableControl.prototype.CreateTableControl=function(){return SocialCalc.CreateTableControl(this)};SocialCalc.TableControl.prototype.PositionTableControlElements=function(){SocialCalc.PositionTableControlElements(this)};SocialCalc.TableControl.prototype.ComputeTableControlPositions=function(){SocialCalc.ComputeTableControlPositions(this)};\nSocialCalc.CreateTableControl=function(a){var c,b,d=SocialCalc.AssignID,e=SocialCalc.setStyles,f=SocialCalc.Constants,g=a.editor.imageprefix,l=a.vertical?\"v\":\"h\";a.main=document.createElement(\"div\");c=a.main.style;c.height=(a.vertical?a.size:a.controlthickness)+\"px\";c.width=(a.vertical?a.controlthickness:a.size)+\"px\";c.zIndex=0;e(a.main,f.TCmainStyle);c.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"main-\"+l+\".gif)\");f.TCmainClass&&(a.main.className=f.TCmainClass);a.main.style.display=\n\"none\";a.endcap=document.createElement(\"div\");c=a.endcap.style;c.height=a.controlthickness+\"px\";c.width=a.controlthickness+\"px\";c.zIndex=1;c.overflow=\"hidden\";c.position=\"absolute\";e(a.endcap,f.TCendcapStyle);c.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"endcap-\"+l+\".gif)\");f.TCendcapClass&&(a.endcap.className=f.TCendcapClass);d(a.editor,a.endcap,\"endcap\"+l);a.main.appendChild(a.endcap);a.paneslider=document.createElement(\"div\");c=a.paneslider.style;c.height=(a.vertical?a.sliderthickness:\na.controlthickness)+\"px\";c.overflow=\"hidden\";c.width=(a.vertical?a.controlthickness:a.sliderthickness)+\"px\";c.position=\"absolute\";c[a.vertical?\"top\":\"left\"]=\"4px\";c.zIndex=3;e(a.paneslider,f.TCpanesliderStyle);c.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"paneslider-\"+l+\".gif)\");f.TCpanesliderClass&&(a.paneslider.className=f.TCpanesliderClass);d(a.editor,a.paneslider,\"paneslider\"+l);(function(c,b,d){f[\"s_\"+b+\"Tooltip\"+d]&&SocialCalc.TooltipRegister(c,f[\"s_\"+b+\"Tooltip\"+d],null,a.editor.toplevel)})(a.paneslider,\n\"paneslider\",l);c={MouseDown:SocialCalc.TCPSDragFunctionStart,MouseMove:SocialCalc.TCPSDragFunctionMove,MouseUp:SocialCalc.TCPSDragFunctionStop,Disabled:function(){return a.editor.busy}};c.control=a;SocialCalc.DragRegister(a.paneslider,a.vertical,!a.vertical,c,a.editor.toplevel);a.main.appendChild(a.paneslider);a.lessbutton=document.createElement(\"div\");c=a.lessbutton.style;c.height=(a.vertical?a.buttonthickness:a.controlthickness)+\"px\";c.width=(a.vertical?a.controlthickness:a.buttonthickness)+\"px\";\nc.zIndex=2;c.overflow=\"hidden\";c.position=\"absolute\";e(a.lessbutton,f.TClessbuttonStyle);c.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"less-\"+l+\"n.gif)\");f.TClessbuttonClass&&(a.lessbutton.className=f.TClessbuttonClass);d(a.editor,a.lessbutton,\"lessbutton\"+l);b={repeatwait:f.TClessbuttonRepeatWait,repeatinterval:f.TClessbuttonRepeatInterval,normalstyle:\"backgroundImage:url(\"+g+\"less-\"+l+\"n.gif);\",downstyle:\"backgroundImage:url(\"+g+\"less-\"+l+\"d.gif);\",hoverstyle:\"backgroundImage:url(\"+\ng+\"less-\"+l+\"h.gif);\"};c={MouseDown:function(){a.editor.busy||a.editor.ScrollRelative(a.vertical,-1)},Repeat:function(){a.editor.busy||a.editor.ScrollRelative(a.vertical,-1)},Disabled:function(){return a.editor.busy}};SocialCalc.ButtonRegister(a.editor,a.lessbutton,b,c);a.main.appendChild(a.lessbutton);a.morebutton=document.createElement(\"div\");c=a.morebutton.style;c.height=(a.vertical?a.buttonthickness:a.controlthickness)+\"px\";c.width=(a.vertical?a.controlthickness:a.buttonthickness)+\"px\";c.zIndex=\n2;c.overflow=\"hidden\";c.position=\"absolute\";e(a.morebutton,f.TCmorebuttonStyle);c.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"more-\"+l+\"n.gif)\");f.TCmorebuttonClass&&(a.morebutton.className=f.TCmorebuttonClass);d(a.editor,a.morebutton,\"morebutton\"+l);b={repeatwait:f.TCmorebuttonRepeatWait,repeatinterval:f.TCmorebuttonRepeatInterval,normalstyle:\"backgroundImage:url(\"+g+\"more-\"+l+\"n.gif);\",downstyle:\"backgroundImage:url(\"+g+\"more-\"+l+\"d.gif);\",hoverstyle:\"backgroundImage:url(\"+g+\"more-\"+\nl+\"h.gif);\"};c={MouseDown:function(){a.editor.busy||a.editor.ScrollRelative(a.vertical,1)},Repeat:function(){a.editor.busy||a.editor.ScrollRelative(a.vertical,1)},Disabled:function(){return a.editor.busy}};SocialCalc.ButtonRegister(a.editor,a.morebutton,b,c);a.main.appendChild(a.morebutton);a.scrollarea=document.createElement(\"div\");c=a.scrollarea.style;c.height=a.controlthickness+\"px\";c.width=a.controlthickness+\"px\";c.zIndex=1;c.overflow=\"hidden\";c.position=\"absolute\";e(a.scrollarea,f.TCscrollareaStyle);\nc.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"scrollarea-\"+l+\".gif)\");f.TCscrollareaClass&&(a.scrollarea.className=f.TCscrollareaClass);d(a.editor,a.scrollarea,\"scrollarea\"+l);b={repeatwait:f.TCscrollareaRepeatWait,repeatinterval:f.TCscrollareaRepeatWait};c={MouseDown:SocialCalc.ScrollAreaClick,Repeat:SocialCalc.ScrollAreaClick,Disabled:function(){return a.editor.busy}};c.control=a;SocialCalc.ButtonRegister(a.editor,a.scrollarea,b,c);a.main.appendChild(a.scrollarea);a.thumb=document.createElement(\"div\");\nc=a.thumb.style;c.height=(a.vertical?a.thumbthickness:a.controlthickness)+\"px\";c.width=(a.vertical?a.controlthickness:a.thumbthickness)+\"px\";c.zIndex=2;c.overflow=\"hidden\";c.position=\"absolute\";e(a.thumb,f.TCthumbStyle);a.thumb.style.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+g+\"thumb-\"+l+\"n.gif)\");f.TCthumbClass&&(a.thumb.className=f.TCthumbClass);d(a.editor,a.thumb,\"thumb\"+l);c={MouseDown:SocialCalc.TCTDragFunctionStart,MouseMove:SocialCalc.TCTDragFunctionMove,MouseUp:SocialCalc.TCTDragFunctionStop,\nDisabled:function(){return a.editor.busy}};c.control=a;SocialCalc.DragRegister(a.thumb,a.vertical,!a.vertical,c,a.editor.toplevel);b={normalstyle:\"backgroundImage:url(\"+g+\"thumb-\"+l+\"n.gif)\",name:\"Thumb\",downstyle:\"backgroundImage:url(\"+g+\"thumb-\"+l+\"d.gif)\",hoverstyle:\"backgroundImage:url(\"+g+\"thumb-\"+l+\"h.gif)\"};SocialCalc.ButtonRegister(a.editor,a.thumb,b,null);a.main.appendChild(a.thumb);return a.main};\nSocialCalc.ScrollAreaClick=function(a,c,b){a=b.functionobj.control;b=SocialCalc.GetElementPositionWithScroll(a.editor.toplevel);c=a.vertical?c.clientY-b.top:c.clientX-b.left;a.editor.busy||a.editor.PageRelative(a.vertical,c>a.thumbpos?1:-1)};\nSocialCalc.PositionTableControlElements=function(a){var c,b,d=a.editor;a.vertical?(c=a.controlborder+\"px\",a.endcap.style.top=a.endcapstart+\"px\",a.endcap.style.left=c,a.paneslider.style.top=a.panesliderstart+\"px\",a.paneslider.style.left=c,a.lessbutton.style.top=a.lessbuttonstart+\"px\",a.lessbutton.style.left=c,a.morebutton.style.top=a.morebuttonstart+\"px\",a.morebutton.style.left=c,a.scrollarea.style.top=a.scrollareastart+\"px\",a.scrollarea.style.left=c,a.scrollarea.style.height=a.scrollareasize+\"px\",\nb=Math.max(d.context.sheetobj.attribs.lastrow,d.firstscrollingrow+1),b=(d.firstscrollingrow-(d.lastnonscrollingrow+1))*(a.scrollareasize-3*a.thumbthickness)/(b-(d.lastnonscrollingrow+1))+a.scrollareastart-1,b=Math.floor(b),a.thumb.style.top=b+\"px\",a.thumb.style.left=c):(c=a.controlborder+\"px\",a.endcap.style.left=a.endcapstart+\"px\",a.endcap.style.top=c,a.paneslider.style.left=a.panesliderstart+\"px\",a.paneslider.style.top=c,a.lessbutton.style.left=a.lessbuttonstart+\"px\",a.lessbutton.style.top=c,a.morebutton.style.left=\na.morebuttonstart+\"px\",a.morebutton.style.top=c,a.scrollarea.style.left=a.scrollareastart+\"px\",a.scrollarea.style.top=c,a.scrollarea.style.width=a.scrollareasize+\"px\",b=Math.max(d.context.sheetobj.attribs.lastcol,d.firstscrollingcol+1),b=(d.firstscrollingcol-(d.lastnonscrollingcol+1))*(a.scrollareasize-a.thumbthickness)/(b-d.lastnonscrollingcol)+a.scrollareastart-1,b=Math.floor(b),a.thumb.style.left=b+\"px\",a.thumb.style.top=c);a.thumbpos=b;a.main.style.display=\"block\"};\nSocialCalc.ComputeTableControlPositions=function(a){var c=a.editor;if(!c.gridposition||!c.headposition)throw\"Can't compute table control positions before editor positions\";a.vertical?(a.controlborder=c.gridposition.left+c.tablewidth,a.endcapstart=c.gridposition.top,a.panesliderstart=c.firstscrollingrowtop-a.sliderthickness,a.lessbuttonstart=c.firstscrollingrowtop-1,a.morebuttonstart=c.gridposition.top+c.tableheight-a.buttonthickness,a.scrollareastart=c.firstscrollingrowtop-1+a.buttonthickness):(a.controlborder=\nc.gridposition.top+c.tableheight,a.endcapstart=c.gridposition.left,a.panesliderstart=c.firstscrollingcolleft-a.sliderthickness,a.lessbuttonstart=c.firstscrollingcolleft-1,a.morebuttonstart=c.gridposition.left+c.tablewidth-a.buttonthickness,a.scrollareastart=c.firstscrollingcolleft-1+a.buttonthickness);a.scrollareaend=a.morebuttonstart-1;a.scrollareasize=a.scrollareaend-a.scrollareastart+1};\nSocialCalc.TCPSDragFunctionStart=function(a,c,b){var d=b.functionobj.control.editor,e=SocialCalc.Constants;SocialCalc.DragFunctionStart(a,c,b);c.trackingline=document.createElement(\"div\");c.trackingline.style.height=b.vertical?e.TCPStrackinglineThickness:d.tableheight-(d.headposition.top-d.gridposition.top)+\"px\";c.trackingline.style.width=b.vertical?d.tablewidth-(d.headposition.left-d.gridposition.left)+\"px\":e.TCPStrackinglineThickness;c.trackingline.style.backgroundImage=TiddlyWiki.getModifiedCssImageStyle(\"url(\"+\nd.imageprefix+\"trackingline-\"+(b.vertical?\"v\":\"h\")+\".gif)\");e.TCPStrackinglineClass&&(c.trackingline.className=e.TCPStrackinglineClass);SocialCalc.setStyles(c.trackingline,e.TCPStrackinglineStyle);b.vertical?(row=SocialCalc.Lookup(c.clientY+b.functionobj.control.sliderthickness,d.rowpositions),c.trackingline.style.top=(d.rowpositions[row]||d.headposition.top)+\"px\",c.trackingline.style.left=d.headposition.left+\"px\",d.context.rowpanes.length-1&&(d.context.SetRowPaneFirstLast(1,d.context.rowpanes[0].last+\n1,d.context.rowpanes[0].last+1),d.FitToEditTable(),d.ScheduleRender())):(col=SocialCalc.Lookup(c.clientX+b.functionobj.control.sliderthickness,d.colpositions),c.trackingline.style.top=d.headposition.top+\"px\",c.trackingline.style.left=(d.colpositions[col]||d.headposition.left)+\"px\",d.context.colpanes.length-1&&(d.context.SetColPaneFirstLast(1,d.context.colpanes[0].last+1,d.context.colpanes[0].last+1),d.FitToEditTable(),d.ScheduleRender()));d.griddiv.appendChild(c.trackingline)};\nSocialCalc.TCPSDragFunctionMove=function(a,c,b){var d,e;e=b.functionobj.control;d=e.sliderthickness;var f=e.editor;if(b.vertical){e=e.morebuttonstart-e.minscrollingpanesize-c.offsetY;c.clientY>e&&(c.clientY=e);e=f.headposition.top-d-c.offsetY;c.clientY<e&&(c.clientY=e);for(d=SocialCalc.Lookup(c.clientY+d,f.rowpositions);\"yes\"==f.context.sheetobj.rowattribs.hide[d];)d++;c.trackingline.style.top=(f.rowpositions[d]||f.headposition.top)+\"px\"}else{e=e.morebuttonstart-e.minscrollingpanesize-c.offsetX;c.clientX>\ne&&(c.clientX=e);e=f.headposition.left-d-c.offsetX;c.clientX<e&&(c.clientX=e);for(d=SocialCalc.Lookup(c.clientX+d,f.colpositions);\"yes\"==f.context.sheetobj.colattribs.hide[SocialCalc.rcColname(d)];)d++;c.trackingline.style.left=(f.colpositions[d]||f.headposition.left)+\"px\"}SocialCalc.DragFunctionPosition(a,c,b)};\nSocialCalc.TCPSDragFunctionStop=function(a,c,b){var d,e=b.functionobj.control;d=e.sliderthickness;a=e.editor;if(b.vertical){b=e.morebuttonstart-e.minscrollingpanesize-c.offsetY;c.clientY>b&&(c.clientY=b);b=a.headposition.top-d-c.offsetY;c.clientY<b&&(c.clientY=b);d=SocialCalc.Lookup(c.clientY+d,a.rowpositions);d>a.context.sheetobj.attribs.lastrow&&(d=a.context.sheetobj.attribs.lastrow);for(;\"yes\"==a.context.sheetobj.rowattribs.hide[d];)d++;!d||d<=a.context.rowpanes[0].first?1<a.context.rowpanes.length&&\n(a.context.rowpanes.length=1):a.context.rowpanes.length-1?a.timeout||(a.context.SetRowPaneFirstLast(0,a.context.rowpanes[0].first,d-1),a.context.SetRowPaneFirstLast(1,d,d)):(a.context.SetRowPaneFirstLast(0,a.context.rowpanes[0].first,d-1),a.context.SetRowPaneFirstLast(1,d,d))}else{b=e.morebuttonstart-e.minscrollingpanesize-c.offsetX;c.clientX>b&&(c.clientX=b);b=a.headposition.left-d-c.offsetX;c.clientX<b&&(c.clientX=b);d=SocialCalc.Lookup(c.clientX+d,a.colpositions);d>a.context.sheetobj.attribs.lastcol&&\n(d=a.context.sheetobj.attribs.lastcol);for(;\"yes\"==a.context.sheetobj.colattribs.hide[SocialCalc.rcColname(d)];)d++;!d||d<=a.context.colpanes[0].first?1<a.context.colpanes.length&&(a.context.colpanes.length=1):a.context.colpanes.length-1?a.timeout||(a.context.SetColPaneFirstLast(0,a.context.colpanes[0].first,d-1),a.context.SetColPaneFirstLast(1,d,d)):(a.context.SetColPaneFirstLast(0,a.context.colpanes[0].first,d-1),a.context.SetColPaneFirstLast(1,d,d))}a.FitToEditTable();a.griddiv.removeChild(c.trackingline);\na.ScheduleRender()};\nSocialCalc.TCTDragFunctionStart=function(a,c,b){var d=b.functionobj.control,e=d.editor,f=SocialCalc.Constants;SocialCalc.DragFunctionStart(a,c,b);c.thumbstatus&&(c.thumbstatus.rowmsgele&&(c.thumbstatus.rowmsgele=null),c.thumbstatus.rowpreviewele&&(c.thumbstatus.rowpreviewele=null),e.toplevel.removeChild(c.thumbstatus),c.thumbstatus=null);c.thumbstatus=document.createElement(\"div\");b.vertical?(f.TCTDFSthumbstatusvClass&&(c.thumbstatus.className=f.TCTDFSthumbstatusvClass),SocialCalc.setStyles(c.thumbstatus,f.TCTDFSthumbstatusvStyle),\nc.thumbstatus.style.top=c.clientY+f.TCTDFStopOffsetv+\"px\",c.thumbstatus.style.left=d.controlborder-10-e.tablewidth/2+\"px\",c.thumbstatus.style.width=e.tablewidth/2+\"px\",c.thumbcontext=new SocialCalc.RenderContext(e.context.sheetobj),c.thumbcontext.showGrid=!0,c.thumbcontext.rowpanes=[{first:1,last:1}],a=e.context.colpanes[e.context.colpanes.length-1],c.thumbcontext.colpanes=[{first:a.first,last:a.last}],c.thumbstatus.innerHTML='<table cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\" style=\"'+f.TCTDFSthumbstatusrownumStyle+\n'\" class=\"'+f.TCTDFSthumbstatusrownumClass+'\"><div>msg</div></td><td valign=\"top\"><div style=\"overflow:hidden;\">preview</div></td></tr></table>',c.thumbstatus.rowmsgele=c.thumbstatus.firstChild.firstChild.firstChild.firstChild.firstChild,c.thumbstatus.rowpreviewele=c.thumbstatus.firstChild.firstChild.firstChild.childNodes[1].firstChild,e.toplevel.appendChild(c.thumbstatus),SocialCalc.TCTDragFunctionRowSetStatus(c,e,e.firstscrollingrow||1)):(f.TCTDFSthumbstatushClass&&(c.thumbstatus.className=f.TCTDFSthumbstatushClass),\nSocialCalc.setStyles(c.thumbstatus,f.TCTDFSthumbstatushStyle),c.thumbstatus.style.top=d.controlborder+f.TCTDFStopOffseth+\"px\",c.thumbstatus.style.left=c.clientX+f.TCTDFSleftOffseth+\"px\",e.toplevel.appendChild(c.thumbstatus),c.thumbstatus.innerHTML=f.s_TCTDFthumbstatusPrefixh+SocialCalc.rcColname(e.firstscrollingcol))};\nSocialCalc.TCTDragFunctionRowSetStatus=function(a,c,b){a.thumbstatus.rowmsgele.innerHTML=SocialCalc.Constants.s_TCTDFthumbstatusPrefixv+b+\" \";a.thumbcontext.rowpanes=[{first:b,last:b}];a.thumbrowshown=b;a.thumbcontext.RenderSheet(a.thumbstatus.rowpreviewele.firstChild,{type:\"html\"})};\nSocialCalc.TCTDragFunctionMove=function(a,c,b){var d,e;d=b.functionobj.control;e=d.editor;var f=SocialCalc.Constants;b.vertical?(c.clientY>d.scrollareaend-c.offsetY-d.thumbthickness+2&&(c.clientY=d.scrollareaend-c.offsetY-d.thumbthickness+2),c.clientY<d.scrollareastart-c.offsetY-1&&(c.clientY=d.scrollareastart-c.offsetY-1),c.thumbstatus.style.top=c.clientY+\"px\",d=(c.clientY+c.offsetY-d.scrollareastart+1)/(d.scrollareasize-d.thumbthickness)*(e.context.sheetobj.attribs.lastrow-e.lastnonscrollingrow)+\ne.lastnonscrollingrow+1,d=Math.floor(d),d<=e.lastnonscrollingrow&&(d=e.lastnonscrollingrow+1),d>e.context.sheetobj.attribs.lastrow&&(d=e.context.sheetobj.attribs.lastrow),d!=c.thumbrowshown&&SocialCalc.TCTDragFunctionRowSetStatus(c,e,d)):(c.clientX>d.scrollareaend-c.offsetX-d.thumbthickness+2&&(c.clientX=d.scrollareaend-c.offsetX-d.thumbthickness+2),c.clientX<d.scrollareastart-c.offsetX-1&&(c.clientX=d.scrollareastart-c.offsetX-1),c.thumbstatus.style.left=c.clientX+\"px\",d=(c.clientX+c.offsetX-d.scrollareastart+\n1)/(d.scrollareasize-d.thumbthickness)*(e.context.sheetobj.attribs.lastcol-e.lastnonscrollingcol)+e.lastnonscrollingcol+1,d=Math.floor(d),d<=e.lastnonscrollingcol&&(d=e.lastnonscrollingcol+1),d>e.context.sheetobj.attribs.lastcol&&(d=e.context.sheetobj.attribs.lastcol),e=f.s_TCTDFthumbstatusPrefixh+SocialCalc.rcColname(d),c.thumbstatus.innerHTML=e);SocialCalc.DragFunctionPosition(a,c,b)};\nSocialCalc.TCTDragFunctionStop=function(a,c,b){var d=b.functionobj.control;a=d.editor;b.vertical?(b=(c.clientY+c.offsetY-d.scrollareastart+1)/(d.scrollareasize-d.thumbthickness)*(a.context.sheetobj.attribs.lastrow-a.lastnonscrollingrow)+a.lastnonscrollingrow+1,b=Math.floor(b),b<=a.lastnonscrollingrow&&(b=a.lastnonscrollingrow+1),b>a.context.sheetobj.attribs.lastrow&&(b=a.context.sheetobj.attribs.lastrow),a.context.SetRowPaneFirstLast(a.context.rowpanes.length-1,b,b+1)):(b=(c.clientX+c.offsetX-d.scrollareastart+\n1)/(d.scrollareasize-d.thumbthickness)*(a.context.sheetobj.attribs.lastcol-a.lastnonscrollingcol)+a.lastnonscrollingcol+1,b=Math.floor(b),b<=a.lastnonscrollingcol&&(b=a.lastnonscrollingcol+1),b>a.context.sheetobj.attribs.lastcol&&(b=a.context.sheetobj.attribs.lastcol),a.context.SetColPaneFirstLast(a.context.colpanes.length-1,b,b+1));a.FitToEditTable();c.thumbstatus.rowmsgele&&(c.thumbstatus.rowmsgele=null);c.thumbstatus.rowpreviewele&&(c.thumbstatus.rowpreviewele=null);a.toplevel.removeChild(c.thumbstatus);\nc.thumbstatus=null;a.ScheduleRender()};SocialCalc.DragInfo={registeredElements:[],draggingElement:null,startX:0,startY:0,startZ:0,clientX:0,clientY:0,offsetX:0,offsetY:0,relativeOffset:{left:0,top:0}};\nSocialCalc.DragRegister=function(a,c,b,d,e){var f=SocialCalc.DragInfo;d||(d={MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null});f.registeredElements.push({element:a,vertical:c,horizontal:b,functionobj:d,parent:e});if(a.addEventListener)a.addEventListener(\"mousedown\",SocialCalc.DragMouseDown,!1);else if(a.attachEvent)a.attachEvent(\"onmousedown\",SocialCalc.DragMouseDown);else throw SocialCalc.Constants.s_BrowserNotSupported;\n};SocialCalc.DragUnregister=function(a){var c=SocialCalc.DragInfo,b;if(a)for(b=0;b<c.registeredElements.length;b++)if(c.registeredElements[b].element==a){c.registeredElements.splice(b,1);a.removeEventListener?a.removeEventListener(\"mousedown\",SocialCalc.DragMouseDown,!1):a.detachEvent(\"onmousedown\",SocialCalc.DragMouseDown);break}};\nSocialCalc.DragMouseDown=function(a){a=a||window.event;var c=SocialCalc.DragInfo,b=SocialCalc.LookupElement(a.target||a.srcElement,c.registeredElements);if(b&&!(b&&b.functionobj&&b.functionobj.Disabled&&b.functionobj.Disabled(a,c,b)))return c.draggingElement=b,b.parent&&(c.relativeOffset=SocialCalc.GetElementPositionWithScroll(b.parent)),c.clientX=a.clientX-c.relativeOffset.left,c.clientY=a.clientY-c.relativeOffset.top,c.startX=c.clientX,c.startY=c.clientY,c.startZ=b.element.style.zIndex,c.offsetX=\n0,c.offsetY=0,b.element.style.zIndex=\"100\",document.addEventListener?(document.addEventListener(\"mousemove\",SocialCalc.DragMouseMove,!0),document.addEventListener(\"mouseup\",SocialCalc.DragMouseUp,!0)):b.element.attachEvent&&(b.element.setCapture(),b.element.attachEvent(\"onmousemove\",SocialCalc.DragMouseMove),b.element.attachEvent(\"onmouseup\",SocialCalc.DragMouseUp),b.element.attachEvent(\"onlosecapture\",SocialCalc.DragMouseUp)),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?\na.preventDefault():a.returnValue=!1,b&&b.functionobj&&b.functionobj.MouseDown&&b.functionobj.MouseDown(a,c,b),!1};SocialCalc.DragMouseMove=function(a){a=a||window.event;var c=SocialCalc.DragInfo,b=c.draggingElement;c.clientX=a.clientX-c.relativeOffset.left;c.clientY=a.clientY-c.relativeOffset.top;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;b&&b.functionobj&&b.functionobj.MouseMove&&b.functionobj.MouseMove(a,c,b);return!1};\nSocialCalc.DragMouseUp=function(a){a=a||window.event;var c=SocialCalc.DragInfo,b=c.draggingElement;c.clientX=a.clientX-c.relativeOffset.left;c.clientY=a.clientY-c.relativeOffset.top;b.element.style.zIndex=c.startZ;b&&b.functionobj&&b.functionobj.MouseUp&&b.functionobj.MouseUp(a,c,b);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;document.removeEventListener?(document.removeEventListener(\"mousemove\",SocialCalc.DragMouseMove,!0),document.removeEventListener(\"mouseup\",SocialCalc.DragMouseUp,\n!0)):b.element.detachEvent&&(b.element.detachEvent(\"onlosecapture\",SocialCalc.DragMouseUp),b.element.detachEvent(\"onmouseup\",SocialCalc.DragMouseUp),b.element.detachEvent(\"onmousemove\",SocialCalc.DragMouseMove),b.element.releaseCapture());c.draggingElement=null;return!1};SocialCalc.DragFunctionStart=function(a,c,b){a=b.functionobj.positionobj||b.element;c.offsetY=parseInt(a.style.top)-c.clientY;c.offsetX=parseInt(a.style.left)-c.clientX};\nSocialCalc.DragFunctionPosition=function(a,c,b){a=b.functionobj.positionobj||b.element;b.vertical&&(a.style.top=c.clientY+c.offsetY+\"px\");b.horizontal&&(a.style.left=c.clientX+c.offsetX+\"px\")};SocialCalc.TooltipInfo={registeredElements:[],registered:!1,tooltipElement:null,timer:null,popupElement:null,clientX:0,clientY:0,offsetX:SocialCalc.Constants.TooltipOffsetX,offsetY:SocialCalc.Constants.TooltipOffsetY};\nSocialCalc.TooltipRegister=function(a,c,b,d){var e=SocialCalc.TooltipInfo;e.registeredElements.push({element:a,tiptext:c,functionobj:b,parent:d});if(!e.registered){if(document.addEventListener)document.addEventListener(\"mousemove\",SocialCalc.TooltipMouseMove,!1);else if(document.attachEvent)document.attachEvent(\"onmousemove\",SocialCalc.TooltipMouseMove);else throw SocialCalc.Constants.s_BrowserNotSupported;e.registered=!0}};\nSocialCalc.TooltipMouseMove=function(a){var c=a||window.event;a=SocialCalc.TooltipInfo;a.clientX=c.clientX;a.clientY=c.clientY;c=SocialCalc.LookupElement(c.target||c.srcElement,a.registeredElements);a.timer&&(window.clearTimeout(a.timer),a.timer=null);a.popupElement&&SocialCalc.TooltipHide();a.tooltipElement=c||null;c&&!SocialCalc.ButtonInfo.buttonDown&&(a.timer=window.setTimeout(SocialCalc.TooltipWaitDone,700),a.tooltipElement.element.addEventListener?a.tooltipElement.element.addEventListener(\"mousedown\",\nSocialCalc.TooltipMouseDown,!1):a.tooltipElement.element.attachEvent&&a.tooltipElement.element.attachEvent(\"onmousedown\",SocialCalc.TooltipMouseDown))};\nSocialCalc.TooltipMouseDown=function(a){a=SocialCalc.TooltipInfo;a.timer&&(window.clearTimeout(a.timer),a.timer=null);a.popupElement&&SocialCalc.TooltipHide();a.tooltipElement&&(a.tooltipElement.element.removeEventListener?a.tooltipElement.element.removeEventListener(\"mousedown\",SocialCalc.TooltipMouseDown,!1):a.tooltipElement.element.attachEvent&&a.tooltipElement.element.detachEvent(\"onmousedown\",SocialCalc.TooltipMouseDown),a.tooltipElement=null)};\nSocialCalc.TooltipDisplay=function(a){var c=SocialCalc.TooltipInfo,b=SocialCalc.Constants,d=a.functionobj&&\"number\"==typeof a.functionobj.offsetx?a.functionobj.offsetx:c.offsetX,e=a.functionobj&&\"number\"==typeof a.functionobj.offsety?a.functionobj.offsety:c.offsetY,f=SocialCalc.GetViewportInfo(),g=SocialCalc.GetElementPositionWithScroll(a.parent);c.popupElement=document.createElement(\"div\");b.TDpopupElementClass&&(c.popupElement.className=b.TDpopupElementClass);SocialCalc.setStyles(c.popupElement,\nb.TDpopupElementStyle);c.popupElement.innerHTML=a.tiptext;c.clientX>f.width/2?(c.popupElement.style.bottom=g.height-c.clientY+e+g.top+\"px\",c.popupElement.style.right=g.width-c.clientX+d+g.left+\"px\"):(c.popupElement.style.bottom=g.height-c.clientY+e+g.top+\"px\",c.popupElement.style.left=c.clientX+d-g.left+\"px\");50>c.clientY&&(c.popupElement.style.bottom=g.height-c.clientY+e-50+g.top+\"px\");a.parent.appendChild(c.popupElement)};\nSocialCalc.TooltipHide=function(){var a=SocialCalc.TooltipInfo;a.popupElement&&(a.popupElement.parentNode.removeChild(a.popupElement),a.popupElement=null)};SocialCalc.TooltipWaitDone=function(){var a=SocialCalc.TooltipInfo;a.timer=null;SocialCalc.TooltipDisplay(a.tooltipElement)};SocialCalc.ButtonInfo={registeredElements:[],buttonElement:null,doingHover:!1,buttonDown:!1,timer:null,relativeOffset:null,clientX:0,clientY:0};\nSocialCalc.ButtonRegister=function(a,c,b,d){var e=SocialCalc.ButtonInfo;b||(b={});e.registeredElements.push({name:b.name,element:c,editor:a,normalstyle:b.normalstyle,hoverstyle:b.hoverstyle,downstyle:b.downstyle,repeatwait:b.repeatwait,repeatinterval:b.repeatinterval,functionobj:d});if(c.addEventListener)c.addEventListener(\"mousedown\",SocialCalc.ButtonMouseDown,!1),c.addEventListener(\"mouseover\",SocialCalc.ButtonMouseOver,!1),c.addEventListener(\"mouseout\",SocialCalc.ButtonMouseOut,!1);else if(c.attachEvent)c.attachEvent(\"onmousedown\",\nSocialCalc.ButtonMouseDown),c.attachEvent(\"onmouseover\",SocialCalc.ButtonMouseOver),c.attachEvent(\"onmouseout\",SocialCalc.ButtonMouseOut);else throw SocialCalc.Constants.s_BrowserNotSupported;};\nSocialCalc.ButtonMouseOver=function(a){a=a||window.event;var c=SocialCalc.ButtonInfo,b=SocialCalc.LookupElement(a.target||a.srcElement,c.registeredElements);b&&(c.buttonDown?c.buttonElement==b&&(c.doingHover=!0):(c.buttonElement&&c.buttonElement!=b&&c.doingHover&&SocialCalc.setStyles(c.buttonElement.element,c.buttonElement.normalstyle),c.buttonElement=b,c.doingHover=!0,SocialCalc.setStyles(b.element,b.hoverstyle),b&&b.functionobj&&b.functionobj.MouseOver&&b.functionobj.MouseOver(a,c,b)))};\nSocialCalc.ButtonMouseOut=function(a){a=a||window.event;var c=SocialCalc.ButtonInfo;if(c.buttonDown)c.doingHover=!1;else{var b=SocialCalc.LookupElement(a.target||a.srcElement,c.registeredElements);c.doingHover&&(c.buttonElement&&SocialCalc.setStyles(c.buttonElement.element,c.buttonElement.normalstyle),c.buttonElement=null,c.doingHover=!1);b&&b.functionobj&&b.functionobj.MouseOut&&b.functionobj.MouseOut(a,c,b)}};\nSocialCalc.ButtonMouseDown=function(a){a=a||window.event;var c=SocialCalc.ButtonInfo;SocialCalc.GetViewportInfo();var b=SocialCalc.LookupElement(a.target||a.srcElement,c.registeredElements);!b||b&&b.functionobj&&b.functionobj.Disabled&&b.functionobj.Disabled(a,c,b)||(c.buttonElement=b,c.buttonDown=!0,SocialCalc.setStyles(b.element,c.buttonElement.downstyle),document.addEventListener?document.addEventListener(\"mouseup\",SocialCalc.ButtonMouseUp,!0):b.element.attachEvent&&(b.element.setCapture(),b.element.attachEvent(\"onmouseup\",\nSocialCalc.ButtonMouseUp),b.element.attachEvent(\"onlosecapture\",SocialCalc.ButtonMouseUp)),a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1,c.relativeOffset=SocialCalc.GetElementPositionWithScroll(b.editor.toplevel),c.clientX=a.clientX-c.relativeOffset.left,c.clientY=a.clientY-c.relativeOffset.top,b&&b.functionobj&&b.functionobj.MouseDown&&b.functionobj.MouseDown(a,c,b),b.repeatwait&&(c.timer=window.setTimeout(SocialCalc.ButtonRepeat,b.repeatwait)))};\nSocialCalc.ButtonMouseUp=function(a){a=a||window.event;var c=SocialCalc.ButtonInfo,b=c.buttonElement;c.timer&&(window.clearTimeout(c.timer),c.timer=null);c.buttonDown&&(a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,a.preventDefault?a.preventDefault():a.returnValue=!1,document.removeEventListener?document.removeEventListener(\"mouseup\",SocialCalc.ButtonMouseUp,!0):document.detachEvent&&(b.element.detachEvent(\"onlosecapture\",SocialCalc.ButtonMouseUp),b.element.detachEvent(\"onmouseup\",SocialCalc.ButtonMouseUp),\nb.element.releaseCapture()),c.buttonElement.downstyle&&(c.doingHover?SocialCalc.setStyles(b.element,c.buttonElement.hoverstyle):SocialCalc.setStyles(b.element,c.buttonElement.normalstyle)),c.buttonDown=!1,b&&b.functionobj&&b.functionobj.MouseUp&&b.functionobj.MouseUp(a,c,b))};\nSocialCalc.ButtonRepeat=function(){var a=SocialCalc.ButtonInfo,c=a.buttonElement;c&&(c&&c.functionobj&&c.functionobj.Repeat&&c.functionobj.Repeat(null,a,c),a.timer=window.setTimeout(SocialCalc.ButtonRepeat,c.repeatinterval||100))};SocialCalc.MouseWheelInfo={registeredElements:[]};\nSocialCalc.MouseWheelRegister=function(a,c){SocialCalc.MouseWheelInfo.registeredElements.push({element:a,functionobj:c});if(a.addEventListener)a.addEventListener(\"DOMMouseScroll\",SocialCalc.ProcessMouseWheel,!1),a.addEventListener(\"mousewheel\",SocialCalc.ProcessMouseWheel,!1);else if(a.attachEvent)a.attachEvent(\"onmousewheel\",SocialCalc.ProcessMouseWheel);else throw SocialCalc.Constants.s_BrowserNotSupported;};\nSocialCalc.ProcessMouseWheel=function(a){a=a||window.event;var c;if(!SocialCalc.GetSpreadsheetControlObject().keyboard.passThru){var b=SocialCalc.MouseWheelInfo;c=a.target||a.srcElement;var d;for(d=null;!d&&c;c=c.parentNode)d=SocialCalc.LookupElement(c,b.registeredElements);d&&((c=a.wheelDelta?a.wheelDelta/120:-a.detail/3)||(c=0),d.functionobj&&d.functionobj.WheelMove&&d.functionobj.WheelMove(a,c,b,d),a.preventDefault&&a.preventDefault(),a.returnValue=!1)}};\nSocialCalc.keyboardTables={specialKeysCommon:{8:\"[backspace]\",9:\"[tab]\",13:\"[enter]\",25:\"[tab]\",27:\"[esc]\",33:\"[pgup]\",34:\"[pgdn]\",35:\"[end]\",36:\"[home]\",37:\"[aleft]\",38:\"[aup]\",39:\"[aright]\",40:\"[adown]\",45:\"[ins]\",46:\"[del]\",113:\"[f2]\"},specialKeysIE:{8:\"[backspace]\",9:\"[tab]\",13:\"[enter]\",25:\"[tab]\",27:\"[esc]\",33:\"[pgup]\",34:\"[pgdn]\",35:\"[end]\",36:\"[home]\",37:\"[aleft]\",38:\"[aup]\",39:\"[aright]\",40:\"[adown]\",45:\"[ins]\",46:\"[del]\",113:\"[f2]\"},controlKeysIE:{67:\"[ctrl-c]\",83:\"[ctrl-s]\",86:\"[ctrl-v]\",\n88:\"[ctrl-x]\",90:\"[ctrl-z]\"},specialKeysOpera:{8:\"[backspace]\",9:\"[tab]\",13:\"[enter]\",25:\"[tab]\",27:\"[esc]\",33:\"[pgup]\",34:\"[pgdn]\",35:\"[end]\",36:\"[home]\",37:\"[aleft]\",38:\"[aup]\",39:\"[aright]\",40:\"[adown]\",45:\"[ins]\",46:\"[del]\",113:\"[f2]\"},controlKeysOpera:{67:\"[ctrl-c]\",83:\"[ctrl-s]\",86:\"[ctrl-v]\",88:\"[ctrl-x]\",90:\"[ctrl-z]\"},specialKeysSafari:{8:\"[backspace]\",9:\"[tab]\",13:\"[enter]\",25:\"[tab]\",27:\"[esc]\",63232:\"[aup]\",63233:\"[adown]\",63234:\"[aleft]\",63235:\"[aright]\",63272:\"[del]\",63273:\"[home]\",\n63275:\"[end]\",63276:\"[pgup]\",63277:\"[pgdn]\",63237:\"[f2]\"},controlKeysSafari:{99:\"[ctrl-c]\",115:\"[ctrl-s]\",118:\"[ctrl-v]\",120:\"[ctrl-x]\",122:\"[ctrl-z]\"},ignoreKeysSafari:{63236:\"[f1]\",63238:\"[f3]\",63239:\"[f4]\",63240:\"[f5]\",63241:\"[f6]\",63242:\"[f7]\",63243:\"[f8]\",63244:\"[f9]\",63245:\"[f10]\",63246:\"[f11]\",63247:\"[f12]\",63289:\"[numlock]\"},specialKeysFirefox:{8:\"[backspace]\",9:\"[tab]\",13:\"[enter]\",25:\"[tab]\",27:\"[esc]\",33:\"[pgup]\",34:\"[pgdn]\",35:\"[end]\",36:\"[home]\",37:\"[aleft]\",38:\"[aup]\",39:\"[aright]\",\n40:\"[adown]\",45:\"[ins]\",46:\"[del]\",113:\"[f2]\"},controlKeysFirefox:{99:\"[ctrl-c]\",115:\"[ctrl-s]\",118:\"[ctrl-v]\",120:\"[ctrl-x]\",122:\"[ctrl-z]\"},ignoreKeysFirefox:{16:\"[shift]\",17:\"[ctrl]\",18:\"[alt]\",20:\"[capslock]\",19:\"[pause]\",44:\"[printscreen]\",91:\"[windows]\",92:\"[windows]\",112:\"[f1]\",114:\"[f3]\",115:\"[f4]\",116:\"[f5]\",117:\"[f6]\",118:\"[f7]\",119:\"[f8]\",120:\"[f9]\",121:\"[f10]\",122:\"[f11]\",123:\"[f12]\",144:\"[numlock]\",145:\"[scrolllock]\",224:\"[cmd]\"}};SocialCalc.Constants.AllowCtrlS=!0;\nSocialCalc.Constants.AllowCtrlJ=!0;SocialCalc.keyboardTables.controlKeysIE[74]=\"[ctrl-j]\";SocialCalc.keyboardTables.controlKeysOpera[74]=\"[ctrl-j]\";SocialCalc.keyboardTables.controlKeysSafari[106]=\"[ctrl-j]\";SocialCalc.keyboardTables.controlKeysFirefox[106]=\"[ctrl-j]\";\nSocialCalc.KeyboardSetFocus=function(a){hack.log(\"\",hack.keyboard,\"SocialCalc.KeyboardSetFocus\");var c=SocialCalc.GetSpreadsheetControlObject();c.keyboard.focusTable=a;c.keyboard.areListener||(TiddlyWiki?(hack.log(\"add event listener: keydown, keypress, focus\",hack.keyboard,\"SocialCalc.KeyboardSetFocus\"),c.spreadsheetDiv.addEventListener(\"keydown\",SocialCalc.ProcessKeyDown,!1),c.spreadsheetDiv.addEventListener(\"keypress\",SocialCalc.ProcessKeyPress,!1),c.spreadsheetDiv.addEventListener(\"focus\",function(a){c.tiddlyWiki.inputboxHasKeyboard=\n!1},!1),c.tiddlyWiki.flagView||(c.editor.inputBox.element.addEventListener(\"focus\",function(a){c.tiddlyWiki.inputboxHasKeyboard=!0},!1),c.editor.inputBox.element.addEventListener(\"blur\",function(a){c.spreadsheetDiv.focus()},!1))):(document.onkeydown=SocialCalc.ProcessKeyDown,document.onkeypress=SocialCalc.ProcessKeyPress),c.keyboard.areListener=!0);c.keyboard.passThru&&(c.keyboard.passThru.blur&&c.keyboard.passThru.blur(),c.keyboard.passThru=null);TiddlyWiki?(hack.log(\"spreadsheet.spreadsheetDiv: take focus\",\nhack.keyboard,\"SocialCalc.KeyboardSetFocus\"),c.spreadsheetDiv.focus()):window.focus()};SocialCalc.KeyboardFocus=function(){hack.log(\"\",hack.keyboard,\"SocialCalc.KeyboardFocus\");var a=SocialCalc.GetSpreadsheetControlObject();a.keyboard.passThru=null;TiddlyWiki?a.spreadsheetDiv.focus():window.focus()};\nSocialCalc.ProcessKeyDown=function(a){hack.log(\"\",hack.keyboard,\"SocialCalc.ProcessKeyDown\");var c=SocialCalc.GetSpreadsheetControlObject(),b=SocialCalc.keyboardTables;b.didProcessKey=!1;b.statusFromProcessKey=!1;b.repeatingKeyPress=!1;var d=\"\",e=!0;if(!c.keyboard.passThru){a=a||window.event;if(void 0==a.which){d=b.specialKeysCommon[a.keyCode];if(!d&&(a.ctrlKey&&(d=b.controlKeysIE[a.keyCode]),!d))return!0;e=SocialCalc.ProcessKey(d,a);e||(a.preventDefault?a.preventDefault():a.returnValue=!1)}else{d=\nb.specialKeysCommon[a.keyCode];if(!d){if(a.ctrlKey||a.metaKey)d=b.controlKeysIE[a.keyCode];if(!d)return!0}e=SocialCalc.ProcessKey(d,a);b.didProcessKey=!0;b.statusFromProcessKey=e;b.chForProcessKey=d}TiddlyWiki&&!c.tiddlyWiki.inputboxHasKeyboard&&(a.preventDefault?a.preventDefault():a.returnValue=!1);return e}};\nSocialCalc.ProcessKeyPress=function(a){var c=SocialCalc.GetSpreadsheetControlObject(),b=SocialCalc.keyboardTables,d=\"\";a=a||window.event;if(!c.keyboard.passThru){if(b.didProcessKey){if(b.repeatingKeyPress)return SocialCalc.ProcessKey(b.chForProcessKey,a);b.repeatingKeyPress=!0;return b.statusFromProcessKey}if(void 0==a.which)d=String.fromCharCode(a.keyCode);else{if(!a.which)return!1;if(void 0==a.charCode)if(0!=a.which)if(32>a.which||144==a.which){if(d=b.specialKeysOpera[a.which])return!0}else d=a.ctrlKey?\nb.controlKeysOpera[a.keyCode]:String.fromCharCode(a.which);else return!0;else{if(0==a.keyCode&&0==a.charCode)return;if(a.keyCode==a.charCode){if(d=b.specialKeysSafari[a.keyCode],!d){if(b.ignoreKeysSafari[a.keyCode])return!0;d=a.metaKey?b.controlKeysSafari[a.keyCode]:String.fromCharCode(a.which)}}else{if(b.specialKeysFirefox[a.keyCode])return!0;d=String.fromCharCode(a.which);if(a.ctrlKey||a.metaKey)d=b.controlKeysFirefox[a.which]}}}c=SocialCalc.ProcessKey(d,a);c||(a.preventDefault?a.preventDefault():\na.returnValue=!1);return c}};SocialCalc.ProcessKey=function(a,c){var b=SocialCalc.GetSpreadsheetControlObject().keyboard.focusTable;return b?b.EditorProcessKey(a,c):!0};SocialCalc||(SocialCalc={});SocialCalc.FormatNumber={};SocialCalc.FormatNumber.format_definitions={};SocialCalc.FormatNumber.separatorchar=\",\";SocialCalc.FormatNumber.decimalchar=\".\";SocialCalc.FormatNumber.daynames=\"Sunday Monday Tuesday Wednesday Thursday Friday Saturday\".split(\" \");SocialCalc.FormatNumber.daynames3=\"Sun Mon Tue Wed Thu Fri Sat\".split(\" \");SocialCalc.FormatNumber.monthnames3=\"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\".split(\" \");SocialCalc.FormatNumber.monthnames=\"January February March April May June July August September October November December\".split(\" \");\nSocialCalc.FormatNumber.allowedcolors={BLACK:\"#000000\",BLUE:\"#0000FF\",CYAN:\"#00FFFF\",GREEN:\"#00FF00\",MAGENTA:\"#FF00FF\",RED:\"#FF0000\",WHITE:\"#FFFFFF\",YELLOW:\"#FFFF00\"};SocialCalc.FormatNumber.alloweddates={H:\"h]\",M:\"m]\",MM:\"mm]\",S:\"s]\",SS:\"ss]\"};SocialCalc.FormatNumber.commands={copy:1,color:2,integer_placeholder:3,fraction_placeholder:4,decimal:5,currency:6,general:7,separator:8,date:9,comparison:10,section:11,style:12};\nSocialCalc.FormatNumber.datevalues={julian_offset:2415019,seconds_in_a_day:86400,seconds_in_an_hour:3600};\nSocialCalc.FormatNumber.formatNumberWithFormat=function(a,c,b){b=SocialCalc.Constants;var d=SocialCalc.FormatNumber,e,f,g,l,h,m,p,r,q,n,s,t=\"\",u,w,v,x,y,z,C,D,G,I,E;if(\"string\"==typeof a&&!a.length)return\"\";E=a-0;if(!isFinite(E))return\"string\"==typeof a?d.formatTextWithFormat(a,c):\"NaN\";a=E;var H=0>E?1:0;H&&(E=-E);v=0==E?1:0;d.parse_format_string(d.format_definitions,c);c=d.format_definitions[c];if(!c)throw\"Format not parsed error!\";u=c.sectioninfo.length-1;if(c.hascomparison)for(v=s=u=0;;v++){e=\nc.operators[v];f=c.operands[v];if(!e){s&&(c=\"General\",d.parse_format_string(d.format_definitions,c),c=d.format_definitions[c],u=0);break}if(e==d.commands.section){if(!s)break;s=0;u++}else if(e==d.commands.comparison){s=f.indexOf(\":\");w=f.substring(0,s);f=f.substring(s+1)-0;if(\"<\"==w&&a<f||\"<=\"==w&&a<=f||\"=\"==w&&a==f||\"<>\"==w&&a!=f||\">=\"==w&&a>=f||\">\"==w&&a>f)break;s=1}}else if(0<u)if(1==u)H?(H=0,u=1):u=0;else if(2==u||3==u)H?(H=0,u=1):u=v?2:0;u=c.sectioninfo[u];if(0<u.commas)for(s=0;s<u.commas;s++)E/=\n1E3;if(0<u.percent)for(s=0;s<u.percent;s++)E*=100;f=1;for(s=0;s<u.fractiondigits;s++)f*=10;v=Math.floor(E*f+.5);v/=f;if(\"number\"!=typeof v||!isFinite(v))return\"NaN\";f=v+\"\";0==v&&(u.fractiondigits||u.integerdigits)&&(H=0);if(0<=f.indexOf(\"e\"))return a+\"\";f=f.match(/^\\+{0,1}(\\d*)(?:\\.(\\d*)){0,1}$/);if(!f)return\"NaN\";(v=f[1])&&\"0\"!=v||(v=\"\");(w=f[2])||(w=\"\");if(u.hasdate){if(0>a)return\"??-???-?? ??:??:??\";g=(a-Math.floor(a))*d.datevalues.seconds_in_a_day;l=a*d.datevalues.seconds_in_a_day;h=Math.floor(g/\nd.datevalues.seconds_in_an_hour);p=Math.floor(l/d.datevalues.seconds_in_an_hour);g-=h*d.datevalues.seconds_in_an_hour;m=Math.floor(g/60);r=Math.floor(l/60);f=1;for(s=0;s<u.fractiondigits;s++)f*=10;g=Math.floor((g-60*m)*f+.5);g/=f;l=Math.floor(l*f+.5);l/=f;60<=g&&(g=0,m++,r++,60<=m&&(m=0,h++,p++,24<=h&&(h=0,a++)));w=g-Math.floor(g)+\"\";w=w.substring(2);n=SocialCalc.FormatNumber.convert_date_julian_to_gregorian(Math.floor(a+d.datevalues.julian_offset));s=0;for(mspos=u.sectionstart;;mspos++){e=c.operators[mspos];\nf=c.operands[mspos];if(!e)break;if(e==d.commands.section)break;e==d.commands.date?(\"am/pm\"!=f.toLowerCase()&&\"a/p\"!=f.toLowerCase()||q||(12<=h?(h-=12,q=\"a/p\"==f.toLowerCase()?b.s_FormatNumber_pm1:b.s_FormatNumber_pm):q=\"a/p\"==f.toLowerCase()?b.s_FormatNumber_am1:b.s_FormatNumber_am,0>f.indexOf(q)&&(q=q.toLowerCase())),!s||\"m\"!=f&&\"mm\"!=f||(c.operands[mspos]+=\"in\"),s=\"h\"==f.charAt(0)?1:0):e!=d.commands.copy&&(s=0)}s=0;for(--mspos;;mspos--){e=c.operators[mspos];f=c.operands[mspos];if(!e)break;if(e==\nd.commands.section)break;e==d.commands.date?(!s||\"m\"!=f&&\"mm\"!=f||(c.operands[mspos]+=\"in\"),s=\"ss\"==f?1:0):e!=d.commands.copy&&(s=0)}}z=y=x=0;D=C=\"\";G=b.FormatNumber_separatorchar;0<=G.indexOf(\" \")&&(G=G.replace(/ /g,\" \"));I=b.FormatNumber_decimalchar;0<=I.indexOf(\" \")&&(I=I.replace(/ /g,\" \"));for(s=u.sectionstart;e=c.operators[s];)if(f=c.operands[s++],e==d.commands.copy)t+=f;else if(e==d.commands.color)C=f;else if(e==d.commands.style)D=f;else if(e==d.commands.integer_placeholder){H&&(t+=\n\"-\",H=0);x++;if(1==x&&v.length>u.integerdigits)for(;y<v.length-u.integerdigits;y++)t+=v.charAt(y),u.thousandssep&&(e=v.length-y-1,2<e&&0==e%3&&(t+=G));if(v.length<u.integerdigits&&x<=u.integerdigits-v.length){if(\"0\"==f||\"?\"==f)t+=\"0\"==f?\"0\":\" \",u.thousandssep&&(e=u.integerdigits-x,2<e&&0==e%3&&(t+=G))}else t+=v.charAt(y),u.thousandssep&&(e=v.length-y-1,2<e&&0==e%3&&(t+=G)),y++}else if(e==d.commands.fraction_placeholder){if(z>=w.length){if(\"0\"==f||\"?\"==f)t+=\"0\"==f?\"0\":\" \"}else t+=w.charAt(z);\nz++}else if(e==d.commands.decimal)H&&(t+=\"-\",H=0),t+=I;else if(e==d.commands.currency)H&&(t+=\"-\",H=0),t+=f;else if(e==d.commands.general){if(0!=E&&(f=Math.floor(Math.LOG10E*Math.log(E)),f=Math.pow(10,13-f),E=Math.floor(f*E+.5)/f,!isFinite(E)))return\"NaN\";H&&(t+=\"-\");f=E+\"\";if(0<=f.indexOf(\"e\"))t+=f;else{f=f.match(/^\\+{0,1}(\\d*)(?:\\.(\\d*)){0,1}$/);(v=f[1])&&\"0\"!=v||(v=\"\");(w=f[2])||(w=\"\");z=y=0;if(v.length)for(;y<v.length;y++)t+=v.charAt(y),u.thousandssep&&(e=v.length-y-1,2<e&&0==e%3&&(t+=G));else t+=\n\"0\";if(w.length)for(t+=I;z<w.length;z++)t+=w.charAt(z)}}else if(e==d.commands.date)f=f.toLowerCase(),\"y\"==f||\"yy\"==f?t+=(n.year+\"\").substring(2):\"yyyy\"==f?t+=n.year+\"\":\"d\"==f?t+=n.day+\"\":\"dd\"==f?(f=1E3+n.day,t+=(f+\"\").substr(2)):\"ddd\"==f?(f=Math.floor(a+6)%7,t+=b.s_FormatNumber_daynames3[f]):\"dddd\"==f?(f=Math.floor(a+6)%7,t+=b.s_FormatNumber_daynames[f]):\"m\"==f?t+=n.month+\"\":\"mm\"==f?(f=1E3+n.month,t+=(f+\"\").substr(2)):\"mmm\"==f?t+=b.s_FormatNumber_monthnames3[n.month-1]:\"mmmm\"==f?t+=b.s_FormatNumber_monthnames[n.month-\n1]:\"mmmmm\"==f?t+=b.s_FormatNumber_monthnames[n.month-1].charAt(0):\"h\"==f?t+=h+\"\":\"h]\"==f?t+=p+\"\":\"mmin\"==f?(f=1E3+m+\"\",t+=f.substr(2)):\"mm]\"==f?100>r?(f=1E3+r+\"\",t+=f.substr(2)):t+=r+\"\":\"min\"==f?t+=m+\"\":\"m]\"==f?t+=r+\"\":\"hh\"==f?(f=1E3+h+\"\",t+=f.substr(2)):\"s\"==f?(f=Math.floor(g),t+=f+\"\"):\"ss\"==f?(f=1E3+Math.floor(g)+\"\",t+=f.substr(2)):\"am/pm\"==f||\"a/p\"==f?t+=q:\"ss]\"==f&&(100>l?(f=1E3+Math.floor(l)+\"\",t+=f.substr(2)):(f=Math.floor(l),t+=f+\"\"));else if(e==d.commands.section)break;else e!=d.commands.comparison&&\n(t+=\"!! Parse error !!\");C&&(t='<span style=\"color:'+C+';\">'+t+\"</span>\");D&&(t='<span style=\"'+D+';\">'+t+\"</span>\");return t};\nSocialCalc.FormatNumber.formatTextWithFormat=function(a,c){var b=SocialCalc.FormatNumber,d=a+\"\",e=\"\",f,g,l=\"\",h=\"\";b.parse_format_string(b.format_definitions,c);thisformat=b.format_definitions[c];if(!thisformat)throw\"Format not parsed error!\";f=thisformat.sectioninfo.length-1;if(0==f)f=0;else if(3==f)f=3;else return d;for(f=thisformat.sectioninfo[f].sectionstart;op=thisformat.operators[f];)g=thisformat.operands[f++],op==b.commands.copy?e=\"@\"==g?e+d:e+g.replace(/ /g,\" \"):op==b.commands.color?\nl=g:op==b.commands.style&&(h=g);l&&(e='<span style=\"color:'+l+';\">'+e+\"</span>\");h&&(e='<span style=\"'+h+';\">'+e+\"</span>\");return e};\nSocialCalc.FormatNumber.parse_format_string=function(a,c){var b=SocialCalc.FormatNumber,d,e,f=1,g,l,h,m,p,r,q,n,s,t,u,w,v;if(!a[c]){d={operators:[],operands:[],sectioninfo:[{}]};a[c]=d;e=0;sectioninfo=d.sectioninfo[e];sectioninfo.sectionstart=0;sectioninfo.integerdigits=0;sectioninfo.fractiondigits=0;sectioninfo.commas=0;for(v=sectioninfo.percent=0;v<c.length;v++)if(s=c.charAt(v),p)'\"'==s?(p=0,d.operators.push(b.commands.copy),d.operands.push(r)):r+=s;else if(q)\"]\"==s?(q=0,s=SocialCalc.FormatNumber.parse_format_bracket(n),\ns.operator==b.commands.separator?sectioninfo.thousandssep=1:(s.operator==b.commands.date&&(sectioninfo.hasdate=1),s.operator==b.commands.comparison&&(d.hascomparison=1),d.operators.push(s.operator),d.operands.push(s.operand))):n+=s;else if(l)d.operators.push(b.commands.copy),d.operands.push(s),l=!1;else if(h)d.operators.push(b.commands.copy),d.operands.push(s+s+s+s+s),h=!1;else if(m)d.operators.push(b.commands.copy),d.operands.push(\" \"),m=!1;else{if(t){if(\"general\".charAt(t)==s.toLowerCase()){t++;\n7==t&&(d.operators.push(b.commands.general),d.operands.push(s),t=0);continue}t=0}if(w){if(w.charAt(0)==s){w+=s;continue}d.operators.push(b.commands.date);d.operands.push(w);sectioninfo.hasdate=1;w=\"\"}if(u)if(u+=s,s=u.toLowerCase(),s!=\"am/pm\".substring(0,s.length)&&s!=\"a/p\".substring(0,s.length))ampstr=\"\";else{if(\"am/pm\"==s||\"a/p\"==s)d.operators.push(b.commands.date),d.operands.push(u),u=\"\"}else\"#\"==s||\"0\"==s||\"?\"==s?(f?(sectioninfo.integerdigits++,sectioninfo.commas&&(sectioninfo.thousandssep=1,sectioninfo.commas=\n0),g=1,d.operators.push(b.commands.integer_placeholder)):(sectioninfo.fractiondigits++,g=1,d.operators.push(b.commands.fraction_placeholder)),d.operands.push(s)):\".\"==s?(g=0,d.operators.push(b.commands.decimal),d.operands.push(s),f=0):\"$\"==s?(g=0,d.operators.push(b.commands.currency),d.operands.push(s)):\",\"==s?g?sectioninfo.commas++:(d.operators.push(b.commands.copy),d.operands.push(s)):\"%\"==s?(g=0,sectioninfo.percent++,d.operators.push(b.commands.copy),d.operands.push(s)):'\"'==s?(g=0,p=1,r=\"\"):\"[\"==\ns?(g=0,q=1,n=\"\"):\"\\\\\"==s?(l=1,g=0):\"*\"==s?(h=1,g=0):\"_\"==s?(m=1,g=0):\";\"==s?(e++,d.sectioninfo[e]={},sectioninfo=d.sectioninfo[e],sectioninfo.sectionstart=1+d.operators.length,sectioninfo.integerdigits=0,sectioninfo.fractiondigits=0,sectioninfo.commas=0,sectioninfo.percent=0,f=1,g=0,d.operators.push(b.commands.section),d.operands.push(s)):\"g\"==s.toLowerCase()?(t=1,g=0):\"a\"==s.toLowerCase()?(u=s,g=0):0<=\"dmyhHs\".indexOf(s)?w=s:(g=0,d.operators.push(b.commands.copy),d.operands.push(s))}w&&(d.operators.push(b.commands.date),\nd.operands.push(w),sectioninfo.hasdate=1)}};\nSocialCalc.FormatNumber.parse_format_bracket=function(a){var c=SocialCalc.FormatNumber,b=SocialCalc.Constants,d={},e;\"$\"==a.charAt(0)?(d.operator=c.commands.currency,e=a.match(/^\\$(.+?)(\\-.+?){0,1}$/),d.operand=e?e[1]||b.FormatNumber_defaultCurrency||\"$\":a.substring(1)||b.FormatNumber_defaultCurrency||\"$\"):\"?$\"==a?(d.operator=c.commands.currency,d.operand=\"[?$]\"):c.allowedcolors[a.toUpperCase()]?(d.operator=c.commands.color,d.operand=c.allowedcolors[a.toUpperCase()]):(e=a.match(/^style=([^\"]*)$/))?\n(d.operator=c.commands.style,d.operand=e[1]):\",\"==a?(d.operator=c.commands.separator,d.operand=a):c.alloweddates[a.toUpperCase()]?(d.operator=c.commands.date,d.operand=c.alloweddates[a.toUpperCase()]):a.match(/^[<>=]/)?(e=a.match(/^([<>=]+)(.+)$/),d.operator=c.commands.comparison,d.operand=e[1]+\":\"+e[2]):(d.operator=c.commands.copy,d.operand=\"[\"+a+\"]\");return d};\nSocialCalc.FormatNumber.convert_date_gregorian_to_julian=function(a,c,b){b=b-32075+SocialCalc.intFunc(1461*(a+4800+SocialCalc.intFunc((c-14)/12))/4);b+=SocialCalc.intFunc(367*(c-2-12*SocialCalc.intFunc((c-14)/12))/12);return b-=SocialCalc.intFunc(3*SocialCalc.intFunc((a+4900+SocialCalc.intFunc((c-14)/12))/100)/4)};\nSocialCalc.FormatNumber.convert_date_julian_to_gregorian=function(a){var c,b,d,e;a+=68569;c=Math.floor(4*a/146097);a-=Math.floor((146097*c+3)/4);b=Math.floor(4E3*(a+1)/1461001);a=a-Math.floor(1461*b/4)+31;d=Math.floor(80*a/2447);e=a-Math.floor(2447*d/80);a=Math.floor(d/11);return{year:100*(c-49)+b+a,month:d+2-12*a,day:e}};SocialCalc.intFunc=function(a){return 0>a?-Math.floor(-a):Math.floor(a)};SocialCalc||(SocialCalc={});SocialCalc.Formula={};SocialCalc.Formula.ParseState={num:1,alpha:2,coord:3,string:4,stringquote:5,numexp1:6,numexp2:7,alphanumeric:8,specialvalue:9};SocialCalc.Formula.TokenType={num:1,coord:2,op:3,name:4,error:5,string:6,space:7};SocialCalc.Formula.CharClass={num:1,numstart:2,op:3,eof:4,alpha:5,incoord:6,error:7,quote:8,space:9,specialstart:10};\nSocialCalc.Formula.CharClassTable={\" \":9,\"!\":3,'\"':8,\"'\":8,\"#\":10,$:6,\"%\":3,\"&\":3,\"(\":3,\")\":3,\"*\":3,\"+\":3,\",\":3,\"-\":3,\".\":2,\"/\":3,0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,\":\":3,\"<\":3,\"=\":3,\">\":3,A:5,B:5,C:5,D:5,E:5,F:5,G:5,H:5,I:5,J:5,K:5,L:5,M:5,N:5,O:5,P:5,Q:5,R:5,S:5,T:5,U:5,V:5,W:5,X:5,Y:5,Z:5,\"^\":3,_:5,a:5,b:5,c:5,d:5,e:5,f:5,g:5,h:5,i:5,j:5,k:5,l:5,m:5,n:5,o:5,p:5,q:5,r:5,s:5,t:5,u:5,v:5,w:5,x:5,y:5,z:5};\nSocialCalc.Formula.UpperCaseTable={a:\"A\",b:\"B\",c:\"C\",d:\"D\",e:\"E\",f:\"F\",g:\"G\",h:\"H\",i:\"I\",j:\"J\",k:\"K\",l:\"L\",m:\"M\",n:\"N\",o:\"O\",p:\"P\",q:\"Q\",r:\"R\",s:\"S\",t:\"T\",u:\"U\",v:\"V\",w:\"W\",x:\"X\",y:\"Y\",z:\"Z\",A:\"A\",B:\"B\",C:\"C\",D:\"D\",E:\"E\",F:\"F\",G:\"G\",H:\"H\",I:\"I\",J:\"J\",K:\"K\",L:\"L\",M:\"M\",N:\"N\",O:\"O\",P:\"P\",Q:\"Q\",R:\"R\",S:\"S\",T:\"T\",U:\"U\",V:\"V\",W:\"W\",X:\"X\",Y:\"Y\",Z:\"Z\"};SocialCalc.Formula.SpecialConstants={\"#NULL!\":\"0,e#NULL!\",\"#NUM!\":\"0,e#NUM!\",\"#DIV/0!\":\"0,e#DIV/0!\",\"#VALUE!\":\"0,e#VALUE!\",\"#REF!\":\"0,e#REF!\",\"#NAME?\":\"0,e#NAME?\"};\nSocialCalc.Formula.TokenPrecedence={\"!\":1,\":\":2,\",\":2,M:-3,P:-3,\"%\":4,\"^\":5,\"*\":6,\"/\":6,\"+\":7,\"-\":7,\"&\":8,\"<\":9,\">\":9,G:9,L:9,N:9};SocialCalc.Formula.TokenOpExpansion={G:\">=\",L:\"<=\",M:\"-\",N:\"<>\",P:\"+\"};\nSocialCalc.Formula.TypeLookupTable={unaryminus:{\"n*\":\"|n*:1|\",\"e*\":\"|e*:1|\",\"t*\":\"|t*:e#VALUE!|\",b:\"|b:n|\"},unaryplus:{\"n*\":\"|n*:1|\",\"e*\":\"|e*:1|\",\"t*\":\"|t*:e#VALUE!|\",b:\"|b:n|\"},unarypercent:{\"n*\":\"|n:n%|n*:n|\",\"e*\":\"|e*:1|\",\"t*\":\"|t*:e#VALUE!|\",b:\"|b:n|\"},plus:{\"n%\":\"|n%:n%|nd:n|nt:n|ndt:n|n$:n|n:n|n*:n|b:n|e*:2|t*:e#VALUE!|\",nd:\"|n%:n|nd:nd|nt:ndt|ndt:ndt|n$:n|n:nd|n*:n|b:n|e*:2|t*:e#VALUE!|\",nt:\"|n%:n|nd:ndt|nt:nt|ndt:ndt|n$:n|n:nt|n*:n|b:n|e*:2|t*:e#VALUE!|\",ndt:\"|n%:n|nd:ndt|nt:ndt|ndt:ndt|n$:n|n:ndt|n*:n|b:n|e*:2|t*:e#VALUE!|\",\nn$:\"|n%:n|nd:n|nt:n|ndt:n|n$:n$|n:n$|n*:n|b:n|e*:2|t*:e#VALUE!|\",nl:\"|n%:n|nd:n|nt:n|ndt:n|n$:n|n:n|n*:n|b:n|e*:2|t*:e#VALUE!|\",n:\"|n%:n|nd:nd|nt:nt|ndt:ndt|n$:n$|n:n|n*:n|b:n|e*:2|t*:e#VALUE!|\",b:\"|n%:n%|nd:nd|nt:nt|ndt:ndt|n$:n$|n:n|n*:n|b:n|e*:2|t*:e#VALUE!|\",\"t*\":\"|n*:e#VALUE!|t*:e#VALUE!|b:e#VALUE!|e*:2|\",\"e*\":\"|e*:1|n*:1|t*:1|b:1|\"},concat:{t:\"|t:t|th:th|tw:tw|tl:t|tr:tr|t*:2|e*:2|\",th:\"|t:th|th:th|tw:t|tl:th|tr:t|t*:t|e*:2|\",tw:\"|t:tw|th:t|tw:tw|tl:tw|tr:tw|t*:t|e*:2|\",tl:\"|t:tl|th:th|tw:tw|tl:tl|tr:tr|t*:t|e*:2|\",\n\"t*\":\"|t*:t|e*:2|\",\"e*\":\"|e*:1|n*:1|t*:1|\"},oneargnumeric:{\"n*\":\"|n*:n|\",\"e*\":\"|e*:1|\",\"t*\":\"|t*:e#VALUE!|\",b:\"|b:n|\"},twoargnumeric:{\"n*\":\"|n*:n|t*:e#VALUE!|e*:2|\",\"e*\":\"|e*:1|n*:1|t*:1|\",\"t*\":\"|t*:e#VALUE!|n*:e#VALUE!|e*:2|\"},propagateerror:{\"n*\":\"|n*:2|e*:2|\",\"e*\":\"|e*:2|\",\"t*\":\"|t*:2|e*:2|\",b:\"|b:2|e*:2|\"}};\nSocialCalc.Formula.ParseFormulaIntoTokens=function(a){var c,b,d,e,f,g;c=SocialCalc.Formula;var l=SocialCalc.Constants,h=c.ParseState,m=c.TokenType,p=c.CharClass,r=c.CharClassTable,q=c.UpperCaseTable,n=c.ParsePushToken,s=/^\\$?[A-Z]{1,2}\\$?[1-9]\\d*$/i,t=[],u=\"\";f=0;e=!1;for(c=0;c<=a.length;c++)c<a.length?(b=a.charAt(c),d=r[b]):(b=\"\",d=p.eof),f==h.num&&(d==p.num?u+=b:d!=p.numstart||e?\"E\"==b||\"e\"==b?(u+=b,e=!1,f=h.numexp1):(n(t,u,m.num,0),e=!1,f=0):(e=!0,u+=b)),f==h.numexp1&&(d==h.num?f=h.numexp2:\"+\"!=\nb&&\"-\"!=b||\"E\"!=q[u.charAt(u.length-1)]?\"E\"!=b&&\"e\"!=b&&(n(t,l.s_parseerrexponent,m.error,0),f=0):u+=b),f==h.numexp2&&(d==p.num?u+=b:(n(t,u,m.num,0),f=0)),f==h.alpha&&(d==p.num?f=h.coord:d==p.alpha||\".\"==b?u+=b:d==p.incoord?f=h.coord:(d==p.op||d==p.numstart||d==p.space||d==p.eof?n(t,u.toUpperCase(),m.name,0):n(t,l.s_parseerrchar,m.error,0),f=0)),f==h.coord&&(d==p.num?u+=b:d==p.incoord?u+=b:d==p.alpha?f=h.alphanumeric:(d==p.op||d==p.numstart||d==p.eof||d==p.space?(f=s.test(u)?m.coord:m.name,n(t,u.toUpperCase(),\nf,0)):n(t,l.s_parseerrchar,m.error,0),f=0)),f==h.alphanumeric&&(d==p.num||d==p.alpha?u+=b:(d==p.op||d==p.numstart||d==p.space||d==p.eof?n(t,u.toUpperCase(),m.name,0):n(t,l.s_parseerrchar,m.error,0),f=0)),f==h.string?d==p.quote?f=h.stringquote:d==p.eof?(n(t,l.s_parseerrstring,m.error,0),f=0):u+=b:f==h.stringquote?d==p.quote?(u+=b,f=h.string):(n(t,u,m.string,0),f=0):f==h.specialvalue&&(\"!\"==u.charAt(u.length-1)?(n(t,u,m.name,0),f=0):d==p.eof?(n(t,l.s_parseerrspecialvalue,m.error,0),f=0):u+=b),0==f&&\n(d==p.num?(u=b,f=h.num):d==p.numstart?(u=b,e=!0,f=h.num):d==p.alpha||d==p.incoord?(u=b,f=h.alpha):d==p.specialstart?(u=b,f=h.specialvalue):d==p.op?(u=b,0<t.length?(f=t[t.length-1],d=f.type,g=f.text,d!=p.op||\"<\"!=g&&\">\"!=g||(u=g+u,t.pop(),0<t.length?(f=t[t.length-1],d=f.type,g=f.text):(d=p.eof,g=\"EOF\"))):(d=p.eof,g=\"EOF\"),f=m.op,0==t.length||d==p.op&&\")\"!=g&&\"%\"!=g?\"-\"==u?b=u=\"M\":\"+\"==u?b=u=\"P\":\")\"==u&&\"(\"==g||\"(\"==u||(f=m.error,u=l.s_parseerrtwoops):1<u.length&&(\">=\"==u?b=u=\"G\":\"<=\"==u?b=u=\"L\":\"<>\"==\nu?b=u=\"N\":(f=m.error,u=l.s_parseerrtwoops)),n(t,u,f,b),f=0):d==p.quote?(u=\"\",f=h.string):d!=p.space&&d!=p.eof&&n(t,l.s_parseerrchar,m.error,0));return t};SocialCalc.Formula.ParsePushToken=function(a,c,b,d){a.push({text:c,type:b,opcode:d})};SocialCalc.Formula.evaluate_parsed_formula=function(a,c,b){var d=SocialCalc.Formula,e;e=d.ConvertInfixToPolish(a);return d.EvaluatePolish(a,e,c,b)};\nSocialCalc.Formula.ConvertInfixToPolish=function(a){var c=SocialCalc.Formula,b=SocialCalc.Constants,d=c.TokenType,c=c.TokenPrecedence,e=[],f=[],g=\"\",l,h,m,p;for(l=0;l<a.length;l++)if(h=a[l],m=h.type,p=h.text,m==d.num||m==d.coord||m==d.string)e.push(l);else if(m==d.name)f.push(l),e.push(-1);else if(m!=d.space)if(\",\"==p){for(;f.length&&\"(\"!=a[f[f.length-1]].text;)e.push(f.pop());if(0==f.length){g=b.s_parseerrmissingopenparen;break}}else if(\"(\"==p)f.push(l);else if(\")\"==p){for(;f.length&&\"(\"!=a[f[f.length-\n1]].text;)e.push(f.pop());if(0==f.length){g=b.s_parseerrcloseparennoopen;break}f.pop();f.length&&a[f[f.length-1]].type==d.name&&e.push(f.pop())}else if(m==d.op){for(f.length&&a[f[f.length-1]].type==d.name&&e.push(f.pop());f.length&&a[f[f.length-1]].type==d.op&&\"(\"!=a[f[f.length-1]].text;){m=c[h.opcode];p=c[a[f[f.length-1]].opcode];if(0<=m&&m<p)break;else if(0>m&&(m=-m,0>p&&(p=-p),m<=p))break;e.push(f.pop())}f.push(l)}else{g=m==d.error?p:\"Internal error while processing parsed formula. \";break}for(;0<\nf.length;){if(\"(\"==a[f[f.length-1]].text){g=b.s_parseerrmissingcloseparen;break}e.push(f.pop())}return g?g:e};\nSocialCalc.Formula.EvaluatePolish=function(a,c,b,d){var e=SocialCalc.Formula,f=SocialCalc.Constants,g=e.TokenType,l=e.LookupResultType,h=e.TypeLookupTable,m=e.OperandAsNumber,p=e.OperandAsText,r=e.OperandValueAndType,q=e.OperandsAsCoordOnSheet,n=SocialCalc.format_number_for_display||function(a,c,b){return a+\"\"},s=\"\",t={value:\"\",type:\"e#VALUE!\",error:f.s_parseerrmissingoperand},u=[],w=function(a,c){u.push({type:a,value:c})},v,x,y,z,C,D;if(!(a.length&&c instanceof Array))return{value:\"\",type:\"e#VALUE!\",\nerror:\"string\"==typeof c?c:\"\"};for(v=0;v<c.length;v++)if(x=c[v],-1==x)w(\"start\",0);else if(x=a[x],y=x.type,x=x.text,y==g.num)w(\"n\",x-0);else if(y==g.coord)w(\"coord\",x);else if(y==g.string)w(\"t\",x);else if(y==g.op){if(0>=u.length)return t;if(\"M\"==x)y=m(b,u),x=l(y.type,y.type,h.unaryminus),w(x,-y.value);else if(\"P\"==x)y=m(b,u),x=l(y.type,y.type,h.unaryplus),w(x,y.value);else if(\"%\"==x)y=m(b,u),x=l(y.type,y.type,h.unarypercent),w(x,.01*y.value);else if(\"&\"==x){if(1>=u.length)return t;z=p(b,u);y=p(b,\nu);x=l(y.type,y.type,h.concat);w(x,y.value+z.value)}else if(\":\"==x){if(1>=u.length)return t;y=e.OperandsAsRangeOnSheet(b,u);y.error&&(s=s||y.error);w(y.type,y.value)}else if(\"!\"==x){if(1>=u.length)return t;y=q(b,u);y.error&&(s=s||y.error);w(y.type,y.value)}else if(\"<\"==x||\"L\"==x||\"=\"==x||\"G\"==x||\">\"==x||\"N\"==x){if(1>=u.length){s=f.s_parseerrmissingoperand;break}z=r(b,u);y=r(b,u);\"n\"==y.type.charAt(0)&&\"n\"==z.type.charAt(0)?(C=0,\"<\"==x?C=y.value<z.value?1:0:\"L\"==x?C=y.value<=z.value?1:0:\"=\"==x?C=y.value==\nz.value?1:0:\"G\"==x?C=y.value>=z.value?1:0:\">\"==x?C=y.value>z.value?1:0:\"N\"==x&&(C=y.value!=z.value?1:0),w(\"nl\",C)):\"e\"==y.type.charAt(0)?w(y.type,0):\"e\"==z.type.charAt(0)?w(z.type,0):(C=y.type.charAt(0),D=z.type.charAt(0),\"n\"==C?y.value=n(y.value,\"n\",\"\"):\"b\"==C&&(y.value=\"\"),\"n\"==D?z.value=n(z.value,\"n\",\"\"):\"b\"==D&&(z.value=\"\"),C=0,y.value=y.value.toLowerCase(),z.value=z.value.toLowerCase(),\"<\"==x?C=y.value<z.value?1:0:\"L\"==x?C=y.value<=z.value?1:0:\"=\"==x?C=y.value==z.value?1:0:\"G\"==x?C=y.value>=\nz.value?1:0:\">\"==x?C=y.value>z.value?1:0:\"N\"==x&&(C=y.value!=z.value?1:0),w(\"nl\",C))}else{if(1>=u.length){s=f.s_parseerrmissingoperand;break}z=m(b,u);y=m(b,u);\"+\"==x?(x=l(y.type,z.type,h.plus),w(x,y.value+z.value)):\"-\"==x?(x=l(y.type,z.type,h.plus),w(x,y.value-z.value)):\"*\"==x?(x=l(y.type,z.type,h.plus),w(x,y.value*z.value)):\"/\"==x?0!=z.value?w(\"n\",y.value/z.value):w(\"e#DIV/0!\",0):\"^\"==x&&(y.value=Math.pow(y.value,z.value),y.type=\"n\",isNaN(y.value)&&(y.value=0,y.type=\"e#NUM!\"),w(y.type,y.value))}}else if(y==\ng.name){if(s=e.CalculateFunction(x,u,b))break}else{s=f.s_InternalError+\"Unknown token \"+y+\" (\"+x+\"). \";break}value=u[0]?u[0].value:\"\";C=u[0]?u[0].type:\"\";\"name\"==C&&(y=SocialCalc.Formula.LookupName(b,value),value=y.value,C=y.type,s=s||y.error);\"coord\"==C&&(y=r(b,u),value=y.value,C=y.type,\"b\"==C&&(C=\"n\",value=0));1<u.length&&!s&&(s+=f.s_parseerrerrorinformula);a=C;\"e\"==C.charAt(0)?s=s||C.substring(1)||f.s_calcerrerrorvalueinformula:\"range\"==C&&(c=value.match(/^(.*)\\|(.*)\\|/),b=c[1].indexOf(\"!\"),c[1]=\n0<=b?c[1].substring(b+1)+\"!\"+c[1].substring(0,b).toUpperCase():c[1].toUpperCase(),value=c[1]+\":\"+c[2].toUpperCase(),d||(s=f.s_formularangeresult+\" \"+value));s&&\"e\"!=a.charAt(0)&&(value=s,a=\"e\");\"n\"!=a.charAt(0)||!isNaN(value)&&isFinite(value)||(value=0,a=\"e#NUM!\",s=isNaN(value)?f.s_calcerrnumericnan:f.s_calcerrnumericoverflow);return{value:value,type:a,error:s}};\nSocialCalc.Formula.LookupResultType=function(a,c,b){var d,e;e=b[a];if(!e&&(e=b[a.charAt(0)+\"*\"],!e))return\"e#VALUE! (internal error, missing LookupResultType \"+a.charAt(0)+\"*)\";b=e.indexOf(\"|\"+c+\":\");if(0<=b){d=e.indexOf(\"|\",b+1);if(0>d)return\"e#VALUE! (internal error, incorrect LookupResultType \"+e+\")\";e=e.substring(b+c.length+2,d);return\"1\"==e?a:\"2\"==e?c:e}b=e.indexOf(\"|\"+c.charAt(0)+\"*:\");if(0<=b){d=e.indexOf(\"|\",b+1);if(0>d)return\"e#VALUE! (internal error, incorrect LookupResultType \"+e+\")\";e=\ne.substring(b+4,d);return\"1\"==e?a:\"2\"==e?c:e}return\"e#VALUE!\"};SocialCalc.Formula.TopOfStackValueAndType=function(a,c){var b=SocialCalc.Formula,d={type:\"\",value:\"\"},e=c.length;if(!e)return d.error=SocialCalc.Constants.s_InternalError+\"no operand on stack\",d;d.value=c[e-1].value;d.type=c[e-1].type;c.pop();\"name\"==d.type&&(d=b.LookupName(a,d.value));return d};\nSocialCalc.Formula.OperandAsNumber=function(a,c){var b,d=SocialCalc.Formula.OperandValueAndType(a,c);b=d.type.charAt(0);\"n\"==b?d.value-=0:\"b\"==b?(d.type=\"n\",d.value=0):\"e\"==b?d.value=0:(b=SocialCalc.DetermineValueType?SocialCalc.DetermineValueType(d.value):{value:d.value-0,type:\"n\"},\"n\"==b.type.charAt(0)?d.value=b.value-0:d.value=0,d.type=b.type);return d};\nSocialCalc.Formula.OperandAsText=function(a,c){var b,d=SocialCalc.Formula.OperandValueAndType(a,c);b=d.type.charAt(0);\"t\"!=b&&(\"n\"==b?(d.value=SocialCalc.format_number_for_display?SocialCalc.format_number_for_display(d.value,d.type,\"\"):d.value+=\"\",d.type=\"t\"):\"b\"==b?(d.value=\"\",d.type=\"t\"):\"e\"==b?d.value=\"\":(c.value=d.value+\"\",c.type=\"t\"));return d};\nSocialCalc.Formula.OperandValueAndType=function(a,c){var b,d,e;b=SocialCalc.Formula;var f={type:\"\",value:\"\"};d=c.length;if(!d)return f.error=SocialCalc.Constants.s_InternalError+\"no operand on stack\",f;f.value=c[d-1].value;f.type=c[d-1].type;c.pop();\"name\"==f.type&&(f=b.LookupName(a,f.value));\"range\"==f.type&&(f=b.StepThroughRangeDown(c,f.value));if(\"coord\"==f.type){e=a;d=f.value.indexOf(\"!\");if(-1!=d){e=b.FindInSheetCache(f.value.substring(d+1));if(null==e)return f.type=\"e#REF!\",f.error=SocialCalc.Constants.s_sheetunavailable+\n\" \"+f.value.substring(d+1),f.value=0,f;f.value=f.value.substring(0,d)}e?(d=e.cells[SocialCalc.Formula.PlainCoord(f.value)])?(b=d.valuetype,f.value=d.datavalue):b=\"b\":(b=\"e#N/A\",f.value=0);f.type=b||\"b\";\"b\"==f.type&&(f.value=0)}return f};\nSocialCalc.Formula.OperandAsCoord=function(a,c){var b={type:\"\",value:\"\"},d=c.length;b.value=c[d-1].value;b.type=c[d-1].type;c.pop();\"name\"==b.type&&(b=SocialCalc.Formula.LookupName(a,b.value));\"coord\"!=b.type&&(b.value=SocialCalc.Constants.s_calcerrcellrefmissing,b.type=\"e#REF!\");return b};\nSocialCalc.Formula.OperandsAsCoordOnSheet=function(a,c){var b,d,e,f={},g={};e=SocialCalc.Formula;b=c.length;f.value=c[b-1].value;f.type=c[b-1].type;c.pop();b=e.OperandAsSheetName(a,c);d=e.FindInSheetCache(b.value);if(null==d)return g.type=\"e#REF!\",g.value=0,g.error=SocialCalc.Constants.s_sheetunavailable+\" \"+b.value,g;\"name\"==f.type&&(f=e.LookupName(d,f.value));g.type=f.type;\"coord\"==f.type?g.value=f.value+\"!\"+b.value:\"range\"==f.type?(e=f.value.indexOf(\"|\"),d=f.value.indexOf(\"|\",e+1),g.value=f.value.substring(0,\ne)+\"!\"+b.value+\"|\"+f.value.substring(e+1,d)+\"|\"):\"e\"==f.type.charAt(0)?g.value=f.value:(g.error=SocialCalc.Constants.s_calcerrcellrefmissing,g.type=\"e#REF!\",g.value=0);return g};\nSocialCalc.Formula.OperandsAsRangeOnSheet=function(a,c){var b,d,e,f,g={},l=SocialCalc.Formula,h=SocialCalc.Constants;b=c.length;g.value=c[b-1].value;g.type=c[b-1].type;c.pop();b=l.OperandAsCoord(a,c);if(\"coord\"!=b.type)return{value:0,type:\"e#REF!\"};d=a;e=b.value.indexOf(\"!\");if(-1!=e&&(f=b.value.indexOf(\"|\",e+1),0>f&&(f=b.value.length),d=l.FindInSheetCache(b.value.substring(e+1,f)),null==d))return{value:0,type:\"e#REF!\",errortext:h.s_sheetunavailable+\" \"+b.value.substring(e+1,f)};\"name\"==g.type&&(g=\nl.LookupName(d,g.value,\"end\"));return\"coord\"==g.type?{value:b.value+\"|\"+g.value+\"|\",type:\"range\"}:{value:h.s_calcerrcellrefmissing,type:\"e#REF!\"}};\nSocialCalc.Formula.OperandAsSheetName=function(a,c){var b,d={type:\"\",value:\"\"};b=c.length;d.value=c[b-1].value;d.type=c[b-1].type;c.pop();if(\"name\"==d.type){b=SocialCalc.Formula.LookupName(a,d.value);if(!b.value)return d;d.value=b.value;d.type=b.type}\"coord\"==d.type&&((b=a.cells[SocialCalc.Formula.PlainCoord(d.value)])?(d.value=b.datavalue,d.type=b.valuetype):(d.value=\"\",d.type=\"b\"));\"t\"!=d.type.charAt(0)&&(d.value=\"\",d.error=SocialCalc.Constants.s_calcerrsheetnamemissing);return d};\nSocialCalc.Formula.LookupName=function(a,c,b){var d,e,f=a.names;e={};d=!1;if(f[c.toUpperCase()]){e.value=f[c.toUpperCase()].definition;if(\"=\"==e.value.charAt(0)){if(!a.checknamecirc)a.checknamecirc={},d=!0;else if(a.checknamecirc[c])return e.type=\"e#NAME?\",e.error=SocialCalc.Constants.s_circularnameref+' \"'+c+'\".',e;a.checknamecirc[c]=!0;e=SocialCalc.Formula.ParseFormulaIntoTokens(e.value.substring(1));e=SocialCalc.Formula.evaluate_parsed_formula(e,a,1);delete a.checknamecirc[c];d&&delete a.checknamecirc;\nif(\"range\"!=e.type)return e}a=e.value.indexOf(\":\");-1!=a?(e.type=\"range\",e.value=e.value.substring(0,a)+\"|\"+e.value.substring(a+1)+\"|\"):e.type=\"coord\";e.value=e.value.toUpperCase()}else(d=SocialCalc.Formula.SpecialConstants[c.toUpperCase()])?(a=d.indexOf(\",\"),e.value=d.substring(0,a)-0,e.type=d.substring(a+1)):/^[a-zA-Z][a-zA-Z]?$/.test(c)?(e.type=\"coord\",e.value=c.toUpperCase()+(b?a.attribs.lastrow:1)):(e.value=\"\",e.type=\"e#NAME?\",e.error=SocialCalc.Constants.s_calcerrunknownname+' \"'+c+'\"');return e};\nSocialCalc.Formula.StepThroughRangeDown=function(a,c){var b,d,e,f,g,l,h,m,p=SocialCalc.Formula;f=c.indexOf(\"|\");e=c.indexOf(\"|\",f+1);b=c.substring(0,f);d=c.substring(f+1,e);e=c.substring(e+1)-0;f=b.indexOf(\"!\");-1!=f?(g=b.substring(f),b=b.substring(0,f)):g=\"\";f=d.indexOf(\"!\");-1!=f&&(d=d.substring(0,f));f=p.OrderRangeParts(b,d);m=0;for(h=f.r1;h<=f.r2;h++)for(l=f.c1;l<=f.c2;l++)if(m++,m>e)return h==f.r2&&l==f.c2||p.PushOperand(a,\"range\",b+g+\"|\"+d+\"|\"+m),{value:SocialCalc.crToCoord(l,h)+g,type:\"coord\"}};\nSocialCalc.Formula.DecodeRangeParts=function(a,c){var b,d,e,f,g=SocialCalc.Formula;e=c.indexOf(\"|\");f=c.indexOf(\"|\",e+1);b=c.substring(0,e);d=c.substring(e+1,f);e=b.indexOf(\"!\");-1!=e?(f=b.substring(e+1),b=b.substring(0,e)):f=\"\";e=d.indexOf(\"!\");-1!=e&&(d=d.substring(0,e));e=a;if(f&&(e=g.FindInSheetCache(f),null==e))return null;b=g.OrderRangeParts(b,d);return{sheetdata:e,sheetname:f,col1num:b.c1,ncols:b.c2-b.c1+1,row1num:b.r1,nrows:b.r2-b.r1+1}};\nSocialCalc.Formula.FunctionList||(SocialCalc.Formula.FunctionList={});SocialCalc.Formula.FunctionClasses=null;SocialCalc.Formula.FunctionArgDefs={};\nSocialCalc.Formula.CalculateFunction=function(a,c,b){var d,e,f,g=SocialCalc.Formula;e=\"\";if(d=g.FunctionList[a]){e=[];f=d[0];d=d[1];g.CopyFunctionArgs(c,e);if(100!=d)if(0>d){if(e.length<-d)return e=g.FunctionArgsError(a,c)}else if(e.length!=d)return e=g.FunctionArgsError(a,c);e=f(a,c,e,b)}else c.length&&\"start\"==c[c.length-1].type?(c.pop(),g.PushOperand(c,\"name\",a)):e=SocialCalc.Constants.s_sheetfuncunknownfunction+\" \"+a+\". \";return e};\nSocialCalc.Formula.PushOperand=function(a,c,b){a.push({type:c,value:b})};SocialCalc.Formula.CopyFunctionArgs=function(a,c){for(;0<a.length&&\"start\"!=a[a.length-1].type;)c.push(a.pop());a.pop()};SocialCalc.Formula.FunctionArgsError=function(a,c){var b=SocialCalc.Constants.s_calcerrincorrectargstofunction+\" \"+a+\". \";SocialCalc.Formula.PushOperand(c,\"e#VALUE!\",b);return b};SocialCalc.Formula.FunctionSpecificError=function(a,c,b,d){SocialCalc.Formula.PushOperand(c,b,d);return d};\nSocialCalc.Formula.CheckForErrorValue=function(a,c){return\"e\"==c.type.charAt(0)?(a.push(c),!0):!1};\nSocialCalc.Formula.FillFunctionInfo=function(){var a=SocialCalc.Formula,c=SocialCalc.Constants,b,d,e;if(!a.FunctionClasses){for(b in a.FunctionList)d=a.FunctionList[b],d[2]&&(a.FunctionArgDefs[d[2]]=c[\"s_farg_\"+d[2]]||\"\"),d[3]||c[\"s_fdef_\"+b]&&(a.FunctionList[b][3]=c[\"s_fdef_\"+b]);a.FunctionClasses={};for(d=0;d<c.function_classlist.length;d++)e=c.function_classlist[d],a.FunctionClasses[e]={name:c[\"s_fclass_\"+e],items:[]};for(b in a.FunctionList)for(d=a.FunctionList[b],c=d[4]?d[4].split(\",\"):[],c.push(\"all\"),\nd=0;d<c.length;d++)e=c[d],a.FunctionClasses[e].items.push(b);for(e in a.FunctionClasses)a.FunctionClasses[e].items.sort()}};SocialCalc.Formula.FunctionArgString=function(a){var c=SocialCalc.Formula;a=c.FunctionList[a];var b;b=a[2];if(!b)if(a=a[1],0==a)b=\" \";else{if(0<a){b=\"v1\";for(c=2;c<=a;c++)b+=\", v\"+c;return b}if(0>a){b=\"v1\";for(c=2;c<-a;c++)b+=\", v\"+c;return b+\", ...\"}return\"nargs: \"+a}return b=c.FunctionArgDefs[b]||b};\nSocialCalc.Formula.SeriesFunctions=function(a,c,b,d){var e,f;e=SocialCalc.Formula;for(var g=e.OperandValueAndType,l=e.LookupResultType,h=e.TypeLookupTable.plus,m=function(a,b){c.push({type:a,value:b})},p=0,r=\"\",q=0,n=0,s=0,t=1,u,w,v,x,y,z;0<b.length;)e=g(d,b),f=e.type.charAt(0),\"n\"==f&&(q+=1),\"b\"!=f&&(n+=1),\"b\"==f&&(s+=1),\"n\"==f?(f=e.value-0,p+=f,t*=f,u=void 0!=u?f>u?f:u:f,w=void 0!=w?f<w?f:w:f,1==q?(y=f,z=0):(v=y+(f-y)/q,z=x=z+(f-y)*(f-v),y=v),r=l(e.type,r||e.type,h)):\"e\"==f&&\"e\"!=r.charAt(0)&&(r=\ne.type);r=r||\"n\";switch(a){case \"SUM\":m(r,p);break;case \"PRODUCT\":m(r,t);break;case \"MIN\":m(r,w||0);break;case \"MAX\":m(r,u||0);break;case \"COUNT\":m(\"n\",q);break;case \"COUNTA\":m(\"n\",n);break;case \"COUNTBLANK\":m(\"n\",s);break;case \"AVERAGE\":0<q?m(r,p/q):m(\"e#DIV/0!\",0);break;case \"STDEV\":1<q?m(r,Math.sqrt(x/(q-1))):m(\"e#DIV/0!\",0);break;case \"STDEVP\":1<q?m(r,Math.sqrt(x/q)):m(\"e#DIV/0!\",0);break;case \"VAR\":1<q?m(r,x/(q-1)):m(\"e#DIV/0!\",0);break;case \"VARP\":1<q?m(r,x/q):m(\"e#DIV/0!\",0)}return null};\nSocialCalc.Formula.FunctionList.AVERAGE=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.COUNT=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.COUNTA=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.COUNTBLANK=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.MAX=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];\nSocialCalc.Formula.FunctionList.MIN=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.PRODUCT=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.STDEV=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.STDEVP=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.SUM=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];\nSocialCalc.Formula.FunctionList.VAR=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];SocialCalc.Formula.FunctionList.VARP=[SocialCalc.Formula.SeriesFunctions,-1,\"vn\",null,\"stat\"];\nSocialCalc.Formula.SumProductFunction=function(a,c,b,d){for(var e=[],f=0,g=SocialCalc.Formula,l=0,h=0,m=function(a,b){c.push({type:a,value:b})};0<b.length;){a=g.TopOfStackValueAndType(d,b);if(\"range\"!=a.type){m(\"e#VALUE!\",0);return}rangeinfo=g.DecodeRangeParts(d,a.value);if(!l)l=rangeinfo.ncols;else if(l!=rangeinfo.ncols){m(\"e#VALUE!\",0);return}if(!h)h=rangeinfo.nrows;else if(h!=rangeinfo.nrows){m(\"e#VALUE!\",0);return}for(i=0;i<rangeinfo.ncols;i++)for(j=0;j<rangeinfo.nrows;j++)k=i*rangeinfo.nrows+\nj,cellcr=SocialCalc.crToCoord(rangeinfo.col1num+i,rangeinfo.row1num+j),cell=rangeinfo.sheetdata.GetAssuredCell(cellcr),value=\"n\"==cell.valuetype?cell.datavalue:0,e[k]=(e[k]||1)*value}for(i=0;i<e.length;i++)f+=e[i];m(\"n\",f)};SocialCalc.Formula.FunctionList.SUMPRODUCT=[SocialCalc.Formula.SumProductFunction,-1,\"rangen\",\"\",\"stat\"];\nSocialCalc.Formula.DSeriesFunctions=function(a,c,b,d){var e,f,g,l,h,m,p,r,q=SocialCalc.Formula,n=q.LookupResultType,s=q.TypeLookupTable.plus,t=function(a,b){c.push({type:a,value:b})};f=e=void 0;var u=0,w=\"\",v=0,x=0,y=1,z,C,D,G,I;g=q.TopOfStackValueAndType(d,b);l=q.OperandValueAndType(d,b);h=q.TopOfStackValueAndType(d,b);if(\"range\"!=g.type||\"range\"!=h.type)return q.FunctionArgsError(a,c);b=q.DecodeRangeParts(d,g.value);d=q.DecodeRangeParts(d,h.value);l=q.FieldToColnum(b.sheetdata,b.col1num,b.ncols,\nb.row1num,l.value,l.type);if(0>=l)t(\"e#VALUE!\",0);else{l=b.col1num+l-1;h=[];for(g=0;g<d.ncols;g++){m=d.sheetdata.GetAssuredCell(SocialCalc.crToCoord(d.col1num+g,d.row1num));criterianum=q.FieldToColnum(b.sheetdata,b.col1num,b.ncols,b.row1num,m.datavalue,m.valuetype);if(0>=criterianum){t(\"e#VALUE!\",0);return}h.push(b.col1num+criterianum-1)}for(g=1;g<b.nrows;g++){p=!1;e=1;a:for(;e<d.nrows;e++){for(f=0;f<d.ncols;f++)if(r=SocialCalc.crToCoord(d.col1num+f,d.row1num+e),m=d.sheetdata.GetAssuredCell(r),r=\nm.datavalue,\"string\"!=typeof r||0!=r.length)if(m=h[f],m=SocialCalc.crToCoord(m,b.row1num+g),m=d.sheetdata.GetAssuredCell(m),!q.TestCriteria(m.datavalue,m.valuetype||\"b\",r))continue a;p=!0;break a}p&&(e=SocialCalc.crToCoord(l,b.row1num+g),m=b.sheetdata.GetAssuredCell(e),e=m.datavalue,f=m.valuetype,p=f.charAt(0),\"n\"==p&&(v+=1),\"b\"!=p&&(x+=1),\"n\"==p?(v1=e-0,u+=v1,y*=v1,z=void 0!=z?v1>z?v1:z:v1,C=void 0!=C?v1<C?v1:C:v1,1==v?(G=v1,I=0):(e=G+(v1-G)/v,I=D=I+(v1-G)*(v1-e),G=e),w=n(f,w||f,s)):\"e\"==p&&\"e\"!=\nw.charAt(0)&&(w=f))}w=w||\"n\";switch(a){case \"DSUM\":t(w,u);break;case \"DPRODUCT\":t(w,y);break;case \"DMIN\":t(w,C||0);break;case \"DMAX\":t(w,z||0);break;case \"DCOUNT\":t(\"n\",v);break;case \"DCOUNTA\":t(\"n\",x);break;case \"DAVERAGE\":0<v?t(w,u/v):t(\"e#DIV/0!\",0);break;case \"DSTDEV\":1<v?t(w,Math.sqrt(D/(v-1))):t(\"e#DIV/0!\",0);break;case \"DSTDEVP\":1<v?t(w,Math.sqrt(D/v)):t(\"e#DIV/0!\",0);break;case \"DVAR\":1<v?t(w,D/(v-1)):t(\"e#DIV/0!\",0);break;case \"DVARP\":1<v?t(w,D/v):t(\"e#DIV/0!\",0);break;case \"DGET\":1==v?t(w,\nu):0==v?t(\"e#VALUE!\",0):t(\"e#NUM!\",0)}}};SocialCalc.Formula.FunctionList.DAVERAGE=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DCOUNT=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DCOUNTA=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DGET=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];\nSocialCalc.Formula.FunctionList.DMAX=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DMIN=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DPRODUCT=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DSTDEV=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DSTDEVP=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];\nSocialCalc.Formula.FunctionList.DSUM=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DVAR=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.DVARP=[SocialCalc.Formula.DSeriesFunctions,3,\"dfunc\",\"\",\"stat\"];\nSocialCalc.Formula.FieldToColnum=function(a,c,b,d,e,f){var g;if(\"n\"==f.charAt(0))return f=e-0,0>=f||f>b?0:Math.floor(f);if(\"t\"!=f.charAt(0))return 0;e=e?e.toLowerCase():\"\";for(f=0;f<b;f++)if(g=a.GetAssuredCell(SocialCalc.crToCoord(c+f,d)),g=g.datavalue,g=(g+\"\").toLowerCase(),g==e)return f+1;return 0};\nSocialCalc.Formula.LookupFunctions=function(a,c,b,d){var e,f,g,l,h,m,p,r,q,n,s;s=SocialCalc.Formula;e=s.OperandValueAndType;var t=function(a,b){c.push({type:a,value:b})};e=e(d,b);\"string\"==typeof e.value&&(e.value=e.value.toLowerCase());f=s.TopOfStackValueAndType(d,b);g=1;if(\"MATCH\"==a){if(b.length){g=s.OperandAsNumber(d,b);if(\"n\"!=g.type.charAt(0)){t(\"e#VALUE!\",0);return}if(b.length)return s.FunctionArgsError(a,c),0;g=g.value-0}}else{l=s.OperandAsNumber(d,b);if(\"n\"!=l.type.charAt(0)){t(\"e#VALUE!\",\n0);return}l=Math.floor(l.value);if(b.length){g=s.OperandAsNumber(d,b);if(\"n\"!=g.type.charAt(0)){t(\"e#VALUE!\",0);return}if(b.length)return s.FunctionArgsError(a,c),0;g=g.value?1:0}}e.type=e.type.charAt(0);\"n\"==e.type&&(e.value-=0);if(\"range\"!=f.type)return s.FunctionArgsError(a,c),0;if(b=s.DecodeRangeParts(d,f.value,f.type)){m=h=f=d=0;if(\"HLOOKUP\"==a){if(h=1,l>b.nrows){t(\"e#REF!\",0);return}}else if(\"VLOOKUP\"==a){if(m=1,l>b.ncols){t(\"e#REF!\",0);return}}else if(\"MATCH\"==a)if(1<b.ncols){if(1<b.nrows){t(\"e#N/A\",\n0);return}h=1}else m=1;else return s.FunctionArgsError(a,c),0;if(1>l&&\"MATCH\"!=a)return t(\"e#VALUE!\",0),0;for(;;){s=SocialCalc.crToCoord(b.col1num+d,b.row1num+f);n=b.sheetdata.GetAssuredCell(s);s=n.datavalue;n=n.valuetype?n.valuetype.charAt(0):\"b\";\"n\"==n&&(s-=0);if(g)if(\"n\"==e.type&&\"n\"==n){if(e.value==s)break;if(0<g&&e.value>s||0>g&&e.value<s)p=1,r=d,q=f;else if(p){p=2;break}}else{if(\"t\"==e.type&&\"t\"==n){s=\"string\"==typeof s?s.toLowerCase():\"\";if(e.value==s)break;if(0<g&&e.value>s||0>g&&e.value<\ns)p=1,r=d,q=f;else if(p){p=2;break}}}else if(\"n\"==e.type&&\"n\"==n){if(e.value==s)break}else if(\"t\"==e.type&&\"t\"==n&&(s=\"string\"==typeof s?s.toLowerCase():\"\",e.value==s))break;f+=m;d+=h;if(f>=b.nrows||d>=b.ncols){if(p){p=2;break}t(\"e#N/A\",0);return}}2==p&&(f=q,d=r);\"MATCH\"==a?(s=d+f+1,n=\"n\"):(s=SocialCalc.crToCoord(b.col1num+d+(\"VLOOKUP\"==a?l-1:0),b.row1num+f+(\"HLOOKUP\"==a?l-1:0)),n=b.sheetdata.GetAssuredCell(s),s=n.datavalue,n=n.valuetype);t(n,s)}else t(\"e#REF!\",0)};\nSocialCalc.Formula.FunctionList.HLOOKUP=[SocialCalc.Formula.LookupFunctions,-3,\"hlookup\",\"\",\"lookup\"];SocialCalc.Formula.FunctionList.MATCH=[SocialCalc.Formula.LookupFunctions,-2,\"match\",\"\",\"lookup\"];SocialCalc.Formula.FunctionList.VLOOKUP=[SocialCalc.Formula.LookupFunctions,-3,\"vlookup\",\"\",\"lookup\"];\nSocialCalc.Formula.IndexFunction=function(a,c,b,d){var e,f,g,l,h=SocialCalc.Formula,m=function(a,b){c.push({type:a,value:b})};e=h.TopOfStackValueAndType(d,b);if(\"range\"!=e.type)return h.FunctionArgsError(a,c),0;f=h.DecodeRangeParts(d,e.value,e.type);e=f.sheetname?\"!\"+f.sheetname:\"\";g={value:0};l={value:0};if(b.length){g=h.OperandAsNumber(d,b);if(\"n\"!=g.type.charAt(0)||0>g.value){m(\"e#VALUE!\",0);return}if(b.length){l=h.OperandAsNumber(d,b);if(\"n\"!=l.type.charAt(0)||0>l.value){m(\"e#VALUE!\",0);return}if(b.length)return h.FunctionArgsError(a,\nc),0}else 1==f.nrows&&(l.value=g.value,g.value=0)}g.value>f.nrows||l.value>f.ncols?m(\"e#REF!\",0):(0==g.value?0==l.value?1==f.nrows&&1==f.ncols?(a=SocialCalc.crToCoord(f.col1num,f.row1num)+e,b=\"coord\"):(a=SocialCalc.crToCoord(f.col1num,f.row1num)+e+\"|\"+SocialCalc.crToCoord(f.col1num+f.ncols-1,f.row1num+f.nrows-1)+\"|\",b=\"range\"):1==f.nrows?(a=SocialCalc.crToCoord(f.col1num+l.value-1,f.row1num)+e,b=\"coord\"):(a=SocialCalc.crToCoord(f.col1num+l.value-1,f.row1num)+e+\"|\"+SocialCalc.crToCoord(f.col1num+l.value-\n1,f.row1num+f.nrows-1)+\"|\",b=\"range\"):0==l.value?1==f.ncols?(a=SocialCalc.crToCoord(f.col1num,f.row1num+g.value-1)+e,b=\"coord\"):(a=SocialCalc.crToCoord(f.col1num,f.row1num+g.value-1)+e+\"|\"+SocialCalc.crToCoord(f.col1num+f.ncols-1,f.row1num+g.value-1)+\"|\",b=\"range\"):(a=SocialCalc.crToCoord(f.col1num+l.value-1,f.row1num+g.value-1)+e,b=\"coord\"),m(b,a))};SocialCalc.Formula.FunctionList.INDEX=[SocialCalc.Formula.IndexFunction,-1,\"index\",\"\",\"lookup\"];\nSocialCalc.Formula.CountifSumifFunctions=function(a,c,b,d){var e,f,g,l,h=0,m=\"\",p=0,r=SocialCalc.Formula,q=r.OperandValueAndType,n=r.LookupResultType,s=r.TypeLookupTable.plus;e=r.TopOfStackValueAndType(d,b);f=r.OperandAsText(d,b);if(\"SUMIF\"==a)if(1==b.length)g=r.TopOfStackValueAndType(d,b);else if(0==b.length)g={value:e.value,type:e.type};else return r.FunctionArgsError(a,c),0;else g={value:e.value,type:e.type};\"n\"==f.type.charAt(0)?f.value+=\"\":\"e\"==f.type.charAt(0)?f.value=null:\"b\"==f.type.charAt(0)&&\n(f.value=null);if(\"coord\"!=e.type&&\"range\"!=e.type||\"SUMIF\"==a&&\"coord\"!=g.type&&\"range\"!=g.type)return r.FunctionArgsError(a,c),0;b.push(e);e=[];for(e.push(g);b.length;)g=q(d,b),l=q(d,e),r.TestCriteria(g.value,g.type,f.value)&&(p+=1,\"n\"==l.type.charAt(0)?(h+=l.value-0,m=n(l.type,m||l.type,s)):\"e\"==l.type.charAt(0)&&\"e\"!=m.charAt(0)&&(m=l.type));\"SUMIF\"==a?c.push({type:m||\"n\",value:h}):\"COUNTIF\"==a&&c.push({type:\"n\",value:p})};\nSocialCalc.Formula.FunctionList.COUNTIF=[SocialCalc.Formula.CountifSumifFunctions,2,\"rangec\",\"\",\"stat\"];SocialCalc.Formula.FunctionList.SUMIF=[SocialCalc.Formula.CountifSumifFunctions,-2,\"sumif\",\"\",\"stat\"];\nSocialCalc.Formula.SumifsFunction=function(a,c,b,d){var e,f,g,l=0,h=\"\",m=SocialCalc.Formula,p=m.OperandValueAndType,r=m.LookupResultType,q=m.TypeLookupTable.plus;g=m.TopOfStackValueAndType(d,b);if(\"coord\"!=g.type&&\"range\"!=g.type)return m.FunctionArgsError(a,c),0;for(var n=[],s=[];b.length;){e=m.TopOfStackValueAndType(d,b);f=m.OperandAsText(d,b);\"n\"==f.type.charAt(0)?f.value+=\"\":\"e\"==f.type.charAt(0)?f.value=null:\"b\"==f.type.charAt(0)&&(f.value=null);if(\"coord\"!=e.type&&\"range\"!=e.type)return m.FunctionArgsError(a,\nc),0;n.push([e]);s.push(f)}a=[];for(a.push(g);a.length;){b=p(d,a);e=!0;for(f=0;f<n.length;f++)if(g=p(d,n[f]),!m.TestCriteria(g.value,g.type,s[f].value)){e=!1;break}e&&(\"n\"==b.type.charAt(0)?(l+=b.value-0,h=r(b.type,h||b.type,q)):\"e\"==b.type.charAt(0)&&\"e\"!=h.charAt(0)&&(h=b.type))}c.push({type:h||\"n\",value:l})};SocialCalc.Formula.FunctionList.SUMIFS=[SocialCalc.Formula.SumifsFunction,-3,\"sumifs\",\"\",\"stat\"];\nSocialCalc.Formula.IfFunction=function(a,c,b,d){var e;d=SocialCalc.Formula.OperandValueAndType(d,b);e=d.type.charAt(0);if(\"n\"!=e&&\"b\"!=e)c.push({type:\"e#VALUE!\",value:0});else{e=b.pop();if(1==b.length)a=b.pop();else if(0==b.length)a={type:\"n\",value:0};else{scf.FunctionArgsError(a,c);return}c.push(d.value?e:a)}};SocialCalc.Formula.FunctionList.IF=[SocialCalc.Formula.IfFunction,-2,\"iffunc\",\"\",\"test\"];\nSocialCalc.Formula.DateFunction=function(a,c,b,d){a=SocialCalc.Formula;var e=0,f=a.OperandAsNumber(d,b),g=a.OperandAsNumber(d,b);b=a.OperandAsNumber(d,b);d=a.LookupResultType(f.type,g.type,a.TypeLookupTable.twoargnumeric);d=a.LookupResultType(d,b.type,a.TypeLookupTable.twoargnumeric);\"n\"==d.charAt(0)&&(e=SocialCalc.FormatNumber.convert_date_gregorian_to_julian(Math.floor(f.value),Math.floor(g.value),Math.floor(b.value))-SocialCalc.FormatNumber.datevalues.julian_offset,d=\"nd\");a.PushOperand(c,d,e)};\nSocialCalc.Formula.FunctionList.DATE=[SocialCalc.Formula.DateFunction,3,\"date\",\"\",\"datetime\"];SocialCalc.Formula.TimeFunction=function(a,c,b,d){a=SocialCalc.Formula;var e=0,f=a.OperandAsNumber(d,b),g=a.OperandAsNumber(d,b);b=a.OperandAsNumber(d,b);d=a.LookupResultType(f.type,g.type,a.TypeLookupTable.twoargnumeric);d=a.LookupResultType(d,b.type,a.TypeLookupTable.twoargnumeric);\"n\"==d.charAt(0)&&(e=(3600*f.value+60*g.value+b.value)/86400,d=\"nt\");a.PushOperand(c,d,e)};\nSocialCalc.Formula.FunctionList.TIME=[SocialCalc.Formula.TimeFunction,3,\"hms\",\"\",\"datetime\"];\nSocialCalc.Formula.DMYFunctions=function(a,c,b,d){var e,f=SocialCalc.Formula,g=0,l=f.OperandAsNumber(d,b),h=f.LookupResultType(l.type,l.type,f.TypeLookupTable.oneargnumeric);if(\"n\"==h.charAt(0))switch(e=SocialCalc.FormatNumber.convert_date_julian_to_gregorian(Math.floor(l.value+SocialCalc.FormatNumber.datevalues.julian_offset)),a){case \"DAY\":g=e.day;break;case \"MONTH\":g=e.month;break;case \"YEAR\":g=e.year;break;case \"WEEKDAY\":e={value:1};if(b.length){e=f.OperandAsNumber(d,b);if(\"n\"!=e.type.charAt(0)||\n1>e.value||3<e.value){f.PushOperand(c,\"e#VALUE!\",0);return}if(b.length){f.FunctionArgsError(a,c);return}}a=6;1<e.value&&--a;g=Math.floor(l.value+a)%7+(3>e.value?1:0)}f.PushOperand(c,h,g)};SocialCalc.Formula.FunctionList.DAY=[SocialCalc.Formula.DMYFunctions,1,\"v\",\"\",\"datetime\"];SocialCalc.Formula.FunctionList.MONTH=[SocialCalc.Formula.DMYFunctions,1,\"v\",\"\",\"datetime\"];SocialCalc.Formula.FunctionList.YEAR=[SocialCalc.Formula.DMYFunctions,1,\"v\",\"\",\"datetime\"];\nSocialCalc.Formula.FunctionList.WEEKDAY=[SocialCalc.Formula.DMYFunctions,-1,\"weekday\",\"\",\"datetime\"];\nSocialCalc.Formula.HMSFunctions=function(a,c,b,d){var e,f=SocialCalc.Formula,g=0,l=f.OperandAsNumber(d,b),h=f.LookupResultType(l.type,l.type,f.TypeLookupTable.oneargnumeric);if(\"n\"==h.charAt(0)){if(0>l.value){f.PushOperand(c,\"e#NUM!\",0);return}e=l.value-Math.floor(l.value);e*=24;b=Math.floor(e);e-=Math.floor(e);e*=60;d=Math.floor(e);e-=Math.floor(e);e=Math.floor(60*e+(0<=l.value?.5:-.5));\"HOUR\"==a?g=b:\"MINUTE\"==a?g=d:\"SECOND\"==a&&(g=e)}f.PushOperand(c,h,g)};\nSocialCalc.Formula.FunctionList.HOUR=[SocialCalc.Formula.HMSFunctions,1,\"v\",\"\",\"datetime\"];SocialCalc.Formula.FunctionList.MINUTE=[SocialCalc.Formula.HMSFunctions,1,\"v\",\"\",\"datetime\"];SocialCalc.Formula.FunctionList.SECOND=[SocialCalc.Formula.HMSFunctions,1,\"v\",\"\",\"datetime\"];\nSocialCalc.Formula.ExactFunction=function(a,c,b,d){a=SocialCalc.Formula;var e=0,f=\"nl\",g=a.OperandValueAndType(d,b),l=g.type.charAt(0);b=a.OperandValueAndType(d,b);d=b.type.charAt(0);\"t\"==l?\"t\"==d?e=g.value==b.value?1:0:\"b\"==d?e=g.value.length?0:1:\"n\"==d?e=g.value==b.value+\"\"?1:0:\"e\"==d?(e=b.value,f=b.type):e=0:\"n\"==l?\"n\"==d?e=g.value-0==b.value-0?1:0:\"b\"==d?e=0:\"t\"==d?e=g.value+\"\"==b.value?1:0:\"e\"==d?(e=b.value,f=b.type):e=0:\"b\"==l?\"t\"==d?e=b.value.length?0:1:\"b\"==d?e=1:\"n\"==d?e=0:\"e\"==d?(e=b.value,\nf=b.type):e=0:\"e\"==l&&(e=g.value,f=g.type);a.PushOperand(c,f,e)};SocialCalc.Formula.FunctionList.EXACT=[SocialCalc.Formula.ExactFunction,2,\"\",\"\",\"text\"];SocialCalc.Formula.ArgList={FIND:[1,1,0],LEFT:[1,0],LEN:[1],LOWER:[1],MID:[1,0,0],PROPER:[1],REPLACE:[1,0,0,1],REPT:[1,0],RIGHT:[1,0],SUBSTITUTE:[1,1,1,0],TRIM:[1],HEXCODE:[1],UPPER:[1]};\nSocialCalc.Formula.StringFunctions=function(a,c,b,d){var e,f,g,l=SocialCalc.Formula;g=0;var h=\"e#VALUE!\",m=b.length,p=l.ArgList[a],r=[],q=[];for(e=1;e<=m;e++){if(e>p.length){l.FunctionArgsError(a,c);return}0==p[e-1]?f=l.OperandAsNumber(d,b):1==p[e-1]?f=l.OperandAsText(d,b):-1==p[e-1]&&(f=l.OperandValueAndType(d,b));r[e]=f.value;q[e]=f.type;if(\"e\"==f.type.charAt(0)){l.PushOperand(c,f.type,g);return}}switch(a){case \"FIND\":g=q[3]?r[3]-1:0;0>g?g=\"Start is before string\":(g=r[2].indexOf(r[1],g),0<=g?(g+=\n1,h=\"n\"):g=\"Not found\");break;case \"LEFT\":g=q[2]?r[2]-0:1;0>g?g=\"Negative length\":(g=r[1].substring(0,g),h=\"t\");break;case \"LEN\":g=r[1].length;h=\"n\";break;case \"LOWER\":g=r[1].toLowerCase();h=\"t\";break;case \"MID\":a=r[2]-0;g=r[3]-0;1>g||1>a?g=\"Bad arguments\":(g=r[1].substring(a-1,a+g-1),h=\"t\");break;case \"PROPER\":g=r[1].replace(/\\b\\w+\\b/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1)});h=\"t\";break;case \"REPLACE\":a=r[2]-0;g=r[3]-0;0>g||1>a?g=\"Bad arguments\":(g=r[1].substring(0,a-1)+\nr[4]+r[1].substring(a-1+g),h=\"t\");break;case \"REPT\":a=r[2]-0;if(0>a)g=\"Negative count\";else{for(g=\"\";0<a;a--)g+=r[1];h=\"t\"}break;case \"RIGHT\":g=q[2]?r[2]-0:1;0>g?g=\"Negative length\":(g=r[1].slice(-g),h=\"t\");break;case \"SUBSTITUTE\":fulltext=r[1];oldtext=r[2];newtext=r[3];if(null!=r[4]){if(which=r[4]-0,0>=which){g=\"Non-positive instance number\";break}}else which=0;oldpos=a=0;for(g=\"\";;)if(pos=fulltext.indexOf(oldtext,oldpos),0<=pos){a++;g+=fulltext.substring(oldpos,pos);if(0==which)g+=newtext;else if(which==\na){g+=newtext+fulltext.substring(pos+oldtext.length);break}else g+=oldtext;oldpos=pos+oldtext.length}else{g+=fulltext.substring(oldpos);break}h=\"t\";break;case \"TRIM\":g=r[1];g=g.replace(/^ */,\"\");g=g.replace(/ *$/,\"\");g=g.replace(/ +/g,\" \");h=\"t\";break;case \"HEXCODE\":g=String(r[1]);h=g.charCodeAt(0);55296<=h&&56319>=h&&(r=g.charCodeAt(1),56320<=r&&57343>=r&&(h=1024*(h-55296)+(r-56320)+65536));g=h.toString(16).toUpperCase();h=\"t\";break;case \"UPPER\":g=r[1].toUpperCase(),h=\"t\"}l.PushOperand(c,h,g)};\nSocialCalc.Formula.FunctionList.FIND=[SocialCalc.Formula.StringFunctions,-2,\"find\",\"\",\"text\"];SocialCalc.Formula.FunctionList.LEFT=[SocialCalc.Formula.StringFunctions,-2,\"tc\",\"\",\"text\"];SocialCalc.Formula.FunctionList.LEN=[SocialCalc.Formula.StringFunctions,1,\"txt\",\"\",\"text\"];SocialCalc.Formula.FunctionList.LOWER=[SocialCalc.Formula.StringFunctions,1,\"txt\",\"\",\"text\"];SocialCalc.Formula.FunctionList.MID=[SocialCalc.Formula.StringFunctions,3,\"mid\",\"\",\"text\"];\nSocialCalc.Formula.FunctionList.PROPER=[SocialCalc.Formula.StringFunctions,1,\"v\",\"\",\"text\"];SocialCalc.Formula.FunctionList.REPLACE=[SocialCalc.Formula.StringFunctions,4,\"replace\",\"\",\"text\"];SocialCalc.Formula.FunctionList.REPT=[SocialCalc.Formula.StringFunctions,2,\"tc\",\"\",\"text\"];SocialCalc.Formula.FunctionList.RIGHT=[SocialCalc.Formula.StringFunctions,-1,\"tc\",\"\",\"text\"];SocialCalc.Formula.FunctionList.SUBSTITUTE=[SocialCalc.Formula.StringFunctions,-3,\"subs\",\"\",\"text\"];\nSocialCalc.Formula.FunctionList.TRIM=[SocialCalc.Formula.StringFunctions,1,\"v\",\"\",\"text\"];SocialCalc.Formula.FunctionList.HEXCODE=[SocialCalc.Formula.StringFunctions,1,\"v\",\"\",\"text\"];SocialCalc.Formula.FunctionList.UPPER=[SocialCalc.Formula.StringFunctions,1,\"v\",\"\",\"text\"];\nSocialCalc.Formula.IsFunctions=function(a,c,b,d){var e=SocialCalc.Formula,f=0;b=e.OperandValueAndType(d,b);d=b.type.charAt(0);switch(a){case \"ISBLANK\":f=\"b\"==b.type?1:0;break;case \"ISERR\":f=\"e\"==d?\"e#N/A\"==b.type?0:1:0;break;case \"ISERROR\":f=\"e\"==d?1:0;break;case \"ISLOGICAL\":f=\"nl\"==b.type?1:0;break;case \"ISNA\":f=\"e#N/A\"==b.type?1:0;break;case \"ISNONTEXT\":f=\"t\"==d?0:1;break;case \"ISNUMBER\":f=\"n\"==d?1:0;break;case \"ISTEXT\":f=\"t\"==d?1:0}e.PushOperand(c,\"nl\",f)};\nSocialCalc.Formula.FunctionList.ISBLANK=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISERR=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISERROR=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISLOGICAL=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISNA=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];\nSocialCalc.Formula.FunctionList.ISNONTEXT=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISNUMBER=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];SocialCalc.Formula.FunctionList.ISTEXT=[SocialCalc.Formula.IsFunctions,1,\"v\",\"\",\"test\"];\nSocialCalc.Formula.NTVFunctions=function(a,c,b,d){var e=SocialCalc.Formula,f=0,g=\"e#VALUE!\";b=e.OperandValueAndType(d,b);d=b.type.charAt(0);switch(a){case \"N\":f=\"n\"==d?b.value-0:0;g=\"n\";break;case \"T\":f=\"t\"==d?b.value+\"\":\"\";g=\"t\";break;case \"VALUE\":\"n\"==d||\"b\"==d?(f=b.value||0,g=\"n\"):\"t\"==d&&(b=SocialCalc.DetermineValueType(b.value),\"n\"!=b.type.charAt(0)?(f=0,g=\"e#VALUE!\"):(f=b.value-0,g=\"n\"))}\"e\"==d&&(g=b.type);e.PushOperand(c,g,f)};\nSocialCalc.Formula.FunctionList.N=[SocialCalc.Formula.NTVFunctions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.T=[SocialCalc.Formula.NTVFunctions,1,\"v\",\"\",\"text\"];SocialCalc.Formula.FunctionList.VALUE=[SocialCalc.Formula.NTVFunctions,1,\"v\",\"\",\"text\"];\nSocialCalc.Formula.Math1Functions=function(a,c,b,d){var e={},f=SocialCalc.Formula;d=f.OperandAsNumber(d,b);b=d.value;e.type=f.LookupResultType(d.type,d.type,f.TypeLookupTable.oneargnumeric);if(\"n\"==e.type)switch(a){case \"ABS\":b=Math.abs(b);break;case \"ACOS\":-1<=b&&1>=b?b=Math.acos(b):e.type=\"e#NUM!\";break;case \"ASIN\":-1<=b&&1>=b?b=Math.asin(b):e.type=\"e#NUM!\";break;case \"ATAN\":b=Math.atan(b);break;case \"COS\":b=Math.cos(b);break;case \"DEGREES\":b=180*b/Math.PI;break;case \"EVEN\":b=0>b?-b:b;b=b!=Math.floor(b)?\nMath.floor(b+1)+Math.floor(b+1)%2:b+b%2;0>d.value&&(b=-b);break;case \"EXP\":b=Math.exp(b);break;case \"FACT\":a=1;for(b=Math.floor(b);0<b;b--)a*=b;b=a;break;case \"INT\":b=Math.floor(b);break;case \"LN\":0>=b&&(e.type=\"e#NUM!\",e.error=SocialCalc.Constants.s_sheetfunclnarg);b=Math.log(b);break;case \"LOG10\":0>=b&&(e.type=\"e#NUM!\",e.error=SocialCalc.Constants.s_sheetfunclog10arg);b=Math.log(b)/Math.log(10);break;case \"ODD\":b=0>b?-b:b;b=b!=Math.floor(b)?Math.floor(b+1)+(1-Math.floor(b+1)%2):b+(1-b%2);0>d.value&&\n(b=-b);break;case \"RADIANS\":b=b*Math.PI/180;break;case \"SIN\":b=Math.sin(b);break;case \"SQRT\":0<=b?b=Math.sqrt(b):e.type=\"e#NUM!\";break;case \"TAN\":0!=Math.cos(b)?b=Math.tan(b):e.type=\"e#NUM!\"}e.value=b;c.push(e);return null};SocialCalc.Formula.FunctionList.ABS=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.ACOS=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.ASIN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];\nSocialCalc.Formula.FunctionList.ATAN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.COS=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.DEGREES=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.EVEN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.EXP=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];\nSocialCalc.Formula.FunctionList.FACT=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.INT=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.LN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.LOG10=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.ODD=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];\nSocialCalc.Formula.FunctionList.RADIANS=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.SIN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.SQRT=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];SocialCalc.Formula.FunctionList.TAN=[SocialCalc.Formula.Math1Functions,1,\"v\",\"\",\"math\"];\nSocialCalc.Formula.Math2Functions=function(a,c,b,d){var e,f,g={};f=SocialCalc.Formula;e=f.OperandAsNumber(d,b);b=f.OperandAsNumber(d,b);g.type=f.LookupResultType(e.type,b.type,f.TypeLookupTable.twoargnumeric);if(\"n\"==g.type)switch(a){case \"ATAN2\":0==e.value&&0==b.value?g.type=\"e#DIV/0!\":g.value=Math.atan2(b.value,e.value);break;case \"POWER\":g.value=Math.pow(e.value,b.value);isNaN(g.value)&&(g.value=0,g.type=\"e#NUM!\");break;case \"MOD\":0==b.value?g.type=\"e#DIV/0!\":(a=e.value/b.value,a=Math.floor(a),\ng.value=e.value-a*b.value);break;case \"TRUNC\":a=1;if(0<=b.value){b.value=Math.floor(b.value);for(f=0;f<b.value;f++)a*=10;g.value=Math.floor(Math.abs(e.value)*a)/a}else if(0>b.value){b.value=Math.floor(-b.value);for(f=0;f<b.value;f++)a*=10;g.value=Math.floor(Math.abs(e.value)/a)*a}0>e.value&&(g.value=-g.value)}c.push(g);return null};SocialCalc.Formula.FunctionList.ATAN2=[SocialCalc.Formula.Math2Functions,2,\"xy\",\"\",\"math\"];\nSocialCalc.Formula.FunctionList.MOD=[SocialCalc.Formula.Math2Functions,2,\"\",\"\",\"math\"];SocialCalc.Formula.FunctionList.POWER=[SocialCalc.Formula.Math2Functions,2,\"\",\"\",\"math\"];SocialCalc.Formula.FunctionList.TRUNC=[SocialCalc.Formula.Math2Functions,2,\"valpre\",\"\",\"math\"];\nSocialCalc.Formula.LogFunction=function(a,c,b,d){var e,f={},g=SocialCalc.Formula;f.value=0;e=g.OperandAsNumber(d,b);f.type=g.LookupResultType(e.type,e.type,g.TypeLookupTable.oneargnumeric);if(1==b.length){if(b=g.OperandAsNumber(d,b),\"n\"!=b.type.charAt(0)||0>=b.value)return g.FunctionSpecificError(a,c,\"e#NUM!\",SocialCalc.Constants.s_sheetfunclogsecondarg),0}else{if(0!=b.length)return g.FunctionArgsError(a,c),0;b={value:Math.E,type:\"n\"}}if(\"n\"==f.type){if(0>=e.value)return g.FunctionSpecificError(a,\nc,\"e#NUM!\",SocialCalc.Constants.s_sheetfunclogfirstarg),0;f.value=Math.log(e.value)/Math.log(b.value)}c.push(f)};SocialCalc.Formula.FunctionList.LOG=[SocialCalc.Formula.LogFunction,-1,\"log\",\"\",\"math\"];\nSocialCalc.Formula.RoundFunction=function(a,c,b,d){var e,f,g=SocialCalc.Formula;f=0;var l=\"e#VALUE!\";e=g.OperandValueAndType(d,b);l=g.LookupResultType(e.type,e.type,g.TypeLookupTable.oneargnumeric);if(1==b.length){if(b=g.OperandValueAndType(d,b),\"n\"!=b.type.charAt(0))return g.FunctionSpecificError(a,c,\"e#NUM!\",SocialCalc.Constants.s_sheetfuncroundsecondarg),0}else{if(0!=b.length)return g.FunctionArgsError(a,c),0;b={value:0,type:\"n\"}}if(\"n\"==l)if(b.value-=0,0==b.value)f=Math.round(e.value);else if(0<\nb.value){a=1;b.value=Math.floor(b.value);for(f=0;f<b.value;f++)a*=10;e=Math.round(e.value*a);f=e/a}else if(0>b.value){a=1;b.value=Math.floor(-b.value);for(f=0;f<b.value;f++)a*=10;e=Math.round(e.value/a);f=e*a}g.PushOperand(c,l,f)};SocialCalc.Formula.FunctionList.ROUND=[SocialCalc.Formula.RoundFunction,-1,\"vp\",\"\",\"math\"];\nSocialCalc.Formula.CeilingFloorFunctions=function(a,c,b,d){var e=SocialCalc.Formula,f,g,l=function(a,b){c.push({type:a,value:b})};f=e.OperandValueAndType(d,b);g=f.type.charAt(0);if(\"n\"!=g)l(\"e#VALUE!\",0);else if(0==f.value)l(\"n\",0);else{if(1==b.length){if(b=e.OperandValueAndType(d,b),g=f.type.charAt(0),\"n\"!=g){l(\"e#VALUE!\",0);return}}else if(0==b.length)b={type:\"n\",value:0<f.value?1:-1};else{l(\"e#VALUE!\",0);return}if(0==b.value)l(\"n\",0);else if(0>b.value*f.value)l(\"e#NUM!\",0);else switch(a){case \"CEILING\":l(\"n\",\nMath.ceil(f.value/b.value)*b.value);break;case \"FLOOR\":l(\"n\",Math.floor(f.value/b.value)*b.value)}}};SocialCalc.Formula.FunctionList.CEILING=[SocialCalc.Formula.CeilingFloorFunctions,-1,\"vsig\",\"\",\"math\"];SocialCalc.Formula.FunctionList.FLOOR=[SocialCalc.Formula.CeilingFloorFunctions,-1,\"vsig\",\"\",\"math\"];\nSocialCalc.Formula.AndOrFunctions=function(a,c,b,d){var e,f,g=SocialCalc.Formula,l=\"\";for(\"AND\"==a?f=1:\"OR\"==a&&(f=0);b.length;)e=g.OperandValueAndType(d,b),\"n\"==e.type.charAt(0)?(e.value-=0,\"AND\"==a?f=0!=e.value?f:0:\"OR\"==a&&(f=0!=e.value?1:f),l=g.LookupResultType(e.type,l||\"nl\",g.TypeLookupTable.propagateerror)):\"e\"==e.type.charAt(0)&&\"e\"!=l.charAt(0)&&(l=e.type);1>l.length&&(l=\"e#VALUE!\",f=0);g.PushOperand(c,l,f)};\nSocialCalc.Formula.FunctionList.AND=[SocialCalc.Formula.AndOrFunctions,-1,\"vn\",\"\",\"test\"];SocialCalc.Formula.FunctionList.OR=[SocialCalc.Formula.AndOrFunctions,-1,\"vn\",\"\",\"test\"];SocialCalc.Formula.NotFunction=function(a,c,b,d){a=0;var e=SocialCalc.Formula;b=e.OperandValueAndType(d,b);d=e.LookupResultType(b.type,b.type,e.TypeLookupTable.propagateerror);\"n\"==b.type.charAt(0)||\"b\"==b.type?(a=0!=b.value-0?0:1,d=\"nl\"):\"t\"==b.type.charAt(0)&&(d=\"e#VALUE!\");e.PushOperand(c,d,a)};\nSocialCalc.Formula.FunctionList.NOT=[SocialCalc.Formula.NotFunction,1,\"v\",\"\",\"test\"];SocialCalc.Formula.ChooseFunction=function(a,c,b,d){var e,f,g=0,l=SocialCalc.Formula,h=l.OperandAsNumber(d,b);\"n\"!=h.type.charAt(0)&&(h.value=0);h.value=Math.floor(h.value);for(a=0;b.length;)if(f=l.TopOfStackValueAndType(d,b),a+=1,h.value==a){g=f.value;e=f.type;break}e?l.PushOperand(c,e,g):l.PushOperand(c,\"e#VALUE!\",0)};SocialCalc.Formula.FunctionList.CHOOSE=[SocialCalc.Formula.ChooseFunction,-2,\"choose\",\"\",\"lookup\"];\nSocialCalc.Formula.ColumnsRowsFunctions=function(a,c,b,d){var e=0,f=SocialCalc.Formula;b=f.TopOfStackValueAndType(d,b);\"coord\"==b.type?(e=1,a=\"n\"):\"range\"==b.type?(d=f.DecodeRangeParts(d,b.value),\"COLUMNS\"==a?e=d.ncols:\"ROWS\"==a&&(e=d.nrows),a=\"n\"):(e=0,a=\"e#VALUE!\");f.PushOperand(c,a,e)};SocialCalc.Formula.FunctionList.COLUMNS=[SocialCalc.Formula.ColumnsRowsFunctions,1,\"range\",\"\",\"lookup\"];SocialCalc.Formula.FunctionList.ROWS=[SocialCalc.Formula.ColumnsRowsFunctions,1,\"range\",\"\",\"lookup\"];\nSocialCalc.Formula.ZeroArgFunctions=function(a,c,b,d){b={value:0};switch(a){case \"FALSE\":b.type=\"nl\";b.value=0;break;case \"NA\":b.type=\"e#N/A\";break;case \"NOW\":a=new Date;d=a.getTimezoneOffset();a=a.getTime()/1E3;b.value=25569+a/86400-d/1440;b.type=\"ndt\";SocialCalc.Formula.FreshnessInfo.volatile.NOW=!0;break;case \"PI\":b.type=\"n\";b.value=Math.PI;break;case \"TODAY\":a=new Date;d=a.getTimezoneOffset();a=a.getTime()/1E3;b.value=Math.floor(25569+a/86400-d/1440);b.type=\"nd\";SocialCalc.Formula.FreshnessInfo.volatile.TODAY=\n!0;break;case \"TRUE\":b.type=\"nl\";b.value=1;break;case \"RAND\":b.type=\"n\",b.value=Math.random(),SocialCalc.Formula.FreshnessInfo.volatile.RAND=!0}c.push(b);return null};SocialCalc.Formula.FunctionList.FALSE=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"test\"];SocialCalc.Formula.FunctionList.NA=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"test\"];SocialCalc.Formula.FunctionList.NOW=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"datetime\"];\nSocialCalc.Formula.FunctionList.RAND=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"math\"];SocialCalc.Formula.FunctionList.PI=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"math\"];SocialCalc.Formula.FunctionList.TODAY=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"datetime\"];SocialCalc.Formula.FunctionList.TRUE=[SocialCalc.Formula.ZeroArgFunctions,0,\"\",\"\",\"test\"];\nSocialCalc.Formula.DDBFunction=function(a,c,b,d){var e,f=SocialCalc.Formula,g=f.OperandAsNumber(d,b),l=f.OperandAsNumber(d,b),h=f.OperandAsNumber(d,b),m=f.OperandAsNumber(d,b);if(!(f.CheckForErrorValue(c,g)||f.CheckForErrorValue(c,l)||f.CheckForErrorValue(c,h)||f.CheckForErrorValue(c,m))){if(1>h.value)return f.FunctionSpecificError(a,c,\"e#NUM!\",SocialCalc.Constants.s_sheetfuncddblife),0;e={value:2,type:\"n\"};0<b.length&&(e=f.OperandAsNumber(d,b));if(0!=b.length)return f.FunctionArgsError(a,c),0;if(!f.CheckForErrorValue(c,\ne)){b=a=0;for(d=1;d<=m.value-0&&d<=h.value;d++)a=e.value/h.value*(g.value-b),g.value-b-a<l.value&&(a=g.value-b-l.value),b+=a;f.PushOperand(c,\"n$\",a)}}};SocialCalc.Formula.FunctionList.DDB=[SocialCalc.Formula.DDBFunction,-4,\"ddb\",\"\",\"financial\"];\nSocialCalc.Formula.SLNFunction=function(a,c,b,d){var e=SocialCalc.Formula,f=e.OperandAsNumber(d,b),g=e.OperandAsNumber(d,b);b=e.OperandAsNumber(d,b);if(!e.CheckForErrorValue(c,f)&&!e.CheckForErrorValue(c,g)&&!e.CheckForErrorValue(c,b)){if(1>b.value)return e.FunctionSpecificError(a,c,\"e#NUM!\",SocialCalc.Constants.s_sheetfuncslnlife),0;a=(f.value-g.value)/b.value;e.PushOperand(c,\"n$\",a)}};SocialCalc.Formula.FunctionList.SLN=[SocialCalc.Formula.SLNFunction,3,\"csl\",\"\",\"financial\"];\nSocialCalc.Formula.SYDFunction=function(a,c,b,d){var e;a=SocialCalc.Formula;e=a.OperandAsNumber(d,b);var f=a.OperandAsNumber(d,b),g=a.OperandAsNumber(d,b);d=a.OperandAsNumber(d,b);if(!(a.CheckForErrorValue(c,e)||a.CheckForErrorValue(c,f)||a.CheckForErrorValue(c,g)||a.CheckForErrorValue(c,d))){if(1>g.value||0>=d.value)return a.PushOperand(c,\"e#NUM!\",0),0;b=(g.value+1)*g.value/2;e=(e.value-f.value)*(g.value-d.value+1)/b;a.PushOperand(c,\"n$\",e)}};\nSocialCalc.Formula.FunctionList.SYD=[SocialCalc.Formula.SYDFunction,4,\"cslp\",\"\",\"financial\"];\nSocialCalc.Formula.InterestFunctions=function(a,c,b,d){var e,f,g,l,h,m,p,r,q,n=SocialCalc.Formula,s=n.OperandAsNumber(d,b);p=n.OperandAsNumber(d,b);m=n.OperandAsNumber(d,b);e=n.LookupResultType(s.type,p.type,n.TypeLookupTable.twoargnumeric);e=n.LookupResultType(e,m.type,n.TypeLookupTable.twoargnumeric);if(b.length&&(g=n.OperandAsNumber(d,b),e=n.LookupResultType(e,g.type,n.TypeLookupTable.twoargnumeric),b.length&&(l=n.OperandAsNumber(d,b),e=n.LookupResultType(e,l.type,n.TypeLookupTable.twoargnumeric),\nb.length))){if(\"RATE\"!=a)return n.FunctionArgsError(a,c),0;h=n.OperandAsNumber(d,b);e=n.LookupResultType(e,h.type,n.TypeLookupTable.twoargnumeric)}if(\"n\"==e)switch(a){case \"FV\":h=s.value;a=p.value;p=m.value;m=null!=g?g.value:0;l=null!=l?l.value?1:0:0;f=g=0==h?-m-p*a:-(m*Math.pow(1+h,a)+p*(1+h*l)*(Math.pow(1+h,a)-1)/h);e=\"n$\";break;case \"NPER\":h=s.value;p=p.value;m=m.value;g=null!=g?g.value:0;l=null!=l?l.value?1:0:0;if(0==h){if(0==p){n.PushOperand(c,\"e#NUM!\",0);return}a=(m+g)/-p}else{r=p*(1+h*l)/h;\nq=m+r;if(0==q||-1>=h){n.PushOperand(c,\"e#NUM!\",0);return}r=(r-g)/q;if(0>=r){n.PushOperand(c,\"e#NUM!\",0);return}r=Math.log(r);q=Math.log(1+h);a=r/q}f=a;e=\"n\";break;case \"PMT\":h=s.value;a=p.value;m=m.value;g=null!=g?g.value:0;l=null!=l?l.value?1:0:0;if(0==a){n.PushOperand(c,\"e#NUM!\",0);return}f=p=0==h?(g-m)/a:(0-g-m*Math.pow(1+h,a))/((1+h*l)*(Math.pow(1+h,a)-1)/h);e=\"n$\";break;case \"PV\":h=s.value;a=p.value;p=m.value;g=null!=g?g.value:0;l=null!=l?l.value?1:0:0;if(-1==h){n.PushOperand(c,\"e#DIV/0!\",0);\nreturn}f=m=0==h?-g-p*a:(-g-p*(1+h*l)*(Math.pow(1+h,a)-1)/h)/Math.pow(1+h,a);e=\"n$\";break;case \"RATE\":a=s.value;p=p.value;m=m.value;g=null!=g?g.value:0;l=null!=l?l.value?1:0:0;h=null!=h?h.value:.1;b=0;delta=1;epsilon=1E-7;for(h=h||1E-8;(0<=delta?delta:-delta)>epsilon&&h!=r;)if(delta=g+m*Math.pow(1+h,a)+p*(1+h*l)*(Math.pow(1+h,a)-1)/h,null!=q?(q=(delta-q)/(h-r)||.001,r=h,h-=delta/q):(r=h,h*=1.1),q=delta,b++,100<=b){n.PushOperand(c,\"e#NUM!\",0);return}f=h;e=\"n%\"}n.PushOperand(c,e,f)};\nSocialCalc.Formula.FunctionList.FV=[SocialCalc.Formula.InterestFunctions,-3,\"fv\",\"\",\"financial\"];SocialCalc.Formula.FunctionList.NPER=[SocialCalc.Formula.InterestFunctions,-3,\"nper\",\"\",\"financial\"];SocialCalc.Formula.FunctionList.PMT=[SocialCalc.Formula.InterestFunctions,-3,\"pmt\",\"\",\"financial\"];SocialCalc.Formula.FunctionList.PV=[SocialCalc.Formula.InterestFunctions,-3,\"pv\",\"\",\"financial\"];SocialCalc.Formula.FunctionList.RATE=[SocialCalc.Formula.InterestFunctions,-3,\"rate\",\"\",\"financial\"];\nSocialCalc.Formula.NPVFunction=function(a,c,b,d){var e,f,g,l,h=SocialCalc.Formula;e=h.OperandAsNumber(d,b);if(!h.CheckForErrorValue(c,e)){f=0;a=\"n\";for(g=1;b.length;)if(l=h.OperandValueAndType(d,b),\"n\"==l.type.charAt(0)){g*=1+e.value;if(0==g){h.PushOperand(c,\"e#DIV/0!\",0);return}f+=l.value/g;a=h.LookupResultType(l.type,a||l.type,h.TypeLookupTable.plus)}else if(\"e\"==l.type.charAt(0)&&\"e\"!=a.charAt(0)){a=l.type;break}\"n\"==a.charAt(0)&&(a=\"n$\");h.PushOperand(c,a,f)}};\nSocialCalc.Formula.FunctionList.NPV=[SocialCalc.Formula.NPVFunction,-2,\"npv\",\"\",\"financial\"];\nSocialCalc.Formula.IRRFunction=function(a,c,b,d){var e,f,g,l;l=[];var h=[],m=SocialCalc.Formula;for(l.push(b.pop());l.length;)if(e=m.OperandValueAndType(d,l),\"n\"==e.type.charAt(0))h.push(e.value);else if(\"e\"==e.type.charAt(0)){m.PushOperand(c,\"e#VALUE!\",0);return}if(h.length){e={value:0};if(b.length){e=m.OperandAsNumber(d,b);if(\"n\"!=e.type.charAt(0)&&\"b\"!=e.type.charAt(0)){m.PushOperand(c,\"e#VALUE!\",0);return}if(b.length){m.FunctionArgsError(a,c);return}}e.value=e.value||.1;a=0;b=e.value;for(d=1;1E-7<\n(0<=d?d:-d)&&b!=g;){d=0;e=1;for(l=0;l<h.length;l++){e*=1+b;if(0==e){m.PushOperand(c,\"e#DIV/0!\",0);return}d+=h[l]/e}null!=f?(f=(d-f)/(b-g),g=b,b-=d/f):(g=b,b*=1.1);f=d;a++;if(20<=a){m.PushOperand(c,\"e#NUM!\",0);return}}m.PushOperand(c,\"n%\",b)}else m.PushOperand(c,\"e#NUM!\",0)};SocialCalc.Formula.FunctionList.IRR=[SocialCalc.Formula.IRRFunction,-1,\"irr\",\"\",\"financial\"];SocialCalc.Formula.SheetCache={sheets:{},waitingForLoading:null,constants:{asloaded:0,recalcing:1,recalcdone:2},loadsheet:null,tiddlersToSheets:{}};\nSocialCalc.Formula.FindInSheetCache=function(a){var c=SocialCalc.Formula.SheetCache,b=SocialCalc.Formula.NormalizeSheetName(a);if(c.sheets[b])return hack.log(\"Found: \"+a,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\"),hack.log(\" .name: \"+c.sheets[b].name,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\"),hack.log(\" .tiddlerTitle: \"+c.sheets[b].tiddlerTitle,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\"),hack.log(\" .recalcstate: \"+c.sheets[b].recalcstate,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\"),\nTiddlyWiki?c.tiddlersToSheets[c.sheets[b].tiddlerTitle]:c.sheets[b].sheet;hack.log(\"Not found: \"+a,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\");if(c.waitingForLoading)return hack.log(\"Waiting other sheet to be loaded: sfsc.waitingForLoading = \"+c.waitingForLoading,hack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\"),null;c.loadsheet&&alert(\"Using SocialCalc.Formula.SheetCache.loadsheet - deprecated\");c.waitingForLoading=b;hack.log(\"To be loaded: sfsc.waitingForLoading = \"+c.waitingForLoading,\nhack.recalcLink,\"SocialCalc.Formula.FindInSheetCache\");return null};\nSocialCalc.Formula.AddSheetToCache=function(a,c,b,d){var e=null,f=SocialCalc.Formula.SheetCache,g=f.constants;a=SocialCalc.Formula.NormalizeSheetName(a);if(TiddlyWiki){if(f.sheets[a])return f.tiddlersToSheets[f.sheets[a].tiddlerTitle];f.sheets[a]={recalcstate:g.asloaded,name:a,tiddlerTitle:d};d&&f.tiddlersToSheets[d]?e=f.tiddlersToSheets[d]:(c&&(e=new SocialCalc.Sheet,e.ParseSheetSave(c)),f.tiddlersToSheets[d]=e)}else c&&(e=new SocialCalc.Sheet,e.ParseSheetSave(c)),f.sheets[a]={sheet:e,recalcstate:g.asloaded,\nname:a};SocialCalc.Formula.FreshnessInfo.sheets[a]=\"undefined\"==typeof b||!1===b;return e};SocialCalc.Formula.NormalizeSheetName=function(a){return SocialCalc.Callbacks.NormalizeSheetName?SocialCalc.Callbacks.NormalizeSheetName(a):a.toLowerCase()};SocialCalc.Formula.RemoteFunctionInfo={waitingForServer:null};SocialCalc.Formula.FreshnessInfo={sheets:{},volatile:{},recalc_completed:!1};\nSocialCalc.Formula.FreshnessInfoReset=function(){var a=SocialCalc.Formula.FreshnessInfo,c=SocialCalc.Formula.SheetCache,b;for(b in a.sheets)!1===a.sheets[b]&&delete c.sheets[b];TiddlyWiki&&(tiddlersToSheets={});a.sheets={};a.volatile={};a.recalc_completed=!1};SocialCalc.Formula.PlainCoord=function(a){return-1==a.indexOf(\"$\")?a:a.replace(/\\$/g,\"\")};\nSocialCalc.Formula.OrderRangeParts=function(a,c){var b,d,e={};b=SocialCalc.coordToCr(a);d=SocialCalc.coordToCr(c);b.col>d.col?(e.c1=d.col,e.c2=b.col):(e.c1=b.col,e.c2=d.col);b.row>d.row?(e.r1=d.row,e.r2=b.row):(e.r1=b.row,e.r2=d.row);return e};\nSocialCalc.Formula.TestCriteria=function(a,c,b){var d,e,f;if(null==b)return!1;b+=\"\";d=b.charAt(0);\"=\"==d||\"<\"==d||\">\"==d?b=b.substring(1):(d=b.substring(0,2),\"<=\"==d||\"<>\"==d||\">=\"==d?b=b.substring(2):d=\"none\");b=SocialCalc.DetermineValueType(b);if(!b.type){if(\"none\"==d)return!1;if(\"b\"==c.charAt(0)){if(\"=\"==d)return!0}else if(\"<>\"==d)return!0;return!1}e=!1;\"n\"==b.type.charAt(0)&&\"t\"==c.charAt(0)&&(f=SocialCalc.DetermineValueType(a),\"n\"==f.type.charAt(0)&&(a=f.value,c=f.type));if(\"n\"==c.charAt(0)&&\n\"n\"==b.type.charAt(0))switch(a-=0,b.value-=0,d){case \"<\":e=a<b.value;break;case \"<=\":e=a<=b.value;break;case \"=\":case \"none\":e=a==b.value;break;case \">=\":e=a>=b.value;break;case \">\":e=a>b.value;break;case \"<>\":e=a!=b.value}else if(\"e\"==c.charAt(0))e=!1;else if(\"e\"==b.type.charAt(0))e=!1;else{\"n\"==c.charAt(0)&&(a=SocialCalc.format_number_for_display(a,\"n\",\"\"));if(\"n\"==b.type.charAt(0))return!1;a=a?a.toLowerCase():\"\";b.value=b.value?b.value.toLowerCase():\"\";switch(d){case \"<\":e=a<b.value;break;case \"<=\":e=\na<=b.value;break;case \"=\":e=a==b.value;break;case \"none\":e=a.substring(0,b.value.length)==b.value;break;case \">=\":e=a>=b.value;break;case \">\":e=a>b.value;break;case \"<>\":e=a!=b.value}}return e};SocialCalc||(SocialCalc={});SocialCalc.Popup={};SocialCalc.Popup.Types={};SocialCalc.Popup.Controls={};SocialCalc.Popup.Current={};SocialCalc.Popup.LocalizeString=function(a){return a};SocialCalc.Popup.Create=function(a,c,b){var d=SocialCalc.Popup.Types[a];d&&d.Create&&d.Create(a,c,b);SocialCalc.Popup.imagePrefix=SocialCalc.Constants.defaultImagePrefix};\nSocialCalc.Popup.SetValue=function(a,c){var b=SocialCalc.Popup,d=b.Types,e=b.Controls;e[a]?(b=e[a].type,d=d[b],e=e[a].data,d&&d.Create&&(d.SetValue(b,a,c),e.attribs&&e.attribs.changedcallback&&e.attribs.changedcallback(e.attribs,a,c))):alert(\"Unknown control \"+a)};\nSocialCalc.Popup.SetDisabled=function(a,c){var b=SocialCalc.Popup,d=b.Types,e=b.Controls;e[a]?(e=e[a].type,(d=d[e])&&d.Create&&(b.Current.id&&a==b.Current.id&&(d.Hide(e,b.Current.id),b.Current.id=null),d.SetDisabled(e,a,c))):alert(\"Unknown control \"+a)};SocialCalc.Popup.GetValue=function(a){var c=SocialCalc.Popup,b=c.Types,c=c.Controls;if(c[a])return c=c[a].type,(b=b[c])&&b.Create?b.GetValue(c,a):null;alert(\"Unknown control \"+a)};\nSocialCalc.Popup.Initialize=function(a,c){var b=SocialCalc.Popup,d=b.Types,b=b.Controls;b[a]?(b=b[a].type,(d=d[b])&&d.Initialize&&d.Initialize(b,a,c)):alert(\"Unknown control \"+a)};SocialCalc.Popup.Reset=function(a){var c=SocialCalc.Popup.Types;c[a].Reset&&c[a].Reset(a)};\nSocialCalc.Popup.CClick=function(a){var c=SocialCalc.Popup,b=c.Types,d=c.Controls;if(!d[a])alert(\"Unknown control \"+a);else if(!d[a].data||!d[a].data.disabled){var e=d[a].type,f=b[e];if(c.Current.id&&(b[d[c.Current.id].type].Hide(e,c.Current.id),a==c.Current.id)){c.Current.id=null;return}f&&f.Show&&f.Show(e,a);c.Current.id=a}};SocialCalc.Popup.Close=function(){var a=SocialCalc.Popup;a.Current.id&&a.CClick(a.Current.id)};\nSocialCalc.Popup.Cancel=function(){var a=SocialCalc.Popup,c=a.Types,b=a.Controls;a.Current.id&&(b=b[a.Current.id].type,c[b].Cancel(b,a.Current.id),a.Current.id=null)};\nSocialCalc.Popup.CreatePopupDiv=function(a,c){var b,d=SocialCalc.Popup.Controls[a].data,e=document.createElement(\"div\");e.style.position=\"absolute\";b=SocialCalc.GetElementPosition(d.mainele);e.style.top=b.top+d.mainele.offsetHeight+\"px\";e.style.left=b.left+\"px\";e.style.zIndex=100;e.style.backgroundColor=\"#FFF\";e.style.border=\"1px solid black\";c.width&&(e.style.width=c.width);d.mainele.appendChild(e);c.title&&(e.innerHTML='<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-bottom:1px solid black;\"><tr><td style=\"font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;\">'+\nc.title+'</td><td style=\"font-size:10px;cursor:default;color:#666;\" onclick=\"SocialCalc.Popup.Cancel();\"> X </td></tr></table>',c.moveable&&(d.dragregistered=e.firstChild.firstChild.firstChild.firstChild,SocialCalc.DragRegister(d.dragregistered,!0,!0,{MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null,positionobj:e},d.mainele)));return e};\nSocialCalc.Popup.EnsurePosition=function(a,c){function b(a){var c=SocialCalc.GetElementPosition(a);c.height=a.offsetHeight;c.width=a.offsetWidth;c.bottom=c.top+c.height;c.right=c.left+c.width;return c}var d=SocialCalc.Popup.Controls[a].data,e=d.mainele.firstChild;if(e){var d=d.popupele,f=b(d),g=b(c),e=b(e);e.bottom+f.height<g.bottom&&e.left+f.width<g.right?(d.style.top=e.bottom+\"px\",d.style.left=e.left+\"px\"):e.top-f.height>g.top&&e.left+f.width<g.right?(d.style.top=e.top-f.height+\"px\",d.style.left=\ne.left+\"px\"):e.bottom+f.height<g.bottom&&e.right-f.width>g.left?(d.style.top=e.bottom+\"px\",d.style.left=e.right-f.width+\"px\"):e.top-f.height>g.top&&e.right-f.width>g.left?(d.style.top=e.top-f.height+\"px\",d.style.left=e.right-f.width+\"px\"):e.bottom+f.height<g.bottom&&f.width<g.width?(d.style.top=e.bottom+\"px\",d.style.left=g.left+Math.floor((g.width-f.width)/2)+\"px\"):e.top-f.height>g.top&&f.width<g.width?(d.style.top=e.top-f.height+\"px\",d.style.left=g.left+Math.floor((g.width-f.width)/2)+\"px\"):f.height<\ng.height&&e.right+f.width<g.right?(d.style.top=g.top+Math.floor((g.height-f.height)/2)+\"px\",d.style.left=e.right+\"px\"):f.height<g.height&&e.left-f.width>g.left&&(d.style.top=g.top+Math.floor((g.height-f.height)/2)+\"px\",d.style.left=e.left-f.width+\"px\")}else alert(\"No main popup element firstChild.\")};SocialCalc.Popup.DestroyPopupDiv=function(a,c){a&&(a.innerHTML=\"\",SocialCalc.DragUnregister(c),a.parentNode&&a.parentNode.removeChild(a))};\nSocialCalc.Popup.RGBToHex=function(a){var c=SocialCalc.Popup;return\"\"==a?\"000000\":(a=a.match(/(\\d+)\\D+(\\d+)\\D+(\\d+)/))?c.ToHex(a[1])+c.ToHex(a[2])+c.ToHex(a[3]):\"000000\"};SocialCalc.Popup.HexDigits=\"0123456789ABCDEF\";SocialCalc.Popup.ToHex=function(a){var c=SocialCalc.Popup,b=a%16;return c.HexDigits.charAt(Math.floor(a/16))+c.HexDigits.charAt(b)};\nSocialCalc.Popup.FromHex=function(a){var c=SocialCalc.Popup,b=c.HexDigits.indexOf(a.charAt(0).toUpperCase());a=c.HexDigits.indexOf(a.charAt(1).toUpperCase());return 16*(0<=b?b:0)+(0<=a?a:0)};SocialCalc.Popup.HexToRGB=function(a){var c=SocialCalc.Popup;return\"rgb(\"+c.FromHex(a.substring(1,3))+\",\"+c.FromHex(a.substring(3,5))+\",\"+c.FromHex(a.substring(5,7))+\")\"};SocialCalc.Popup.makeRGB=function(a,c,b){return\"rgb(\"+(0<a?a:0)+\",\"+(0<c?c:0)+\",\"+(0<b?b:0)+\")\"};\nSocialCalc.Popup.splitRGB=function(a){return(a=a.match(/(\\d+)\\D+(\\d+)\\D+(\\d+)\\D/))?{r:a[1]-0,g:a[2]-0,b:a[3]-0}:{r:0,g:0,b:0}};SocialCalc.Popup.Types.List={};\nSocialCalc.Popup.Types.List.Create=function(a,c,b){a={type:a,value:\"\",display:\"\",data:{}};SocialCalc.Popup.Controls[c]=a;a=a.data;a.attribs=b||{};(b=document.getElementById(c))?(a.mainele=b,b.innerHTML='<input style=\"cursor:pointer;width:100px;font-size:smaller;\" onfocus=\"this.blur();\" onclick=\"SocialCalc.Popup.CClick(\\''+c+'\\');\" value=\"\">',a.options=[]):alert(\"Missing element \"+c)};\nSocialCalc.Popup.Types.List.SetValue=function(a,c,b){a=SocialCalc.Popup.Controls[c].data;a.value=b;a.custom=!1;for(b=0;b<a.options.length;b++)if(o=a.options[b],!(o.a&&(o.a.skip||o.a.custom||o.a.cancel)||o.v!=a.value)){a.display=o.o;break}b==a.options.length&&(a.display=\"Custom\",a.custom=!0);a.mainele&&a.mainele.firstChild&&(a.mainele.firstChild.value=a.display)};\nSocialCalc.Popup.Types.List.SetDisabled=function(a,c,b){a=SocialCalc.Popup.Controls[c].data;a.disabled=b;a.mainele&&a.mainele.firstChild&&(a.mainele.firstChild.disabled=b)};SocialCalc.Popup.Types.List.GetValue=function(a,c){return SocialCalc.Popup.Controls[c].data.value};SocialCalc.Popup.Types.List.Initialize=function(a,c,b){var d;a=SocialCalc.Popup;var e=a.Controls[c].data;for(d in b.attribs)e.attribs[d]=b.attribs[d];e.options=b?b.options:[];b.value&&a.SetValue(c,b.value)};\nSocialCalc.Popup.Types.List.Reset=function(a){var c=SocialCalc.Popup,b=c.Types,d=c.Controls;c.Current.id&&d[c.Current.id].type==a&&(b[a].Hide(a,c.Current.id),c.Current.id=null)};\nSocialCalc.Popup.Types.List.Show=function(a,c){var b;b=SocialCalc.Popup;var d=b.Controls[c].data,e=\"\";d.popupele=b.CreatePopupDiv(c,d.attribs);d.custom?(e=SocialCalc.Popup.Types.List.MakeCustom(a,c),b=document.createElement(\"div\"),b.innerHTML='<div style=\"cursor:default;padding:4px;background-color:#CCC;\">'+e+\"</div>\",d.customele=b.firstChild.firstChild.childNodes[1],d.listdiv=null):(e=SocialCalc.Popup.Types.List.MakeList(a,c),b=document.createElement(\"div\"),b.innerHTML='<div style=\"cursor:default;padding:4px;\">'+\ne+\"</div>\",d.customele=null,d.listdiv=b.firstChild);d.contentele=b;d.mainele&&d.mainele.firstChild&&(d.mainele.firstChild.disabled=!0);d.popupele.appendChild(b);d.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(c,d.attribs.ensureWithin)};\nSocialCalc.Popup.Types.List.MakeList=function(a,c){var b,d,e,f=SocialCalc.Popup.Controls[c].data,g;g='<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"vertical-align:top;\">';f.ncols=1;for(b=0;b<f.options.length;b++){d=f.options[b];if(d.a){if(d.a.newcol){g+='</td><td style=\"vertical-align:top;\"> </td><td style=\"vertical-align:top;\">';f.ncols+=1;continue}if(d.a.skip){g+='<div style=\"font-size:x-small;white-space:nowrap;\">'+d.o+\"</div>\";continue}}e=d.v!=f.value||d.a&&(d.a.custom||\nd.a.cancel)?\"\":\"background-color:#DDF;\";g+='<div style=\"font-size:x-small;white-space:nowrap;'+e+'\" onclick=\"SocialCalc.Popup.Types.List.ItemClicked(\\''+c+\"','\"+b+\"');\\\" onmousemove=\\\"SocialCalc.Popup.Types.List.MouseMove('\"+c+\"',this);\\\">\"+d.o+\"</div>\"}return g+\"</td></tr></table>\"};\nSocialCalc.Popup.Types.List.MakeCustom=function(a,c){var b=SocialCalc.Popup.LocalizeString,d=\"\",d=SocialCalc.Popup.Controls[c].data.value,d=SocialCalc.special_chars(d);return d='<div style=\"white-space:nowrap;\"><br><input id=\"customvalue\" value=\"'+d+'\"><br><br><input style=\"font-size:smaller;\" type=\"button\" value=\"'+b(\"OK\")+'\" onclick=\"SocialCalc.Popup.Types.List.CustomOK(\\''+c+'\\');return false;\"><input style=\"font-size:smaller;\" type=\"button\" value=\"'+b(\"List\")+'\" onclick=\"SocialCalc.Popup.Types.List.CustomToList(\\''+\nc+'\\');\"><input style=\"font-size:smaller;\" type=\"button\" value=\"'+b(\"Cancel\")+'\" onclick=\"SocialCalc.Popup.Close();\"><br></div>'};\nSocialCalc.Popup.Types.List.ItemClicked=function(a,c){var b,d,e,f=SocialCalc.Popup.Controls[a].data;(b=f.options[c].a)&&b.custom?(b=f.contentele,d=SocialCalc.Popup.Types.List.MakeCustom(\"List\",a),e=document.createElement(\"div\"),e.innerHTML='<div style=\"cursor:default;padding:4px;background-color:#CCC;\">'+d+\"</div>\",f.customele=e.firstChild.firstChild.childNodes[1],f.listdiv=null,f.contentele=e,f.popupele.replaceChild(e,b),f.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(a,f.attribs.ensureWithin)):\n(b&&b.cancel||SocialCalc.Popup.SetValue(a,f.options[c].v),SocialCalc.Popup.Close())};SocialCalc.Popup.Types.List.CustomToList=function(a){var c,b,d,e=SocialCalc.Popup.Controls[a].data;c=e.contentele;b=SocialCalc.Popup.Types.List.MakeList(\"List\",a);d=document.createElement(\"div\");d.innerHTML='<div style=\"cursor:default;padding:4px;\">'+b+\"</div>\";e.customele=null;e.listdiv=d.firstChild;e.contentele=d;e.popupele.replaceChild(d,c);e.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(a,e.attribs.ensureWithin)};\nSocialCalc.Popup.Types.List.CustomOK=function(a){SocialCalc.Popup.SetValue(a,SocialCalc.Popup.Controls[a].data.customele.value);SocialCalc.Popup.Close()};SocialCalc.Popup.Types.List.MouseMove=function(a,c){var b,d,e=SocialCalc.Popup.Controls[a].data;if(b=e.listdiv){var f=b.firstChild.firstChild.firstChild;for(b=0;b<e.ncols;b++)for(d=0;d<f.childNodes[2*b].childNodes.length;d++)f.childNodes[2*b].childNodes[d].style.backgroundColor=\"#FFF\";c.style.backgroundColor=\"#DDF\"}};\nSocialCalc.Popup.Types.List.Hide=function(a,c){var b=SocialCalc.Popup,d=b.Controls[c].data;b.DestroyPopupDiv(d.popupele,d.dragregistered);d.popupele=null;d.mainele&&d.mainele.firstChild&&(d.mainele.firstChild.disabled=!1)};SocialCalc.Popup.Types.List.Cancel=function(a,c){SocialCalc.Popup.Types.List.Hide(a,c)};SocialCalc.Popup.Types.ColorChooser={};\nSocialCalc.Popup.Types.ColorChooser.Create=function(a,c,b){a={type:a,value:\"\",display:\"\",data:{}};SocialCalc.Popup.Controls[c]=a;a=a.data;a.attribs=b||{};b=a.attribs;a.value=\"\";var d=document.getElementById(c);d?(a.mainele=d,d.innerHTML='<div style=\"cursor:pointer;border:1px solid black;vertical-align:top;width:'+(b.sampleWidth||\"15px\")+\";height:\"+(b.sampleHeight||\"15px\")+';\" onclick=\"SocialCalc.Popup.Types.ColorChooser.ControlClicked(\\''+c+\"');\\\"> </div>\"):alert(\"Missing element \"+c)};\nSocialCalc.Popup.Types.ColorChooser.SetValue=function(a,c,b){a=SocialCalc.Popup;c=a.Controls[c].data;var d=c.attribs;c.value=b;c.custom=!1;c.mainele&&c.mainele.firstChild&&(c.value?(c.mainele.firstChild.style.backgroundColor=c.value,b=d.backgroundImage?\"url(\"+a.imagePrefix+d.backgroundImage+\")\":\"\",a=\"center center\"):(c.mainele.firstChild.style.backgroundColor=\"#FFF\",d.backgroundImageDefault?(b=\"url(\"+a.imagePrefix+d.backgroundImageDefault+\")\",a=\"center center\"):(b=\"url(\"+a.imagePrefix+\"defaultcolor.gif)\",\na=\"left top\")),c.mainele.firstChild.style.backgroundPosition=a,TiddlyWiki&&(b=TiddlyWiki.getModifiedCssImageStyle(b)),c.mainele.firstChild.style.backgroundImage=b)};\nSocialCalc.Popup.Types.ColorChooser.SetDisabled=function(a,c,b){a=SocialCalc.Popup;var d=a.Controls[c].data,e=d.attribs;d.disabled=b;d.mainele&&d.mainele.firstChild&&(b?(d.mainele.firstChild.style.backgroundColor=\"#DDD\",e.backgroundImageDisabled?(img=\"url(\"+a.imagePrefix+e.backgroundImageDisabled+\")\",pos=\"center center\"):(img=\"url(\"+a.imagePrefix+\"defaultcolor.gif)\",pos=\"left top\"),d.mainele.firstChild.style.backgroundPosition=pos,TiddlyWiki&&(img=TiddlyWiki.getModifiedCssImageStyle(img)),d.mainele.firstChild.style.backgroundImage=\nimg):a.SetValue(c,d.value))};SocialCalc.Popup.Types.ColorChooser.GetValue=function(a,c){return SocialCalc.Popup.Controls[c].data.value};SocialCalc.Popup.Types.ColorChooser.Initialize=function(a,c,b){var d;a=SocialCalc.Popup;var e=a.Controls[c].data;for(d in b.attribs)e.attribs[d]=b.attribs[d];b.value&&a.SetValue(c,b.value)};\nSocialCalc.Popup.Types.ColorChooser.Reset=function(a){var c=SocialCalc.Popup,b=c.Types,d=c.Controls;c.Current.id&&d[c.Current.id].type==a&&(b[a].Hide(a,c.Current.id),c.Current.id=null)};\nSocialCalc.Popup.Types.ColorChooser.Show=function(a,c){var b,d;b=SocialCalc.Popup;var e=b.Controls[c].data;d=\"\";e.oldvalue=e.value;e.popupele=b.CreatePopupDiv(c,e.attribs);e.custom?(d=SocialCalc.Popup.Types.ColorChooser.MakeCustom(a,c),b=document.createElement(\"div\"),b.innerHTML='<div style=\"cursor:default;padding:4px;background-color:#CCC;\">'+d+\"</div>\",e.customele=b.firstChild.firstChild.childNodes[2]):(d=SocialCalc.Popup.Types.ColorChooser.CreateGrid(a,c),b=document.createElement(\"div\"),b.style.padding=\n\"3px\",b.style.backgroundColor=\"#CCC\",b.appendChild(d),e.customele=null);e.contentele=b;e.popupele.appendChild(b);e.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(c,e.attribs.ensureWithin)};\nSocialCalc.Popup.Types.ColorChooser.MakeCustom=function(a,c){var b=SocialCalc.Popup,d=b.LocalizeString,e=\"\";return e='<div style=\"white-space:nowrap;\"><br>#<input id=\"customvalue\" style=\"width:75px;\" value=\"'+b.Controls[c].data.value+'\"><br><br><input style=\"font-size:smaller;\" type=\"button\" value=\"'+d(\"OK\")+'\" onclick=\"SocialCalc.Popup.Types.ColorChooser.CustomOK(\\''+c+'\\');return false;\"><input style=\"font-size:smaller;\" type=\"button\" value=\"'+d(\"Grid\")+'\" onclick=\"SocialCalc.Popup.Types.ColorChooser.CustomToGrid(\\''+\nc+\"');\\\"><br></div>\"};SocialCalc.Popup.Types.ColorChooser.ItemClicked=function(a,c){SocialCalc.Popup.Close()};SocialCalc.Popup.Types.ColorChooser.CustomToList=function(a){};SocialCalc.Popup.Types.ColorChooser.CustomOK=function(a){var c=SocialCalc.Popup;c.SetValue(a,c.Controls[a].data.customele.value);c.Close()};SocialCalc.Popup.Types.ColorChooser.Hide=function(a,c){var b=SocialCalc.Popup,d=b.Controls[c].data;b.DestroyPopupDiv(d.popupele,d.dragregistered);d.popupele=null};\nSocialCalc.Popup.Types.ColorChooser.Cancel=function(a,c){var b=SocialCalc.Popup;b.SetValue(c,b.Controls[c].data.oldvalue);SocialCalc.Popup.Types.ColorChooser.Hide(a,c)};\nSocialCalc.Popup.Types.ColorChooser.CreateGrid=function(a,c){var b,d,e,f,g,l=SocialCalc.Popup,h=l.Types,m=l.LocalizeString;b=l.Controls[c].data;b.grid={};var p=b.grid,r=document.createElement(\"div\");b=document.createElement(\"table\");b.cellSpacing=0;b.cellPadding=0;b.style.width=\"100px\";p.table=b;b=document.createElement(\"tbody\");p.table.appendChild(b);p.tbody=b;for(d=0;16>d;d++){e=document.createElement(\"tr\");for(f=0;5>f;f++)g={},p[d+\",\"+f]=g,b=document.createElement(\"td\"),b.style.fontSize=\"1px\",\nb.innerHTML=\" \",b.style.height=\"10px\",1>=f?(b.style.width=\"17px\",b.style.borderRight=\"3px solid white\"):(b.style.width=\"20px\",b.style.backgroundRepeat=\"no-repeat\"),e.appendChild(b),g.ele=b;p.tbody.appendChild(e)}r.appendChild(p.table);b=document.createElement(\"div\");b.style.marginTop=\"3px\";b.innerHTML='<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"width:17px;background-color:#FFF;background-image:url('+l.imagePrefix+'defaultcolor.gif);height:16px;font-size:10px;cursor:pointer;\" title=\"'+\nm(\"Default\")+'\"> </td><td style=\"width:23px;height:16px;font-size:10px;text-align:center;cursor:pointer;\" title=\"'+m(\"Custom\")+'\">#</td><td style=\"width:60px;height:16px;font-size:10px;text-align:center;cursor:pointer;\">'+m(\"OK\")+\"</td></tr></table>\";TiddlyWiki&&(b.innerHTML=TiddlyWiki.getModifiedCssImageStyle(b.innerHTML));p.defaultbox=b.firstChild.firstChild.firstChild.childNodes[0];p.defaultbox.onclick=h.ColorChooser.DefaultClicked;p.custom=b.firstChild.firstChild.firstChild.childNodes[1];\np.custom.onclick=h.ColorChooser.CustomClicked;p.msg=b.firstChild.firstChild.firstChild.childNodes[2];p.msg.onclick=h.ColorChooser.CloseOK;r.appendChild(b);p.table.onmousedown=h.ColorChooser.GridMouseDown;h.ColorChooser.DetermineColors(c);h.ColorChooser.SetColors(c);return r};SocialCalc.Popup.Types.ColorChooser.gridToG=function(a,c,b){return a[c+\",\"+b]};\nSocialCalc.Popup.Types.ColorChooser.DetermineColors=function(a){var c=SocialCalc.Popup,b=c.Types.ColorChooser,d=c.Controls[a].data;a=d.grid;var e,f=c.splitRGB(d.value),d=2;e=16-Math.floor((f.r+16)/16);a[\"selectedrow\"+d]=e;for(e=0;16>e;e++)b.gridToG(a,e,d).rgb=c.makeRGB(17*(15-e),0,0);d=3;e=16-Math.floor((f.g+16)/16);a[\"selectedrow\"+d]=e;for(e=0;16>e;e++)b.gridToG(a,e,d).rgb=c.makeRGB(0,17*(15-e),0);d=4;e=16-Math.floor((f.b+16)/16);a[\"selectedrow\"+d]=e;for(e=0;16>e;e++)b.gridToG(a,e,d).rgb=c.makeRGB(0,\n0,17*(15-e));d=1;for(e=0;16>e;e++)b.gridToG(a,e,d).rgb=c.makeRGB(17*(15-e),17*(15-e),17*(15-e));var d=0,c=[0,68,153,204,255],f=\"400 310 420 440 442 340 040 042 032 044 024 004 204 314 402 414\".split(\" \"),g;for(e=0;16>e;e++)g=f[e],b.gridToG(a,e,d).rgb=\"rgb(\"+c[g.charAt(0)-0]+\",\"+c[g.charAt(1)-0]+\",\"+c[g.charAt(2)-0]+\")\"};\nSocialCalc.Popup.Types.ColorChooser.SetColors=function(a){var c,b,d,e=SocialCalc.Popup,f=e.Types.ColorChooser,g=e.Controls[a].data,l=g.grid;for(c=0;16>c;c++)for(b=0;5>b;b++)d=f.gridToG(l,c,b),d.ele.style.backgroundColor=d.rgb,d.ele.title=e.RGBToHex(d.rgb),d.ele.style.backgroundImage=l[\"selectedrow\"+b]==c?TiddlyWiki?TiddlyWiki.getModifiedCssImageStyle(\"url(\"+e.imagePrefix+\"chooserarrow.gif)\"):\"url(\"+e.imagePrefix+\"chooserarrow.gif)\":\"\";e.SetValue(a,g.value);l.msg.style.backgroundColor=g.value;a=e.splitRGB(g.value||\n\"rgb(255,255,255)\");l.msg.style.color=220>a.r+a.g+a.b?\"#FFF\":\"#000\";g.value?(l.msg.style.backgroundImage=\"\",l.msg.title=e.RGBToHex(g.value)):(l.msg.style.backgroundColor=\"#FFF\",l.msg.style.backgroundImage=TiddlyWiki?TiddlyWiki.getModifiedCssImageStyle(\"url(\"+e.imagePrefix+\"defaultcolor.gif)\"):\"url(\"+e.imagePrefix+\"defaultcolor.gif)\",l.msg.title=\"Default\")};\nSocialCalc.Popup.Types.ColorChooser.GridMouseDown=function(a){var c=a||window.event;a=SocialCalc.Popup;var b=a.Types.ColorChooser,d=a.Controls,e=a.Current.id;if(e){var d=d[e].data,f=d.grid;switch(c.type){case \"mousedown\":f.mousedown=!0;break;case \"mouseup\":f.mousedown=!1;break;case \"mousemove\":if(!f.mousedown)return}var g=SocialCalc.GetElementPositionWithScroll(d.mainele),l=c.clientX-g.left,h=c.clientY-g.top,c=SocialCalc.GetElementPositionWithScroll(f.table);c.left-=g.left;c.top-=g.top;g=Math.floor((h-\nc.top-2)/10);g=0>g?0:g;l=Math.floor((l-c.left)/20);l=0>l?0:4<l?4:l;f=b.gridToG(f,0>g?0:15<g?15:g,l).ele.style.backgroundColor;g=a.splitRGB(f);c=a.splitRGB(d.value);switch(l){case 2:d.value=a.makeRGB(g.r,c.g,c.b);break;case 3:d.value=a.makeRGB(c.r,g.g,c.b);break;case 4:d.value=a.makeRGB(c.r,c.g,g.b);break;case 0:case 1:d.value=f}b.DetermineColors(e);b.SetColors(e)}};\nSocialCalc.Popup.Types.ColorChooser.ControlClicked=function(a){var c=SocialCalc.Popup,b=c.Types.ColorChooser,d=c.Current.id;d&&a==d?b.CloseOK():c.CClick(a)};SocialCalc.Popup.Types.ColorChooser.DefaultClicked=function(a){var c=SocialCalc.Popup;a=c.Controls;if(c=c.Current.id)a=a[c].data,a.value=\"\",SocialCalc.Popup.SetValue(c,a.value),SocialCalc.Popup.Close()};\nSocialCalc.Popup.Types.ColorChooser.CustomClicked=function(a){a=SocialCalc.Popup;var c=a.Controls,b=a.Current.id;if(b){var c=c[b].data,d,e,f;d=c.contentele;e=SocialCalc.Popup.Types.ColorChooser.MakeCustom(\"ColorChooser\",b);f=document.createElement(\"div\");f.innerHTML='<div style=\"cursor:default;padding:4px;background-color:#CCC;\">'+e+\"</div>\";c.customele=f.firstChild.firstChild.childNodes[2];c.contentele=f;c.popupele.replaceChild(f,d);c.customele.value=a.RGBToHex(c.value);c.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(b,\nc.attribs.ensureWithin)}};\nSocialCalc.Popup.Types.ColorChooser.CustomToGrid=function(a){var c,b;c=SocialCalc.Popup;var d=c.Controls[a].data;SocialCalc.Popup.SetValue(a,c.HexToRGB(\"#\"+d.customele.value));var e;c=d.contentele;e=SocialCalc.Popup.Types.ColorChooser.CreateGrid(\"ColorChooser\",a);b=document.createElement(\"div\");b.style.padding=\"3px\";b.style.backgroundColor=\"#CCC\";b.appendChild(e);d.customele=null;d.contentele=b;d.popupele.replaceChild(b,c);d.attribs.ensureWithin&&SocialCalc.Popup.EnsurePosition(a,d.attribs.ensureWithin)};\nSocialCalc.Popup.Types.ColorChooser.CustomOK=function(a){var c=SocialCalc.Popup;SocialCalc.Popup.SetValue(a,c.HexToRGB(\"#\"+c.Controls[a].data.customele.value));SocialCalc.Popup.Close()};SocialCalc.Popup.Types.ColorChooser.CloseOK=function(a){var c=SocialCalc.Popup;a=c.Controls;if(c=c.Current.id)SocialCalc.Popup.SetValue(c,a[c].data.value),SocialCalc.Popup.Close()};SocialCalc||(alert(\"Main SocialCalc code module needed\"),SocialCalc={});SocialCalc.TableEditor||alert(\"SocialCalc TableEditor code module needed\");SocialCalc.CurrentSpreadsheetControlObject=null;\nSocialCalc.SpreadsheetControl=function(a,c){var b=SocialCalc.Constants;TiddlyWiki&&(this.tiddlyWiki=c,this.keyboard={areListener:!1,focusTable:null,passThru:null,didProcessKey:!1,statusFromProcessKey:!1,repeatingKeyPress:!1,chForProcessKey:\"\"},this.importExport=null);this.spreadsheetDiv=this.parentNode=null;this.viewheight=this.width=this.height=this.requestedSpaceBelow=this.requestedWidth=this.requestedHeight=0;this.tabs=[];this.tabnums={};this.tabreplacements={};this.currentTab=-1;this.views={};\nthis.editorDiv=this.spreadsheetDiv=this.editor=this.context=this.sheet=null;this.moverange=this.sortrange=\"\";this.idPrefix=a||\"SocialCalc-\";this.multipartBoundary=\"SocialCalcSpreadsheetControlSave\";this.imagePrefix=b.defaultImagePrefix;this.toolbarbackground=b.SCToolbarbackground;this.tabbackground=b.SCTabbackground;this.tabselectedCSS=b.SCTabselectedCSS;this.tabplainCSS=b.SCTabplainCSS;this.toolbartext=b.SCToolbartext;this.formulabarheight=b.SCFormulabarheight;this.statuslineheight=b.SCStatuslineheight;\nthis.statuslineCSS=b.SCStatuslineCSS;this.ExportCallback=null;this.sheet=new SocialCalc.Sheet;this.context=new SocialCalc.RenderContext(this.sheet);this.context.showGrid=!0;this.context.showRCHeaders=!0;this.editor=new SocialCalc.TableEditor(this.context);this.editor.StatusCallback.statusline={func:SocialCalc.SpreadsheetControlStatuslineCallback,params:{statuslineid:this.idPrefix+\"statusline\",recalcid1:this.idPrefix+\"divider_recalc\",recalcid2:this.idPrefix+\"button_recalc\"}};SocialCalc.CurrentSpreadsheetControlObject=\nthis;this.editor.MoveECellCallback.movefrom=function(a){var c=SocialCalc.GetSpreadsheetControlObject();c.context.cursorsuffix=\"\";a.range2.hasrange&&!a.cellhandles.noCursorSuffix&&(a.ecell.row==a.range2.top&&(a.ecell.col<a.range2.left||a.ecell.col>a.range2.right+1)&&(c.context.cursorsuffix=\"insertleft\"),a.ecell.col==a.range2.left&&(a.ecell.row<a.range2.top||a.ecell.row>a.range2.bottom+1)&&(c.context.cursorsuffix=\"insertup\"))};this.formulabuttons={formulafunctions:{image:\"formuladialog.gif\",tooltip:\"Functions\",\ncommand:SocialCalc.SpreadsheetControl.DoFunctionList},multilineinput:{image:\"multilinedialog.gif\",tooltip:\"Multi-line Input Box\",command:SocialCalc.SpreadsheetControl.DoMultiline},link:{image:\"linkdialog.gif\",tooltip:\"Link Input Box\",command:SocialCalc.SpreadsheetControl.DoLink},sum:{image:\"sumdialog.gif\",tooltip:\"Auto Sum\",command:SocialCalc.SpreadsheetControl.DoSum}};this.tabnums.edit=this.tabs.length;this.tabs.push({name:\"edit\",text:\"Edit\",html:' <div id=\"%id.edittools\" class=\"SocialCalc-toolbar\"> <img id=\"%id.button_undo\" src=\"%img.undo.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_redo\" src=\"%img.redo.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_copy\" src=\"%img.copy.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_cut\" src=\"%img.cut.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_paste\" src=\"%img.paste.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_delete\" src=\"%img.delete.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_pasteformats\" src=\"%img.pasteformats.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <span id=\"%id.locktools\"><img id=\"%id.button_lock\" src=\"%img.lock.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_unlock\" src=\"%img.unlock.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> </span> <img id=\"%id.button_filldown\" src=\"%img.filldown.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_fillright\" src=\"%img.fillright.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_movefrom\" src=\"%img.movefromoff.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_movepaste\" src=\"%img.movepasteoff.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_moveinsert\" src=\"%img.moveinsertoff.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_alignleft\" src=\"%img.alignleft.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_aligncenter\" src=\"%img.aligncenter.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_alignright\" src=\"%img.alignright.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_borderon\" src=\"%img.borderson.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_borderoff\" src=\"%img.bordersoff.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_swapcolors\" src=\"%img.swapcolors.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_merge\" src=\"%img.merge.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_unmerge\" src=\"%img.unmerge.gif\" style=\"vertical-align:bottom;\"> <img src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_insertrow\" src=\"%img.insertrow.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_insertcol\" src=\"%img.insertcol.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_deleterow\" src=\"%img.deleterow.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_deletecol\" src=\"%img.deletecol.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_hiderow\" src=\"%img.hiderow.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_hidecol\" src=\"%img.hidecol.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.divider_recalc\" src=\"%img.divider1.gif\" style=\"vertical-align:bottom;\"> <img id=\"%id.button_recalc\" src=\"%img.recalc.gif\" style=\"vertical-align:bottom;\"> </div>',\noncreate:null,onclick:null});this.tabnums.settings=this.tabs.length;this.tabs.push({name:\"settings\",text:\"Format\",html:'<div id=\"%id.settingstools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"> <div id=\"%id.sheetsettingstoolbar\" style=\"display:none;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr><td> <div style=\"%tbt.\">%loc!SHEET SETTINGS!:</div> </td></tr><tr><td> <input id=\"%id.settings-savesheet\" type=\"button\" value=\"%loc!Save!\" onclick=\"SocialCalc.SettingsControlSave(\\'sheet\\');\"> <input type=\"button\" value=\"%loc!Cancel!\" onclick=\"SocialCalc.SettingsControlSave(\\'cancel\\');\"> <input type=\"button\" value=\"%loc!Show Cell Settings!\" onclick=\"SocialCalc.SpreadsheetControlSettingsSwitch(\\'cell\\');return false;\"> </td></tr></table> </div> <div id=\"%id.cellsettingstoolbar\" style=\"display:none;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr><td> <div style=\"%tbt.\">%loc!CELL SETTINGS!: <span id=\"%id.settingsecell\"> </span></div> </td></tr><tr><td> <input id=\"%id.settings-savecell\" type=\"button\" value=\"%loc!Save!\" onclick=\"SocialCalc.SettingsControlSave(\\'cell\\');\"> <input type=\"button\" value=\"%loc!Cancel!\" onclick=\"SocialCalc.SettingsControlSave(\\'cancel\\');\"> <input type=\"button\" value=\"%loc!Show Sheet Settings!\" onclick=\"SocialCalc.SpreadsheetControlSettingsSwitch(\\'sheet\\');return false;\"> </td></tr></table> </div></div>',\nview:\"settings\",onclick:function(a,c){SocialCalc.SettingsControls.idPrefix=a.idPrefix;SocialCalc.SettingControlReset();var b=a.sheet.EncodeSheetAttributes(),g=a.sheet.EncodeCellAttributes(a.editor.ecell.coord);SocialCalc.SettingsControlLoadPanel(a.views.settings.values.sheetspanel,b);SocialCalc.SettingsControlLoadPanel(a.views.settings.values.cellspanel,g);document.getElementById(a.idPrefix+\"settingsecell\").innerHTML=a.editor.ecell.coord;SocialCalc.SpreadsheetControlSettingsSwitch(\"cell\");a.views.settings.element.style.height=\na.viewheight+\"px\";a.views.settings.element.firstChild.style.height=a.viewheight+\"px\";b=a.editor.range.hasrange?SocialCalc.crToCoord(a.editor.range.left,a.editor.range.top)+\":\"+SocialCalc.crToCoord(a.editor.range.right,a.editor.range.bottom):a.editor.ecell.coord;document.getElementById(a.idPrefix+\"settings-savecell\").value=SocialCalc.LocalizeString(\"Save to\")+\": \"+b},onclickFocus:!0});this.views.settings={name:\"settings\",values:{},oncreate:function(a,c){var b=SocialCalc.Constants;c.values.sheetspanel=\n{colorchooser:{id:a.idPrefix+\"scolorchooser\"},formatnumber:{setting:\"numberformat\",type:\"PopupList\",id:a.idPrefix+\"formatnumber\",initialdata:b.SCFormatNumberFormats},formattext:{setting:\"textformat\",type:\"PopupList\",id:a.idPrefix+\"formattext\",initialdata:b.SCFormatTextFormats},fontfamily:{setting:\"fontfamily\",type:\"PopupList\",id:a.idPrefix+\"fontfamily\",initialdata:b.SCFormatFontfamilies},fontlook:{setting:\"fontlook\",type:\"PopupList\",id:a.idPrefix+\"fontlook\",initialdata:b.SCFormatFontlook},fontsize:{setting:\"fontsize\",\ntype:\"PopupList\",id:a.idPrefix+\"fontsize\",initialdata:b.SCFormatFontsizes},textalignhoriz:{setting:\"textalignhoriz\",type:\"PopupList\",id:a.idPrefix+\"textalignhoriz\",initialdata:b.SCFormatTextAlignhoriz},numberalignhoriz:{setting:\"numberalignhoriz\",type:\"PopupList\",id:a.idPrefix+\"numberalignhoriz\",initialdata:b.SCFormatNumberAlignhoriz},alignvert:{setting:\"alignvert\",type:\"PopupList\",id:a.idPrefix+\"alignvert\",initialdata:b.SCFormatAlignVertical},textcolor:{setting:\"textcolor\",type:\"ColorChooser\",id:a.idPrefix+\n\"textcolor\"},bgcolor:{setting:\"bgcolor\",type:\"ColorChooser\",id:a.idPrefix+\"bgcolor\"},padtop:{setting:\"padtop\",type:\"PopupList\",id:a.idPrefix+\"padtop\",initialdata:b.SCFormatPadsizes},padright:{setting:\"padright\",type:\"PopupList\",id:a.idPrefix+\"padright\",initialdata:b.SCFormatPadsizes},padbottom:{setting:\"padbottom\",type:\"PopupList\",id:a.idPrefix+\"padbottom\",initialdata:b.SCFormatPadsizes},padleft:{setting:\"padleft\",type:\"PopupList\",id:a.idPrefix+\"padleft\",initialdata:b.SCFormatPadsizes},colwidth:{setting:\"colwidth\",\ntype:\"PopupList\",id:a.idPrefix+\"colwidth\",initialdata:b.SCFormatColwidth},recalc:{setting:\"recalc\",type:\"PopupList\",id:a.idPrefix+\"recalc\",initialdata:b.SCFormatRecalc},usermaxcol:{setting:\"usermaxcol\",type:\"PopupList\",id:a.idPrefix+\"usermaxcol\",initialdata:b.SCFormatUserMaxCol},usermaxrow:{setting:\"usermaxrow\",type:\"PopupList\",id:a.idPrefix+\"usermaxrow\",initialdata:b.SCFormatUserMaxRow}};c.values.cellspanel={name:\"cell\",colorchooser:{id:a.idPrefix+\"scolorchooser\"},cformatnumber:{setting:\"numberformat\",\ntype:\"PopupList\",id:a.idPrefix+\"cformatnumber\",initialdata:b.SCFormatNumberFormats},cformattext:{setting:\"textformat\",type:\"PopupList\",id:a.idPrefix+\"cformattext\",initialdata:b.SCFormatTextFormats},cfontfamily:{setting:\"fontfamily\",type:\"PopupList\",id:a.idPrefix+\"cfontfamily\",initialdata:b.SCFormatFontfamilies},cfontlook:{setting:\"fontlook\",type:\"PopupList\",id:a.idPrefix+\"cfontlook\",initialdata:b.SCFormatFontlook},cfontsize:{setting:\"fontsize\",type:\"PopupList\",id:a.idPrefix+\"cfontsize\",initialdata:b.SCFormatFontsizes},\ncalignhoriz:{setting:\"alignhoriz\",type:\"PopupList\",id:a.idPrefix+\"calignhoriz\",initialdata:b.SCFormatTextAlignhoriz},calignvert:{setting:\"alignvert\",type:\"PopupList\",id:a.idPrefix+\"calignvert\",initialdata:b.SCFormatAlignVertical},ctextcolor:{setting:\"textcolor\",type:\"ColorChooser\",id:a.idPrefix+\"ctextcolor\"},cbgcolor:{setting:\"bgcolor\",type:\"ColorChooser\",id:a.idPrefix+\"cbgcolor\"},cbt:{setting:\"bt\",type:\"BorderSide\",id:a.idPrefix+\"cbt\"},cbr:{setting:\"br\",type:\"BorderSide\",id:a.idPrefix+\"cbr\"},cbb:{setting:\"bb\",\ntype:\"BorderSide\",id:a.idPrefix+\"cbb\"},cbl:{setting:\"bl\",type:\"BorderSide\",id:a.idPrefix+\"cbl\"},cpadtop:{setting:\"padtop\",type:\"PopupList\",id:a.idPrefix+\"cpadtop\",initialdata:b.SCFormatPadsizes},cpadright:{setting:\"padright\",type:\"PopupList\",id:a.idPrefix+\"cpadright\",initialdata:b.SCFormatPadsizes},cpadbottom:{setting:\"padbottom\",type:\"PopupList\",id:a.idPrefix+\"cpadbottom\",initialdata:b.SCFormatPadsizes},cpadleft:{setting:\"padleft\",type:\"PopupList\",id:a.idPrefix+\"cpadleft\",initialdata:b.SCFormatPadsizes}};\nSocialCalc.SettingsControlInitializePanel(c.values.sheetspanel);SocialCalc.SettingsControlInitializePanel(c.values.cellspanel)},replacements:{itemtitle:{regex:/\\%itemtitle\\./g,replacement:'style=\"padding:12px 10px 0px 10px;font-weight:bold;text-align:right;vertical-align:top;font-size:small;\"'},sectiontitle:{regex:/\\%sectiontitle\\./g,replacement:'style=\"padding:16px 10px 0px 0px;font-weight:bold;vertical-align:top;font-size:small;color:#C00;\"'},parttitle:{regex:/\\%parttitle\\./g,replacement:'style=\"font-weight:bold;font-size:x-small;padding:0px 0px 3px 0px;\"'},\nitembody:{regex:/\\%itembody\\./g,replacement:'style=\"padding:12px 0px 0px 0px;vertical-align:top;font-size:small;\"'},bodypart:{regex:/\\%bodypart\\./g,replacement:'style=\"padding:0px 10px 0px 0px;font-size:small;vertical-align:top;\"'}},divStyle:\"border:1px solid black;overflow:auto;\",html:'<div id=\"%id.scolorchooser\" style=\"display:none;position:absolute;z-index:20;\"></div><table cellspacing=\"0\" cellpadding=\"0\"> <tr><td style=\"vertical-align:top;\"><table id=\"%id.sheetsettingstable\" style=\"display:none;\" cellspacing=\"0\" cellpadding=\"0\"><tr> <td %itemtitle.><br>%loc!Default Format!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Number!</div> <span id=\"%id.formatnumber\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Text!</div> <span id=\"%id.formattext\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Default Alignment!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Text Horizontal!</div> <span id=\"%id.textalignhoriz\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Number Horizontal!</div> <span id=\"%id.numberalignhoriz\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Vertical!</div> <span id=\"%id.alignvert\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Default Font!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Family!</div> <span id=\"%id.fontfamily\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Bold & Italics!</div> <span id=\"%id.fontlook\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Size!</div> <span id=\"%id.fontsize\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Color!</div> <div id=\"%id.textcolor\" class=\"SocialCalc-colorchooser\"></div> </td> <td %bodypart.> <div %parttitle.>%loc!Background!</div> <div id=\"%id.bgcolor\" class=\"SocialCalc-colorchooser\"></div> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Default Padding!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Top!</div> <span id=\"%id.padtop\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Right!</div> <span id=\"%id.padright\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Bottom!</div> <span id=\"%id.padbottom\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Left!</div> <span id=\"%id.padleft\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Default Column Width!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.> </div> <span id=\"%id.colwidth\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Recalculation!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.> </div> <span id=\"%id.recalc\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Dimensions!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Columns!</div> <span id=\"%id.usermaxcol\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Rows!</div> <span id=\"%id.usermaxrow\"></span> </td> </tr></table> </td></tr></table><table id=\"%id.cellsettingstable\" cellspacing=\"0\" cellpadding=\"0\"><tr> <td %itemtitle.><br>%loc!Format!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Number!</div> <span id=\"%id.cformatnumber\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Text!</div> <span id=\"%id.cformattext\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Alignment!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Horizontal!</div> <span id=\"%id.calignhoriz\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Vertical!</div> <span id=\"%id.calignvert\"></span> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Font!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Family!</div> <span id=\"%id.cfontfamily\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Bold & Italics!</div> <span id=\"%id.cfontlook\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Size!</div> <span id=\"%id.cfontsize\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Color!</div> <div id=\"%id.ctextcolor\" class=\"SocialCalc-colorchooser\"></div> </td> <td %bodypart.> <div %parttitle.>%loc!Background!</div> <div id=\"%id.cbgcolor\" class=\"SocialCalc-colorchooser\"></div> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Borders!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"> <tr><td %bodypart. colspan=\"3\"><div %parttitle.>%loc!Top Border!</div></td> <td %bodypart. colspan=\"3\"><div %parttitle.>%loc!Right Border!</div></td> <td %bodypart. colspan=\"3\"><div %parttitle.>%loc!Bottom Border!</div></td> <td %bodypart. colspan=\"3\"><div %parttitle.>%loc!Left Border!</div></td> </tr><tr> <td %bodypart.> <input id=\"%id.cbt-onoff-bcb\" onclick=\"SocialCalc.SettingsControlOnchangeBorder(this);\" type=\"checkbox\"> </td> <td %bodypart.> <div id=\"%id.cbt-color\" class=\"SocialCalc-colorchooser\"></div> </td> <td> </td> <td %bodypart.> <input id=\"%id.cbr-onoff-bcb\" onclick=\"SocialCalc.SettingsControlOnchangeBorder(this);\" type=\"checkbox\"> </td> <td %bodypart.> <div id=\"%id.cbr-color\" class=\"SocialCalc-colorchooser\"></div> </td> <td> </td> <td %bodypart.> <input id=\"%id.cbb-onoff-bcb\" onclick=\"SocialCalc.SettingsControlOnchangeBorder(this);\" type=\"checkbox\"> </td> <td %bodypart.> <div id=\"%id.cbb-color\" class=\"SocialCalc-colorchooser\"></div> </td> <td> </td> <td %bodypart.> <input id=\"%id.cbl-onoff-bcb\" onclick=\"SocialCalc.SettingsControlOnchangeBorder(this);\" type=\"checkbox\"> </td> <td %bodypart.> <div id=\"%id.cbl-color\" class=\"SocialCalc-colorchooser\"></div> </td> <td> </td> </tr></table> </td></tr><tr> <td %itemtitle.><br>%loc!Padding!:</td> <td %itembody.> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td %bodypart.> <div %parttitle.>%loc!Top!</div> <span id=\"%id.cpadtop\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Right!</div> <span id=\"%id.cpadright\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Bottom!</div> <span id=\"%id.cpadbottom\"></span> </td> <td %bodypart.> <div %parttitle.>%loc!Left!</div> <span id=\"%id.cpadleft\"></span> </td> </tr></table> </td></tr></table> </td><td style=\"vertical-align:top;padding:12px 0px 0px 12px;\"> <div style=\"width:100px;height:100px;overflow:hidden;border:1px solid black;background-color:#EEE;padding:6px;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td id=\"sample-text\" style=\"height:100px;width:100px;\"><div>%loc!This is a<br>sample!</div><div>-1234.5</div></td> </tr></table> </div> </td></tr></table><br>'};\nthis.tabnums.sort=this.tabs.length;this.tabs.push({name:\"sort\",text:\"Sort\",html:' <div id=\"%id.sorttools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;padding-right:4px;width:160px;\"> <div style=\"%tbt.\">%loc!Set Cells To Sort!</div> <select id=\"%id.sortlist\" size=\"1\" onfocus=\"%s.CmdGotFocus(this);\"><option selected>[select range]</option></select> <input type=\"button\" value=\"%loc!OK!\" onclick=\"%s.DoCmd(this, \\'ok-setsort\\');\" style=\"font-size:x-small;\"> </td> <td style=\"vertical-align:middle;padding-right:16px;width:100px;text-align:right;\"> <div style=\"%tbt.\"> </div> <input type=\"button\" id=\"%id.sortbutton\" value=\"%loc!Sort Cells! A1:A1\" onclick=\"%s.DoCmd(this, \\'dosort\\');\" style=\"visibility:hidden;\"> </td> <td style=\"vertical-align:top;padding-right:16px;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;\"> <div style=\"%tbt.\">%loc!Major Sort!</div> <select id=\"%id.majorsort\" size=\"1\" onfocus=\"%s.CmdGotFocus(this);\"></select> </td><td> <input type=\"radio\" name=\"majorsort\" id=\"%id.majorsortup\" value=\"up\" checked><span style=\"font-size:x-small;color:#FFF;\">%loc!Up!</span><br> <input type=\"radio\" name=\"majorsort\" id=\"%id.majorsortdown\" value=\"down\"><span style=\"font-size:x-small;color:#FFF;\">%loc!Down!</span> </td> </tr></table> </td> <td style=\"vertical-align:top;padding-right:16px;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;\"> <div style=\"%tbt.\">%loc!Minor Sort!</div> <select id=\"%id.minorsort\" size=\"1\" onfocus=\"%s.CmdGotFocus(this);\"></select> </td><td> <input type=\"radio\" name=\"minorsort\" id=\"%id.minorsortup\" value=\"up\" checked><span style=\"font-size:x-small;color:#FFF;\">%loc!Up!</span><br> <input type=\"radio\" name=\"minorsort\" id=\"%id.minorsortdown\" value=\"down\"><span style=\"font-size:x-small;color:#FFF;\">%loc!Down!</span> </td> </tr></table> </td> <td style=\"vertical-align:top;padding-right:16px;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;\"> <div style=\"%tbt.\">%loc!Last Sort!</div> <select id=\"%id.lastsort\" size=\"1\" onfocus=\"%s.CmdGotFocus(this);\"></select> </td><td> <input type=\"radio\" name=\"lastsort\" id=\"%id.lastsortup\" value=\"up\" checked><span style=\"font-size:x-small;color:#FFF;\">%loc!Up!</span><br> <input type=\"radio\" name=\"lastsort\" id=\"%id.lastsortdown\" value=\"down\"><span style=\"font-size:x-small;color:#FFF;\">%loc!Down!</span> </td> </tr></table> </td> </tr></table> </div>',\nonclick:SocialCalc.SpreadsheetControlSortOnclick});this.editor.SettingsCallbacks.sort={save:SocialCalc.SpreadsheetControlSortSave,load:SocialCalc.SpreadsheetControlSortLoad};this.tabnums.audit=this.tabs.length;this.tabs.push({name:\"audit\",text:\"Audit\",html:'<div id=\"%id.audittools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"> <div style=\"%tbt.\"> </div></div>',view:\"audit\",onclick:function(a,c){var b=SocialCalc.LocalizeString,g,l,h='<table cellspacing=\"0\" cellpadding=\"0\" style=\"margin-bottom:10px;\"><tr><td style=\"font-size:small;padding:6px;\"><b>'+\nb(\"Audit Trail This Session\")+\":</b><br><br>\",m=a.sheet.changes.stack,p=a.sheet.changes.tos;for(g=0;g<m.length;g++)for(g==p+1&&(h+='<br></td></tr><tr><td style=\"font-size:small;background-color:#EEE;padding:6px;\">'+b(\"UNDONE STEPS\")+\":<br>\"),l=0;l<m[g].command.length;l++)h+=SocialCalc.special_chars(m[g].command[l])+\"<br>\";a.views.audit.element.innerHTML=h+\"</td></tr></table>\";SocialCalc.CmdGotFocus(!0)},onclickFocus:!0});this.views.audit={name:\"audit\",divStyle:\"border:1px solid black;overflow:auto;\",\nhtml:\"Audit Trail\"};this.tabnums.comment=this.tabs.length;this.tabs.push({name:\"comment\",text:\"Comment\",html:'<div id=\"%id.commenttools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"><table cellspacing=\"0\" cellpadding=\"0\"><tr><td><textarea id=\"%id.commenttext\" class=\"SocialCalc-commenttext\" style=\"font-size:small;overflow:auto;\" onfocus=\"%s.CmdGotFocus(this);\"></textarea></td><td style=\"vertical-align:top;\"> <input type=\"button\" value=\"%loc!Save!\" onclick=\"%s.SpreadsheetControlCommentSet();\" style=\"font-size:x-small;\"></td></tr></table></div>',\nview:\"sheet\",onclick:SocialCalc.SpreadsheetControlCommentOnclick,onunclick:SocialCalc.SpreadsheetControlCommentOnunclick});this.tabnums.names=this.tabs.length;this.tabs.push({name:\"names\",text:\"Names\",html:'<div id=\"%id.namestools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;padding-right:24px;\"> <div style=\"%tbt.\">%loc!Existing Names!</div> <select id=\"%id.nameslist\" size=\"1\" onchange=\"%s.SpreadsheetControlNamesChangedName();\" onfocus=\"%s.CmdGotFocus(this);\"><option selected>[New]</option></select> </td> <td style=\"vertical-align:top;padding-right:6px;\"> <div style=\"%tbt.\">%loc!Name!</div> <input type=\"text\" id=\"%id.namesname\" style=\"font-size:x-small;width:75px;\" onfocus=\"%s.CmdGotFocus(this);\"> </td> <td style=\"vertical-align:top;padding-right:6px;\"> <div style=\"%tbt.\">%loc!Description!</div> <input type=\"text\" id=\"%id.namesdesc\" style=\"font-size:x-small;width:150px;\" onfocus=\"%s.CmdGotFocus(this);\"> </td> <td style=\"vertical-align:top;padding-right:6px;\"> <div style=\"%tbt.\">%loc!Value!</div> <input type=\"text\" id=\"%id.namesvalue\" width=\"16\" style=\"font-size:x-small;width:100px;\" onfocus=\"%s.CmdGotFocus(this);\"> </td> <td style=\"vertical-align:top;padding-right:12px;width:100px;\"> <div style=\"%tbt.\">%loc!Set Value To!</div> <input type=\"button\" id=\"%id.namesrangeproposal\" value=\"A1\" onclick=\"%s.SpreadsheetControlNamesSetValue();\" style=\"font-size:x-small;\"> </td> <td style=\"vertical-align:top;padding-right:6px;\"> <div style=\"%tbt.\"> </div> <input type=\"button\" value=\"%loc!Save!\" onclick=\"%s.SpreadsheetControlNamesSave();\" style=\"font-size:x-small;\"> <input type=\"button\" value=\"%loc!Delete!\" onclick=\"%s.SpreadsheetControlNamesDelete()\" style=\"font-size:x-small;\"> </td> </tr></table></div>',\nview:\"sheet\",onclick:SocialCalc.SpreadsheetControlNamesOnclick,onunclick:SocialCalc.SpreadsheetControlNamesOnunclick});this.tabnums.clipboard=this.tabs.length;this.tabs.push({name:\"clipboard\",text:\"Clipboard\",html:'<div id=\"%id.clipboardtools\" class=\"SocialCalc-toolbar\" style=\"display:none;\"> <table cellspacing=\"0\" cellpadding=\"0\"><tr> <td style=\"vertical-align:top;padding-right:24px;\"><!- *tiddlywiki* begin /> <div style=\"%tbt.\">'+SocialCalc.Constants.s_clipboard_menu_title+'</div> </td> <td style=\"vertical-align:top;padding-right:16px;\"> <span style=\"%tbt.\">%loc!Tiddler! : </span> <input type=\"text\" id=\"%id.clipboard-tiddler\" onfocus=\"%s.CmdGotFocus(this);\"> </td> <td style=\"vertical-align:top;\"> <input type=\"button\" value=\"%loc!Export!\" id=\"%id.clipboard-export\" style=\"font-size:x-small;\"> <select id=\"%id.clipboard-export-select-source\" onfocus=\"%s.CmdGotFocus(this);\"></select> <span style=\"%tbt.\"> %loc!to! </span> <select id=\"%id.clipboard-export-select-format\" onfocus=\"%s.CmdGotFocus(this);\"></select> <div style=\"padding-top:4px;\"> <input type=\"button\" value=\"%loc!Import!\" id=\"%id.clipboard-import\" style=\"font-size:x-small;\"> </div><!- *tiddlywiki* end /> </td> </tr></table></div>',\nview:\"clipboard\",onclick:SocialCalc.SpreadsheetControlClipboardOnclick,onclickFocus:\"clipboardtext\"});this.views.clipboard={name:\"clipboard\",divStyle:\"overflow:auto;\",html:'<div style=\"width:100%;height:100%;overflow:hidden\"> <div style=\"font-size:x-small;padding:5px 0px 10px 0px;\"> <b>%loc!Display Clipboard in!:</b> <input type=\"radio\" id=\"%id.clipboardformat-tab\" name=\"%id.clipboardformat\" checked onclick=\"%s.SpreadsheetControlClipboardFormat(\\'tab\\');\"> %loc!Tab-delimited format! <input type=\"radio\" id=\"%id.clipboardformat-csv\" name=\"%id.clipboardformat\" onclick=\"%s.SpreadsheetControlClipboardFormat(\\'csv\\');\"> %loc!CSV format! <input type=\"radio\" id=\"%id.clipboardformat-scsave\" name=\"%id.clipboardformat\" onclick=\"%s.SpreadsheetControlClipboardFormat(\\'scsave\\');\"> %loc!SocialCalc-save format! </div> <input type=\"button\" value=\"%loc!Load SocialCalc Clipboard With This!\" style=\"font-size:x-small;\" onclick=\"%s.SpreadsheetControlClipboardLoad();\"> <input type=\"button\" value=\"%loc!Clear SocialCalc Clipboard!\" style=\"font-size:x-small;\" onclick=\"%s.SpreadsheetControlClipboardClear();\"> <textarea id=\"%id.clipboardtext\" style=\"width:100%;height:80%;font-size:small;overflow:auto;margin-top:5px;\" onfocus=\"%s.CmdGotFocus(this);\"></textarea></div>'}};\nSocialCalc.SpreadsheetControl.prototype.InitializeSpreadsheetControl=function(a,c,b,d){return SocialCalc.InitializeSpreadsheetControl(this,a,c,b,d)};SocialCalc.SpreadsheetControl.prototype.DoOnResize=function(){return SocialCalc.DoOnResize(this)};SocialCalc.SpreadsheetControl.prototype.SizeSSDiv=function(){return SocialCalc.SizeSSDiv(this)};SocialCalc.SpreadsheetControl.prototype.ExecuteCommand=function(a,c){return SocialCalc.SpreadsheetControlExecuteCommand(this,a,c)};\nSocialCalc.SpreadsheetControl.prototype.CreateSheetHTML=function(){return SocialCalc.SpreadsheetControlCreateSheetHTML(this)};SocialCalc.SpreadsheetControl.prototype.CreateSpreadsheetSave=function(a){return SocialCalc.SpreadsheetControlCreateSpreadsheetSave(this,a)};SocialCalc.SpreadsheetControl.prototype.DecodeSpreadsheetSave=function(a){return SocialCalc.SpreadsheetControlDecodeSpreadsheetSave(this,a)};\nSocialCalc.SpreadsheetControl.prototype.CreateCellHTML=function(a){return SocialCalc.SpreadsheetControlCreateCellHTML(this,a)};SocialCalc.SpreadsheetControl.prototype.CreateCellHTMLSave=function(a){return SocialCalc.SpreadsheetControlCreateCellHTMLSave(this,a)};SocialCalc.SpreadsheetControl.prototype.ParseSheetSave=function(a){return this.sheet.ParseSheetSave(a)};SocialCalc.SpreadsheetControl.prototype.CreateSheetSave=function(){return this.sheet.CreateSheetSave()};\nSocialCalc.InitializeSpreadsheetControl=function(a,c,b,d,e){var f=SocialCalc.Constants,g=SocialCalc.LocalizeString,l=SocialCalc.LocalizeSubstrings,h,m,p,r=a.tabs,q=a.views;a.requestedHeight=b;a.requestedWidth=d;a.requestedSpaceBelow=e;\"string\"==typeof c&&(c=document.getElementById(c));null==c&&alert(\"SocialCalc.SpreadsheetControl not given parent node.\");a.parentNode=c;a.spreadsheetDiv=document.createElement(\"div\");a.SizeSSDiv();for(b=c.firstChild;null!=b;b=c.firstChild)c.removeChild(b);b=TiddlyWiki?\n'<div><div style=\"'+a.toolbarbackground+'padding:0px 0px 0p 0px;\">':'<div><div style=\"'+a.toolbarbackground+'padding:12px 10px 10px 4px;height:40px;\">';for(d=0;d<r.length;d++)b+=r[d].html;b+=\"</div>\";b=TiddlyWiki?b+('<div style=\"'+a.tabbackground+'margin:0px 0px 8px 0px;\">'):b+('<div style=\"'+a.tabbackground+'padding-bottom:4px;margin:0px 0px 8px 0px;\">');if(TiddlyWiki)for(d=0;d<r.length;d++)b+='<div id=\"%id.'+r[d].name+'tab\" style=\"'+(0==d?a.tabselectedCSS:a.tabplainCSS)+'\" onclick=\"%s.SetTab(this);\">'+\ng(r[d].text)+\"</div>\";else{b+='<table cellpadding=\"0\" cellspacing=\"0\"><tr>';for(d=0;d<r.length;d++)b+=' <td id=\"%id.'+r[d].name+'tab\" style=\"'+(0==d?a.tabselectedCSS:a.tabplainCSS)+'\" onclick=\"%s.SetTab(this);\">'+g(r[d].text)+\"</td>\";b+=\" </tr></table>\"}b+=\"</div></div>\";a.currentTab=0;for(m in a.tabreplacements)b=b.replace(a.tabreplacements[m].regex,a.tabreplacements[m].replacement);b=b.replace(/\\%s\\./g,\"SocialCalc.\");b=b.replace(/\\%id\\./g,a.idPrefix);b=b.replace(/\\%tbt\\./g,a.toolbartext);b=b.replace(/\\%img\\./g,\na.imagePrefix);b=l(b);if(TiddlyWiki){e=/[\"][.]?[/]?images\\/(.+?)[\"]/g;for(var n;n=e.exec(b);)(d=TiddlyWiki.getModifiedImgSrc(n[0].replace(/\\\"/g,\"\")))&&(b=b.replace(n[0],'\"'+d+'\"'))}a.spreadsheetDiv.innerHTML=b;c.appendChild(a.spreadsheetDiv);a.Buttons={button_undo:{tooltip:\"Undo\",command:\"undo\"},button_redo:{tooltip:\"Redo\",command:\"redo\"},button_copy:{tooltip:\"Copy\",command:\"copy\"},button_cut:{tooltip:\"Cut\",command:\"cut\"},button_paste:{tooltip:\"Paste\",command:\"paste\"},button_pasteformats:{tooltip:\"Paste Formats\",\ncommand:\"pasteformats\"},button_lock:{tooltip:\"Lock\",command:\"lock\"},button_unlock:{tooltip:\"Unlock\",command:\"unlock\"},button_delete:{tooltip:\"Delete Contents\",command:\"delete\"},button_filldown:{tooltip:\"Fill Down\",command:\"filldown\"},button_fillright:{tooltip:\"Fill Right\",command:\"fillright\"},button_movefrom:{tooltip:\"Set/Clear Move From\",command:\"movefrom\"},button_movepaste:{tooltip:\"Move Paste\",command:\"movepaste\"},button_moveinsert:{tooltip:\"Move Insert\",command:\"moveinsert\"},button_alignleft:{tooltip:\"Align Left\",\ncommand:\"align-left\"},button_aligncenter:{tooltip:\"Align Center\",command:\"align-center\"},button_alignright:{tooltip:\"Align Right\",command:\"align-right\"},button_borderon:{tooltip:\"Borders On\",command:\"borderon\"},button_borderoff:{tooltip:\"Borders Off\",command:\"borderoff\"},button_swapcolors:{tooltip:\"Swap Colors\",command:\"swapcolors\"},button_merge:{tooltip:\"Merge Cells\",command:\"merge\"},button_unmerge:{tooltip:\"Unmerge Cells\",command:\"unmerge\"},button_insertrow:{tooltip:\"Insert Row\",command:\"insertrow\"},\nbutton_insertcol:{tooltip:\"Insert Column\",command:\"insertcol\"},button_deleterow:{tooltip:\"Delete Row\",command:\"deleterow\"},button_deletecol:{tooltip:\"Delete Column\",command:\"deletecol\"},button_hiderow:{tooltip:\"Hide Row\",command:\"hiderow\"},button_hidecol:{tooltip:\"Hide Column\",command:\"hidecol\"},button_recalc:{tooltip:\"Recalc\",command:\"recalc\"}};for(p in a.Buttons)(c=document.getElementById(a.idPrefix+p))?(c.style.border=\"1px solid \"+f.ISCButtonBorderNormal,SocialCalc.TooltipRegister(c,g(a.Buttons[p].tooltip),\n{},a.spreadsheetDiv),SocialCalc.ButtonRegister(a.editor,c,{normalstyle:\"border:1px solid \"+f.ISCButtonBorderNormal+\";backgroundColor:\"+f.ISCButtonBorderNormal+\";\",hoverstyle:\"border:1px solid \"+f.ISCButtonBorderHover+\";backgroundColor:\"+f.ISCButtonBorderNormal+\";\",downstyle:\"border:1px solid \"+f.ISCButtonBorderDown+\";backgroundColor:\"+f.ISCButtonDownBackground+\";\"},{MouseDown:SocialCalc.DoButtonCmd,command:a.Buttons[p].command})):alert(\"Button \"+(a.idPrefix+p)+\" missing\");TiddlyWiki?(a.formulabarDiv=\ndocument.createElement(\"div\"),a.formulabarDiv.style=\"margin: 0px 0px 8px 0px;\",a.formulabarDiv.innerHTML='<input type=\"text\" style=\"width:70%;margin-right:4px;\" value=\"\">'):(a.formulabarDiv=document.createElement(\"div\"),a.formulabarDiv.style.height=a.formulabarheight+\"px\",a.formulabarDiv.innerHTML='<input type=\"text\" size=\"60\" value=\"\"> ');a.spreadsheetDiv.appendChild(a.formulabarDiv);f=new SocialCalc.InputBox(a.formulabarDiv.firstChild,a.editor);TiddlyWiki&&SocialCalc.CmdGotFocus(f.element);\nfor(p in a.formulabuttons){c=document.createElement(\"img\");c.id=a.idPrefix+p;if(TiddlyWiki){if(d=(a.formulabuttons[p].skipImagePrefix?\"\":a.imagePrefix)+a.formulabuttons[p].image,d=TiddlyWiki.getModifiedImgSrc(d))c.src=d}else c.src=(a.formulabuttons[p].skipImagePrefix?\"\":a.imagePrefix)+a.formulabuttons[p].image;c.style.verticalAlign=\"middle\";c.style.border=\"1px solid #FFF\";c.style.marginLeft=\"4px\";SocialCalc.TooltipRegister(c,g(a.formulabuttons[p].tooltip),{},a.spreadsheetDiv);SocialCalc.ButtonRegister(a.editor,\nc,{normalstyle:\"border:1px solid #FFF;backgroundColor:#FFF;\",hoverstyle:\"border:1px solid #CCC;backgroundColor:#FFF;\",downstyle:\"border:1px solid #000;backgroundColor:#FFF;\"},{MouseDown:a.formulabuttons[p].command,Disabled:function(){return a.editor.ECellReadonly()}});a.formulabarDiv.appendChild(c)}for(d=0;d<r.length;d++)if(r[d].oncreate)r[d].oncreate(a,r[d].name);a.nonviewheight=a.statuslineheight+a.spreadsheetDiv.firstChild.offsetHeight+a.spreadsheetDiv.lastChild.offsetHeight;a.viewheight=a.height-\na.nonviewheight;a.editorDiv=a.editor.CreateTableEditor(a.width,a.viewheight);a.spreadsheetDiv.appendChild(a.editorDiv);for(h in q){b=q[h].html;for(m in q[h].replacements)b=b.replace(q[h].replacements[m].regex,q[h].replacements[m].replacement);b=b.replace(/\\%s\\./g,\"SocialCalc.\");b=b.replace(/\\%id\\./g,a.idPrefix);b=b.replace(/\\%tbt\\./g,a.toolbartext);b=b.replace(/\\%img\\./g,a.imagePrefix);g=document.createElement(\"div\");SocialCalc.setStyles(g,q[h].divStyle);g.style.display=\"none\";g.style.width=a.width+\n\"px\";g.style.height=a.viewheight+\"px\";g.id=a.idPrefix+q[h].name+\"view\";b=l(b);g.innerHTML=b;a.spreadsheetDiv.appendChild(g);q[h].element=g;if(q[h].oncreate)q[h].oncreate(a,q[h])}q.sheet={name:\"sheet\",element:a.editorDiv};a.statuslineDiv=document.createElement(\"div\");TiddlyWiki?a.statuslineDiv.setAttribute(\"class\",\"SocialCalc-statusline\"):(a.statuslineDiv.style.cssText=a.statuslineCSS,a.statuslineDiv.style.height=a.statuslineheight-(a.statuslineDiv.style.paddingTop.slice(0,-2)-0)-(a.statuslineDiv.style.paddingBottom.slice(0,\n-2)-0)+\"px\");a.statuslineDiv.id=a.idPrefix+\"statusline\";a.spreadsheetDiv.appendChild(a.statuslineDiv);TiddlyWiki&&a.spreadsheetDiv.setAttribute(\"tabindex\",\"0\");if(a.spreadsheetDiv.addEventListener)a.spreadsheetDiv.addEventListener(\"mousedown\",function(){SocialCalc.SetSpreadsheetControlObject(a);TiddlyWiki&&(a.tiddlyWiki.saveTodo.flagStart=!0)},!1),a.spreadsheetDiv.addEventListener(\"mouseover\",function(){SocialCalc.SetSpreadsheetControlObject(a)},!1);else if(a.spreadsheetDiv.attachEvent)a.spreadsheetDiv.attachEvent(\"onmousedown\",\nfunction(){SocialCalc.SetSpreadsheetControlObject(a)}),a.spreadsheetDiv.attachEvent(\"onmouseover\",function(){SocialCalc.SetSpreadsheetControlObject(a)});else throw SocialCalc.Constants.s_BrowserNotSupported;};SocialCalc.LocalizeString=function(a){var c=SocialCalc.LocalizeStringList[a];c||(c=SocialCalc.Constants[\"s_loc_\"+a.toLowerCase().replace(/\\s/g,\"_\").replace(/\\W/g,\"X\")]||a,SocialCalc.LocalizeStringList[a]=c);return c};SocialCalc.LocalizeStringList={};\nSocialCalc.LocalizeSubstrings=function(a){var c=SocialCalc.LocalizeString;return a.replace(/%(loc|ssc)!(.*?)!/g,function(a,d,e){return\"ssc\"==d?SocialCalc.Constants[e]||alert(\"Missing constant: \"+e):c(e)})};SocialCalc.GetSpreadsheetControlObject=function(){var a=SocialCalc.CurrentSpreadsheetControlObject;if(a)return a};SocialCalc.SetSpreadsheetControlObject=function(a){SocialCalc.CurrentSpreadsheetControlObject=a;a.keyboard.focusTable&&a&&(a.keyboard.focusTable=a.editor)};\nSocialCalc.DoOnResize=function(a){var c,b=a.views;TiddlyWiki&&(a.keyboard.areListener=!1);if(a.SizeSSDiv()){for(vname in b)c=b[vname].element,c.style.width=a.width+\"px\",c.style.height=a.height-a.nonviewheight+\"px\";a.editor.ResizeTableEditor(a.width,a.height-a.nonviewheight)}};\nSocialCalc.SizeSSDiv=function(a){var c,b=!1,d;c=SocialCalc.GetViewportInfo();d=a.requestedHeight||c.height-(a.requestedSpaceBelow||0);a.height!=d&&(a.height=d,a.spreadsheetDiv.style.height=d+\"px\",b=!0);d=a.requestedWidth||c.width;a.width!=d&&(a.width=d,a.spreadsheetDiv.style.width=d+\"px\",b=!0);a.spreadsheetDiv.style.position=\"relative\";return b};\nSocialCalc.SetTab=function(a){var c,b,d,e,f,g={},l={},h=SocialCalc.GetSpreadsheetControlObject(),m=h.tabs,p=h.views;a=\"string\"==typeof a?a:a.id.slice(h.idPrefix.length,-3);if(h.editor.busy&&(!m[h.currentTab].view||\"sheet\"==m[h.currentTab].view))for(e=0;e<m.length;e++)if(m[e].name==a&&m[e].view&&\"sheet\"!=m[e].view)return;if(h.tabs[h.currentTab].onunclick)h.tabs[h.currentTab].onunclick(h,h.tabs[h.currentTab].name);for(e=0;e<m.length;e++)c=m[e].name,g[c]=document.getElementById(h.idPrefix+c+\"tab\"),l[c]=\ndocument.getElementById(h.idPrefix+c+\"tools\"),c==a?(b=e,l[c].style.display=\"block\",g[c].style.cssText=h.tabselectedCSS):(l[c].style.display=\"none\",g[c].style.cssText=h.tabplainCSS);h.currentTab=b;if(m[b].onclick)m[b].onclick(h,a);for(f in p)!m[b].view&&\"sheet\"==f||m[b].view==f?(p[f].element.style.display=\"block\",d=f):p[f].element.style.display=\"none\";m[b].onclickFocus?(b=m[b].onclickFocus,\"string\"==typeof b&&(b=document.getElementById(h.idPrefix+b),b.focus()),SocialCalc.CmdGotFocus(b)):SocialCalc.KeyboardFocus();\np[d].needsresize&&p[d].onresize&&(p[d].needsresize=!1,p[d].onresize(h,p[d]));\"sheet\"==d?(h.statuslineDiv.style.display=\"block\",h.editor.ScheduleRender()):h.statuslineDiv.style.display=\"none\"};\nSocialCalc.SpreadsheetControlStatuslineCallback=function(a,c,b,d){var e=document.getElementById(d.statuslineid);e&&(e.innerHTML=a.GetStatuslineString(c,b,d));switch(c){case \"cmdendnorender\":case \"calcfinished\":case \"doneposcalc\":c=document.getElementById(d.recalcid1);d=document.getElementById(d.recalcid2);if(!c||!d)break;\"yes\"==a.context.sheetobj.attribs.needsrecalc?(c.style.display=\"inline\",d.style.display=\"inline\"):(c.style.display=\"none\",d.style.display=\"none\")}};\nSocialCalc.UpdateSortRangeProposal=function(a){document.getElementById(SocialCalc.GetSpreadsheetControlObject().idPrefix+\"sortlist\").options[0].text=a.range.hasrange?SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom):SocialCalc.LocalizeString(\"[select range]\")};\nSocialCalc.LoadColumnChoosers=function(a){var c=SocialCalc.LocalizeString,b,d,e,f;a.sortrange&&-1==a.sortrange.indexOf(\":\")?(b=SocialCalc.Formula.LookupName(a.sheet,a.sortrange||\"\"),\"range\"==b.type?(b=b.value.match(/^(.*)\\|(.*)\\|$/),b=b[1]+\":\"+b[2]):b=\"A1:A1\"):b=a.sortrange;var g=SocialCalc.ParseRange(b);e=document.getElementById(a.idPrefix+\"majorsort\");f=e.selectedIndex;e.options.length=0;e.options[e.options.length]=new Option(c(\"[None]\"),\"\");for(b=g.cr1.col;b<=g.cr2.col;b++)d=SocialCalc.rcColname(b),\ne.options[e.options.length]=new Option(c(\"Column \")+d,d);e.selectedIndex=1<f&&f<=g.cr2.col-g.cr1.col+1?f:1;e=document.getElementById(a.idPrefix+\"minorsort\");f=e.selectedIndex;e.options.length=0;e.options[e.options.length]=new Option(c(\"[None]\"),\"\");for(b=g.cr1.col;b<=g.cr2.col;b++)d=SocialCalc.rcColname(b),e.options[e.options.length]=new Option(d,d);e.selectedIndex=0<f&&f<=g.cr2.col-g.cr1.col+1?f:0;e=document.getElementById(a.idPrefix+\"lastsort\");f=e.selectedIndex;e.options.length=0;e.options[e.options.length]=\nnew Option(c(\"[None]\"),\"\");for(b=g.cr1.col;b<=g.cr2.col;b++)d=SocialCalc.rcColname(b),e.options[e.options.length]=new Option(d,d);e.selectedIndex=0<f&&f<=g.cr2.col-g.cr1.col+1?f:0};SocialCalc.CmdGotFocus=function(a){SocialCalc.GetSpreadsheetControlObject().keyboard.passThru=a};SocialCalc.DoButtonCmd=function(a,c,b){SocialCalc.DoCmd(b.element,b.functionobj.command)};\nSocialCalc.DoCmd=function(a,c){var b,d,e,f,g,l;f=SocialCalc.GetSpreadsheetControlObject();e=f.editor;switch(c){case \"undo\":f.ExecuteCommand(\"undo\",\"\");break;case \"redo\":f.ExecuteCommand(\"redo\",\"\");break;case \"fill-rowcolstuff\":case \"fill-text\":e=c.substring(5);d=document.getElementById(f.idPrefix+e+\"list\");for(b=d.length=0;b<SocialCalc.SpreadsheetCmdTable[e].length;b++)d.options[b]=new Option(SocialCalc.SpreadsheetCmdTable[e][b].t);c=\"changed-\"+e;case \"changed-rowcolstuff\":case \"changed-text\":e=c.substring(8);\nd=document.getElementById(f.idPrefix+e+\"list\");d=SocialCalc.SpreadsheetCmdTable.slists[SocialCalc.SpreadsheetCmdTable[e][d.selectedIndex].s];f=document.getElementById(f.idPrefix+e+\"slist\");for(b=f.length=0;b<(d.length||0);b++)f.options[b]=new Option(d[b].t,d[b].s);return;case \"ok-rowcolstuff\":case \"ok-text\":e=c.substring(3);d=document.getElementById(f.idPrefix+e+\"list\");f=document.getElementById(f.idPrefix+e+\"slist\");b=SocialCalc.SpreadsheetCmdTable[e][d.selectedIndex].c;d=f[f.selectedIndex].value;\nSocialCalc.SpreadsheetControlExecuteCommand(a,b,d);break;case \"ok-setsort\":b=document.getElementById(f.idPrefix+\"sortlist\");f.sortrange=0==b.selectedIndex?e.range.hasrange?SocialCalc.crToCoord(e.range.left,e.range.top)+\":\"+SocialCalc.crToCoord(e.range.right,e.range.bottom):e.ecell.coord+\":\"+e.ecell.coord:b.options[b.selectedIndex].value;d=document.getElementById(f.idPrefix+\"sortbutton\");d.value=SocialCalc.LocalizeString(\"Sort \")+f.sortrange;d.style.visibility=\"visible\";SocialCalc.LoadColumnChoosers(f);\na&&a.blur&&a.blur();SocialCalc.KeyboardFocus();return;case \"dosort\":if(f.sortrange&&-1==f.sortrange.indexOf(\":\")){e=SocialCalc.Formula.LookupName(f.sheet,f.sortrange||\"\");if(\"range\"!=e.type)return;e=e.value.match(/^(.*)\\|(.*)\\|$/);e=e[1]+\":\"+e[2]}else e=f.sortrange;if(\"A1:A1\"==e)return;b=\"sort \"+e+\" \";e=document.getElementById(f.idPrefix+\"majorsort\");d=document.getElementById(f.idPrefix+\"majorsortup\");b+=e.options[e.selectedIndex].value+(d.checked?\" up\":\" down\");e=document.getElementById(f.idPrefix+\n\"minorsort\");0<e.selectedIndex&&(d=document.getElementById(f.idPrefix+\"minorsortup\"),b+=\" \"+e.options[e.selectedIndex].value+(d.checked?\" up\":\" down\"));e=document.getElementById(f.idPrefix+\"lastsort\");0<e.selectedIndex&&(d=document.getElementById(f.idPrefix+\"lastsortup\"),b+=\" \"+e.options[e.selectedIndex].value+(d.checked?\" up\":\" down\"));f.ExecuteCommand(b,\"\");break;case \"merge\":b=SocialCalc.SpreadsheetCmdLookup[c]||\"\";d=SocialCalc.SpreadsheetCmdSLookup[c]||\"\";f.ExecuteCommand(b,d);e.range.hasrange&&\n(e.MoveECell(SocialCalc.crToCoord(e.range.left,e.range.top)),e.RangeRemove());break;case \"movefrom\":e.range2.hasrange?(f.context.cursorsuffix=\"\",e.Range2Remove(),f.ExecuteCommand(\"redisplay\",\"\")):e.range.hasrange?(e.range2.top=e.range.top,e.range2.right=e.range.right,e.range2.bottom=e.range.bottom,e.range2.left=e.range.left,e.range2.hasrange=!0,e.MoveECell(SocialCalc.crToCoord(e.range.left,e.range.top))):(e.range2.top=e.ecell.row,e.range2.right=e.ecell.col,e.range2.bottom=e.ecell.row,e.range2.left=\ne.ecell.col,e.range2.hasrange=!0);b=e.range2.hasrange?\"\":\"off\";d=document.getElementById(f.idPrefix+\"button_movefrom\");d.src=f.imagePrefix+\"movefrom\"+b+\".gif\";d=document.getElementById(f.idPrefix+\"button_movepaste\");d.src=f.imagePrefix+\"movepaste\"+b+\".gif\";d=document.getElementById(f.idPrefix+\"button_moveinsert\");d.src=f.imagePrefix+\"moveinsert\"+b+\".gif\";e.range2.hasrange&&e.RangeRemove();break;case \"movepaste\":case \"moveinsert\":e.range2.hasrange&&(f.context.cursorsuffix=\"\",b=c+\" \"+SocialCalc.crToCoord(e.range2.left,\ne.range2.top)+\":\"+SocialCalc.crToCoord(e.range2.right,e.range2.bottom)+\" \"+e.ecell.coord,f.ExecuteCommand(b,\"\"),e.Range2Remove(),d=document.getElementById(f.idPrefix+\"button_movefrom\"),d.src=f.imagePrefix+\"movefromoff.gif\",d=document.getElementById(f.idPrefix+\"button_movepaste\"),d.src=f.imagePrefix+\"movepasteoff.gif\",d=document.getElementById(f.idPrefix+\"button_moveinsert\"),d.src=f.imagePrefix+\"moveinsertoff.gif\");break;case \"swapcolors\":b=f.sheet;g=b.GetAssuredCell(e.ecell.coord);d=b.attribs.defaultcolor?\nb.colors[b.attribs.defaultcolor]:\"rgb(0,0,0)\";l=b.attribs.defaultbgcolor?b.colors[b.attribs.defaultbgcolor]:\"rgb(255,255,255)\";e=g.color?b.colors[g.color]:d;e==l&&(e=\"\");b=g.bgcolor?b.colors[g.bgcolor]:l;b==d&&(b=\"\");f.ExecuteCommand(\"set %C color \"+b+\"%Nset %C bgcolor \"+e,\"\");break;default:b=SocialCalc.SpreadsheetCmdLookup[c]||\"\",d=SocialCalc.SpreadsheetCmdSLookup[c]||\"\",f.ExecuteCommand(b,d)}a&&a.blur&&a.blur();SocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetCmdLookup={copy:\"copy %C all\",cut:\"cut %C all\",paste:\"paste %C all\",pasteformats:\"paste %C formats\",lock:\"set %C readonly yes\",unlock:\"set %C readonly no\",\"delete\":\"erase %C formulas\",filldown:\"filldown %C all\",fillright:\"fillright %C all\",erase:\"erase %C all\",borderon:\"set %C bt %S%Nset %C br %S%Nset %C bb %S%Nset %C bl %S\",borderoff:\"set %C bt %S%Nset %C br %S%Nset %C bb %S%Nset %C bl %S\",merge:\"merge %C\",unmerge:\"unmerge %C\",\"align-left\":\"set %C cellformat left\",\"align-center\":\"set %C cellformat center\",\n\"align-right\":\"set %C cellformat right\",\"align-default\":\"set %C cellformat\",insertrow:\"insertrow %C\",insertcol:\"insertcol %C\",deleterow:\"deleterow %C\",deletecol:\"deletecol %C\",hiderow:\"set %H hide yes\",hidecol:\"set %W hide yes\",undo:\"undo\",redo:\"redo\",recalc:\"recalc\"};SocialCalc.SpreadsheetCmdSLookup={borderon:\"1px solid rgb(0,0,0)\",borderoff:\"\"};\nSocialCalc.SpreadsheetControlExecuteCommand=function(a,c,b){a=SocialCalc.GetSpreadsheetControlObject().editor;var d,e,f,g;a.range.hasrange?(e=d=SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom),f=SocialCalc.rcColname(a.range.left)+\":\"+SocialCalc.rcColname(a.range.right),g=a.range.top+\":\"+a.range.bottom):(e=a.ecell.coord,d=a.ecell.coord+\":\"+a.ecell.coord,f=SocialCalc.rcColname(SocialCalc.coordToCr(a.ecell.coord).col),g=SocialCalc.coordToCr(a.ecell.coord).row);\nc=c.replace(/%C/g,e);c=c.replace(/%R/g,d);c=c.replace(/%N/g,\"\\n\");c=c.replace(/%S/g,b);c=c.replace(/%W/g,f);c=c.replace(/%H/g,g);c=c.replace(/%P/g,\"%\");a.EditorScheduleSheetCommands(c,!0,!1)};SocialCalc.SpreadsheetControlCreateSheetHTML=function(a){var c,b;c=\"\";c=new SocialCalc.RenderContext(a.sheet);a=document.createElement(\"div\");b=c.RenderSheet(null,{type:\"html\"});a.appendChild(b);delete c;c=a.innerHTML;delete b;delete a;return c};\nSocialCalc.SpreadsheetControlCreateCellHTML=function(a,c,b){var d=\"\",d=a.sheet.cells[c];if(!d)return\"\";d=void 0==d.displaystring?SocialCalc.FormatValueForDisplay(a.sheet,d.datavalue,c,b||a.context.defaultHTMLlinkstyle):d.displaystring;\" \"==d&&(d=\"\");return d};\nSocialCalc.SpreadsheetControlCreateCellHTMLSave=function(a,c,b){var d,e,f,g,l,h=[];d=c?SocialCalc.ParseRange(c):{cr1:{row:1,col:1},cr2:{row:a.sheet.attribs.lastrow,col:a.sheet.attribs.lastcol}};c=d.cr1;d=d.cr2;h.push(\"version:1.0\");for(e=c.row;e<=d.row;e++)for(f=c.col;f<=d.col;f++)if(g=SocialCalc.crToCoord(f,e),l=a.sheet.cells[g])l=void 0==l.displaystring?SocialCalc.FormatValueForDisplay(a.sheet,l.datavalue,g,b||a.context.defaultHTMLlinkstyle):l.displaystring,\" \"!=l&&h.push(g+\":\"+SocialCalc.encodeForSave(l));\nh.push(\"\");return h.join(\"\\n\")};\nSocialCalc.SpreadsheetControl.DoFunctionList=function(){var a,c,b=SocialCalc.Formula,d=SocialCalc.Constants.function_classlist,e=SocialCalc.GetSpreadsheetControlObject(),f=e.idPrefix+\"function\";c=document.getElementById(f+\"dialog\");if(!c){b.FillFunctionInfo();c='<table><tr><td><span style=\"font-size:x-small;font-weight:bold\">%loc!Category!</span><br><select id=\"'+f+'class\" size=\"'+d.length+'\" style=\"width:120px;\" onchange=\"SocialCalc.SpreadsheetControl.FunctionClassChosen(this.options[this.selectedIndex].value);\">';for(a=\n0;a<d.length;a++)c+='<option value=\"'+d[a]+'\"'+(0==a?\" selected>\":\">\")+SocialCalc.special_chars(b.FunctionClasses[d[a]].name)+\"</option>\";c+='</select></td><td> </td><td id=\"'+f+'list\"><span style=\"font-size:x-small;font-weight:bold\">%loc!Functions!</span><br><select id=\"'+f+'name\" size=\"'+d.length+'\" style=\"width:240px;\" onchange=\"SocialCalc.SpreadsheetControl.FunctionChosen(this.options[this.selectedIndex].value);\" ondblclick=\"SocialCalc.SpreadsheetControl.DoFunctionPaste();\">';c+=SocialCalc.SpreadsheetControl.GetFunctionNamesStr(\"all\");\nc+='</td></tr><tr><td colspan=\"3\"><div id=\"'+f+'desc\" style=\"width:380px;height:80px;overflow:auto;font-size:x-small;\">'+SocialCalc.SpreadsheetControl.GetFunctionInfoStr(b.FunctionClasses[d[0]].items[0])+'</div><div style=\"width:380px;text-align:right;padding-top:6px;font-size:small;\"><input type=\"button\" value=\"%loc!Paste!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.DoFunctionPaste();\"> <input type=\"button\" value=\"%loc!Cancel!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.HideFunctions();\"></div></td></tr></table>';\nb=document.createElement(\"div\");b.id=f+\"dialog\";b.style.position=\"absolute\";d=SocialCalc.GetViewportInfo();a=SocialCalc.GetElementPositionWithScroll(e.spreadsheetDiv);b.style.top=d.height/3-a.top+\"px\";b.style.left=d.width/3-a.left+\"px\";b.style.zIndex=100;b.style.backgroundColor=\"#FFF\";b.style.border=\"1px solid black\";b.style.width=\"400px\";c=SocialCalc.LocalizeSubstrings('<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-bottom:1px solid black;\"><tr><td style=\"font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;\"> %loc!Function List!</td><td style=\"font-size:10px;cursor:default;color:#666;\" onclick=\"SocialCalc.SpreadsheetControl.HideFunctions();\"> X </td></tr></table><div class=\"SocialCalc-functiondialogbody\" style=\"background-color:#DDD;\">'+\nc+\"</div>\");b.innerHTML=c;SocialCalc.DragRegister(b.firstChild.firstChild.firstChild.firstChild,!0,!0,{MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null,positionobj:b},e.spreadsheetDiv);e.spreadsheetDiv.appendChild(b);c=document.getElementById(f+\"name\");c.focus();SocialCalc.CmdGotFocus(c)}};\nSocialCalc.SpreadsheetControl.GetFunctionNamesStr=function(a){var c,b=\"\";c=SocialCalc.Formula.FunctionClasses[a];for(a=0;a<c.items.length;a++)b+='<option value=\"'+c.items[a]+'\"'+(0==a?\" selected>\":\">\")+c.items[a]+\"</option>\";return b};SocialCalc.SpreadsheetControl.FillFunctionNames=function(a,c){var b,d;b=SocialCalc.Formula;c.length=0;d=b.FunctionClasses[a];for(b=0;b<d.items.length;b++)c.options[b]=new Option(d.items[b],d.items[b]),0==b&&(c.options[b].selected=!0)};\nSocialCalc.SpreadsheetControl.GetFunctionInfoStr=function(a){var c=SocialCalc.Formula,b=c.FunctionList[a],d=SocialCalc.special_chars;a=\"<b>\"+a+\"(\"+d(c.FunctionArgString(a))+\")</b><br>\";return a+=d(b[3])};SocialCalc.SpreadsheetControl.FunctionClassChosen=function(a){var c=SocialCalc.GetSpreadsheetControlObject().idPrefix+\"function\",b=SocialCalc.Formula;SocialCalc.SpreadsheetControl.FillFunctionNames(a,document.getElementById(c+\"name\"));SocialCalc.SpreadsheetControl.FunctionChosen(b.FunctionClasses[a].items[0])};\nSocialCalc.SpreadsheetControl.FunctionChosen=function(a){var c=SocialCalc.GetSpreadsheetControlObject().idPrefix+\"function\";document.getElementById(c+\"desc\").innerHTML=SocialCalc.SpreadsheetControl.GetFunctionInfoStr(a)};SocialCalc.SpreadsheetControl.HideFunctions=function(){var a=SocialCalc.GetSpreadsheetControlObject(),a=document.getElementById(a.idPrefix+\"functiondialog\");a.innerHTML=\"\";SocialCalc.DragUnregister(a);SocialCalc.KeyboardFocus();a.parentNode&&a.parentNode.removeChild(a)};\nSocialCalc.SpreadsheetControl.DoFunctionPaste=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=a.editor,b=document.getElementById(a.idPrefix+\"functionname\"),a=document.getElementById(a.idPrefix+\"multilinetextarea\"),b=b.value+\"(\";SocialCalc.SpreadsheetControl.HideFunctions();a?(a.value+=b,a.focus(),SocialCalc.CmdGotFocus(a)):c.EditorAddToInput(b,\"=\")};\nSocialCalc.SpreadsheetControl.DoMultiline=function(){var a=SocialCalc.LocalizeSubstrings,c,b,d=SocialCalc.GetSpreadsheetControlObject(),e=d.editor,f=e.workingvalues,d=SocialCalc.GetSpreadsheetControlObject(),g=d.idPrefix+\"multiline\";c=document.getElementById(g+\"dialog\");if(!c){switch(e.state){case \"start\":f.ecoord=e.ecell.coord;f.erow=e.ecell.row;f.ecol=e.ecell.col;e.RangeRemove();b=SocialCalc.GetCellContents(e.context.sheetobj,f.ecoord);break;case \"input\":case \"inputboxdirect\":b=e.inputBox.GetText()}e.inputBox.element.disabled=\n!0;b=SocialCalc.special_chars(b);c='<textarea id=\"'+g+'textarea\" style=\"width:380px;height:120px;margin:10px 0px 0px 6px;\">'+b+'</textarea><div style=\"width:380px;text-align:right;padding:6px 0px 4px 6px;font-size:small;\">'+a('<input type=\"button\" value=\"%loc!Set Cell Contents!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.DoMultilinePaste();\"> <input type=\"button\" value=\"%loc!Clear!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.DoMultilineClear();\"> <input type=\"button\" value=\"%loc!Cancel!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.HideMultiline();\"></div></div>');\nb=document.createElement(\"div\");b.id=g+\"dialog\";b.style.position=\"absolute\";e=SocialCalc.GetViewportInfo();f=SocialCalc.GetElementPositionWithScroll(d.spreadsheetDiv);b.style.top=e.height/3-f.top+\"px\";b.style.left=e.width/3-f.left+\"px\";b.style.zIndex=100;b.style.backgroundColor=\"#FFF\";b.style.border=\"1px solid black\";b.style.width=\"400px\";b.innerHTML='<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-bottom:1px solid black;\"><tr><td style=\"font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;\">'+\na(\" %loc!Multi-line Input Box!\")+'</td><td style=\"font-size:10px;cursor:default;color:#666;\" onclick=\"SocialCalc.SpreadsheetControl.HideMultiline();\"> X </td></tr></table><div style=\"background-color:#DDD;\">'+c+\"</div>\";SocialCalc.DragRegister(b.firstChild.firstChild.firstChild.firstChild,!0,!0,{MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null,positionobj:b},d.spreadsheetDiv);d.spreadsheetDiv.appendChild(b);\nc=document.getElementById(g+\"textarea\");c.focus();SocialCalc.CmdGotFocus(c)}};SocialCalc.SpreadsheetControl.HideMultiline=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=a.editor,a=document.getElementById(a.idPrefix+\"multilinedialog\");a.innerHTML=\"\";SocialCalc.DragUnregister(a);SocialCalc.KeyboardFocus();a.parentNode&&a.parentNode.removeChild(a);switch(c.state){case \"start\":c.inputBox.DisplayCellContents(null);break;case \"input\":case \"inputboxdirect\":c.inputBox.element.disabled=!1,c.inputBox.Focus()}};\nSocialCalc.SpreadsheetControl.DoMultilineClear=function(){var a=SocialCalc.GetSpreadsheetControlObject(),a=document.getElementById(a.idPrefix+\"multilinetextarea\");a.value=\"\";a.focus()};\nSocialCalc.SpreadsheetControl.DoMultilinePaste=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=a.editor,b=c.workingvalues,a=document.getElementById(a.idPrefix+\"multilinetextarea\").value;SocialCalc.SpreadsheetControl.HideMultiline();switch(c.state){case \"start\":b.partialexpr=\"\";b.ecoord=c.ecell.coord;b.erow=c.ecell.row;b.ecol=c.ecell.col;break;case \"input\":case \"inputboxdirect\":c.inputBox.Blur(),c.inputBox.ShowInputBox(!1),c.state=\"start\"}c.EditorSaveEdit(a)};\nSocialCalc.SpreadsheetControl.DoLink=function(){var a=SocialCalc.LocalizeString,c,b,d,e,f=SocialCalc.GetSpreadsheetControlObject();d=f.editor;e=d.workingvalues;var f=SocialCalc.GetSpreadsheetControlObject(),g=f.idPrefix+\"link\";b=document.getElementById(g+\"dialog\");if(!b){switch(d.state){case \"start\":e.ecoord=d.ecell.coord;e.erow=d.ecell.row;e.ecol=d.ecell.col;d.RangeRemove();c=SocialCalc.GetCellContents(d.context.sheetobj,e.ecoord);break;case \"input\":case \"inputboxdirect\":c=d.inputBox.GetText()}d.inputBox.element.disabled=\n!0;\"'\"==c.charAt(0)&&(c=c.slice(1));b=SocialCalc.ParseCellLinkText(c);SocialCalc.special_chars(c);d=(c=f.sheet.cells[d.ecell.coord])&&c.textvalueformat?\"\":\" checked\";e=b.newwin?\" checked\":\"\";c='<div style=\"padding:6px 0px 4px 6px;\"><span style=\"font-size:smaller;\">'+a(\"Description\")+'</span><br><input type=\"text\" id=\"'+g+'desc\" style=\"width:380px;\" value=\"'+SocialCalc.special_chars(b.desc)+'\"><br><span style=\"font-size:smaller;\">'+a(\"URL\")+'</span><br><input type=\"text\" id=\"'+g+'url\" style=\"width:380px;\" value=\"'+\nSocialCalc.special_chars(b.url)+'\"><br>';SocialCalc.Callbacks.MakePageLink&&(c+='<span style=\"font-size:smaller;\">'+a(\"Page Name\")+'</span><br><input type=\"text\" id=\"'+g+'pagename\" style=\"width:380px;\" value=\"'+SocialCalc.special_chars(b.pagename)+'\"><br><span style=\"font-size:smaller;\">'+a(\"Workspace\")+'</span><br><input type=\"text\" id=\"'+g+'workspace\" style=\"width:380px;\" value=\"'+SocialCalc.special_chars(b.workspace)+'\"><br>');c+=SocialCalc.LocalizeSubstrings('<input type=\"checkbox\" id=\"'+g+'format\"'+\nd+'> <span style=\"font-size:smaller;\">%loc!Set to Link format!</span><br><input type=\"checkbox\" id=\"'+g+'popup\"'+e+'> <span style=\"font-size:smaller;\">%loc!Show in new browser window!</span></div><div style=\"width:380px;text-align:right;padding:6px 0px 4px 6px;font-size:small;\"><input type=\"button\" value=\"%loc!Set Cell Contents!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.DoLinkPaste();\"> <input type=\"button\" value=\"%loc!Clear!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.DoLinkClear();\"> <input type=\"button\" value=\"%loc!Cancel!\" style=\"font-size:smaller;\" onclick=\"SocialCalc.SpreadsheetControl.HideLink();\"></div></div>');\nb=document.createElement(\"div\");b.id=g+\"dialog\";b.style.position=\"absolute\";d=SocialCalc.GetViewportInfo();e=SocialCalc.GetElementPositionWithScroll(f.spreadsheetDiv);b.style.top=d.height/3-e.top+\"px\";b.style.left=d.width/3-e.left+\"px\";b.style.zIndex=100;b.style.backgroundColor=\"#FFF\";b.style.border=\"1px solid black\";b.style.width=\"400px\";b.innerHTML='<table cellspacing=\"0\" cellpadding=\"0\" style=\"border-bottom:1px solid black;\"><tr><td style=\"font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;\"> '+\na(\"Link Input Box\")+'</td><td style=\"font-size:10px;cursor:default;color:#666;\" onclick=\"SocialCalc.SpreadsheetControl.HideLink();\"> X </td></tr></table><div style=\"background-color:#DDD;\">'+c+\"</div>\";SocialCalc.DragRegister(b.firstChild.firstChild.firstChild.firstChild,!0,!0,{MouseDown:SocialCalc.DragFunctionStart,MouseMove:SocialCalc.DragFunctionPosition,MouseUp:SocialCalc.DragFunctionPosition,Disabled:null,positionobj:b},f.spreadsheetDiv);f.spreadsheetDiv.appendChild(b);b=document.getElementById(g+\n\"url\");b.focus();SocialCalc.CmdGotFocus(b)}};SocialCalc.SpreadsheetControl.HideLink=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=a.editor,a=document.getElementById(a.idPrefix+\"linkdialog\");a.innerHTML=\"\";SocialCalc.DragUnregister(a);SocialCalc.KeyboardFocus();a.parentNode&&a.parentNode.removeChild(a);switch(c.state){case \"start\":c.inputBox.DisplayCellContents(null);break;case \"input\":case \"inputboxdirect\":c.inputBox.element.disabled=!1,c.inputBox.Focus()}};\nSocialCalc.SpreadsheetControl.DoLinkClear=function(){var a=SocialCalc.GetSpreadsheetControlObject();document.getElementById(a.idPrefix+\"linkdesc\").value=\"\";document.getElementById(a.idPrefix+\"linkpagename\").value=\"\";document.getElementById(a.idPrefix+\"linkworkspace\").value=\"\";a=document.getElementById(a.idPrefix+\"linkurl\");a.value=\"\";a.focus()};\nSocialCalc.SpreadsheetControl.DoLinkPaste=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=a.editor,b=c.workingvalues,d=document.getElementById(a.idPrefix+\"linkdesc\"),e=document.getElementById(a.idPrefix+\"linkurl\"),f=document.getElementById(a.idPrefix+\"linkpagename\"),g=document.getElementById(a.idPrefix+\"linkworkspace\"),l=document.getElementById(a.idPrefix+\"linkformat\"),h=\"\",m,p;document.getElementById(a.idPrefix+\"linkpopup\").checked?(a=\"<<\",h=\">>\",m=\"[[\",p=\"]]\"):(a=\"<\",h=\">\",m=\"[\",p=\"]\");\nh=f&&f.value?g.value?d.value+\"{\"+g.value+m+f.value+p+\"}\":d.value+m+f.value+p:d.value+a+e.value+h;SocialCalc.SpreadsheetControl.HideLink();switch(c.state){case \"start\":b.partialexpr=\"\";b.ecoord=c.ecell.coord;b.erow=c.ecell.row;b.ecol=c.ecell.col;break;case \"input\":case \"inputboxdirect\":c.inputBox.Blur(),c.inputBox.ShowInputBox(!1),c.state=\"start\"}l.checked&&SocialCalc.SpreadsheetControlExecuteCommand(null,\"set %C textvalueformat text-link\",\"\");c.EditorSaveEdit(h)};\nSocialCalc.SpreadsheetControl.DoSum=function(){var a,c,b,d,e=SocialCalc.GetSpreadsheetControlObject().editor,f=e.context.sheetobj;if(e.range.hasrange)a=SocialCalc.crToCoord(e.range.left,e.range.top)+\":\"+SocialCalc.crToCoord(e.range.right,e.range.bottom),a=\"set \"+SocialCalc.crToCoord(e.range.right,e.range.bottom+1)+\" formula sum(\"+a+\")\";else if(a=e.ecell.row-1,b=e.ecell.col,1>=a)a=\"set \"+e.ecell.coord+\" constant e#REF! 0 #REF!\";else{for(d=!1;0<a;){c=SocialCalc.crToCoord(b,a);c=f.GetAssuredCell(c);\nif(c.datatype&&\"t\"!=c.datatype)d=!0;else if(d){a++;break}a--}a=\"set \"+e.ecell.coord+\" formula sum(\"+SocialCalc.crToCoord(b,a)+\":\"+SocialCalc.crToCoord(b,e.ecell.row-1)+\")\"}e.EditorScheduleSheetCommands(a,!0,!1)};\nSocialCalc.SpreadsheetControlSortOnclick=function(a,c){var b,d,e=[],f=document.getElementById(a.idPrefix+\"sortlist\");SocialCalc.LoadColumnChoosers(a);a.editor.RangeChangeCallback.sort=SocialCalc.UpdateSortRangeProposal;for(b in a.sheet.names)e.push(b);e.sort();f.length=0;f.options[0]=new Option(SocialCalc.LocalizeString(\"[select range]\"));for(d=0;d<e.length;d++)b=e[d],f.options[d+1]=new Option(b,b),b==a.sortrange&&(f.options[d+1].selected=!0);\"\"==a.sortrange&&(f.options[0].selected=!0);SocialCalc.UpdateSortRangeProposal(a.editor);\nSocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetControlSortSave=function(a,c){var b=SocialCalc.GetSpreadsheetControlObject(),d,e,f;d=\"sort:\"+SocialCalc.encodeForSave(b.sortrange)+\":\";e=document.getElementById(b.idPrefix+\"majorsort\");f=document.getElementById(b.idPrefix+\"majorsortup\");d+=e.selectedIndex+(f.checked?\":up\":\":down\");e=document.getElementById(b.idPrefix+\"minorsort\");0<e.selectedIndex?(f=document.getElementById(b.idPrefix+\"minorsortup\"),d+=\":\"+e.selectedIndex+(f.checked?\":up\":\":down\")):d+=\"::\";e=document.getElementById(b.idPrefix+\n\"lastsort\");0<e.selectedIndex?(f=document.getElementById(b.idPrefix+\"lastsortup\"),d+=\":\"+e.selectedIndex+(f.checked?\":up\":\":down\")):d+=\"::\";return d+\"\\n\"};\nSocialCalc.SpreadsheetControlSortLoad=function(a,c,b,d){a=SocialCalc.GetSpreadsheetControlObject();b=b.split(\":\");a.sortrange=SocialCalc.decodeFromSave(b[1]);c=document.getElementById(a.idPrefix+\"sortbutton\");a.sortrange?(c.value=SocialCalc.LocalizeString(\"Sort \")+a.sortrange,c.style.visibility=\"visible\"):c.style.visibility=\"hidden\";SocialCalc.LoadColumnChoosers(a);sele=document.getElementById(a.idPrefix+\"majorsort\");sele.selectedIndex=b[2]-0;document.getElementById(a.idPrefix+\"majorsort\"+b[3]).checked=\n!0;sele=document.getElementById(a.idPrefix+\"minorsort\");b[4]?(sele.selectedIndex=b[4]-0,document.getElementById(a.idPrefix+\"minorsort\"+b[5]).checked=!0):(sele.selectedIndex=0,document.getElementById(a.idPrefix+\"minorsortup\").checked=!0);sele=document.getElementById(a.idPrefix+\"lastsort\");b[6]?(sele.selectedIndex=b[6]-0,document.getElementById(a.idPrefix+\"lastsort\"+b[7]).checked=!0):(sele.selectedIndex=0,document.getElementById(a.idPrefix+\"lastsortup\").checked=!0);return!0};\nSocialCalc.SpreadsheetControlCommentOnclick=function(a,c){a.editor.MoveECellCallback.comment=SocialCalc.SpreadsheetControlCommentMoveECell;SocialCalc.SpreadsheetControlCommentDisplay(a,c);SocialCalc.KeyboardFocus()};SocialCalc.SpreadsheetControlCommentDisplay=function(a,c){var b=\"\";a.editor.ecell&&a.editor.ecell.coord&&a.sheet.cells[a.editor.ecell.coord]&&(b=a.sheet.cells[a.editor.ecell.coord].comment||\"\");document.getElementById(a.idPrefix+\"commenttext\").value=b};\nSocialCalc.SpreadsheetControlCommentMoveECell=function(a){SocialCalc.SpreadsheetControlCommentDisplay(SocialCalc.GetSpreadsheetControlObject(),\"comment\")};\nSocialCalc.SpreadsheetControlCommentSet=function(){var a=SocialCalc.GetSpreadsheetControlObject();a.ExecuteCommand(\"set %C comment \"+SocialCalc.encodeForSave(document.getElementById(a.idPrefix+\"commenttext\").value));var c=SocialCalc.GetEditorCellElement(a.editor,a.editor.ecell.row,a.editor.ecell.col);a.editor.ECellReadonly()||(c.element.title=document.getElementById(a.idPrefix+\"commenttext\").value,a.editor.UpdateCellCSS(c,a.editor.ecell.row,a.editor.ecell.col));SocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetControlCommentOnunclick=function(a,c){delete a.editor.MoveECellCallback.comment};\nSocialCalc.SpreadsheetControlNamesOnclick=function(a,c){document.getElementById(a.idPrefix+\"namesname\").value=\"\";document.getElementById(a.idPrefix+\"namesdesc\").value=\"\";document.getElementById(a.idPrefix+\"namesvalue\").value=\"\";a.editor.RangeChangeCallback.names=SocialCalc.SpreadsheetControlNamesRangeChange;a.editor.MoveECellCallback.names=SocialCalc.SpreadsheetControlNamesRangeChange;SocialCalc.SpreadsheetControlNamesRangeChange(a.editor);SocialCalc.SpreadsheetControlNamesFillNameList();SocialCalc.SpreadsheetControlNamesChangedName()};\nSocialCalc.SpreadsheetControlNamesFillNameList=function(){var a=SocialCalc.LocalizeString,c,b=[],d=SocialCalc.GetSpreadsheetControlObject(),e=document.getElementById(d.idPrefix+\"nameslist\"),f=document.getElementById(d.idPrefix+\"namesname\").value.toUpperCase().replace(/[^A-Z0-9_\\.]/g,\"\");for(c in d.sheet.names)b.push(c);b.sort();e.length=0;e.options[0]=0<b.length?new Option(a(\"[New]\")):new Option(a(\"[None]\"));for(a=0;a<b.length;a++)c=b[a],e.options[a+1]=new Option(c,c),c==f&&(e.options[a+1].selected=\n!0);\"\"==f&&(e.options[0].selected=!0)};\nSocialCalc.SpreadsheetControlNamesChangedName=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=document.getElementById(a.idPrefix+\"nameslist\"),c=c.options[c.selectedIndex].value;a.sheet.names[c]?(document.getElementById(a.idPrefix+\"namesname\").value=c,document.getElementById(a.idPrefix+\"namesdesc\").value=a.sheet.names[c].desc||\"\",document.getElementById(a.idPrefix+\"namesvalue\").value=a.sheet.names[c].definition||\"\"):(document.getElementById(a.idPrefix+\"namesname\").value=\"\",document.getElementById(a.idPrefix+\n\"namesdesc\").value=\"\",document.getElementById(a.idPrefix+\"namesvalue\").value=\"\")};SocialCalc.SpreadsheetControlNamesRangeChange=function(a){var c=SocialCalc.GetSpreadsheetControlObject();document.getElementById(c.idPrefix+\"namesrangeproposal\").value=a.range.hasrange?SocialCalc.crToCoord(a.range.left,a.range.top)+\":\"+SocialCalc.crToCoord(a.range.right,a.range.bottom):a.ecell.coord};SocialCalc.SpreadsheetControlNamesOnunclick=function(a,c){delete a.editor.RangeChangeCallback.names;delete a.editor.MoveECellCallback.names};\nSocialCalc.SpreadsheetControlNamesSetValue=function(){var a=SocialCalc.GetSpreadsheetControlObject();document.getElementById(a.idPrefix+\"namesvalue\").value=document.getElementById(a.idPrefix+\"namesrangeproposal\").value;SocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetControlNamesSave=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=document.getElementById(a.idPrefix+\"namesname\").value;SocialCalc.SetTab(a.tabs[0].name);SocialCalc.KeyboardFocus();\"\"!=c&&a.ExecuteCommand(\"name define \"+c+\" \"+document.getElementById(a.idPrefix+\"namesvalue\").value+\"\\nname desc \"+c+\" \"+document.getElementById(a.idPrefix+\"namesdesc\").value)};\nSocialCalc.SpreadsheetControlNamesDelete=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=document.getElementById(a.idPrefix+\"namesname\").value;SocialCalc.SetTab(a.tabs[0].name);SocialCalc.KeyboardFocus();\"\"!=c&&a.ExecuteCommand(\"name delete \"+c);SocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetControlClipboardOnclick=function(a,c){a=SocialCalc.GetSpreadsheetControlObject();TiddlyWiki&&a.tiddlyWiki.clickImportExportUI(a);clipele=document.getElementById(a.idPrefix+\"clipboardtext\");document.getElementById(a.idPrefix+\"clipboardformat-tab\").checked=!0;clipele.value=SocialCalc.ConvertSaveToOtherFormat(SocialCalc.Clipboard.clipboard,\"tab\")};\nSocialCalc.SpreadsheetControlClipboardFormat=function(a){var c=SocialCalc.GetSpreadsheetControlObject();clipele=document.getElementById(c.idPrefix+\"clipboardtext\");clipele.value=SocialCalc.ConvertSaveToOtherFormat(SocialCalc.Clipboard.clipboard,a)};\nSocialCalc.SpreadsheetControlClipboardLoad=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=\"tab\";SocialCalc.SetTab(a.tabs[0].name);SocialCalc.KeyboardFocus();document.getElementById(a.idPrefix+\"clipboardformat-csv\").checked?c=\"csv\":document.getElementById(a.idPrefix+\"clipboardformat-scsave\").checked&&(c=\"scsave\");a.editor.EditorScheduleSheetCommands(\"loadclipboard \"+SocialCalc.encodeForSave(SocialCalc.ConvertOtherFormatToSave(document.getElementById(a.idPrefix+\"clipboardtext\").value,c)),\n!0,!1)};SocialCalc.SpreadsheetControlClipboardClear=function(){var a=SocialCalc.GetSpreadsheetControlObject(),c=document.getElementById(a.idPrefix+\"clipboardtext\");c.value=\"\";a.editor.EditorScheduleSheetCommands(\"clearclipboard\",!0,!1);c.focus()};SocialCalc.SpreadsheetControlClipboardExport=function(){var a=SocialCalc.GetSpreadsheetControlObject();a.ExportCallback&&a.ExportCallback(a);SocialCalc.SetTab(a.tabs[0].name);SocialCalc.KeyboardFocus()};\nSocialCalc.SpreadsheetControlSettingsSwitch=function(a){SocialCalc.SettingControlReset();var c=SocialCalc.GetSpreadsheetControlObject(),b=document.getElementById(c.idPrefix+\"sheetsettingstable\"),d=document.getElementById(c.idPrefix+\"cellsettingstable\"),e=document.getElementById(c.idPrefix+\"sheetsettingstoolbar\"),f=document.getElementById(c.idPrefix+\"cellsettingstoolbar\");\"sheet\"==a?(b.style.display=\"block\",d.style.display=\"none\",e.style.display=\"block\",f.style.display=\"none\",SocialCalc.SettingsControlSetCurrentPanel(c.views.settings.values.sheetspanel)):\n(b.style.display=\"none\",d.style.display=\"block\",e.style.display=\"none\",f.style.display=\"block\",SocialCalc.SettingsControlSetCurrentPanel(c.views.settings.values.cellspanel))};\nSocialCalc.SettingsControlSave=function(a){var c,b,d=SocialCalc.GetSpreadsheetControlObject(),e=SocialCalc.SettingsControlUnloadPanel(SocialCalc.SettingsControls.CurrentPanel);SocialCalc.SetTab(d.tabs[0].name);SocialCalc.KeyboardFocus();\"sheet\"==a?b=d.sheet.DecodeSheetAttributes(e):\"cell\"==a&&(d.editor.range.hasrange&&(c=SocialCalc.crToCoord(d.editor.range.left,d.editor.range.top)+\":\"+SocialCalc.crToCoord(d.editor.range.right,d.editor.range.bottom)),b=d.sheet.DecodeCellAttributes(d.editor.ecell.coord,\ne,c));b&&d.editor.EditorScheduleSheetCommands(b,!0,!1)};\nSocialCalc.SpreadsheetControlCreateSpreadsheetSave=function(a,c){var b=\"\",d=\"\",e,f;if(c)for(e in c)f=\"\\n\"!=c[e].charAt(c[e]-1)?\"\\n\":\"\",b+=\"--\"+a.multipartBoundary+\"\\nContent-type: text/plain; charset=UTF-8\\n\\n\"+c[e]+f,d+=\"part:\"+e+\"\\n\";return\"socialcalc:version:1.0\\nMIME-Version: 1.0\\nContent-Type: multipart/mixed; boundary=\"+a.multipartBoundary+\"\\n--\"+a.multipartBoundary+\"\\nContent-type: text/plain; charset=UTF-8\\n\\n# SocialCalc Spreadsheet Control Save\\nversion:1.0\\npart:sheet\\npart:edit\\npart:audit\\n\"+d+\n\"--\"+a.multipartBoundary+\"\\nContent-type: text/plain; charset=UTF-8\\n\\n\"+a.CreateSheetSave()+\"--\"+a.multipartBoundary+\"\\nContent-type: text/plain; charset=UTF-8\\n\\n\"+a.editor.SaveEditorSettings()+\"--\"+a.multipartBoundary+\"\\nContent-type: text/plain; charset=UTF-8\\n\\n\"+a.sheet.CreateAuditString()+b+\"--\"+a.multipartBoundary+\"--\\n\"};\nSocialCalc.SpreadsheetControlDecodeSpreadsheetSave=function(a,c){var b,d,e,f,g,l,h,m={},p=[];b=c.search(/^MIME-Version:\\s1\\.0/mi);if(0>b)return m;d=/^Content-Type:\\s*multipart\\/mixed;\\s*boundary=(\\S+)/mig;d.lastIndex=b;e=d.exec(c);if(0>=d.lastIndex)return m;b=e[1];f=new RegExp(\"^--\"+b+\"(?:\\r\\n|\\n)\",\"mg\");f.lastIndex=d.lastIndex;f.exec(c);d=/(?:\\r\\n|\\n)(?:\\r\\n|\\n)/gm;d.lastIndex=f.lastIndex;e=d.exec(c);if(!e)return m;g=d.lastIndex;f.lastIndex=g;e=f.exec(c);if(!e)return m;e=e.index;g=c.substring(g,\ne).split(/\\r\\n|\\n/);for(l=0;l<g.length;l++)switch(line=g[l],h=line.split(\":\"),h[0]){case \"part\":p.push(h[1])}for(pnum=0;pnum<p.length;pnum++){d.lastIndex=e;e=d.exec(c);if(!e)break;g=d.lastIndex;pnum==p.length-1&&(f=new RegExp(\"^--\"+b+\"--$\",\"mg\"));f.lastIndex=g;e=f.exec(c);if(!e)break;e=e.index;m[p[pnum]]={start:g,end:e}}return m};SocialCalc.SettingsControls={Controls:{},CurrentPanel:null};\nSocialCalc.SettingsControlSetCurrentPanel=function(a){SocialCalc.SettingsControls.CurrentPanel=a;SocialCalc.SettingsControls.PopupChangeCallback({panelobj:a},\"\",null)};SocialCalc.SettingsControlInitializePanel=function(a){var c,b=SocialCalc.SettingsControls;for(c in a)\"name\"!=c&&(ctrl=b.Controls[a[c].type])&&ctrl.Initialize&&ctrl.Initialize(a,c)};\nSocialCalc.SettingsControlLoadPanel=function(a,c){var b,d=SocialCalc.SettingsControls;for(b in a)\"name\"!=b&&(ctrl=d.Controls[a[b].type])&&ctrl.SetValue&&ctrl.SetValue(a,b,c[a[b].setting])};SocialCalc.SettingsControlUnloadPanel=function(a){var c,b=SocialCalc.SettingsControls,d={};for(c in a)\"name\"!=c&&(ctrl=b.Controls[a[c].type])&&ctrl.GetValue&&(d[a[c].setting]=ctrl.GetValue(a,c));return d};\nSocialCalc.SettingsControls.PopupChangeCallback=function(a,c,b){var d=SocialCalc.Constants;if((c=document.getElementById(\"sample-text\"))&&a&&a.panelobj){b=SocialCalc.CurrentSpreadsheetControlObject.idPrefix;var e=\"cell\"==a.panelobj.name?\"c\":\"\",f,g;g=d.defaultCellLayout.match(/^padding.(\\S+) (\\S+) (\\S+) (\\S+).vertical.align.(\\S+);$/)||[];g={color:[\"textcolor\"],backgroundColor:[\"bgcolor\",\"#FFF\"],fontSize:[\"fontsize\",d.defaultCellFontSize],fontFamily:[\"fontfamily\"],paddingTop:[\"padtop\",g[1]],paddingRight:[\"padright\",\ng[2]],paddingBottom:[\"padbottom\",g[3]],paddingLeft:[\"padleft\",g[4]],verticalAlign:[\"alignvert\",g[5]]};for(f in g)d=SocialCalc.Popup.GetValue(b+e+g[f][0])||g[f][1]||\"\",c.style[f]=d;if(\"c\"==e){g={borderTop:\"cbt\",borderRight:\"cbr\",borderBottom:\"cbb\",borderLeft:\"cbl\"};for(f in g)d=SocialCalc.SettingsControls.BorderSideGetValue(a.panelobj,g[f]),c.style[f]=d?d.val||\"\":\"\";d=SocialCalc.Popup.GetValue(b+\"calignhoriz\");c.style.textAlign=d||\"left\"}else c.style.border=\"\",d=SocialCalc.Popup.GetValue(b+\"textalignhoriz\"),\nc.style.textAlign=d||\"left\",d=SocialCalc.Popup.GetValue(b+\"numberalignhoriz\");c.childNodes[1].style.textAlign=d||\"right\";g=(d=SocialCalc.Popup.GetValue(b+e+\"fontlook\"))?d.match(/^(\\S+) (\\S+)$/)||[]:[];c.style.fontStyle=g[1]||\"\";c.style.fontWeight=g[2]||\"\";d=SocialCalc.Popup.GetValue(b+e+\"formatnumber\")||\"General\";a=SocialCalc.FormatNumber.formatNumberWithFormat(9.8765,d,\"\");f=SocialCalc.FormatNumber.formatNumberWithFormat(-1234.5,d,\"\");\"??-???-?? ??:??:??\"!=f&&(a+=\"<br>\"+f);c.childNodes[1].innerHTML=\na}};SocialCalc.SettingsControls.PopupListSetValue=function(a,c,b){if(b){var d=SocialCalc.Popup;b.def?d.SetValue(a[c].id,\"\"):d.SetValue(a[c].id,b.val)}else alert(c+\" no value\")};SocialCalc.SettingsControls.PopupListGetValue=function(a,c){var b=a[c];return b?(b=SocialCalc.Popup.GetValue(b.id))?{def:!1,val:b}:{def:!0,val:0}:null};\nSocialCalc.SettingsControls.PopupListInitialize=function(a,c){var b,d,e,f;b=SocialCalc.SettingsControls;b=a[c].initialdata||b.Controls[a[c].type].InitialData||\"\";b=SocialCalc.LocalizeSubstrings(b);var g=b.split(/\\|/),l=[];for(b=0;b<(g.length||0);b++)d=g[b],e=d.indexOf(\":\"),f=d.substring(0,e),-1!=f.indexOf(\"\\\\\")&&(f=f.replace(/\\\\c/g,\":\"),f=f.replace(/\\\\b/g,\"\\\\\")),f=SocialCalc.special_chars(f),l[b]=\"[custom]\"==f?{o:SocialCalc.Constants.s_PopupListCustom,v:d.substring(e+1),a:{custom:!0}}:\"[cancel]\"==\nf?{o:SocialCalc.Constants.s_PopupListCancel,v:\"\",a:{cancel:!0}}:\"[break]\"==f?{o:\"-----\",v:\"\",a:{skip:!0}}:\"[newcol]\"==f?{o:\"\",v:\"\",a:{newcol:!0}}:{o:f,v:d.substring(e+1)};SocialCalc.Popup.Create(\"List\",a[c].id,{});SocialCalc.Popup.Initialize(a[c].id,{options:l,attribs:{changedcallback:SocialCalc.SettingsControls.PopupChangeCallback,panelobj:a}})};SocialCalc.SettingsControls.PopupListReset=function(a){SocialCalc.Popup.Reset(\"List\")};\nSocialCalc.SettingsControls.Controls.PopupList={SetValue:SocialCalc.SettingsControls.PopupListSetValue,GetValue:SocialCalc.SettingsControls.PopupListGetValue,Initialize:SocialCalc.SettingsControls.PopupListInitialize,OnReset:SocialCalc.SettingsControls.PopupListReset,ChangedCallback:null};SocialCalc.SettingsControls.ColorChooserSetValue=function(a,c,b){if(b){var d=SocialCalc.Popup;b.def?d.SetValue(a[c].id,\"\"):d.SetValue(a[c].id,b.val)}else alert(c+\" no value\")};\nSocialCalc.SettingsControls.ColorChooserGetValue=function(a,c){var b=SocialCalc.Popup.GetValue(a[c].id);return b?{def:!1,val:b}:{def:!0,val:0}};SocialCalc.SettingsControls.ColorChooserInitialize=function(a,c){SocialCalc.Popup.Create(\"ColorChooser\",a[c].id,{});SocialCalc.Popup.Initialize(a[c].id,{attribs:{title:\" \",moveable:!0,width:\"106px\",changedcallback:SocialCalc.SettingsControls.PopupChangeCallback,panelobj:a}})};SocialCalc.SettingsControls.ColorChooserReset=function(a){SocialCalc.Popup.Reset(\"ColorChooser\")};\nSocialCalc.SettingsControls.Controls.ColorChooser={SetValue:SocialCalc.SettingsControls.ColorChooserSetValue,GetValue:SocialCalc.SettingsControls.ColorChooserGetValue,Initialize:SocialCalc.SettingsControls.ColorChooserInitialize,OnReset:SocialCalc.SettingsControls.ColorChooserReset,ChangedCallback:null};\nSocialCalc.SettingsControls.BorderSideSetValue=function(a,c,b){a=a[c].id;if(b){if(c=document.getElementById(a+\"-onoff-bcb\"))b.val?(c.checked=!0,c.value=b.val,b=b.val.match(/(\\S+)\\s+(\\S+)\\s+(\\S.+)/),a+=\"-color\",SocialCalc.Popup.SetValue(a,b[3]),SocialCalc.Popup.SetDisabled(a,!1)):(c.checked=!1,c.value=b.val,a+=\"-color\",SocialCalc.Popup.SetValue(a,\"\"),SocialCalc.Popup.SetDisabled(a,!0))}else alert(c+\" no value\")};\nSocialCalc.SettingsControls.BorderSideGetValue=function(a,c){var b,d=a[c].id;if(b=document.getElementById(d+\"-onoff-bcb\"))return b.checked?(b=SocialCalc.Popup.GetValue(d+\"-color\"),{def:!1,val:\"1px solid \"+(b||\"rgb(0,0,0)\")}):{def:!1,val:\"\"}};\nSocialCalc.SettingsControls.BorderSideInitialize=function(a,c){var b=a[c].id;SocialCalc.Popup.Create(\"ColorChooser\",b+\"-color\",{});SocialCalc.Popup.Initialize(b+\"-color\",{attribs:{title:\" \",width:\"106px\",moveable:!0,changedcallback:SocialCalc.SettingsControls.PopupChangeCallback,panelobj:a}})};\nSocialCalc.SettingsControlOnchangeBorder=function(a){var c=SocialCalc.SettingsControls,b=c.CurrentPanel,d=a.id.match(/(^.*\\-)(\\w+)\\-(\\w+)\\-(\\w+)$/);if(d){var e=d[2],b=b[e].type;switch(d[4]){case \"bcb\":a.checked?c.Controls[b].SetValue(c.CurrentPanel,e,{def:!1,val:a.value||\"1px solid rgb(0,0,0)\"}):c.Controls[b].SetValue(c.CurrentPanel,e,{def:!1,val:\"\"})}}};\nSocialCalc.SettingsControls.Controls.BorderSide={SetValue:SocialCalc.SettingsControls.BorderSideSetValue,GetValue:SocialCalc.SettingsControls.BorderSideGetValue,OnClick:SocialCalc.SettingsControls.ColorComboOnClick,Initialize:SocialCalc.SettingsControls.BorderSideInitialize,InitialData:{thickness:\"1 pixel:1px\",style:\"Solid:solid\"},ChangedCallback:null};SocialCalc.SettingControlReset=function(){var a=SocialCalc.SettingsControls,c;for(c in a.Controls)a.Controls[c].OnReset&&a.Controls[c].OnReset(c)};\nSocialCalc.OtherSaveParts={};\nSocialCalc.CtrlSEditor=function(a){var c,b;if(0<a.length)c=SocialCalc.special_chars(SocialCalc.OtherSaveParts[a]||\"\");else for(b in c=\"Listing of Parts\\n\",SocialCalc.OtherSaveParts)c+=SocialCalc.special_chars(\"\\nPart: \"+b+\"\\n=====\\n\"+SocialCalc.OtherSaveParts[b]+\"\\n\");b=document.createElement(\"div\");b.style.cssText=\"position:absolute;z-index:500;width:300px;height:300px;left:100px;top:200px;border:1px solid black;background-color:#EEE;text-align:center;\";b.id=\"socialcalc-editbox\";b.innerHTML=a+'<br><br><textarea id=\"socialcalc-editbox-textarea\" style=\"width:250px;height:200px;\">'+\nc+\"</textarea><br><br><input type=button onclick=\\\"SocialCalc.CtrlSEditorDone ('socialcalc-editbox', '\"+a+'\\');\" value=\"OK\">';document.body.appendChild(b);a=document.getElementById(\"socialcalc-editbox-textarea\");a.focus();SocialCalc.CmdGotFocus(a)};SocialCalc.CtrlSEditorDone=function(a,c){var b=document.getElementById(a+\"-textarea\").value;0<c.length&&(0<b.length?SocialCalc.OtherSaveParts[c]=b:delete SocialCalc.OtherSaveParts[c]);b=document.getElementById(a);SocialCalc.KeyboardFocus();b.parentNode.removeChild(b)};SocialCalc||(alert(\"Main SocialCalc code module needed\"),SocialCalc={});SocialCalc.TableEditor||alert(\"SocialCalc TableEditor code module needed\");SocialCalc.CurrentSpreadsheetViewerObject=null;\nSocialCalc.SpreadsheetViewer=function(a,c){var b=SocialCalc.Constants;TiddlyWiki&&(this.tiddlyWiki=c,this.keyboard={areListener:!1,focusTable:null,passThru:null,didProcessKey:!1,statusFromProcessKey:!1,repeatingKeyPress:!1,chForProcessKey:\"\"},this.inputView=null);this.spreadsheetDiv=this.parentNode=null;this.viewheight=this.width=this.height=this.requestedSpaceBelow=this.requestedWidth=this.requestedHeight=0;this.editorDiv=this.spreadsheetDiv=this.editor=this.context=this.sheet=null;this.sortrange=\n\"\";this.idPrefix=a||\"SocialCalc-\";this.imagePrefix=b.defaultImagePrefix;this.statuslineheight=b.SVStatuslineheight;this.statuslineCSS=b.SVStatuslineCSS;this.sheet=new SocialCalc.Sheet;this.context=new SocialCalc.RenderContext(this.sheet);this.context.showGrid=!0;this.context.showRCHeaders=!0;this.editor=new SocialCalc.TableEditor(this.context);this.editor.noEdit=!0;this.editor.StatusCallback.statusline={func:SocialCalc.SpreadsheetViewerStatuslineCallback,params:{}};this.hasStatusLine=!0;this.statuslineHTML=\n'<table cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"100%\" style=\"overflow:hidden;\">{status}</td><td> </td></tr></table>';this.noRecalc=this.statuslineFull=!0;this.repeatingMacroTimer=null;this.repeatingMacroInterval=60;this.repeatingMacroCommands=\"\";TiddlyWiki?SocialCalc.CurrentSpreadsheetControlObject=this:SocialCalc.CurrentSpreadsheetViewerObject=this};\nSocialCalc.SpreadsheetViewer.prototype.InitializeSpreadsheetViewer=function(a,c,b,d){return SocialCalc.InitializeSpreadsheetViewer(this,a,c,b,d)};SocialCalc.SpreadsheetViewer.prototype.LoadSave=function(a){return SocialCalc.SpreadsheetViewerLoadSave(this,a)};SocialCalc.SpreadsheetViewer.prototype.DoOnResize=function(){return SocialCalc.DoOnResize(this)};SocialCalc.SpreadsheetViewer.prototype.SizeSSDiv=function(){return SocialCalc.SizeSSDiv(this)};\nSocialCalc.SpreadsheetViewer.prototype.DecodeSpreadsheetSave=function(a){return SocialCalc.SpreadsheetViewerDecodeSpreadsheetSave(this,a)};SocialCalc.SpreadsheetViewer.prototype.ParseSheetSave=function(a){return this.sheet.ParseSheetSave(a)};\nSocialCalc.InitializeSpreadsheetViewer=function(a,c,b,d,e){a.requestedHeight=b;a.requestedWidth=d;a.requestedSpaceBelow=e;\"string\"==typeof c&&(c=document.getElementById(c));null==c&&alert(\"SocialCalc.SpreadsheetControl not given parent node.\");a.parentNode=c;a.spreadsheetDiv=document.createElement(\"div\");a.SizeSSDiv();for(b=c.firstChild;null!=b;b=c.firstChild)c.removeChild(b);c.appendChild(a.spreadsheetDiv);a.nonviewheight=a.hasStatusLine?a.statuslineheight:0;a.viewheight=a.height-a.nonviewheight;\na.editorDiv=a.editor.CreateTableEditor(a.width,a.viewheight);a.spreadsheetDiv.appendChild(a.editorDiv);a.hasStatusLine&&(a.statuslineDiv=document.createElement(\"div\"),a.statuslineDiv.style.cssText=a.statuslineCSS,a.statuslineDiv.style.height=a.statuslineheight-(a.statuslineDiv.style.paddingTop.slice(0,-2)-0)-(a.statuslineDiv.style.paddingBottom.slice(0,-2)-0)+\"px\",a.statuslineDiv.id=a.idPrefix+\"statusline\",a.spreadsheetDiv.appendChild(a.statuslineDiv),a.editor.StatusCallback.statusline={func:SocialCalc.SpreadsheetViewerStatuslineCallback,\nparams:{spreadsheetobj:a}});TiddlyWiki&&(a.inputView=document.createElement(\"input\"),a.inputView.setAttribute(\"type\",\"text\"),a.inputView.style.width=\"0px\",a.inputView.style.height=\"0px\",a.inputView.style.padding=\"0\",a.inputView.style.border=\"0\",a.spreadsheetDiv.appendChild(a.inputView),SocialCalc.CmdGotFocus(a.inputView));if(TiddlyWiki)if(a.spreadsheetDiv.addEventListener)a.spreadsheetDiv.addEventListener(\"mousedown\",function(){SocialCalc.SetSpreadsheetControlObject(a)},!1),a.spreadsheetDiv.addEventListener(\"mouseover\",\nfunction(){SocialCalc.SetSpreadsheetControlObject(a)},!1);else if(a.spreadsheetDiv.attachEvent)a.spreadsheetDiv.attachEvent(\"onmousedown\",function(){SocialCalc.SetSpreadsheetControlObject(a)}),a.spreadsheetDiv.attachEvent(\"onmouseover\",function(){SocialCalc.SetSpreadsheetControlObject(a)});else throw SocialCalc.Constants.s_BrowserNotSupported;};\nSocialCalc.SpreadsheetViewerLoadSave=function(a,c){var b,d,e;if(b=a.DecodeSpreadsheetSave(c))b.sheet&&(a.sheet.ResetSheet(),a.sheet.ParseSheetSave(c.substring(b.sheet.start,b.sheet.end))),b.edit&&a.editor.LoadEditorSettings(c.substring(b.edit.start,b.edit.end)),b.startupmacro&&a.editor.EditorScheduleSheetCommands(c.substring(b.startupmacro.start,b.startupmacro.end),!1,!0),b.repeatingmacro&&(b=c.substring(b.repeatingmacro.start,b.repeatingmacro.end),b=b.replace(\"\\r\",\"\"),d=b.indexOf(\"\\n\"),0<d&&(e=b.substring(0,\nd)-0,a.repeatingMacroInterval=e,a.repeatingMacroCommands=b.substring(d+1),0<e&&(a.repeatingMacroTimer=window.setTimeout(SocialCalc.SpreadsheetViewerDoRepeatingMacro,1E3*a.repeatingMacroInterval))));\"off\"==a.editor.context.sheetobj.attribs.recalc||a.noRecalc?a.editor.ScheduleRender():a.editor.EditorScheduleSheetCommands(\"recalc\")};\nSocialCalc.SpreadsheetViewerDoRepeatingMacro=function(){var a=SocialCalc.GetSpreadsheetViewerObject(),c=a.editor;a.repeatingMacroTimer=null;SocialCalc.SheetCommandInfo.CmdExtensionCallbacks.repeatmacro={func:SocialCalc.SpreadsheetViewerRepeatMacroCommand,data:null};c.EditorScheduleSheetCommands(a.repeatingMacroCommands)};\nSocialCalc.SpreadsheetViewerRepeatMacroCommand=function(a,c,b,d,e){a=SocialCalc.GetSpreadsheetViewerObject();d=d.RestOfString()-0;0<d||(d=a.repeatingMacroInterval);a.repeatingMacroInterval=d;a.repeatingMacroTimer=window.setTimeout(SocialCalc.SpreadsheetViewerDoRepeatingMacro,1E3*a.repeatingMacroInterval)};SocialCalc.SpreadsheetViewerStopRepeatingMacro=function(){var a=SocialCalc.GetSpreadsheetViewerObject();a.repeatingMacroTimer&&(window.clearTimeout(a.repeatingMacroTimer),a.repeatingMacroTimer=null)};\nSocialCalc.SpreadsheetViewerDoButtonCmd=function(a,c,b){a=b.element;b=b.functionobj.command;c=SocialCalc.GetSpreadsheetViewerObject().editor;switch(b){case \"recalc\":c.EditorScheduleSheetCommands(\"recalc\")}a&&a.blur&&a.blur();SocialCalc.KeyboardFocus()};SocialCalc.LocalizeString=function(a){var c=SocialCalc.LocalizeStringList[a];c||(c=SocialCalc.Constants[\"s_loc_\"+a.toLowerCase().replace(/\\s/g,\"_\").replace(/\\W/g,\"X\")]||a,SocialCalc.LocalizeStringList[a]=c);return c};SocialCalc.LocalizeStringList={};\nSocialCalc.LocalizeSubstrings=function(a){var c=SocialCalc.LocalizeString;return a.replace(/%(loc|ssc)!(.*?)!/g,function(a,d,e){return\"ssc\"==d?SocialCalc.Constants[e]||alert(\"Missing constant: \"+e):c(e)})};SocialCalc.GetSpreadsheetViewerObject=function(){var a=SocialCalc.CurrentSpreadsheetViewerObject;if(a)return a;throw\"No current SpreadsheetViewer object.\";};\nSocialCalc.DoOnResize=function(a){var c,b=a.views;if(a.SizeSSDiv()){for(vname in b)c=b[vname].element,c.style.width=a.width+\"px\",c.style.height=a.height-a.nonviewheight+\"px\";a.editor.ResizeTableEditor(a.width,a.height-a.nonviewheight)}};SocialCalc.SpreadsheetViewerStatuslineCallback=function(a,c,b,d){var e=d.spreadsheetobj,f=\"\";e&&e.statuslineDiv&&(f=e.statuslineFull?a.GetStatuslineString(c,b,d):a.ecell.coord,f=e.statuslineHTML.replace(/\\{status\\}/,f),e.statuslineDiv.innerHTML=f)};\nSocialCalc.CmdGotFocus=function(a){SocialCalc.GetSpreadsheetControlObject().keyboard.passThru=a};SocialCalc.SpreadsheetViewerCreateSheetHTML=function(a){var c,b;c=\"\";c=new SocialCalc.RenderContext(a.sheet);a=document.createElement(\"div\");b=c.RenderSheet(null,{type:\"html\"});a.appendChild(b);delete c;c=a.innerHTML;delete b;delete a;return c};\nSocialCalc.SpreadsheetViewerDecodeSpreadsheetSave=function(a,c){var b,d,e,f,g,l,h,m={},p=[];/[^\\n]\\r[^\\n]/.test(c)&&(c=c.replace(/([^\\n])\\r([^\\n])/g,\"$1\\r\\n$2\"));b=c.search(/^MIME-Version:\\s1\\.0/mi);if(0>b)return m;d=/^Content-Type:\\s*multipart\\/mixed;\\s*boundary=(\\S+)/mig;d.lastIndex=b;e=d.exec(c);if(0>=d.lastIndex)return m;b=e[1];f=new RegExp(\"^--\"+b+\"(?:\\r\\n|\\n)\",\"mg\");f.lastIndex=d.lastIndex;f.exec(c);d=/(?:\\r\\n|\\n)(?:\\r\\n|\\n)/gm;d.lastIndex=f.lastIndex;e=d.exec(c);if(!e)return m;g=d.lastIndex;\nf.lastIndex=g;e=f.exec(c);if(!e)return m;e=e.index;g=c.substring(g,e).split(/\\r\\n|\\n/);for(l=0;l<g.length;l++)switch(line=g[l],h=line.split(\":\"),h[0]){case \"part\":p.push(h[1])}for(pnum=0;pnum<p.length;pnum++){d.lastIndex=e;e=d.exec(c);if(!e)break;g=d.lastIndex;pnum==p.length-1&&(f=new RegExp(\"^--\"+b+\"--$\",\"mg\"));f.lastIndex=g;e=f.exec(c);if(!e)break;e=e.index;m[p[pnum]]={start:g,end:e}}return m};(function(){Class=function(a,c){if(!a)throw\"Class requires a class definition string as its first argument\";if(!c)throw\"Class requires a class wrapper function as its second argument\";if(!a.match(/^([\\w\\.]+)(?:\\(\\s*([\\w\\.]+)\\s*\\))?(?:\\s+(.*?)\\s*)?$/))throw\"Can't parse Class Definition: '\"+a+\"'\";var b=RegExp.$1,d=RegExp.$2||\"\",e=[];RegExp.$3&&(e=RegExp.$3.split(/\\s+/));for(var f=[],g=!0,l=0,h=e.length;l<h;l++){var m=e[l];\"-nostrict\"==m&&(g=!1);m.match(/^-inc=(.+)$/)&&(f=RegExp.$1.split(\",\"))}for(var e=\nb.split(\".\"),p=Class.global,l=0;l<e.length;l++)p[e[l]]||(p[e[l]]=function(){try{this.init()}catch(a){}}),p=p[e[l]];p.className=b;p.isa=function(a){if(p.baseClassName=a)p.prototype=eval(\"new \"+a+\"()\"),p.prototype.superFunc=function(c){return eval(a).prototype[c]}};p.isa(d);p.global=Class.global;p.addGlobal=function(){this.newGlobals++;return Class.global};p.extend=function(a){if(\"object\"!=typeof a)throw\"extend requires an object of name:value pairs\";for(var c in a)p.prototype[c]=a[c]};b=0;for(d=f.length;b<\nd;b++)l=f[b],f[b]=\"proto\"==l?p.prototype:\"this\"==l?p:Class.global[l];g?Class.eval_strict(c,p,f):c.apply(p,f);return p}})();Class.global=this;Class.eval_strict=function(a,c,b){var d=0,e;for(e in Class.global)d++;c.newGlobals=0;a.apply(c,b);a=0;for(e in Class.global)a++;if(d+c.newGlobals!=a)throw\"Class '\"+c.className+\"' defines \"+(a-d)+\" new global JavaScript variables without using this.addGlobal()\";delete c.newGlobals};Class(\"Document.Emitter\",function(){var a=this.prototype;a.className=\"Document.Emitter\";a.instantiate=function(){return eval(\"new \"+this.className+\"()\")};a.init=function(){this.output=\"\"};a.content=function(){return this.output};a.insert=function(a){this.output+=a.output}});Class(\"Document.Emitter.HTML(Document.Emitter)\",function(){var a=this.prototype;a.className=\"Document.Emitter.HTML\";a.begin_node=function(a){var b=a.type;switch(b){case \"asis\":case \"line\":break;case \"br\":case \"hr\":this.output+=\"<\"+b+\" />\";break;case \"html\":this.output+='<span class=\"wafl\">Raw HTML section. Edit in Wiki Text mode.</span>';break;case \"waflparagraph\":case \"waflphrase\":case \"im\":if(a._wafl.match(/^image:\\s*(\\S+)(?:\\s+size=(\\w+))?/)){a=\"if (typeof(ss) != 'undefined' && ss.editor) { var recalc = function () { try { ss.editor.DoPositionCalculations() } catch (e) { setTimeout(recalc, 500) } }; recalc() } if (!window.image_dimension_cache) window.image_dimension_cache = {};window.image_dimension_cache['/data/wafl/\"+\na._label.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/'/g,\"\\\\'\").replace(/\\\\/g,\"\\\\\\\\\")+\"'] = [ this.offsetWidth, this.offsetHeight ]; this.style.width = this.offsetWidth + 'px'; this.style.height = this.offsetHeight + 'px'\";var b=RegExp.$1,d=RegExp.$2;switch(d){case \"small\":d=\"100\";break;case \"medium\":d=\"300\";break;case \"large\":d=\"600\"}d&&(d=' width=\"'+d+'\"');this.output+='<img src=\"'+b.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\n\">\")+'\" onload=\"'+a+'\"'+d+\" />\";break}this.output+='<span class=\"wafl\">'+a._label.replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/'/g,\"\\\\'\").replace(/\\\\/g,\"\\\\\\\\\")+\"</span>\";break;case \"a\":case \"wikilink\":this.output+='<a href=\"'+encodeURI(a._href)+'\">';break;case \"file\":this.output+='<a title=\"(network resource)\" href=\"'+encodeURI(a._href)+'\">';break;case \"ul\":case \"ol\":case \"table\":case \"tr\":this.output+=\"<\"+b+\">\\n\";break;default:this.output+=\"<\"+\nb+\">\"}};a.end_node=function(a){a=a.type;switch(a){case \"asis\":case \"br\":case \"hr\":case \"html\":case \"waflparagraph\":case \"waflphrase\":case \"im\":break;case \"line\":this.output+=\"<br />\";break;case \"file\":case \"wikilink\":this.output+=\"</a>\";break;default:0==a.search(/^(?:p|ul|ol|li|h\\d|table|tr|td)$/)?this.output+=\"</\"+a+\">\\n\":this.output+=\"</\"+a+\">\"}};a.text_node=function(a){this.output+=a.replace(/&/g,\"&\").replace(/>/g,\">\").replace(/</g,\"<\").replace(/\"/g,\""\").replace(/'/g,\"'\")}});Class(\"Document.Parser\",function(){var a=this.prototype;a.className=\"Document.Parser\";a.init=function(){};a.parse=function(a,b){this.input=-1==a.search(/\\n$/)?a+\"\\n\":a;b&&(this.receiver=b);this.receiver.init();this.grammar=this.create_grammar();this.parse_blocks(\"top\");return this.receiver.content()};a.create_grammar=function(){throw\"Please define create_grammar in a derived class of Document.Parser.\";};a.parse_blocks=function(a){if(a=this.grammar[a].blocks)for(;this.input.length;){for(var b=this.input.length,\nd=0;d<a.length;d++){var e=a[d],f=this.find_match(\"matched_block\",e);if(f){this.input=this.input.substr(f.end);this.handle_match(e,f);break}}if(this.input.length>=b)throw this.classname+\": Reduction error for:\\n\"+this.input+\"\\n\"+JSON.stringify(this);}};a.handle_match=function(a,b){var d=this.grammar[a];this.subparse(d.blocks?\"parse_blocks\":\"parse_phrases\",b,a,d.filter)};a.find_match=function(a,b){var d=this.grammar[b].match;if(!d)throw\"no regexp for type: \"+b;if(d=this.input.match(d))return d=this[a].call(this,\nd,this.grammar[b].lookbehind),d.type=this.grammar[b].type||b,d};a.parse_phrases=function(a){if(a=this.grammar[a].phrases)for(;this.input.length;){for(var b=null,d=0;d<a.length;d++){var e=this.find_match(\"matched_phrase\",a[d]);if(e&&(!b||e.begin<b.begin)&&(b=e,0==b.begin))break}if(!b){this.receiver.text_node(this.input||\"\");break}0!=b.begin&&this.receiver.text_node(this.input.substr(0,b.begin)||\"\");this.input=this.input.substr(b.end);this.handle_match(b.type,b)}else this.receiver.text_node(this.input||\n\"\")};a.subparse=function(a,b,d,e){b.type=this.grammar[d].type;null==b.type&&(b.type=d);e=e?e(b):null;b.type&&this.receiver.begin_node(b);var f=eval(\"new \"+this.className+\"()\");f.input=null==e?b.text:e;f.grammar=this.grammar;f.receiver=this.receiver.instantiate();f[a].call(f,d);this.receiver.insert(f.receiver);b.type&&this.receiver.end_node(b)};a.matched_block=function(a){return{begin:a.index,text:a[1],end:a[0].length,1:a[2],2:a[3],3:a[4]}};a.matched_phrase=function(a,b){if(b){var d=a[2],e=this.input.indexOf(a[1]);\nreturn{text:d,begin:e,end:e+a[1].length,1:RegExp.$2,2:RegExp.$3,3:RegExp.$4}}return{begin:a.index,text:a[1],end:a.index+a[0].length,1:a[2],2:a[3],3:a[4]}}});Class(\"Document.Parser.Wikitext(Document.Parser)\",function(){var a=this.prototype;a.className=\"Document.Parser.Wikitext\";a.init=function(){};a.create_grammar=function(){var a=\"pre html hr hx waflparagraph ul ol blockquote p empty else\".split(\" \"),b=\"waflphrase asis wikilink wikilink2 a im mail file tt b i del a\".split(\" \"),d=function(a,c){c=\"\\\\\"+(c||a);a=\"\\\\\"+a;return{match:new RegExp(\"(?:^|[^\"+a+\"\\\\w])(\"+a+\"(?=\\\\S)(?!\"+c+\")(.*?)\"+c+\"(?=[^\"+c+\"\\\\w]|$))\"),phrases:\"\\\\`\"==a?null:b,lookbehind:!0}},e=\n{yahoo:\"yahoo\",ymsgr:\"yahoo\",callto:\"callto\",callme:\"callto\",skype:\"callto\",aim:\"aim\"},f={aim:\"AIM: %1\",yahoo:\"Yahoo: %1\",callto:\"Skype: %1\"},g=\"(\\\\b(\",l;for(l in e)g+=l+\"|\";g=g.replace(/\\|$/,\")\\\\:([^\\\\s\\\\>\\\\)]+))\");l=function(a,b){var c=new RegExp(\"(^|\\n)\"+b+\" *\",\"g\");return{match:new RegExp(\"^(\"+a+\"+ .*\\n(?:[*-+#]+ .*\\n)*)(?:s*\\n)?\"),blocks:[\"ul\",\"ol\",\"subl\",\"li\"],filter:function(a){return a.text.replace(c,\"$1\")}}};return{_all_blocks:a,_all_phrases:b,top:{blocks:a},ol:l(\"#\",\"[*#]\"),ul:l(\"[-+*]\",\n\"[-+*#]\"),blockquote:{match:/^((?:>[^\\n]*\\n)+)(?:\\s*\\n)?/,blocks:[\"blockquote\",\"line\"],filter:function(a){return a.text.replace(/(^|\\n)>\\ ?/g,\"$1\")}},line:{match:/([^\\n]*)\\n/,phrases:b},subl:{type:\"li\",match:/^(([^\\n]*)\\n[*#]+\\ [^\\n]*\\n(?:[*#]+\\ [^\\n]*\\n)*)(?:\\s*\\n)?/,blocks:[\"ul\",\"ol\",\"li2\"]},li:{match:/([^\\n]*)\\n/,phrases:b},li2:{type:\"\",match:/([^\\n]*)\\n/,phrases:b},html:{match:/^(\\.html\\ *\\n(?:[^\\n]*\\n)*?\\.html)\\ *\\n(?:\\s*\\n)?/,filter:function(a){a._html=a.text;return\"\"}},pre:{match:/^\\.pre\\ *\\n((?:[^\\n]*\\n)*?)\\.pre\\ *\\n(?:\\s*\\n)?/},\nhr:{match:/^--+(?:\\s*\\n)?/},hx:{match:/^((\\^+) *([^\\n]*?)(\\s+=+)?\\s*?\\n+)/,phrases:b,filter:function(a){a.type=\"h\"+a[\"1\"].length;return a[2]}},p:{match:/^((?:(?!(?:(?:\\^+|\\#+|\\*+|\\-+) |\\>|\\.\\w+\\s*\\n|\\{[^\\}]+\\}\\s*\\n))[^\\n]*\\S[^\\n]*\\n)+(?:(?=^|\\n)\\s*\\n)*)/,phrases:b,filter:function(a){return a.text.replace(/\\n$/,\"\")}},empty:{match:/^(\\s*\\n)/,filter:function(a){a.type=\"\"}},\"else\":{match:/^(([^\\n]*)\\n)/,phrases:[],filter:function(a){a.type=\"p\"}},waflparagraph:{match:/^\\{(.*)\\}[\\ \\t]*\\n(?:\\s*\\n)?/,filter:function(a){a._wafl=\na._label=a.text;return\"\"}},waflphrase:{match:/(?:^|[\\s\\-])((?:\"([^\\n]+?)\")?\\{([\\w-]+(?=[\\:\\ \\}])(?:\\s*:)?\\s*[^\\n]*?\\s*)\\}(?=[\\W_]|$))/,filter:function(a){a._wafl=a[2];a._label=a[1]||a._wafl;return\"\"},lookbehind:!0},asis:{match:/(\\{\\{([^\\n]*?)\\}\\}(\\}*))/,filter:function(a){a.type=\"\";return a[1]+a[2]}},wikilink:{match:/(?:^|[_\\W])(\\[()(?=[^\\s\\[\\]])(.*?)\\](?=[_\\W]|$))/,filter:function(a){a._href=\"?\"+a[2];return a.text||a[2]},lookbehind:!0},wikilink2:{type:\"wikilink\",match:/(?:\"([^\"]*)\"\\s*)(\\[(?=[^\\s\\[\\]])(.*?)\\](?=[_\\W]|$))/,\nfilter:function(a){a._href=\"?\"+a[2];return a[1]||a[2]}},a:{match:/((?:\"([^\"]*)\"\\s*)?<?((?:http|https|ftp|irc|file):(?:\\/\\/)?[\\;\\/\\?\\:\\@\\&\\=\\+\\$\\,\\[\\]\\#A-Za-z0-9\\-\\_\\.\\!\\~\\*\\'\\(\\)]+[A-Za-z0-9\\/#])>?)/,filter:function(a){a._href=a[2];return a[1]||a[2]}},file:{match:/((?:\"([^\"]*)\")?<(\\\\\\\\[^\\s\\>\\)]+)>)/,filter:function(a){var b=a[2].replace(/^\\\\\\\\/,\"\");a._href=\"file://\"+b.replace(/\\\\/g,\"/\");return a[\"1\"]||b}},im:{match:new RegExp(g),filter:function(a){a._wafl=a[1]+\": \"+a[2];a._label=(f[e[a[1]]]||\"%1\").replace(/%1/g,\na[2]);return\"\"}},mail:{match:/([\\w+%\\-\\.]+@(?:[\\w\\-]+\\.)+[\\w\\-]+)/,filter:function(a){a.type=\"a\";a._href=\"mailto:\"+a.text.replace(/%/g,\"%25\")}},tt:d(\"`\"),b:d(\"*\"),i:d(\"_\"),del:d(\"-\")}}});\n\nexports.SocialCalc = SocialCalc;\n})();"
},
"$:/plugins/rboue/SocialCalc/Lib/graph.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/SocialCalc/Lib/graph.js",
"module-type": "library",
"text": "(function (){\n\n // Graph object\n\n var Graph = function() {};\n\n Graph.init = function(SocialCalc, sessionConfig) {\n if (!SocialCalc) alert('Cannot find SocialCalc');\n\n // Localization\n\n SocialCalc.Constants.s_loc_plain = \"Plain\";\n SocialCalc.Constants.s_loc_graph = \"Graph\";\n SocialCalc.Constants.s_loc_cells_to_graph = \"Cells to Graph\";\n SocialCalc.Constants.s_loc_set_cells_to_graph = \"Set Cells To Graph\";\n SocialCalc.Constants.s_loc_graph_type = \"Graph Type\";\n SocialCalc.Constants.s_loc_help = \"Help\";\n SocialCalc.Constants.s_loc_horizontal_bar = \"Horizontal Bar\";\n SocialCalc.Constants.s_loc_vertical_bar = \"Vertical Bar\";\n SocialCalc.Constants.s_loc_pie_chart = \"Pie Chart\";\n SocialCalc.Constants.s_loc_line_chart = \"Line Chart\";\n SocialCalc.Constants.s_loc_scatter_chart = \"Plot Points\";\n SocialCalc.Constants.s_loc_not_set = \"Not Set\";\n SocialCalc.Constants.s_loc_unknown_range_name = \"Unknown range name\";\n SocialCalc.Constants.s_loc_hide_help = \"Hide Help\";\n SocialCalc.Constants.s_loc_x = \"X\";\n SocialCalc.Constants.s_loc_y = \"Y\";\n SocialCalc.Constants.s_loc_max = \"Max\";\n SocialCalc.Constants.s_loc_min = \"Min\";\n SocialCalc.Constants.s_loc_ok = \" OK \";\n SocialCalc.Constants.s_loc_Xselect_rangeX = \"[select range]\";\n SocialCalc.Constants.s_GraphRangeNotSelected = \"Select a range of cells with numeric values to graph and use the OK button above to set the range as the graph range.\";\n SocialCalc.Constants.s_graph_error_selection = \"<b>Range selection error</b>.<br>You must select cells in a single row or column !\";\n SocialCalc.Constants.s_graph_help_intro = \"This is the help text for graph type: \";\n SocialCalc.Constants.s_graph_VerticalBar_help = \"The <b>Graph</b> tab displays a bar graph of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\";\n SocialCalc.Constants.s_graph_HorizontalBar_help = \"The <b>Graph</b> tab displays a bar graph of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\";\n SocialCalc.Constants.s_graph_PieChart_help = \"The <b>Graph</b> tab displays a pie chart of the cells which have been selected (either in a single row across or column down). If the row above (or column to the left) of the selection has values, those values are used as labels. Otherwise the cell coordinates are used (e.g., B5).\";\n SocialCalc.Constants.s_graph_PieChart_error_selection = \"<b>Selection error</b><br>You must select cells with positive value !\";\n SocialCalc.Constants.s_graph_LineChart_help = \"The <b>Graph</b> tab displays a XY profile line of the cells which have been selected (either in a single row across or column down). The row above (or column to the left) of the selection is used as X coordinates.\";\n SocialCalc.Constants.s_graph_ScatterChart_help = \"The <b>Graph</b> tab displays a XY scattered chart of the cells which have been selected (either in a single row across or column down). The row above (or column to the left) of the selection is used as X coordinates. If row below (or column to the right) have values, they are interpreted as plot dimensions.\";\n\n // Configuration\n\n SocialCalc.GraphTypesInfo = {\n // Graph types\n displayorder: [\"verticalbar\", \"horizontalbar\", \"piechart\", \"linechart\", \"scatterchart\"],\n verticalbar: {\n display: SocialCalc.Constants.s_loc_vertical_bar,\n func: Graph.GraphVerticalBar\n },\n horizontalbar: {\n display: SocialCalc.Constants.s_loc_horizontal_bar,\n func: Graph.GraphHorizontalBar\n },\n piechart: {\n display: SocialCalc.Constants.s_loc_pie_chart,\n func: Graph.MakePieChart\n },\n linechart: {\n display: SocialCalc.Constants.s_loc_line_chart,\n func: Graph.MakeLineChart\n },\n scatterchart: {\n display: SocialCalc.Constants.s_loc_scatter_chart,\n func: Graph.MakeScatterChart\n },\n\n // Graph visuals\n visual: {\n marginX: 0.07, // X margin ratio v/s graph width\n marginY: 0.07, // Y margin ratio v/s graph height\n axisWidth: 0.01, // axis printed width\n fontSize: 0.03, // font size ratio v/s graph height\n fontSizeMin: 10, // minimum font size in pixel\n valueMargin: 0.7, // margin between value and X axis, in font size unit\n labelMargin: 0.7 // margin between label and X axis, in font size unit\n }\n };\n };\n\n \n var colorIndex = 0;\n var getBarColor = function(){\n var colors = ['00f', 'ff0', '0ff', 'f0f', 'f00', '0f0', '888', '880', '088', '808', '008', '800', '080'];\n var iMax = colors.length - 1;\n if (colorIndex <= iMax)\n return colors[colorIndex++]\n else {\n return colors[Math.round(Math.random() * iMax)];\n }\n };\n var getDrawColor = function(){\n return \"#\" + getBarColor();\n };\n\n // Add Graph tab\n Graph.addGraphTab = function(spreadsheet) {\n if (spreadsheet.tabs) {\n spreadsheet.tabnums.graph = spreadsheet.tabs.length;\n spreadsheet.tabs.push({\n name: 'graph',\n text: SocialCalc.Constants.s_loc_graph,\n html:\n '<div id=\"%id.graphtools\" class=\"SocialCalc-toolbar\" style=\"display:none;\">' +\n ' <table cellspacing=\"0\" cellpadding=\"0\">' +\n ' <tr>' +\n ' <td style=\"vertical-align:top;padding-right:24px;\">' +\n ' <div style=\"%tbt.\">%loc!Cells to Graph!</div>' +\n ' <div id=\"%id.graphrange\" style=\"%tbt.\">Not Set</div>' +\n ' </td>' +\n ' <td style=\"vertical-align:top;padding-right:24px;\">' +\n ' <div style=\"%tbt.\">%loc!Set Cells To Graph!</div>' +\n ' <select id=\"%id.graphlist\" size=\"1\" onfocus=\"%s.CmdGotFocus(this);\">' +\n ' <option selected>[select range]</option>' +\n ' </select>' +\n ' </td>' +\n ' <td style=\"vertical-align:top;padding-right:4px;\">' +\n ' <div style=\"%tbt.\">%loc!Graph Type!</div>' +\n ' <select id=\"%id.graphtype\" size=\"1\" onchange=\"Graph.GraphChanged(this);\" onfocus=\"%s.CmdGotFocus(this);\">' +\n ' </select>' +\n ' <input type=\"button\" value=\"OK\" onclick=\"Graph.GraphSetCells();\" style=\"font-size:x-small;\">' +\n ' </td>' +\n ' <td style=\"vertical-align:top;padding-right:16px;\">' +\n ' <div style=\"%tbt.\"> </div>' +\n ' <input id=\"%id.graphhelp\" type=\"button\" onclick=\"Graph.DoGraph(true);\" value=\"Help\" style=\"font-size:x-small;\"/>' +\n ' </td>' +\n ' <td style=\"vertical-align:top\">' +\n ' <div id=\"%id.graphLimits\">' +\n ' <span style=\"%tbt.\">%loc!Min! %loc!X!</span>' +\n ' <input type=\"text\" id=\"%id.graphMinX\" onchange=\"Graph.MinMaxChanged(this,0);\" onfocus=\"%s.CmdGotFocus(this);\" size=\"5\"/>' +\n ' <span style=\"%tbt.\">%loc!Max! %loc!X!</span>' +\n ' <input type=\"text\" id=\"%id.graphMaxX\" onchange=\"Graph.MinMaxChanged(this,1);\" onfocus=\"%s.CmdGotFocus(this);\" size=\"5\"/><br>' +\n ' <span style=\"%tbt.\">%loc!Min! %loc!Y!</span>' +\n ' <input type=\"text\" id=\"%id.graphMinY\" onchange=\"Graph.MinMaxChanged(this,2);\" onfocus=\"%s.CmdGotFocus(this);\" size=\"5\"/>' +\n ' <span style=\"%tbt.\">%loc!Max! %loc!Y!</span>' +\n ' <input type=\"text\" id=\"%id.graphMaxY\" onchange=\"Graph.MinMaxChanged(this,3);\" onfocus=\"%s.CmdGotFocus(this);\" size=\"5\"/>' +\n ' </div>' +\n ' </td>' +\n ' </tr>' +\n ' </table>' +\n '</div>',\n view: 'graph',\n onclick: Graph.GraphOnClick,\n onclickFocus: true\n });\n }\n if (spreadsheet.views) {\n spreadsheet.views.graph = {\n name: 'graph',\n divStyle: \"overflow:auto;\",\n values: {},\n html: '<div style=\"padding:6px;\">Graph View</div>'\n };\n }\n if (spreadsheet.editor) {\n spreadsheet.editor.SettingsCallbacks.graph = {\n save: Graph.GraphSave,\n load: Graph.GraphLoad\n };\n }\n };\n\n Graph.GraphOnClick = function(s, t){\n colorIndex = 0;\n var SCLoc = SocialCalc.LocalizeString;\n var namelist = [];\n var nl = document.getElementById(s.idPrefix + 'graphlist');\n s.editor.RangeChangeCallback.graph = Graph.UpdateGraphRangeProposal;\n for (var name in s.sheet.names) {\n namelist.push(name);\n }\n namelist.sort();\n nl.length = 0;\n nl.options[0] = new Option(SCLoc(\"[select range]\"));\n for (var i = 0; i < namelist.length; i++) {\n var name = namelist[i];\n nl.options[i + 1] = new Option(name, name);\n if (name === s.graphrange) {\n nl.options[i + 1].selected = true;\n }\n }\n if (s.graphrange === '') {\n nl.options[0].selected = true;\n }\n Graph.UpdateGraphRangeProposal(s.editor);\n nl = document.getElementById(s.idPrefix + 'graphtype');\n nl.length = 0;\n for (var i = 0; i < SocialCalc.GraphTypesInfo.displayorder.length; i++) {\n var name = SocialCalc.GraphTypesInfo.displayorder[i];\n nl.options[i] = new Option(SCLoc(SocialCalc.GraphTypesInfo[name].display), name);\n if (name === s.graphtype) {\n nl.options[i].selected = true;\n }\n }\n if (!s.graphtype) {\n nl.options[0].selected = true;\n s.graphtype = nl.options[0].value;\n }\n var graphLimits = document.getElementById(s.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"none\";\n\n Graph.DoGraph(false, false);\n };\n\n Graph.UpdateGraphRangeProposal = function(editor){\n var ele;\n ele = document.getElementById(SocialCalc.GetSpreadsheetControlObject().idPrefix + \"graphlist\");\n if (editor.range.hasrange) {\n return ele.options[0].text = SocialCalc.crToCoord(editor.range.left, editor.range.top) + \":\" + SocialCalc.crToCoord(editor.range.right, editor.range.bottom);\n } else {\n return ele.options[0].text = SocialCalc.LocalizeString(\"[select range]\");\n }\n };\n\n Graph.GraphSetCells = function(){\n var spreadsheet, editor, lele, ele;\n spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n editor = spreadsheet.editor;\n lele = document.getElementById(spreadsheet.idPrefix + \"graphlist\");\n if (lele.selectedIndex === 0) {\n if (editor.range.hasrange) {\n spreadsheet.graphrange = SocialCalc.crToCoord(editor.range.left, editor.range.top) + \":\" + SocialCalc.crToCoord(editor.range.right, editor.range.bottom);\n } else {\n spreadsheet.graphrange = editor.ecell.coord + \":\" + editor.ecell.coord;\n }\n } else {\n spreadsheet.graphrange = lele.options[lele.selectedIndex].value;\n }\n ele = document.getElementById(spreadsheet.idPrefix + \"graphrange\");\n ele.innerHTML = spreadsheet.graphrange;\n Graph.DoGraph(false, false);\n };\n\n Graph.DoGraph = function(helpflag, isResize){\n colorIndex = 0;\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n var editor = spreadsheet.editor;\n var gview = spreadsheet.views.graph.element;\n var ginfo = SocialCalc.GraphTypesInfo[spreadsheet.graphtype];\n var gfunc = ginfo.func;\n if (!spreadsheet.graphrange) {\n if (gfunc && helpflag) {\n gfunc(spreadsheet, null, gview, spreadsheet.graphtype, helpflag, isResize);\n } else {\n gview.innerHTML = \"<div style=\\\"padding:30px;font-weight:bold;\\\">\" + SocialCalc.Constants.s_GraphRangeNotSelected + \"</div>\";\n }\n return;\n }\n var grange = spreadsheet.graphrange;\n if (grange && grange.indexOf(\":\") === -1) {\n var nrange = SocialCalc.Formula.LookupName(spreadsheet.sheet, grange || \"\");\n if (nrange.type !== \"range\") {\n gview.innerHTML = SocialCalc.LocalizeString(\"Unknown range name\") + \": \" + grange;\n return;\n }\n var rparts = nrange.value.match(/^(.*)\\|(.*)\\|$/);\n grange = rparts[1] + \":\" + rparts[2];\n }\n var prange = SocialCalc.ParseRange(grange);\n var range = {};\n if (prange.cr1.col <= prange.cr2.col) {\n range.left = prange.cr1.col;\n range.right = prange.cr2.col;\n } else {\n range.left = prange.cr2.col;\n range.right = prange.cr1.col;\n }\n if (prange.cr1.row <= prange.cr2.row) {\n range.top = prange.cr1.row;\n range.bottom = prange.cr2.row;\n } else {\n range.top = prange.cr2.row;\n range.bottom = prange.cr1.row;\n }\n if (gfunc) {\n gfunc(spreadsheet, range, gview, spreadsheet.graphtype, helpflag, isResize);\n }\n };\n\n Graph.GraphChanged = function(gtobj){\n SocialCalc.CurrentSpreadsheetControlObject.graphtype = gtobj.options[gtobj.selectedIndex].value;\n return Graph.DoGraph(false, false);\n };\n\n Graph.MinMaxChanged = function(minmaxobj, index){\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n switch (index) {\n case 0:\n spreadsheet.graphMinX = minmaxobj.value;\n break;\n case 1:\n spreadsheet.graphMaxX = minmaxobj.value;\n break;\n case 2:\n spreadsheet.graphMinY = minmaxobj.value;\n break;\n case 3:\n spreadsheet.graphMaxY = minmaxobj.value;\n }\n return Graph.DoGraph(false, true);\n };\n\n Graph.GraphSave = function(editor, setting){\n var spreadsheet, gtype, str;\n spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n gtype = spreadsheet.graphtype || \"\";\n str = \"graph:range:\" + SocialCalc.encodeForSave(spreadsheet.graphrange) + \":type:\" + SocialCalc.encodeForSave(gtype);\n str += \":minmax:\" + SocialCalc.encodeForSave(spreadsheet.graphMinX + \",\" + spreadsheet.graphMaxX + \",\" + spreadsheet.graphMinY + \",\" + spreadsheet.graphMaxY) + \"\\n\";\n return str;\n };\n\n Graph.GraphLoad = function(editor, setting, line, flags){\n var spreadsheet, parts, i, splitMinMax;\n spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n parts = line.split(\":\");\n i = 1;\n while (i < parts.length) {\n switch (parts[i]) {\n case 'type':\n spreadsheet.graphtype = SocialCalc.decodeFromSave(parts[i + 1]);\n break;\n case 'range':\n spreadsheet.graphrange = SocialCalc.decodeFromSave(parts[i + 1]);\n break;\n case 'minmax':\n splitMinMax = SocialCalc.decodeFromSave(parts[i + 1]).split(',');\n spreadsheet.graphMinX = splitMinMax[0];\n document.getElementById(spreadsheet.idPrefix+\"graphMinX\").value = spreadsheet.graphMinX;\n spreadsheet.graphMaxX = splitMinMax[1];\n document.getElementById(spreadsheet.idPrefix+\"graphMaxX\").value = spreadsheet.graphMaxX;\n spreadsheet.graphMinY = splitMinMax[2];\n document.getElementById(spreadsheet.idPrefix+\"graphMinY\").value = spreadsheet.graphMinY;\n spreadsheet.graphMaxY = splitMinMax[3];\n document.getElementById(spreadsheet.idPrefix+\"graphMaxY\").value = spreadsheet.graphMaxY;\n }\n i += 2;\n }\n return true;\n };\n\n // Extract display data from a range of cell\n var cellRangeToDisplay = function(range) {\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n var values = [];\n var labels = [];\n var nitems, byrow;\n if (!(range.right === range.left || range.top === range.bottom))\n return null;\n if (range.left === range.right) {\n nitems = range.bottom - range.top + 1;\n byrow = true;\n } else {\n nitems = range.right - range.left + 1;\n byrow = false;\n }\n var val = null; minval = null, maxval = null;\n for (var i = 0; i < nitems; i++) {\n var cr = byrow\n ? SocialCalc.rcColname(range.left) + (i + range.top)\n : SocialCalc.rcColname(i + range.left) + range.top;\n var cr1 = byrow\n ? SocialCalc.rcColname(range.left - 1 || 1) + (i + range.top)\n : SocialCalc.rcColname(i + range.left) + (range.top - 1 || 1);\n var cell = spreadsheet.sheet.GetAssuredCell(cr);\n if (cell.valuetype.charAt(0) === \"n\") {\n val = cell.datavalue - 0;\n if (maxval == null || maxval < val) maxval = val;\n if (minval == null || minval > val) minval = val;\n values.push(val);\n cell = spreadsheet.sheet.GetAssuredCell(cr1);\n if (cell.valuetype.charAt(0) === \"t\" || cell.valuetype.charAt(0) === \"n\")\n labels.push(\"\" + cell.datavalue);\n else\n labels.push(cr);\n }\n }\n if (maxval < 0) maxval = 0;\n if (minval > 0) minval = 0;\n\n return {values: values, labels: labels, minval: minval, maxval: maxval};\n };\n\n Graph.GraphVerticalBar = function(spreadsheet, range, gview, gtype, helpflag) {\n fonc = \"Graph.GraphVerticalBar\";\n var scc = SocialCalc.Constants;\n var str;\n if (helpflag || !range) {\n str = \"<input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\"><br><br>\" + scc.s_graph_help_intro + SocialCalc.GraphTypesInfo[gtype].display + \".<br><br>\" + scc.s_graph_VerticalBar_help + \"<br><br><input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\">\";\n str = SocialCalc.LocalizeSubstrings(str);\n gview.innerHTML = str;\n return;\n }\n var data = cellRangeToDisplay(range);\n if (!data) {\n gview.innerHTML = scc.s_graph_error_selection;\n return;\n }\n var graphLimits = document.getElementById(spreadsheet.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"none\";\n\n // Create display\n str = \"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"width:100%;\\\"><tr><td><canvas id=\\\"\"+spreadsheet.idPrefix+\"myBarCanvas\\\" style=\\\"border:1px solid black;\\\"></canvas></td></tr></table>\";\n gview.innerHTML = str;\n var canv = document.getElementById(spreadsheet.idPrefix+'myBarCanvas');\n\n // The canvas must be explicitly resized to fill space\n canv.width = 0 + gview.style.width.replace(\"px\", \"\") - 4;\n canv.height = 0 + gview.style.height.replace(\"px\", \"\") - 4;\n\n var configVisual = SocialCalc.GraphTypesInfo.visual;\n var marginX = Math.floor(canv.width * configVisual.marginX);\n var marginY = Math.floor(canv.height * configVisual.marginY);\n totalWidth = canv.width - 2 * marginX;\n totalHeight = canv.height - 2 * marginY;\n\n // Draw X axis\n var ctx = canv.getContext('2d');\n var barColor = getBarColor();\n ctx.fillStyle = '#' + barColor;\n var originY = totalHeight * (data.maxval / (data.maxval - data.minval)) + marginY;\n ctx.lineWidth = totalHeight * configVisual.axisWidth;\n ctx.moveTo(0, originY);\n ctx.lineTo(canv.width, originY);\n ctx.stroke();\n\n // Draw bars\n var barWidth = Math.floor(totalWidth / (data.values.length || 1));\n var yScale = totalHeight / (data.maxval - data.minval);\n for (var i = 0; i < data.values.length; i++) {\n ctx.fillRect(marginX + i * barWidth, originY - yScale * data.values[i], barWidth, yScale * data.values[i]);\n barColor = getBarColor();\n ctx.fillStyle = '#' + barColor;\n }\n\n // Draw labels\n ctx.strokeStyle = '#000000';\n ctx.fillStyle = '#000000';\n var fontSize = Math.floor(canv.height * configVisual.fontSize);\n if (fontSize < configVisual.fontSizeMin) fontSize = configVisual.fontSizeMin;\n ctx.font = \"\" + fontSize + \"px bold Arial\";\n var offsetTextX = (barWidth <= 3 * fontSize) ? 0 : fontSize;\n for (var i = 0; i < data.values.length; i++) {\n var yValue, yLabel;\n if (data.values[i] > 0) {\n yValue = originY - fontSize * configVisual.valueMargin;\n yLabel = originY + fontSize * (configVisual.labelMargin + 1);\n } else {\n yValue = originY + fontSize * (configVisual.valueMargin + 1);\n yLabel = originY - fontSize * configVisual.labelMargin;\n }\n var x = marginX + offsetTextX + i * barWidth;\n ctx.fillText(data.values[i], x, yValue);\n ctx.fillText(data.labels[i], x, yLabel);\n }\n };\n\n Graph.GraphHorizontalBar = function(spreadsheet, range, gview, gtype, helpflag){\n fonc = \"Graph.GraphHorizontalBar\";\n var scc = SocialCalc.Constants;\n var str;\n if (helpflag || !range) {\n str = \"<input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\"><br><br>\" + scc.s_graph_help_intro + SocialCalc.GraphTypesInfo[gtype].display + \".<br><br>\" + scc.s_graph_HorizontalBar_help + \"<br><br><input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\">\";\n gview.innerHTML = str;\n return;\n }\n var data = cellRangeToDisplay(range);\n if (!data) {\n gview.innerHTML = scc.s_graph_error_selection;\n return;\n }\n var graphLimits = document.getElementById(spreadsheet.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"none\";\n\n // Create display\n str = \"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"width:100%;\\\"><tr><td><canvas id=\\\"\"+spreadsheet.idPrefix+\"myBarCanvas\\\" style=\\\"border:1px solid black;\\\"></canvas></td></tr></table>\";\n gview.innerHTML = str;\n var canv = document.getElementById(spreadsheet.idPrefix+\"myBarCanvas\");\n\n // The canvas must be explicitly resized to fill space\n canv.width = 0 + gview.style.width.replace(\"px\", \"\") - 4;\n canv.height = 0 + gview.style.height.replace(\"px\", \"\") - 4;\n\n var configVisual = SocialCalc.GraphTypesInfo.visual;\n var marginX = Math.floor(canv.width * configVisual.marginX);\n var marginY = Math.floor(canv.height * configVisual.marginY);\n totalWidth = canv.width - 2 * marginX;\n totalHeight = canv.height - 2 * marginY;\n\n // Draw Y axis\n var ctx = canv.getContext(\"2d\");\n barColor = getBarColor();\n ctx.fillStyle = \"#\" + barColor;\n var originX = totalWidth * (1 - (data.maxval / (data.maxval - data.minval))) + marginX;\n ctx.lineWidth = totalWidth * configVisual.axisWidth;\n ctx.moveTo(originX, 0);\n ctx.lineTo(originX, canv.height);\n ctx.stroke();\n\n // Draw bars\n var barWidth = Math.floor(totalHeight / (data.values.length || 1));\n var yScale = totalWidth / (data.maxval - data.minval);\n for (var i = 0; i < data.values.length; i++) {\n ctx.fillRect(originX + yScale * data.values[i], marginY + i * barWidth, - yScale * data.values[i], barWidth);\n barColor = getBarColor();\n ctx.fillStyle = \"#\" + barColor;\n }\n\n // Draw labels\n ctx.strokeStyle = \"#000000\";\n ctx.fillStyle = \"#000000\";\n var fontSize = Math.floor(canv.height * configVisual.fontSize);\n if (fontSize < configVisual.fontSizeMin) fontSize = configVisual.fontSizeMin;\n ctx.font = \"\" + fontSize + \"px bold Arial\";\n var offsetTextY = (barWidth <= 3 * fontSize) ? 0 : 2 * fontSize;\n for (var i = 0; i < data.values.length; i++) {\n var xValue, xLabel;\n if (data.values[i] > 0) {\n xValue = originX + fontSize * configVisual.valueMargin;\n xLabel = originX - fontSize * (configVisual.labelMargin + 1);\n } else {\n xValue = originX - fontSize * configVisual.valueMargin - ctx.measureText(\"\"+data.values[i]).width;\n xLabel = originX + fontSize * configVisual.labelMargin;\n }\n var y = marginY + offsetTextY + i * barWidth;\n ctx.fillText(data.values[i], xValue, y);\n ctx.save();\n ctx.translate(xLabel, y);\n ctx.rotate(90 * Math.PI/180);\n ctx.fillText(data.labels[i], 0, 0);\n ctx.restore();\n }\n };\n\n Graph.MakePieChart = function(spreadsheet, range, gview, gtype, helpflag){\n fonc = \"Graph.MakePieChart\";\n var scc = SocialCalc.Constants;\n var str;\n if (helpflag || !range) {\n str = \"<input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\"><br><br>\" + scc.s_graph_help_intro + SocialCalc.GraphTypesInfo[gtype].display + \".<br><br>\" + scc.s_graph_PieChart_help + \"<br><br><input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\">\";\n str = SocialCalc.LocalizeSubstrings(str);\n gview.innerHTML = str;\n return;\n }\n var data = cellRangeToDisplay(range);\n if (!data) {\n gview.innerHTML = scc.s_graph_error_selection;\n return;\n }\n for (var i = 0; i < data.values.length; i++) {\n if (data.values[i] < 0) {\n gview.innerHTML = scc.s_graph_PieChart_error_selection;\n return;\n }\n }\n var graphLimits = document.getElementById(spreadsheet.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"none\";\n\n // Create display\n str = \"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"width:100%;\\\"><tr><td><canvas id=\\\"\"+spreadsheet.idPrefix+\"myCanvas\\\" style=\\\"border:1px solid black;\\\"></canvas></td></tr></table>\";\n gview.innerHTML = str;\n var canv = document.getElementById(spreadsheet.idPrefix+\"myCanvas\");\n\n // The canvas must be explicitly resized to fill space\n canv.width = 0 + gview.style.width.replace(\"px\", \"\") - 4;\n canv.height = 0 + gview.style.height.replace(\"px\", \"\") - 4;\n\n var ctx = canv.getContext(\"2d\");\n var configVisual = SocialCalc.GraphTypesInfo.visual;\n var fontSize = Math.floor(canv.height * configVisual.fontSize);\n if (fontSize < configVisual.fontSizeMin) fontSize = configVisual.fontSizeMin;\n ctx.font = \"\" + fontSize + \"px bold Arial\";\n var total = 0;\n for (var i = 0; i < data.values.length; i++) {\n total += data.values[i];\n }\n centerX = canv.width / 2;\n centerY = canv.height / 2;\n var rad = centerY - 50;\n var textRad = rad * 1.1;\n var lastStart = 0;\n for (var i = 0; i < data.values.length; i++) {\n if (Number(data.values[i]) === 0) continue;\n ctx.beginPath();\n ctx.moveTo(centerX, centerY);\n var arcColor = getDrawColor();\n ctx.fillStyle = arcColor;\n var arcRads = 2 * Math.PI * (data.values[i] / total);\n ctx.arc(centerX, centerY, rad, lastStart, lastStart + arcRads, false);\n ctx.closePath();\n ctx.fill();\n ctx.fillStyle = \"black\";\n var centralRad = lastStart + 0.5 * arcRads;\n var leftBias = 0;\n if (centralRad > 1.5 && centralRad < 4.6) {\n leftBias = 55;\n }\n ctx.translate(centerX + Math.cos(centralRad) * textRad - leftBias, centerY + Math.sin(centralRad) * textRad);\n ctx.fillText(data.labels[i] + \" (\" + Math.round(data.values[i] / total * 100) + \"%)\", 0, 0);\n ctx.translate(-1 * centerX - Math.cos(centralRad) * textRad + leftBias, -1 * centerY - Math.sin(centralRad) * textRad);\n ctx.fillRect(1, 1, 1, 1);\n ctx.closePath();\n lastStart += arcRads;\n }\n };\n\n // Extract XY display data from a range of cell\n var cellRangeToDisplay2 = function(range, isResize) {\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n var values = [];\n var labels = [];\n var nitems, byrow;\n if (range.left === range.right) {\n nitems = range.bottom - range.top + 1;\n byrow = true;\n } else {\n nitems = range.right - range.left + 1;\n byrow = false;\n }\n var val = null, minX = null, maxX = null, minval = null, maxval = null;\n if (isResize) {\n try {\n minX = 1 * document.getElementById(spreadsheet.idPrefix+\"graphMinX\").value;\n } catch (e$) {\n e = e$;\n minX = null;\n }\n try {\n maxX = 1 * document.getElementById(spreadsheet.idPrefix+\"graphMaxX\").value;\n } catch (e$) {\n e = e$;\n maxX = null;\n }\n try {\n minval = 1 * document.getElementById(spreadsheet.idPrefix+\"graphMinY\").value;\n } catch (e$) {\n e = e$;\n minval = null;\n }\n try {\n maxval = 1 * document.getElementById(spreadsheet.idPrefix+\"graphMaxY\").value;\n } catch (e$) {\n e = e$;\n maxval = null;\n }\n }\n dotSizes = new Array();\n var evenlySpaced = false;\n for (var i = 0; i < nitems; i++) {\n cr = byrow\n ? SocialCalc.rcColname(range.left) + (i + range.top)\n : SocialCalc.rcColname(i + range.left) + range.top;\n cr1 = byrow\n ? SocialCalc.rcColname(range.left - 1 || 1) + (i + range.top)\n : SocialCalc.rcColname(i + range.left) + (range.top - 1 || 1);\n cr2 = byrow\n ? SocialCalc.rcColname(range.left + 1 || 2) + (i + range.top)\n : SocialCalc.rcColname(i + range.left) + (range.top + 1 || 2);\n cell = spreadsheet.sheet.GetAssuredCell(cr);\n if (cell.valuetype.charAt(0) === \"n\") {\n val = cell.datavalue - 0;\n if ((maxval == null || maxval < val) && !isResize) maxval = val;\n if ((minval == null || minval > val) && !isResize) minval = val;\n values.push(val);\n cell = spreadsheet.sheet.GetAssuredCell(cr1);\n if ((range.right === range.left || range.top === range.bottom) && (cell.valuetype.charAt(0) === \"t\" || cell.valuetype.charAt(0) === \"n\")) {\n labels.push(cell.datavalue + \"\");\n if ((maxX == null || maxX < cell.datavalue) && !isResize) maxX = cell.datavalue;\n if ((minX == null || minX > cell.datavalue) && !isResize) minX = cell.datavalue;\n } else {\n labels.push(cr);\n evenlySpaced = true;\n }\n cell = spreadsheet.sheet.GetAssuredCell(cr2);\n if ((range.right === range.left || range.top === range.bottom) && (cell.valuetype.charAt(0) === \"t\" || cell.valuetype.charAt(0) === \"n\"))\n dotSizes.push(cell.datavalue + \"\");\n else\n dotSizes.push(\"5\");\n }\n }\n if (evenlySpaced) {\n for (var i = 0; i < values.length; i++) {\n labels[i] = i;\n }\n if (!isResize) {\n minX = 0;\n maxX = values.length - 1;\n }\n }\n\n return {values: values, labels: labels, dotSizes: dotSizes, minval: minval, maxval: maxval, minX: minX, maxX: maxX};\n };\n\n Graph.MakeLineChart = function(spreadsheet, range, gview, gtype, helpflag, isResize){\n fonc = \"Graph.MakeLineChart\";\n var scc = SocialCalc.Constants;\n var str;\n if (helpflag || !range) {\n str = \"<input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\"><br><br>\" + scc.s_graph_help_intro + SocialCalc.GraphTypesInfo[gtype].display + \".<br><br>\" + scc.s_graph_LineChart_help + \"<br><br><input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\">\";\n str = SocialCalc.LocalizeSubstrings(str);\n gview.innerHTML = str;\n return;\n }\n var data = cellRangeToDisplay2(range, isResize);\n if (!data) {\n gview.innerHTML = scc.s_graph_error_selection;\n return;\n }\n var graphLimits = document.getElementById(spreadsheet.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"block\";\n\n // Create display\n str = \"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"width:100%;\\\"><tr><td><canvas id=\\\"\"+spreadsheet.idPrefix+\"myLineCanvas\\\" style=\\\"border:1px solid black;\\\"></canvas></td></tr></table>\";\n gview.innerHTML = str;\n if (!isResize) {\n document.getElementById(spreadsheet.idPrefix+\"graphMinX\").value = data.minX;\n spreadsheet.graphMinX = minX;\n document.getElementById(spreadsheet.idPrefix+\"graphMaxX\").value = data.maxX;\n spreadsheet.graphMaxX = maxX;\n document.getElementById(spreadsheet.idPrefix+\"graphMinY\").value = data.minval;\n spreadsheet.graphMinY = minval;\n document.getElementById(spreadsheet.idPrefix+\"graphMaxY\").value = data.maxval;\n spreadsheet.graphMaxY = maxval;\n }\n var canv = document.getElementById(spreadsheet.idPrefix+\"myLineCanvas\");\n\n // The canvas must be explicitly resized to fill space\n canv.width = 0 + gview.style.width.replace(\"px\", \"\") - 4;\n canv.height = 0 + gview.style.height.replace(\"px\", \"\") - 4;\n\n var ctx = canv.getContext(\"2d\");\n var minX = data.minX, maxX = data.maxX, minval = data.minval, maxval = data.maxval;\n var scaleFactorX = (canv.width - 40) / (maxX - minX);\n var scaleFactorY = (canv.height - 40) / (maxval - minval);\n var topY = canv.height;\n var colorArray = [];\n for (var i = 0; i < data.values.length; i++) {\n var lastX, lastY, drawColor;\n if ((i > 0) && (data.labels[i] * 1 > data.labels[i - 1] * 1)) {\n ctx.moveTo(lastX, topY - lastY);\n ctx.lineTo(scaleFactorX * (data.labels[i] - minX) + 20, topY - (scaleFactorY * (data.values[i] - minval) + 20));\n ctx.stroke();\n } else {\n ctx.beginPath();\n drawColor = getDrawColor();\n colorArray.push(drawColor.replace(\"#\", \"\"));\n ctx.strokeStyle = drawColor;\n ctx.fillStyle = drawColor;\n }\n lastX = scaleFactorX * (data.labels[i] - minX) + 20;\n lastY = scaleFactorY * (data.values[i] - minval) + 20;\n if ((colorArray.length - 1) % 3 === 0) {\n ctx.fillRect(lastX - 3, topY - lastY - 3, 6, 6);\n } else if ((colorArray.length - 1) % 3 === 1) {\n ctx.beginPath();\n ctx.arc(lastX, topY - lastY, 3, 0, Math.PI * 2, false);\n ctx.fill();\n } else {\n ctx.fillRect(lastX, topY - lastY - 3, 2, 8);\n ctx.fillRect(lastX - 3, topY - lastY, 8, 2);\n }\n }\n ctx.stroke();\n for (var i = 0; i < colorArray.length; i++) {\n if (i % 3 === 0)\n colorArray[i] = \"s,\" + colorArray[i] + \",\" + i + \",-1,6\";\n else if (i % 3 === 1)\n colorArray[i] = \"o,\" + colorArray[i] + \",\" + i + \",-1,6\";\n else\n colorArray[i] = \"c,\" + colorArray[i] + \",\" + i + \",-1,10\";\n }\n if (minval <= 0 && maxval >= 0) {\n ctx.beginPath();\n ctx.strokeStyle = \"#000000\";\n ctx.moveTo(0, canv.height - (scaleFactorY * -1 * minval + 20));\n ctx.lineTo(canv.width, canv.height - (scaleFactorY * -1 * minval + 20));\n ctx.stroke();\n graphPlace = 1 - (canv.height - (scaleFactorY * -1 * minval + 20)) / canv.height;\n }\n if (minX <= 0 && maxX >= 0) {\n ctx.beginPath();\n ctx.strokeStyle = \"#000000\";\n ctx.moveTo(scaleFactorX * -1 * minX + 20, 0);\n ctx.lineTo(scaleFactorX * -1 * minX + 20, canv.height);\n ctx.stroke();\n graphPlace = (scaleFactorX * -1 * minX + 20) / canv.width;\n }\n minX -= (maxX - minX) / 23;\n maxX += (maxX - minX) / 23;\n minval -= (maxval - minval) / 18;\n maxval += (maxval - minval) / 18;\n };\n\n Graph.MakeScatterChart = function(spreadsheet, range, gview, gtype, helpflag, isResize){\n fonc = \"Graph.MakeScatterChart\";\n var scc = SocialCalc.Constants;\n var str;\n if (helpflag || !range) {\n str = \"<input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\"><br><br>\" + scc.s_graph_help_intro + SocialCalc.GraphTypesInfo[gtype].display + \".<br><br>\" + scc.s_graph_ScatterChart_help + \"<br><br><input type=\\\"button\\\" value=\" + scc.s_loc_hide_help + \" onclick=\\\"Graph.DoGraph(false,false);\\\">\";\n str = SocialCalc.LocalizeSubstrings(str);\n gview.innerHTML = str;\n return;\n }\n var data = cellRangeToDisplay2(range, isResize);\n if (!data) {\n gview.innerHTML = scc.s_graph_error_selection;\n return;\n }\n var graphLimits = document.getElementById(spreadsheet.idPrefix + \"graphLimits\");\n graphLimits.style.display = \"block\";\n\n // Create display\n str = \"<table cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" style=\\\"width:100%;\\\"><tr><td><canvas id=\\\"\"+spreadsheet.idPrefix+\"myScatterCanvas\\\" style=\\\"border:1px solid black;\\\"></canvas></td></tr></table>\";\n gview.innerHTML = str;\n if (!isResize) {\n document.getElementById(spreadsheet.idPrefix+\"graphMinX\").value = data.minX;\n spreadsheet.graphMinX = minX;\n document.getElementById(spreadsheet.idPrefix+\"graphMaxX\").value = data.maxX;\n spreadsheet.graphMaxX = maxX;\n document.getElementById(spreadsheet.idPrefix+\"graphMinY\").value = data.minval;\n spreadsheet.graphMinY = minval;\n document.getElementById(spreadsheet.idPrefix+\"graphMaxY\").value = data.maxval;\n spreadsheet.graphMaxY = maxval;\n }\n var canv = document.getElementById(spreadsheet.idPrefix+\"myScatterCanvas\");\n\n // The canvas must be explicitly resized to fill space\n canv.width = 0 + gview.style.width.replace(\"px\", \"\") - 4;\n canv.height = 0 + gview.style.height.replace(\"px\", \"\") - 4;\n\n var ctx = canv.getContext(\"2d\");\n var minX = data.minX, maxX = data.maxX, minval = data.minval, maxval = data.maxval;\n var scaleFactorX = (canv.width - 40) / (maxX - minX);\n var scaleFactorY = (canv.height - 40) / (maxval - minval);\n var topY = canv.height;\n\n lastX = scaleFactorX * (data.labels[0] - minX) + 20;\n lastY = scaleFactorY * (data.values[0] - minval) + 20;\n drawColor = getDrawColor();\n ctx.fillStyle = drawColor;\n ctx.beginPath();\n ctx.arc(lastX, topY - lastY, data.dotSizes[0], 0, 2 * Math.PI, false);\n ctx.fill();\n for (var i = 1; i < data.values.length; i++) {\n ctx.moveTo(lastX, topY - lastY);\n lastX = scaleFactorX * (data.labels[i] - minX) + 20;\n lastY = scaleFactorY * (data.values[i] - minval) + 20;\n ctx.beginPath();\n ctx.arc(lastX, topY - lastY, data.dotSizes[i], 0, 2 * Math.PI, false);\n ctx.fill();\n }\n if (minval <= 0 && maxval >= 0) {\n ctx.beginPath();\n ctx.strokeStyle = \"#000000\";\n ctx.moveTo(0, canv.height - (scaleFactorY * -1 * minval + 20));\n ctx.lineTo(canv.width, canv.height - (scaleFactorY * -1 * minval + 20));\n ctx.stroke();\n graphPlace = 1 - (canv.height - (scaleFactorY * -1 * minval + 20)) / canv.height;\n }\n if (minX <= 0 && maxX >= 0) {\n ctx.beginPath();\n ctx.strokeStyle = \"#000000\";\n ctx.moveTo(scaleFactorX * -1 * minX + 20, 0);\n ctx.lineTo(scaleFactorX * -1 * minX + 20, canv.height);\n ctx.stroke();\n graphPlace = (scaleFactorX * -1 * minX + 20) / canv.width;\n }\n minX -= (maxX - minX) / 23;\n maxX += (maxX - minX) / 23;\n minval -= (maxval - minval) / 18;\n maxval += (maxval - minval) / 18;\n };\n\n exports.Graph = Graph;\n})();"
},
"$:/plugins/rboue/SocialCalc/Lib/socialcalc.css": {
"type": "text/css",
"title": "$:/plugins/rboue/SocialCalc/Lib/socialcalc.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": "/*\n// The optional default CSS style sheet for the SocialCalc package.\n// SocialCalc can run without a style sheet (the default) or with one.\n//\n// (c) Copyright 2008 Socialtext, Inc.\n// All Rights Reserved.\n//\n// The contents of this file are subject to the Artistic License 2.0; you may not\n// use this file except in compliance with the License. You may obtain a copy of \n// the License at http://socialcalc.org/licenses/al-20/.\n//\n// Some of the other files in the SocialCalc package are licensed under\n// different licenses. Please note the licenses of the modules you use.\n//\n// Code History:\n//\n// Initially coded by Dan Bricklin of Software Garden, Inc., for Socialtext, Inc.\n*/\n\nbody:last-child .defaultPeer {\n border-collapse: separate;\n filter: none;\n}\n\n.defaultPeer {\n box-shadow: inset 0 0 0 2px blue;\n -webkit-box-shadow: inset 0 0 0 2px blue;\n -moz-box-shadow: inset 0 0 0 2px blue;\n *background: white;\n filter: progid:DXImageTransform.Microsoft.DropShadow(OffX=1, OffY=1, Color=#0000ff),\n progid:DXImageTransform.Microsoft.DropShadow(OffX=-1, OffY=1, Color=#0000ff),\n progid:DXImageTransform.Microsoft.DropShadow(OffX=1, OffY=-1, Color=#0000ff),\n progid:DXImageTransform.Microsoft.DropShadow(OffX=-1, OffY=-1, Color=#0000ff),\n progid:DXImageTransform.Microsoft.Chroma(Color=#FFFFFF);\n /*\n * concat peer combinations into multishadows:\n inset 0 0 0 4px orange,\n inset 0 0 0 6px yellow,\n inset 0 0 0 8px lime,\n inset 0 0 0 10px cyan,\n inset 0 0 0 12px blue,\n inset 0 0 0 14px purple; \n */\n}\n.defaultComment {background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-commentbg.gif);}\n.defaultCommentNoGridStyle {}\n.defaultHighlightTypeCursor {color:#FFF;background-color:#A6A6A6;}\n.defaultHighlightTypeRange {color:#000;background-color:#E5E5E5;}\n.defaultColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#808080;cursor:e-resize;}\n.defaultSelectedColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#404040;cursor:e-resize;}\n.defaultRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#808080;}\n.defaultSelectedRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#404040;}\n.defaultUpperLeft {font-size:small;}\n.defaultSkippedCell {font-size:small;background-color:#CCC;}\n.defaultPaneDivider {font-size:small;background-color:#ECECEC;padding:0px;}\n.cteGriddiv {}\n.defaultInputEcho {background-color:#FFD;border:1px solid #884;\n font-size:small;padding:2px 10px 1px 2px;cursor:default;}\n.TCmain {background-color:#EEE;}\n.TCendcap {background-color:#FFF;}\n.TCpaneslider {background-color:#CCC;}\n.TClessbutton {background-color:#AAA;}\n.TCmorebutton {background-color:#AAA;}\n.TCscrollarea {background-color:#DDD;}\n.TCthumb {background-color:#CCC;}\n.TCPStrackingline {overflow:hidden;position:absolute;z-index:100;}\n.TCTDFSthumbstatus {height:20px;width:auto;border:1px solid black;padding:2px;\n background-color:#FFF;font-size:small;position:absolute;z-index:100;}\n.TDpopupElement {border:1px solid black;padding:1px 2px 2px 2px;text-align:center;background-color:#FFF;\n font-size:7pt;font-family:Verdana,Arial,Helvetica,sans-serif;\n position:absolute;width:auto;z-index:110;}\n\n#te_fullgrid {\n table-layout: fixed;\n}\n\n#te_fullgrid td {\n overflow: hidden;\n word-break: break-all;\n word-wrap: break-word;\n}\n\n#SocialCalc-settings-savecell, #SocialCalc-settings-savesheet {\n background: #AEF;\n font-weight: bold;\n}\n"
},
"$:/plugins/rboue/SocialCalc/config.css": {
"type": "text/css",
"title": "$:/plugins/rboue/SocialCalc/config.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": "/* Root node */\n.SocialCalcWidget {\n font-family: verdana,helvetica,sans-serif;\n font-size: small;\n margin: 0;\n padding: 0;\n padding-bottom: 4px;\n border: none;\n}\n\n/* Toolbars */\n.SocialCalc-toolbar {\n padding: 8px 8px 8px 8px;\n height: 60px;\n}\n\n/* Comment text area */\n.SocialCalc-commenttext {\n width: 500px;\n height: 32px;\n}\n\n/* Function chooser */\n.SocialCalc-functiondialogbody {\n padding: 8px 8px 8px 8px;\n}\n\n/* Status line */\n.SocialCalc-statusline {\n font-size: 10px;\n padding: 3px 0 2px 0;\n}\n\n/* Fix conflicts with TiddlyWiki defaults\n*/\n.SocialCalcWidget {\n line-height: 10pt;\n}\n.SocialCalcWidget table {\n margin: 0;\n padding: 0;\n border: none;\n}\n.SocialCalcWidget table td {\n margin: 0;\n padding: 0;\n border: none;\n}\n.SocialCalcWidget table td p {\n margin: 0;\n}\n.SocialCalcWidget #te_logo div {\n line-height: 3pt;\n}\n#SocialCalc-functiondialog div {\n padding: 4px 4px 4px 8px;\n}\n\n/* Transparent keyboard management (no more dashed border with focus) */\n.SocialCalcWidget :focus {\n outline: none;\n}\n\n/* Fix color pickers */\n.SocialCalc-colorchooser {\n line-height: 1px;\n}\n\n/* Sheet aspect (cf. SocialCalc.ConstantsSetClasses())\n */\n.SocialCalc-defaultComment { /* cells with non-null comments when grid enabled */\n background-repeat: no-repeat;\n background-position: top right;\n}\n.SocialCalc-defaultCommentNoGrid {} /* cells with non-null comments when grid not enabled */\n.SocialCalc-defaultHighlightTypeCursor {\n color: #FFF;\n background-color: #A6A6A6;\n}\n.SocialCalc-defaultHighlightTypeRange {\n color: #000;\n background-color: #E5E5E5;\n}\n.SocialCalc-defaultColname { /* regular column heading letters, needs a cursor property */\n font-size: small;\n text-align: center;\n color: #FFFFFF;\n background-color: #808080;\n cursor: e-resize;\n}\n.SocialCalc-defaultSelectedColname { /* column with selected cell, needs a cursor property */\n font-size: small;\n text-align: center;\n color: #FFFFFF;\n background-color: #404040;\n cursor: e-resize;\n}\n.SocialCalc-defaultRowname { /* regular row heading numbers */\n font-size: small;\n text-align: right;\n color: #FFFFFF;\n background-color: #808080;\n direction: rtl;\n}\n.SocialCalc-defaultSelectedRowname { /* column with selected cell, needs a cursor property */\n font-size: small;\n text-align: right;\n color: #FFFFFF;\n background-color: #404040;\n} \n.SocialCalc-defaultUpperLeft { /* Corner cell in upper left */\n font-size: small;\n}\n.SocialCalc-defaultSkippedCell { /* used if present for spanned cells peeking into a pane */\n font-size: small;\n background-color: #CCC\n}\n.SocialCalc-defaultPaneDivider { /* used if present for the look of the space between panes */\n font-size: small;\n background-color: #C0C0C0;\n padding: 0px;\n}\n.SocialCalc-cteGriddiv {} /* the TableEditor griddiv element */\n.SocialCalc-defaultInputEcho { /* the popup inputEcho div */\n filter: alpha(opacity=90);\n opacity: .9;\n background-color: #FFD;\n border: 1px solid #884;\n}\n.SocialCalc-TCmain { /* pseudo style (text-align is textAlign) for main div of a table control */\n background-color: #EEE;\n}\n.SocialCalc-TCendcap { /* may be used while waiting for image that may not come */\n background-color: #FFF;\n}\n.SocialCalc-TCpaneslider {\n background-color: #CCC;\n}\n.SocialCalc-TClessbutton {\n background-color: #AAA;\n}\n.SocialCalc-TCmorebutton {\n background-color: #AAA;\n}\n.SocialCalc-TCscrollarea {\n background-color: #DDD;\n}\n.SocialCalc-TCthumb {\n background-color: #CCC;\n}\n.SocialCalc-TCPStrackingline { /* pane slider tracking line display in table control */\n overflow: hidden;\n position: absolute;\n z-index: 100;\n}\n.SocialCalc-TCTDFSthumbstatus { /* vertical thumb dragging status display in table control */\n height: 20px;\n width: auto;\n border: 3px solid #808080;\n overflow: hidden;\n background-color: #FFF;\n font-size: small;\n position: absolute;\n z-index:100;\n}\n.SocialCalc-TDpopupElement { /* tooltip display */\n border: 1px solid black;\n padding: 1px 2px 2px 2px;\n text-align: center;\n background-color: #FFF;\n font-size: 7pt;\n font-family: Verdana,Arial,Helvetica,sans-serif;\n position: absolute;\n width: auto;\n z-index: 110;\n}"
},
"$:/plugins/rboue/SocialCalc/LEGAL.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/SocialCalc/LEGAL.txt",
"text": "SOCIALCALC LEGAL.txt FILE:\n\nLEGAL INFORMATION\n\nThis LEGAL.txt file accompanies the SocialCalc program. It includes notices required by the \nlicenses as well as general legal notices.\n\n=========================================\n COPYRIGHT AND ATTRIBUTION NOTICES\n=========================================\n\nCopyright (C) 2009 Socialtext, Inc. \nAll Rights Reserved.\n\nimage:sc-logo.gif\n\"SocialCalc\"\nhttp://www.socialcalc.org/xoattrib\n\n=========================================\n SOURCE CODE AVAILABILITY NOTICE\n=========================================\n\nThe source code for this product is available from:\nhttp://socialcalc.org/.\n\n=========================================\n GENERAL LEGAL NOTICES\n=========================================\n\nwikiCalc, Garden, and Software Garden are registered trademarks of Software Garden, Inc.\nSocialtext and SocialCalc are registered trademarks of Socialtext, Inc.\nThe Socialtext logo and Dreamcatcher are trademarks of Socialtext, Inc.\n\n=========================================\n LEGAL NOTICES REQUIRED BY THE LICENSE\n=========================================\n\nCHANGES MADE TO THE COVERED CODE (see CPAL Version 1.0 Section 3.3):\n\n2012-04-21:\n Incorporated charting framework from OLPC Sugar into player.coffee.\n\n The pie, line and bar chart tools was developed by Nicholas Doiron,\n an engineering student from Carnegie Mellon University, U.S.A under\n the guidance of Manusheel Gupta.\n\n2008-02-08:\n Original Code started as a translation to JavaScript of code in SocialCalc 1.1.0 plus\n much new code.\n\n Python code for the OLPC XO-1 initially coded by Luke Closs of Socialtext, Inc.\n\n JavaScript initially coded by Dan Bricklin of Software Garden, Inc., for Socialtext, Inc.\n Based in part on the SocialCalc 1.1.0 code written in Perl.\n The SocialCalc 1.1.0 code was:\n Portions (c) Copyright 2005, 2006, 2007 Software Garden, Inc.\n All Rights Reserved.\n Portions (c) Copyright 2007 Socialtext, Inc.\n All Rights Reserved.\n The Perl SocialCalc started as modifications to the wikiCalc(R) program, version 1.0.\n wikiCalc 1.0 was written by Software Garden, Inc.\n Unless otherwise specified, referring to \"SocialCalc\" in comments refers to this\n JavaScript version of the code, not the SocialCalc Perl code.\n\n----------\n\n(Documentation of future changes as the result of Modifications, including the date of \nchange, will go here in this LEGAL.txt file. This documentation may be summaries of \nchanges with the more detailed descriptions included in the actual modified files as \nappropriate.)\n\n==========\n\nTHIRD PARTY CLAIMS (see CPAL Version 1.0 Section 3.4(a)):\n\nNone.\n\n[End of LEGAL.txt]\n\n"
},
"$:/plugins/rboue/SocialCalc/LICENSE.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/SocialCalc/LICENSE.txt",
"text": "SOCIALCALC LICENSE.txt FILE:\n\n=========================================\n ABOUT THIS FILE\n=========================================\n\nThis file includes copies of the Common Public Attribution License (CPAL) and\nthe Artistic License 2.0.\n\nThis product consists of components licensed under different licenses.\nCheck the contents of each file for a statement of the license for that file.\nFiles without license information are licensed under the Artistic License 2.0.\n\n======================================================\n COMMON PUBLIC ATTRIBUTION LICENSE VERSION 1.0 (CPAL)\n======================================================\n\nCommon Public Attribution License Version 1.0 (CPAL)\n\n1. \"Definitions\"\n\n1.0.1 \"Commercial Use\" means distribution or otherwise making the Covered Code \navailable to a third party.\n\n1.1 \"Contributor\" means each entity that creates or contributes to the creation \nof Modifications.\n\n1.2 \"Contributor Version\" means the combination of the Original Code, prior \nModifications used by a Contributor, and the Modifications made by that particular \nContributor.\n\n1.3 \"Covered Code\" means the Original Code or Modifications or the combination of \nthe Original Code and Modifications, in each case including portions thereof.\n\n1.4 \"Electronic Distribution Mechanism\" means a mechanism generally accepted in \nthe software development community for the electronic transfer of data.\n\n1.5 \"Executable\" means Covered Code in any form other than Source Code.\n\n1.6 \"Initial Developer\" means the individual or entity identified as the Initial \nDeveloper in the Source Code notice required by Exhibit A.\n\n1.7 \"Larger Work\" means a work which combines Covered Code or portions thereof with \ncode not governed by the terms of this License.\n\n1.8 \"License\" means this document.\n\n1.8.1 \"Licensable\" means having the right to grant, to the maximum extent possible, \nwhether at the time of the initial grant or subsequently acquired, any and all of \nthe rights conveyed herein.\n\n1.9 \"Modifications\" means any addition to or deletion from the substance or structure \nof either the Original Code or any previous Modifications. When Covered Code is \nreleased as a series of files, a Modification is:\n\nA. Any addition to or deletion from the contents of a file containing Original Code \nor previous Modifications.\n\nB. Any new file that contains any part of the Original Code or previous Modifications.\n\n1.10 \"Original Code\" means Source Code of computer software code which is described in \nthe Source Code notice required by Exhibit A as Original Code, and which, at the time \nof its release under this License is not already Covered Code governed by this License.\n\n1.10.1 \"Patent Claims\" means any patent claim(s), now owned or hereafter acquired, \nincluding without limitation, method, process, and apparatus claims, in any patent \nLicensable by grantor.\n\n1.11 \"Source Code\" means the preferred form of the Covered Code for making modifications \nto it, including all modules it contains, plus any associated interface definition files, \nscripts used to control compilation and installation of an Executable, or source code \ndifferential comparisons against either the Original Code or another well known, \navailable Covered Code of the Contributor�s choice. The Source Code can be in a compressed \nor archival form, provided the appropriate decompression or de-archiving software is \nwidely available for no charge.\n\n1.12 \"You\" (or \"Your\") means an individual or a legal entity exercising rights under, and \ncomplying with all of the terms of, this License or a future version of this License \nissued under Section 6.1. For legal entities, \"You\" includes any entity which controls, \nis controlled by, or is under common control with You. For purposes of this definition, \n\"control\" means (a) the power, direct or indirect, to cause the direction or management \nof such entity, whether by contract or otherwise, or (b) ownership of more than fifty \npercent (50%) of the outstanding shares or beneficial ownership of such entity.\n\n2. Source Code License.\n\n2.1 The Initial Developer Grant.\n\nThe Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive \nlicense, subject to third party intellectual property claims:\n\n(a) under intellectual property rights (other than patent or trademark) Licensable by \nInitial Developer to use, reproduce, modify, display, perform, sublicense and distribute \nthe Original Code (or portions thereof) with or without Modifications, and/or as part \nof a Larger Work; and\n\n(b) under Patents Claims infringed by the making, using or selling of Original Code, to \nmake, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of \nthe Original Code (or portions thereof).\n\n(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date \nInitial Developer first distributes Original Code under the terms of this License.\n\n(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code \nthat You delete from the Original Code; 2) separate from the Original Code; or 3) for \ninfringements caused by: i) the modification of the Original Code or ii) the combination \nof the Original Code with other software or devices.\n\n2.2 Contributor Grant.\n\nSubject to third party intellectual property claims, each Contributor hereby grants You \na world-wide, royalty-free, non-exclusive license\n\n(a) under intellectual property rights (other than patent or trademark) Licensable by \nContributor, to use, reproduce, modify, display, perform, sublicense and distribute \nthe Modifications created by such Contributor (or portions thereof) either on an \nunmodified basis, with other Modifications, as Covered Code and/or as part of a Larger \nWork; and\n\n(b) under Patent Claims infringed by the making, using, or selling of Modifications \nmade by that Contributor either alone and/or in combination with its Contributor \nVersion (or portions of such combination), to make, use, sell, offer for sale, have \nmade, and/or otherwise dispose of: 1) Modifications made by that Contributor (or \nportions thereof); and 2) the combination of Modifications made by that Contributor \nwith its Contributor Version (or portions of such combination).\n\n(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date \nContributor first makes Commercial Use of the Covered Code.\n\n(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code \nthat Contributor has deleted from the Contributor Version; 2) separate from the \nContributor Version; 3) for infringements caused by: i) third party modifications of \nContributor Version or ii) the combination of Modifications made by that Contributor \nwith other software (except as part of the Contributor Version) or other devices; or \n4) under Patent Claims infringed by Covered Code in the absence of Modifications made \nby that Contributor.\n\n3. Distribution Obligations.\n\n3.1 Application of License.\n\nThe Modifications which You create or to which You contribute are governed by the terms \nof this License, including without limitation Section 2.2. The Source Code version of \nCovered Code may be distributed only under the terms of this License or a future version \nof this License released under Section 6.1, and You must include a copy of this License \nwith every copy of the Source Code You distribute. You may not offer or impose any terms \non any Source Code version that alters or restricts the applicable version of this License \nor the recipients� rights hereunder. However, You may include an additional document \noffering the additional rights described in Section 3.5.\n\n3.2 Availability of Source Code.\n\nAny Modification which You create or to which You contribute must be made available in \nSource Code form under the terms of this License either on the same media as an Executable \nversion or via an accepted Electronic Distribution Mechanism to anyone to whom you made \nan Executable version available; and if made available via Electronic Distribution \nMechanism, must remain available for at least twelve (12) months after the date it \ninitially became available, or at least six (6) months after a subsequent version of that \nparticular Modification has been made available to such recipients. You are responsible \nfor ensuring that the Source Code version remains available even if the Electronic \nDistribution Mechanism is maintained by a third party.\n\n3.3 Description of Modifications.\n\nYou must cause all Covered Code to which You contribute to contain a file documenting the \nchanges You made to create that Covered Code and the date of any change. You must include \na prominent statement that the Modification is derived, directly or indirectly, from \nOriginal Code provided by the Initial Developer and including the name of the Initial \nDeveloper in (a) the Source Code, and (b) in any notice in an Executable version or \nrelated documentation in which You describe the origin or ownership of the Covered Code.\n\n3.4 Intellectual Property Matters\n\n(a) Third Party Claims.\n\nIf Contributor has knowledge that a license under a third party�s intellectual property \nrights is required to exercise the rights granted by such Contributor under Sections 2.1 \nor 2.2, Contributor must include a text file with the Source Code distribution titled \"LEGAL\" \nwhich describes the claim and the party making the claim in sufficient detail that a \nrecipient will know whom to contact. If Contributor obtains such knowledge after the \nModification is made available as described in Section 3.2, Contributor shall promptly \nmodify the LEGAL file in all copies Contributor makes available thereafter and shall take \nother steps (such as notifying appropriate mailing lists or newsgroups) reasonably \ncalculated to inform those who received the Covered Code that new knowledge has been obtained.\n\n(b) Contributor APIs.\n\nIf Contributor�s Modifications include an application programming interface and Contributor \nhas knowledge of patent licenses which are reasonably necessary to implement that API, \nContributor must also include this information in the LEGAL file.\n\n(c) Representations.\n\nContributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor \nbelieves that Contributor�s Modifications are Contributor�s original creation(s) and/or \nContributor has sufficient rights to grant the rights conveyed by this License.\n\n3.5 Required Notices.\n\nYou must duplicate the notice in Exhibit A in each file of the Source Code. If it is not \npossible to put such notice in a particular Source Code file due to its structure, then \nYou must include such notice in a location (such as a relevant directory) where a user \nwould be likely to look for such a notice. If You created one or more Modification(s) \nYou may add your name as a Contributor to the notice described in Exhibit A. You must \nalso duplicate this License in any documentation for the Source Code where You describe \nrecipients� rights or ownership rights relating to Covered Code. You may choose to offer, \nand to charge a fee for, warranty, support, indemnity or liability obligations to one or \nmore recipients of Covered Code. However, You may do so only on Your own behalf, and not \non behalf of the Initial Developer or any Contributor. You must make it absolutely clear \nthan any such warranty, support, indemnity or liability obligation is offered by You alone, \nand You hereby agree to indemnify the Initial Developer and every Contributor for any \nliability incurred by the Initial Developer or such Contributor as a result of warranty, \nsupport, indemnity or liability terms You offer.\n\n3.6 Distribution of Executable Versions.\n\nYou may distribute Covered Code in Executable form only if the requirements of Section \n3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the \nSource Code version of the Covered Code is available under the terms of this License, \nincluding a description of how and where You have fulfilled the obligations of Section \n3.2. The notice must be conspicuously included in any notice in an Executable version, \nrelated documentation or collateral in which You describe recipients� rights relating to \nthe Covered Code. You may distribute the Executable version of Covered Code or ownership \nrights under a license of Your choice, which may contain terms different from this License, \nprovided that You are in compliance with the terms of this License and that the license for \nthe Executable version does not attempt to limit or alter the recipient�s rights in the \nSource Code version from the rights set forth in this License. If You distribute the \nExecutable version under a different license You must make it absolutely clear that any \nterms which differ from this License are offered by You alone, not by the Initial Developer, \nOriginal Developer or any Contributor. You hereby agree to indemnify the Initial Developer, \nOriginal Developer and every Contributor for any liability incurred by the Initial Developer, \nOriginal Developer or such Contributor as a result of any such terms You offer.\n\n3.7 Larger Works.\n\nYou may create a Larger Work by combining Covered Code with other code not governed by the \nterms of this License and distribute the Larger Work as a single product. In such a case, You \nmust make sure the requirements of this License are fulfilled for the Covered Code.\n\n4. Inability to Comply Due to Statute or Regulation.\n\nIf it is impossible for You to comply with any of the terms of this License with respect to \nsome or all of the Covered Code due to statute, judicial order, or regulation then You must: \n(a) comply with the terms of this License to the maximum extent possible; and (b) describe the \nlimitations and the code they affect. Such description must be included in the LEGAL file \ndescribed in Section 3.4 and must be included with all distributions of the Source Code. \nExcept to the extent prohibited by statute or regulation, such description must be \nsufficiently detailed for a recipient of ordinary skill to be able to understand it.\n\n5. Application of this License.\n\nThis License applies to code to which the Initial Developer has attached the notice in Exhibit \nA and to related Covered Code.\n\n6. Versions of the License.\n\n6.1 New Versions.\n\nSocialtext, Inc. (\"Socialtext\") may publish revised and/or new versions of the License from \ntime to time. Each version will be given a distinguishing version number.\n\n6.2 Effect of New Versions.\n\nOnce Covered Code has been published under a particular version of the License, You may always \ncontinue to use it under the terms of that version. You may also choose to use such Covered \nCode under the terms of any subsequent version of the License published by Socialtext. No one \nother than Socialtext has the right to modify the terms applicable to Covered Code created \nunder this License.\n\n6.3 Derivative Works.\n\nIf You create or use a modified version of this License (which you may only do in order to \napply it to code which is not already Covered Code governed by this License), You must (a) \nrename Your license so that the phrases \"Socialtext\", \"CPAL\" or any confusingly similar phrase \ndo not appear in your license (except to note that your license differs from this License) and \n(b) otherwise make it clear that Your version of the license contains terms which differ from \nthe CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or \nContributor in the notice described in Exhibit A shall not of themselves be deemed to be \nmodifications of this License.)\n\n7. DISCLAIMER OF WARRANTY.\n\nCOVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN \"AS IS\" BASIS, WITHOUT WARRANTY OF ANY KIND, \nEITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS \nFREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK \nAS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE \nDEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER \nCONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER \nOF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS \nAUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.\n\n8. TERMINATION.\n\n8.1 This License and the rights granted hereunder will terminate automatically if You fail to \ncomply with terms herein and fail to cure such breach within 30 days of becoming aware of the \nbreach. All sublicenses to the Covered Code which are properly granted shall survive any \ntermination of this License. Provisions which, by their nature, must remain in effect beyond \nthe termination of this License shall survive.\n\n8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory \njudgment actions) against Initial Developer, Original Developer or a Contributor (the Initial \nDeveloper, Original Developer or Contributor against whom You file such action is referred to \nas \"Participant\") alleging that:\n\n(a) such Participant�s Contributor Version directly or indirectly infringes any patent, then \nany and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this \nLicense shall, upon 60 days notice from Participant terminate prospectively, unless if within \n60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually \nagreeable reasonable royalty for Your past and future use of Modifications made by such \nParticipant, or (ii) withdraw Your litigation claim with respect to the Contributor Version \nagainst such Participant. If within 60 days of notice, a reasonable royalty and payment \narrangement are not mutually agreed upon in writing by the parties or the litigation claim is \nnot withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 \nautomatically terminate at the expiration of the 60 day notice period specified above.\n\n(b) any software, hardware, or device, other than such Participant�s Contributor Version, \ndirectly or indirectly infringes any patent, then any rights granted to You by such Participant \nunder Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, \nsold, distributed, or had made, Modifications made by that Participant.\n\n8.3 If You assert a patent infringement claim against Participant alleging that such \nParticipant�s Contributor Version directly or indirectly infringes any patent where such claim \nis resolved (such as by license or settlement) prior to the initiation of patent infringement \nlitigation, then the reasonable value of the licenses granted by such Participant under Sections \n2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or \nlicense.\n\n8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements \n(excluding distributors and resellers) which have been validly granted by You or any distributor \nhereunder prior to termination shall survive termination.\n\n9. LIMITATION OF LIABILITY.\n\nUNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, \nOR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR \nANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON \nFOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, \nWITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, \nOR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF \nTHE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR \nDEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY�S NEGLIGENCE TO THE EXTENT APPLICABLE LAW \nPROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF \nINCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.\n\n10. U.S. GOVERNMENT END USERS.\n\nThe Covered Code is a \"commercial item,\" as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), \nconsisting of \"commercial computer software\" and \"commercial computer software documentation,\" as \nsuch terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 \nC.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered \nCode with only those rights set forth herein.\n\n11. MISCELLANEOUS.\n\nThis License represents the complete agreement concerning subject matter hereof. If any provision \nof this License is held to be unenforceable, such provision shall be reformed only to the extent \nnecessary to make it enforceable. This License shall be governed by California law provisions \n(except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law \nprovisions. With respect to disputes in which at least one party is a citizen of, or an entity \nchartered or registered to do business in the United States of America, any litigation relating to \nthis License shall be subject to the jurisdiction of the Federal Courts of the Northern District \nof California, with venue lying in Santa Clara County, California, with the losing party \nresponsible for costs, including without limitation, court costs and reasonable attorneys� fees \nand expenses. The application of the United Nations Convention on Contracts for the International \nSale of Goods is expressly excluded. Any law or regulation which provides that the language of a \ncontract shall be construed against the drafter shall not apply to this License.\n\n12. RESPONSIBILITY FOR CLAIMS.\n\nAs between Initial Developer, Original Developer and the Contributors, each party is responsible \nfor claims and damages arising, directly or indirectly, out of its utilization of rights under \nthis License and You agree to work with Initial Developer, Original Developer and Contributors to \ndistribute such responsibility on an equitable basis. Nothing herein is intended or shall be \ndeemed to constitute any admission of liability.\n\n13. MULTIPLE-LICENSED CODE.\n\nInitial Developer may designate portions of the Covered Code as Multiple-Licensed. \nMultiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered \nCode under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial \nDeveloper in the file described in Exhibit A.\n\n14. ADDITIONAL TERM: ATTRIBUTION\n\n(a) As a modest attribution to the organizer of the development of the Original Code (\"Original \nDeveloper\"), in the hope that its promotional value may help justify the time, money and effort \ninvested in writing the Original Code, the Original Developer may include in Exhibit B \n(\"Attribution Information\") a requirement that each time an Executable and Source Code or a Larger \nWork is launched or initially run (which includes initiating a session), a prominent display of \nthe Original Developer�s Attribution Information (as defined below) must occur on the graphic user \ninterface employed by the end user to access such Covered Code (which may include display on a \nsplash screen), if any. The size of the graphic image should be consistent with the size of the \nother elements of the Attribution Information. If the access by the end user to the Executable and \nSource Code does not create a graphic user interface for access to the Covered Code, this \nobligation shall not apply. If the Original Code displays such Attribution Information in a \nparticular form (such as in the form of a splash screen, notice at login, an \"about\" display, or \ndedicated attribution area on user interface screens), continued use of such form for that \nAttribution Information is one way of meeting this requirement for notice.\n\n(b) Attribution information may only include a copyright notice, a brief phrase, graphic image and \na URL (\"Attribution Information\") and is subject to the Attribution Limits as defined below. For \nthese purposes, prominent shall mean display for sufficient duration to give reasonable notice to \nthe user of the identity of the Original Developer and that if You include Attribution Information \nor similar information for other parties, You must ensure that the Attribution Information for the \nOriginal Developer shall be no less prominent than such Attribution Information or similar \ninformation for the other party. For greater certainty, the Original Developer may choose to \nspecify in Exhibit B below that the above attribution requirement only applies to an Executable \nand Source Code resulting from the Original Code or any Modification, but not a Larger Work. The \nintent is to provide for reasonably modest attribution, therefore the Original Developer cannot \nrequire that You display, at any time, more than the following information as Attribution \nInformation: (a) a copyright notice including the name of the Original Developer; (b) a word or \none phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and \n(d) a URL (collectively, the \"Attribution Limits\").\n\n(c) If Exhibit B does not include any Attribution Information, then there are no requirements for \nYou to display any Attribution Information of the Original Developer.\n\n(d) You acknowledge that all trademarks, service marks and/or trade names contained within the \nAttribution Information distributed with the Covered Code are the exclusive property of their \nowners and may only be used with the permission of their owners, or under circumstances otherwise \npermitted by law or as expressly set out in this License.\n\n15. ADDITIONAL TERM: NETWORK USE.\nThe term \"External Deployment\" means the use, distribution, or communication of the Original Code \nor Modifications in any way such that the Original Code or Modifications may be used by anyone \nother than You, whether those works are distributed or communicated to those persons or made \navailable as an application intended for use over a network. As an express condition for the grants \nof license hereunder, You must treat any External Deployment by You of the Original Code or \nModifications as a distribution under section 3.1 and make Source Code available under Section 3.2.\n\nEXHIBIT A. Common Public Attribution License Version 1.0.\n\n\"The contents of this file are subject to the Common Public Attribution License Version 1.0 (the \n\"License\"); you may not use this file except in compliance with the License. You may obtain a copy \nof the License at _____________. The License is based on the Mozilla Public License Version 1.1 but \nSections 14 and 15 have been added to cover use of software over a computer network and provide for \nlimited attribution for the Original Developer. In addition, Exhibit A has been modified to be \nconsistent with Exhibit B.\n\nSoftware distributed under the License is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY \nKIND, either express or implied. See the License for the specific language governing rights and \nlimitations under the License.\n\nThe Original Code is______________________.\n\nThe Original Developer is not the Initial Developer and is __________. If left blank, the Original \nDeveloper is the Initial Developer.\n\nThe Initial Developer of the Original Code is ____________. All portions of the code written by \n___________ are Copyright (c) _____. All Rights Reserved.\n\nContributor ______________________.\n\nAlternatively, the contents of this file may be used under the terms of the _____ license (the \n[___] License), in which case the provisions of [______] License are applicable instead of those \nabove.\n\nIf you wish to allow use of your version of this file only under the terms of the [____] License \nand not to allow others to use your version of this file under the CPAL, indicate your decision by \ndeleting the provisions above and replace them with the notice and other provisions required by \nthe [___] License. If you do not delete the provisions above, a recipient may use your version of \nthis file under either the CPAL or the [___] License.\"\n\n[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source \nCode files of the Original Code. You should use the text of this Exhibit A rather than the text \nfound in the Original Code Source Code for Your Modifications.]\n\nEXHIBIT B. Attribution Information\n\nWhen the TableEditor is producing and/or controlling the display the Graphic Image must be\ndisplayed on the screen visible to the user in a manner comparable to that in the \nOriginal Code. The Attribution Phrase must be displayed as a \"tooltip\" or \"hover-text\" for\nthat image. The image must be linked to the Attribution URL so as to access that page\nwhen clicked. If the user interface includes a prominent \"about\" display which includes\nfactual prominent attribution in a form similar to that in the \"about\" display included\nwith the Original Code, including Socialtext copyright notices and URLs, then the image\nneed not be linked to the Attribution URL but the \"tool-tip\" is still required.\n\nAttribution Copyright Notice:\n\n Copyright (C) 2009 Socialtext, Inc.\n All Rights Reserved.\n\nAttribution Phrase (not exceeding 10 words): SocialCalc\n\nAttribution URL: http://www.socialcalc.org\n\nGraphic Image: The contents of the sc-logo.gif file in the Original Code or\na suitable replacement from http://www.socialcalc.org/licenses specified as\nbeing for SocialCalc.\n\nDisplay of Attribution Information is required in Larger Works which are defined \nin the CPAL as a work which combines Covered Code or portions thereof with code \nnot governed by the terms of the CPAL.\n\n\n=========================================\n THE ARTISTIC LICENSE 2.0\n=========================================\n\n\t\t The Artistic License 2.0\n\n\t Copyright (c) 2000-2006, The Perl Foundation.\n\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\nPreamble\n\nThis license establishes the terms under which a given free software\nPackage may be copied, modified, distributed, and/or redistributed.\nThe intent is that the Copyright Holder maintains some artistic\ncontrol over the development of that Package while still keeping the\nPackage available as open source and free software.\n\nYou are always permitted to make arrangements wholly outside of this\nlicense directly with the Copyright Holder of a given Package. If the\nterms of this license do not permit the full use that you propose to\nmake of the Package, you should contact the Copyright Holder and seek\na different licensing arrangement. \n\nDefinitions\n\n \"Copyright Holder\" means the individual(s) or organization(s)\n named in the copyright notice for the entire Package.\n\n \"Contributor\" means any party that has contributed code or other\n material to the Package, in accordance with the Copyright Holder's\n procedures.\n\n \"You\" and \"your\" means any person who would like to copy,\n distribute, or modify the Package.\n\n \"Package\" means the collection of files distributed by the\n Copyright Holder, and derivatives of that collection and/or of\n those files. A given Package may consist of either the Standard\n Version, or a Modified Version.\n\n \"Distribute\" means providing a copy of the Package or making it\n accessible to anyone else, or in the case of a company or\n organization, to others outside of your company or organization.\n\n \"Distributor Fee\" means any fee that you charge for Distributing\n this Package or providing support for this Package to another\n party. It does not mean licensing fees.\n\n \"Standard Version\" refers to the Package if it has not been\n modified, or has been modified only in ways explicitly requested\n by the Copyright Holder.\n\n \"Modified Version\" means the Package, if it has been changed, and\n such changes were not explicitly requested by the Copyright\n Holder. \n\n \"Original License\" means this Artistic License as Distributed with\n the Standard Version of the Package, in its current version or as\n it may be modified by The Perl Foundation in the future.\n\n \"Source\" form means the source code, documentation source, and\n configuration files for the Package.\n\n \"Compiled\" form means the compiled bytecode, object code, binary,\n or any other form resulting from mechanical transformation or\n translation of the Source form.\n\n\nPermission for Use and Modification Without Distribution\n\n(1) You are permitted to use the Standard Version and create and use\nModified Versions for any purpose without restriction, provided that\nyou do not Distribute the Modified Version.\n\n\nPermissions for Redistribution of the Standard Version\n\n(2) You may Distribute verbatim copies of the Source form of the\nStandard Version of this Package in any medium without restriction,\neither gratis or for a Distributor Fee, provided that you duplicate\nall of the original copyright notices and associated disclaimers. At\nyour discretion, such verbatim copies may or may not include a\nCompiled form of the Package.\n\n(3) You may apply any bug fixes, portability changes, and other\nmodifications made available from the Copyright Holder. The resulting\nPackage will still be considered the Standard Version, and as such\nwill be subject to the Original License.\n\n\nDistribution of Modified Versions of the Package as Source \n\n(4) You may Distribute your Modified Version as Source (either gratis\nor for a Distributor Fee, and with or without a Compiled form of the\nModified Version) provided that you clearly document how it differs\nfrom the Standard Version, including, but not limited to, documenting\nany non-standard features, executables, or modules, and provided that\nyou do at least ONE of the following:\n\n (a) make the Modified Version available to the Copyright Holder\n of the Standard Version, under the Original License, so that the\n Copyright Holder may include your modifications in the Standard\n Version.\n\n (b) ensure that installation of your Modified Version does not\n prevent the user installing or running the Standard Version. In\n addition, the Modified Version must bear a name that is different\n from the name of the Standard Version.\n\n (c) allow anyone who receives a copy of the Modified Version to\n make the Source form of the Modified Version available to others\n under\n\t\n (i) the Original License or\n\n (ii) a license that permits the licensee to freely copy,\n modify and redistribute the Modified Version using the same\n licensing terms that apply to the copy that the licensee\n received, and requires that the Source form of the Modified\n Version, and of any works derived from it, be made freely\n available in that license fees are prohibited but Distributor\n Fees are allowed.\n\n\nDistribution of Compiled Forms of the Standard Version \nor Modified Versions without the Source\n\n(5) You may Distribute Compiled forms of the Standard Version without\nthe Source, provided that you include complete instructions on how to\nget the Source of the Standard Version. Such instructions must be\nvalid at the time of your distribution. If these instructions, at any\ntime while you are carrying out such distribution, become invalid, you\nmust provide new instructions on demand or cease further distribution.\nIf you provide valid instructions or cease distribution within thirty\ndays after you become aware that the instructions are invalid, then\nyou do not forfeit any of your rights under this license.\n\n(6) You may Distribute a Modified Version in Compiled form without\nthe Source, provided that you comply with Section 4 with respect to\nthe Source of the Modified Version.\n\n\nAggregating or Linking the Package \n\n(7) You may aggregate the Package (either the Standard Version or\nModified Version) with other packages and Distribute the resulting\naggregation provided that you do not charge a licensing fee for the\nPackage. Distributor Fees are permitted, and licensing fees for other\ncomponents in the aggregation are permitted. The terms of this license\napply to the use and Distribution of the Standard or Modified Versions\nas included in the aggregation.\n\n(8) You are permitted to link Modified and Standard Versions with\nother works, to embed the Package in a larger work of your own, or to\nbuild stand-alone binary or bytecode versions of applications that\ninclude the Package, and Distribute the result without restriction,\nprovided the result does not expose a direct interface to the Package.\n\n\nItems That are Not Considered Part of a Modified Version \n\n(9) Works (including, but not limited to, modules and scripts) that\nmerely extend or make use of the Package, do not, by themselves, cause\nthe Package to be a Modified Version. In addition, such works are not\nconsidered parts of the Package itself, and are not subject to the\nterms of this license.\n\n\nGeneral Provisions\n\n(10) Any use, modification, and distribution of the Standard or\nModified Versions is governed by this Artistic License. By using,\nmodifying or distributing the Package, you accept this license. Do not\nuse, modify, or distribute the Package, if you do not accept this\nlicense.\n\n(11) If your Modified Version has been derived from a Modified\nVersion made by someone other than you, you are nevertheless required\nto ensure that your Modified Version complies with the requirements of\nthis license.\n\n(12) This license does not grant you the right to use any trademark,\nservice mark, tradename, or logo of the Copyright Holder.\n\n(13) This license includes the non-exclusive, worldwide,\nfree-of-charge patent license to make, have made, use, offer to sell,\nsell, import and otherwise transfer the Package with respect to any\npatent claims licensable by the Copyright Holder that are necessarily\ninfringed by the Package. If you institute patent litigation\n(including a cross-claim or counterclaim) against any party alleging\nthat the Package constitutes direct or contributory patent\ninfringement, then this Artistic License to you shall terminate on the\ndate that such litigation is filed.\n\n(14) Disclaimer of Warranty:\nTHE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS \"AS\nIS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED\nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR\nNON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL\nLAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL\nDAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n[End of LICENSE.txt]\n\n\n"
},
"$:/plugins/rboue/SocialCalc/CHANGES.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/SocialCalc/CHANGES.txt",
"text": "SocialCalc sources modification\n-------------------------------\n\nAll modifications are under if(TiddlyWiki) test or identified with comments (\"*tiddlywiki*\" string).\n\nVersion 1.0.0 : 2015-02-01\n formula1.js :\n Modify Sheet Cache to handle sheet data in tiddlers.\n socialcalc-3.js :\n Add a callback to monitor commands.\n Replace images or icon's url by tiddler images.\n Modify link behaviour to handle specific TiddlyWiki URL's like <tw:a-tiddler-to-get>.\n socialcalcpopup.js :\n Replace images or icon's url by tiddler images.\n socialcalcspreadsheetcontrol.js and socialcalcviewer.js :\n Add a TiddlyWiki interface object.\n Adapt visual interface to tiddler's smallness.\n Replace images or icon's url by tiddler images.\n Add class attribute to essential DOM elements.\n Enhance events and keyboard management : switch between widget's sheet pages.\n socialcalctableeditor.js :\n Implement a copy functionnality (Ctrl-s).\n Enhance events and keyboard management : grid navigation without browser's interception and\n focus management.\n Replace images or icon's url by tiddler images.\n Other :\n Enhance graph visual and behaviour.\n Add an export to tiddler functionality.\n"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/export.png": {
"type": "image/png",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/export.png",
"text": "iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADeUExURf///ygoKHx8fDExMTAwMDQ0NCkpKTMzMy0tLSYmJnl5eTIyMv7+/vn5+eTk5Dg4ODs7O+zs7CwsLEZGRsrKyioqKkJCQvv7+/T09P39/XZ2dn5+fnp6evz8/ODg4BsbG2ZmZra2tjU1NcbGxsjIyCIiIsDAwF5eXsPDwzc3NzY2NmJiYmxsbHh4eObm5m9vby8vL+Xl5UFBQaamplBQUG1tbbCwsFtbW7m5ubKyspeXl9/f34uLi5WVlYmJiYiIiJ2dncHBwfb29vHx8Z6eniAgIJGRkVpaWiEhIa6urtMWpG0AAACnSURBVBjThY/lDsJAEISvdnvXQr3F3d3dHd7/hagAIW0C82ey32Y3Mwj9VDSMxHQkiPK5VOLrRuvKcsuibMaftdFkbKuKIgBQMeaS6ZBi0uc5TgKQaDKO0AIT+EggkEUnQwfgdcwwDC8AKVYROljAYXXW67CswZNm3fl0dpbLgReoXWmUXL9S8nglqZGy5/vL7R2uYPpu3nfBFkd7Eyq7XYfQao7+6gkNmwxuhUmepgAAAABJRU5ErkJggg=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-1x1.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-1x1.gif",
"text": "R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-aligncenter.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-aligncenter.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIdjI+py+0PD5i02hnh3bkb62XbGD4jUJonlbbu+xYAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-alignleft.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-alignleft.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIdjI+py+0PowO02ktlw1jH7oXcCITLaEpklrbumxQAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-alignright.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-alignright.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIejI+py+0PEZi02hlzuFf7030KRwJiRp5OianuC2cFADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-bordersoff.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-bordersoff.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIdjI+pywr4TjSz2YuzxrXDDYai6EnfiKZqUFLnGhYAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-borderson.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-borderson.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIwjI+pywoPowSIHmtw0Lz6+2XhNnbXhD7lCraiS8LmS8d1mrK3bvezz/vhUI2i8VgAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-chooserarrow.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-chooserarrow.gif",
"text": "R0lGODlhBQAKAMQCAAAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAIALAAAAAAFAAoAAAUTYCCMwieOn4mmYsq6rVqeAk2SIQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-commentbg.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-commentbg.gif",
"text": "R0lGODlhBAAEAJECAP////8CAv///wAAACH5BAEAAAIALAAAAAAEAAQAAAIHRC4WkstQAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-copy.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-copy.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI4jI+pEOytopzwgIvzlWx26HyRiITaY4hksqbNiYIv1YIYa5U092quG9qNhIuer1b7LWAZivM5KQAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-cursorinsertleft.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-cursorinsertleft.gif",
"text": "R0lGODlhBAAEAIAAAP///////yH5BAEAAAEALAAAAAAEAAQAAAIFRB6GelAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-cursorinsertup.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-cursorinsertup.gif",
"text": "R0lGODlhBAAEAIAAAP///////yH5BAEAAAEALAAAAAAEAAQAAAIFRB6GelAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-cut.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-cut.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIujI+pCNvL0oNnGkvDxHln1XBf+DmleUZip6VX5XolQFc15cloq4NwD7pphC5IAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-defaultcolor.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-defaultcolor.gif",
"text": "R0lGODlhBAAEAIAAAKampv///yH5BAEAAAEALAAAAAAEAAQAAAIFRB6GelAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-deletecol.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-deletecol.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI2jI+pwHzwGjQzVFTz25Rbj3laR37lJabaaJrQxMbp2cHzt94ozbdyGer9fCCdRHRUKJfMZqAAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-delete.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-delete.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIrjI+pywrxIpyy2fTuXBmz3hmgNTYh5V0n550rUn6HO8uOrWq6xKOvDgwCCwA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-deleterow.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-deleterow.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIvjI+pwO3PDlDUTFvpDTtLCYWNR1ZbV05oonIf1mZxidX0LeYvfd6unQLlIL4iqQAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-divider1.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-divider1.gif",
"text": "R0lGODlhAQAUAIAAAJmZmQAAACH5BAAAAAAALAAAAAABABQAAAIEhI+ZBQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-drag-handles.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-drag-handles.gif",
"text": "R0lGODlhWgBaAOZ/AKjZiGt7raO2t1x1tVeY25nLkb6+vreolra2to7m88Wbe5CImPWuYXWnpj9vz6qqqu3t7UJ701OFuaSwsMyqhF+k377rfUqG1rHIkoLV7rbVi5j0993d3Z7T1czMzMXFxfuvXd/f37Ljg7Ozs8OpjZ3Z2rvlgqu1nUl1zZzd3uKtcqLAwdureN6lbmibrp/Ky5Oq2HK+596sd4q7mpjv8jVozHvM60Z4wmSr4eHh4evw+r/we9Ld9HGU28bU8d/n91iC1f///0x50q3C65Ww5WSL2LrL7n2d3vv7+8HBwa+vr6G56Imm4dvb27vG3djb4Ojo6MfHx9fX1/z8/NLS0vLy8uDg4GOI0uvr69TU1LjbiKK12uetb5zh5Jrp60BrxbGnnYnf8bTPjn+xoF6QszVny32Bozxvx2qz40p9v6/Al6aopk9wvdOgc9arfe6uaKimpLfZiLnehq6/l66+mYGCoaCOj62TiLCUh+WnaamwoKiuoeqpZzNmzKampv///yH5BAEAAH8ALAAAAABaAFoAAAf/gH+Cg4SFhoeIiYqLjI2Oj5CRkpOUkA9KCAZRVCEQSJWgoY9+pKWkIx9SWKKsrYOmsKRrBlkQrreUsbp+Dx9WU7jBjbvEBhyfwsmGxMxJOcrQgszMDx620cLT0whN2MHa02seVd6u4NpJUOWs59oIz+ug7dojHPGV89pK3feSNF5dSrxYMSEfLCX2+kHawLAhjRQvBBg8BU9hIwcRLhBAYyMBQxolVqwxiECdRUZ9UqqMQCCGxw0pVhhMQu6kIpU4U0bAkYFhB4nzPNi8mTPnzjAbvLyYt4bfUENFo16I4bPgOQTXnhKKGrVGBaQlgIITqnUrTgdcUxLomULstAcV/8viBKJjSdo+F2zAdNsMmdyUdH3UvZt3Qwmr2hL+pTtkiA4dQwj37HDOALC/PhrrYPLDyN0+BJAuBWel7B+VRDb/4OGgB5C7FZLy3fXBNM4eq+k+jsy1BlXK2h5kHXp2iIPVQnroQMv1AlKZ2rL8zamDSB8my5lHxQFz5DQD03Hy+LFEh+cf1qNG6Amd2ZpVT6MKMcLDuvIiabmXACdF6+c+PvDQxxHpGZUADbPFUlt8d9E1XnVcUTUaMyP4ddJn5W3WRw/4FUUATOAMZ5ETMFzBlQP4CfHDbkVFcCBixITwVA45PAEDCmnxoAMPR+ggRFF6tUcMFTPSmMMWOEZVnf9gyxWFxgYTEhNFkUbCwJUPPgBhRIE4fbjfd1TS+ISJRQkhWFoXbNCFO2HSaOV/LSalT5s5OAFnUQ5sQENwNgXh559GGsnBROH0iVMQgdI4KKHErEHIA9owAMIXd+bkRKI5BHEojXZWqtIZO1jA5yBKaPMGCGx4qhIMmGqqEqI5vKlqGjuYMOcgCGjDBQgB5FREh3dd8USirqaE6JiqpiTBDnKwOYgB2sgAQh049QjZf6wG+iegshYFhA/a5eTCDhpoA94gUWhDAQh2qMQEdj32kBKwOaGwBaaBIsmVbqxFNcYOGGgz5SBUaEMCCAqkdJ95RqQIYVQowDBsojYmGZX/A0So2G9OBexAhzZEDhKCNmAwwEeqffAQoA44CfYjV1fAcGmdJe4LrkoaO3CESjeIYIEe2sg4CATgqACCGSnNp8POKTkm7380NvjYxn2ouOJrfYyrRYiEIDGCuiDgwZXTd0adFsY5q1Te033MADA9Fv7xgTYHMJDHADgRwYMROrCdUrg5mf1Zzjv3rVIaPp+gzYKESAEOCyAskJNgTPdRBBPlAa4SBxxciXXSP1ydUwPk8mcIFt4xc3AbKKuEpUqM+Z0TKRdvFu7aOd0AwA5zaPPeIdBOA4fRkp/1Odlp0R6Vg9oZPvoOcaReDCJZgHNwC3j7urfzPTxNr/KA1dcH/xFLrIYiVxLsrgY40h0CAaTaQH5HGUVRXvWKkKUGLPh9mFe51SwrSg3cVq7giIgQc6PbqYo3ucjwgDXKWRpO+KeDIhjhc7grCulMoLjFKcIK51hXC3pVOyb0wTGVSwn/+Ea1IcguJWTYXcBIo4gpBE8bbkBY9oqyGr7tjEMqWeFjPoe+jomhMpdJxKJIJi0F7PAslFMRi/rAvyKYSQdEzIkEOqaBPZxDMYlAQhLOcQCjOZEr8tIRj3xERT9ExQc/KOIOtNBBdMQNETmAH93MSEIlEYFJaOEfTuilEjJ0jI7ngMsjPNCOA0irBQugX/2ytCUVuhFONWjA7jRQR22Qxf8REMjVOcCQQxDc4YlJO1MQL/kZCbhtB2Lw4lUOuIgmSE9dp4Jk67giyKLcQJO1muE5mjIJRs7jAJADQRsWgMoJsrIoaQAmuTo5FkpUYYz5IIHRQJAHPJhhl5b0pQtmIIIdQG99+aBJJaAgynnAgQQskBQI+KAAO9QhAGz4AinOkAYJuGAMBShnqDQwh1uCoyShyMHXJnIACqhAniCIKAhIYc6KhkoLGKBmO0YQl0pwoFSMAgMJKCADLryBAaSwgAnkoAEM0AFojEKIK5oAUkbZFBz7wAUHFnrTnuqiHsLIQTt9StR3KAMK2CRqT9MRjSp4wKBKbYc4aoKNJgw1qldicUo5IOABPWKVGtawSA6S+lVdOGMoSODADctKCmPc0SJTsMIHvErUXvzCNISAQBYMANV8zKIWeE0EFqTwAZ5uNBXwCSwjkACBEFAhCgZAgBIesIY1XCITm+jEWxXL2c4qJBAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-drag-handles.png": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-drag-handles.png",
"text": "iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEERJREFUeNrsXQl0FPUZ/3KwySYbls19kUBCQkgACSDIHSqxog+qVvQpvr5qQX1ate3rq0dtLdWi9vVS1KdCra9VVLTUgoo1KDGiHObAADEkJCQhm829SfZI2Fyd32QmnSyz1z+zm6P53vveJrMzs//9zTe//3ftf/wGBwdpSrwv/lMQ+EYCxT/8/Pwm2ti3cNrLqY3THk6tnFo4NXHaJWjfWA9SZIzACW4kUDWnWpn3AbiR0zZOWwUde4uehBImaBIMi9NmTps4bRTAnwLaCwJejBF0HqcNnOo5ree0fwpo78g0TpMFNXBaJ2jfFNDekzhBEzmtEQCfAtqLksBpLKfRnFZz2j7lR3tPAjhN43QZp3OmgPa+6DhdyukSwWuZAtrLXko6p9mCpzIFtA+4O1vwxaeA9gGVXMFp6hTQ3hcNpwtGM0n6iUmPiZZUeqG909Jnu2S6ZLYYrR3Glo6Ghsamyor68vwjdacOHmzy0sd2c3qa0yp3DxjGd6IC/bK5WzaR3mezWToNhgpD+bflZ/Pyyo68/FKVwh9t5vQbd4MbRYFWuniw9J4il/sEqQMGgzUBFKqdRmERKpoRrSJdXDBFJgaTWhMogm5tqa4qOf/ll8Xv73ii0NLe3qvQEJEVLKGhJNXEAtodcO0/Vm5jWLiKYlNCKD4tlBI4DZ0xjd/ecqG66Fx+/ldvPHD/MYXA1gtgmyYE0AwAOwVaKuGchSdnhdGshWGcpasxzgH9mdMFJ95+Kz/vub9UKAA2zlE0roEeBcBuAz1s5Ry1zFmspTlLtBzFBJG1o6P+3Of5h3f/4I68gf7+wVGOoZDT8+MSaAVA9ghoUaKT1ZRxlY7mLtfx/1/4+utDB5/67aGyTw+PpvoCvj5JDhJRYwK0QgAzA81/T38/ylodzuv0SBVxLuGxw7ueP/DFa3+tHcVYKgXLHnugFQZZFmiNOoDM3e4VTMDdC9dH8hNnW21tyacvvrD/s5deYHUF8aHH5Vw+ERufRIZeAPkySeMmu/d2ZNGD3090a//asyY6+UETXfzWTBHJydlX3//jm9bc9aNkxo9HinUWOcnv+08WkHc9mEaV9d103fJwt8FuqrFS0cfNw2BveODBzZlXb4gcRQIqaUyA9iXIBaWdZGi38dsA9mN3uGecLRe7qSSvhRqrrRSTlr5i0+O/3ugfEMDKo0mCdfsOaF+ADHnwpkQeZMjahVp67SMDz9Nh6gC3zwHLLj3SSl2tNpp95ZUbt//9jVzG4Yj1R99Th7flgecrqZGzZBHkW9ZHk8naT797o5bfBot3l7PPHh3y0Oauy9mQ+9BP0kdBIZd7O97wOnxkzSM+FKCCmwHyzjdreToRBRa/8w3X3htcvzVb4ng/u/50af5TK5a/yjAu5FOOkNCk4zWvw1eUYS/FlWZeYeFPb08hQ5uN7ny2nAcYF0HjBpUMDgxS+XEjdTRfooT5C9besevFFQxDQXIldtJRhyjgZYCKV4D6xelOHuzYcNUIP9uVNNd20/miTtzh/nNzclaGhodPYxhOjFeBHitrthcALLp5d10XRyWcpeMCvP5IBv+/Kzlf3EmtnKsYNTtlyQ1P7FjKMAT0h0ROSouWymN7qnmfOnuOhvblt9Cju6uH6aOk0uTyeBN3oWpKh/abs2rVYpZI3x7owMlmzaJFA1ypbMmJ5rfDumHtsRFBvJfizAuZt1JHUSmp2evvvS+VoVITMektWi6oEd08d8P0dkMP6SstFKhShWTl5mYyfKxOasj/F0BvXD5kXHERKtp3pJmu/UUpna+3UnaaxulxDZWWoeMy5mUwfCy6nKYrSh1jQRuddV/eEKybvXSaWrfWP1C91tm+oIgvSjt42gDYsGrRA3HmYyMs7zb3kTYuLn3Rpk0xDNV1AN0+oS36/McPlZx5a/Pu6sOP3mszG57y9x9odOb6AWTIzm0pPMjg6+f/Wc9PkgBfdlLkIs7W+h7QR2hGzvokRqueHNTRWXfUcnrvpt2W1gvPOAN7OBkB+uA8EYAvcjWiSUdiNPQMOcZp6YkMwwuddBxd9t6t/+rpatrjaj/R7Xt+fz1v5SLojqSjeSgjOCM+PpZhWCGTcjKsO/rs3oG+7gJn+yAPAkEuBC6gMxdP9Kl5xGboohiGFKy4Hz1eaKS321gQFOZ4cgQ3Ix/irlg6h3pugjShOoYhqSate9djvFCo6PnMQ7QSqApiaUofzpMokiZdcnehz4AsfGWJbCWYG7+jkgr8uKvG6Lpz8A6+PWGpw95v58Af92OWAr3FU+At727dowr0D8k9fIlMvUGKBiPwk2XffMV5a8Oca5/L1iatel+psajVvfTkjg+oz9ZvzY1+ZpuHh/fLcbTHnZaXevv5FJdOZVX06iPiG4tj5USjucS/2mz9JobDe+WAtnl6FnNPH9qhKCrYIvs+cgmu8gmyMwgXVmuTVod6ehyOwbFKAq2d3s2/dpttRobDbXLUgRBI68lZOsy2ljidOiNB3UlFdsVfaX+FuzW74asfqF6btPrh20/vPbrbwYQoexyOcZX3gCCTh+o5/GhXnU3hEUN3q7mjp4XFaZGzaI/vf327lQ95kzUj+/tuyYkaTtqI+QSo1NJdhlSayG2ZN79zo5x3IafYN3h61DZ3QEawIr66Km9FRw0xRovB1MgAtFUOaIunZ6nQd2F1AErV/G9VBgCKclGlfuiWW7NwBh/qmgTLQa4BxVNXJaU+mhYbFp70yILbD253RiN4D/uERiY/MjAQ6DJMRsCCsBuF27CQAJdgx8Z28a8XK9vqGYC2yAHtMdl/Vmqos/UNWOZqWyhe3TVME/gyd22M419hvbhFxewZtiHfAKt3lDWTgq3SxD2esuHpl+ffdmA7PAqpd4FteA/7OANZar2gCoTdYoQoBRt0N4I2wq2UmNABj8NS/HkNyw/yTXJAd3l6ln+fuNhkaLdWwOtYFK4f3o6aHb4QgAR1SAWtWvji4GxDm81tzg4Ki39c6rbhb2xzxcnOqEIKNgq3mFOkDTcps1t5r6O10Vxx9MNzLL/06nIEtMdWXXaxs5yPDiPqR3wBWDEqGR+daB8BMqgFIIttXN4WV1SB9zEWbMO4cLeJkpo6NP/VlreUM1qzLNBYGMRjF+Y/JQ1lHH1Yr4yoo9SwyxvnwcV/eziD52VnIGs86JXzyAV1gyrwaj+uOI6b09Na+EDl5KfVZQwfbSTJYiv2SSWP1xp68cPyqiqDqSQ62Exroqsve19sOgRXg0akXwbbwNW4ZaXlJRcSQA46NqUi0oVc5s6eKnDn2V/8rCwDabXdpK82lux/5WuWBvURWNoDDZP0+CcLR8uaivGaE1NFCSGXWyu+HG5JsUgqtTZYvHjbutmtf5WrJBHOBwCR4Le/eM6oQpSIcAvNz2rg/y49VlfMkkwiu1XJ5IBu9vSsv3rzVGF1o6koQ9tM18Sdk90HnI2qhlTQa8FfqNIORTkbFwwXFxdRzn2To4oREW12PSUmdlDDBWPRnifzWVKTza6Ahng8u7aZLvUeOd341eAgDVybUE7zZzTKfnm+jMTRhSPOZglspN4Fziv65/DfMRFLOVk8nxxViJKc1E6Lsy8SvktxQc1XXe3dLL+2bXKWvRMFKGHJMo+a++596fixK9MiFyycRTmbZ56hss4YGhi8PMct9sFJORtuoNTyVnPb0PMM/pb64K44Gfs1tl0anhsg7+Y38++Bk3F+gOzQjfQfpOXLaig62kRVZ5oK/vjQRyy/su0VMCRXFg0Sb2C5Zd/8vDrfaLbVb048S1uSv3G4n8jZi9KGihZoAUAl+uYnzg632QJkXAh3QBZlHwcqLFk6CdpzsjNZtbKali2rJVNHT33eO2fyGZmrQc6pcFTK0rN8wp/eL6vgKOQwz78c0HJeiBRsfHEAAIs+dKKNt/TVHFBijkTqg7sSXBDQEdp07QMhEWRn80BWpoFWrRpyLkoKag6/s+s460+YZbFzBDRmLQPLp9z+h4K8kxWthxJDOmhrSjEt0BlcTlxQeCQib4sg429P06y4aPahvSuQZyW3U866SoqMsNC3hfpDO+7cn8caHwnYuQ00/Cymxfb6BwYHf/PWN4cq9F3HFun0dGfqSZqndT6//vCZ8hG8XXLezPvViCQBvju/sAJtIPoDJcn50I5kZqKRrr76HM2e3YbE0bHXdhYcGuhnXkWgjhwswenv4iAmCsk71dD65wNlB2qbzSUro2poe9pxp5YtumOwPFiyJ21bUuoQAxKAjQvkSmDJ11xTTvMyGqmxrrNk34snDhR+Vt06CspwaJyBTpNnQ8tIxroTidnLnk8qa9WqgP0PbZpHK6NrskMCe+nN6sX0RbNjAMTbW2zbQsDhTtuWHP+7ohxwMugClgyQ33vp5P4PXi9h/T14v4BVHwvQolUjqkhj+fRdH5RXddv69/10c2bPogRaETnPQvEhXfRu7RWyrp8o0rYtpFuR23b3N95SC3fkwsG7wMQHTgZdwJJHATKk2hXVutPXgcwLlpHUsY4id1F85G9uu2LjsvTIjfj/QH0WHbg4n850xDqc0B7bmjych5BK0atLb+ezhXcX7vV0HAhG4CfDhYNg4gMnj4IuxOSRYstIYBkyVJeZu2wC/P389v58be76BbEbdBpVYq1FRx/rM+gTw1zSW90vVbIAjdwFwmpEfAhG4CfDhYN3MYqJT8xpuLUwirt9HDgR0GD9NSnvjdz6+88/+dkNmTVb16XkLEimtfekH/NfF1NF+U2pPHdXmSJJSUGqE1k4JIiQu0BYjYgPwcgo/OQRLOcMZE+pQxSEcSglJSgBwsv3XbWCs+6VKbFhfEm7uUdDX7clUVFbIp1qT6CG7ulMFo3yEyojSNojn4xUJx+uXTAWIXfBGFY78jLcXrzKk84knBCpuZDR8LU0NxIRFlT45NZFS1dnxixOjRvIvj6hLIRTMtpC6FxnFFWZI6jWHE76bi219ITy20VBBxHKTOi7QEsAqtUopKLGJza9IGlfW24sQaoTWTjGBJEjXj5HHlSkWJoc8RMDrNWpUfI2v//6jNTvZsdnZs7UZsSFh6SrAv1lK9/TbvwHb9FHOn4pa9EopKLGh/ITKiOMSXunwSwxLDDI0uRYJ2T2sFanWqnRo1ID5f48+L3lM2O+szAuKT1hemJCeEjsDI0qShMcqAuaFhAmAdSKNi10EKG5BX0XaAlAtZqxkOqOgIfKWKLm0bTtwhOZryTY41wA8hl3Jz8lLFrqieAsmUrTyDgUs2DJzDSkRCN6kgC2bpKCbGSlC5aAxZVg2YS5Srl+40j0gnfBzPlKPysLAxEfCpY2mghynMigEIxUEENTkbeoQ26SnDOBqcQozD/nFbliXl6oG4moFEEDJgjA/UIWTtEH3vhqRXRMlLMmAHeDi2vIC49w8uXS84EC4NC4cQaw1x9KNhZr/INCEgXrjicP+0YUFOQ7fPaYvbF+mAKa8GIFtzDaB17KmD04cjw9tSJS0AjBU1Hq+VTj4lGo4/XxIODz6YICcGTwkBvFKgEqgW4CJF7ChHm4r9/Uc8F9I1OPcPKR/FeAAQBhzQayRWqS/QAAAABJRU5ErkJggg=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-endcap-h.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-endcap-h.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAITwBNmSo1UGCpgwILEiQ48J/DhxAjQiwlsaJEihYz/jOlMSPGjhdBVuQoMiLJkg9Poty48uHHlS9RqkQZs+RMmy0d1hR5U+RCgwMZLmQYNCAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-endcap-v.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-endcap-v.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAISgD/CRxIsGDBUqVMmUq4EKHChg8TljJI8aCpihj/KcxYESFHihs/WhRZcCFJgiZPCkyocuXFliFVeoT5UmVKmzVPsmy50+ZEngEBADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-filldown.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-filldown.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAJAjI+pAe3vDECTplola2xPbEUfBx6ZZnUmxJaoeb3dN9eqfKPnmat7C5HxhkKdMUdM/YARZEyZgoU4uCRvgTUUAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-fillright.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-fillright.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI7jI+pwO3fDEDz1HAlnlx7u2GUmJFddZXZClLQ63xiO4MM+akh2413n0qwaCqYUYFMKpMpI2zJhEqnigIAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-formuladialog.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-formuladialog.gif",
"text": "R0lGODlhEgAMAIAAAAQEBP///yH5BAEAAAEALAAAAAASAAwAAAIjjI+pAb3rwJEMUnNrcljlxmXdBI6IyGnndomqlKpyuZnPbRQAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-hidecol.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-hidecol.gif",
"text": "R0lGODlhFAAUAIABAP///wAAACH5BAEAAAEALAAAAAAUABQAAAIyjI+pwHzwGjQzVFTz25Rbj3laR37lJaanaiZj+8YgK6+2S+d3eNfw3JOIhIqi8YgMFAAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-hiderow.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-hiderow.gif",
"text": "R0lGODlhFAAUAIABAP///wAAACH5BAEAAAEALAAAAAAUABQAAAIrjI+pwO3PDlDUTFvpDTtLCYWNR5bm+U0qx64dCsekSH/n9no4itOhDEwUAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-insertcol.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-insertcol.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI7jI+pwGz9GjjzxVpD3td6TXXgx2nOiJZQGnpryZpYG7+0esL4TFKSdAv9YrVcsIckInS05Q24gCqm0wIAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-insertrow.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-insertrow.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAItjI+pwO3fDFD0zHDrkppeCD6dNVaMF4pJCq1sVCJnLJtvi9Fcrn86f8P9hooCADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hd.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIjABNmSpFcCDBgqUEJhQ4ENu1a9gcRpwIUSJEgeHCiROnMSPHjR01iiP4r6TJkyhNJkyJkkzKlSxLkimTcmDMf2Vy1iwVM6dOlDBR+vx5kmTLoTSB8hSK9KUpljNzukRpE6rPmk97ElWZNeZMpzdl7gwbkyDHjGg/nvWYUeBEiW8rRqx48KBChQsNHgwIADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hh.gif",
"text": "R0lGODlhFAAUAKIAANfX1+Li4uHh4djY2KWlpaampv///wAAACH5BAAAAAAALAAAAAAUABQAAANWSFRb3C6qOEC9I+s9XBBg8IljKHyMoa5suypuS7hOvNYtHkd0YS8w2cwF8cmMLMiiR5voXkgWg3f8TZi2Kda6zXZtzRMJRP6UQQqNpbLmaCTTOHyiSAAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-hn.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIiQBNlRpYypRBgQUPFiRoCptDh9ciPpSI7VpFg+HEhcvIcaPHjRrDCVxHsqTJkyULojxZqqQ6kgNXpmzJkubKhChjrhRoMKepmwpRjqzJ0+ZMoUV/slR6kmfPpTIXMp35cudTk0NlXi25dSdSmWDXDQSZMWTZsiHFDXzItm3FiQYHxkW4kCFCUwEBADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vd.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIjQBLlTJFcKDBgaYECixoClu4fxAjSpQYDltCbOImaowoDttAjBs3ViR47WHIiRU/mjwZcWTDjCw5WizlUGOZMhpH0oQZ8eZNlB5fSvTpU2JHlRHJkCG6lOO1iyaXLi0jVSnElA0fMiVatCPBmjGvBgUbVifIsP+8CkUb7hpStF5prozpMiFCgnYXKiwYEAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vh.gif",
"text": "R0lGODlhFAAUAKIAANfX1+Hh4eLi4tjY2KWlpaampv///wAAACH5BAAAAAAALAAAAAAUABQAAANjWErFvY0wR4YwOGstgATXJmIBoADBOAoDA6oiywwprAVD89oZ29AiRqxVAGoehQ1OV8MgJZxWJWR4OBQ9UzEUUUSEBlkBVfVOzkmxhdfLTdkk0xuubvJ8W7hhmafnvFZPV2cJADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-less-vn.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIlQBLCTRVypRBgQMJFjxYCpu4dRAjRlQnMRw2gg4hUpTIcZ1FgdjCdRzpEVvBjCQ5WsQoMqVEcSZNoXQJEWbBaw85Cuy4UmbLiApLbax5UWZOiAQNEqxYNOQ6igcVGoxo0yjEhVGTQuyZMSlCr0thGpw5dOTHhkdp2iyFk2ZErj9TUhRrqq3bdXSd3l2JsK/UggMBlwoIADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-linkdialog.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-linkdialog.gif",
"text": "R0lGODlhEgAMAIAAAAQEBP///yH5BAEAAAEALAAAAAASAAwAAAIejI+py+0BYkRyGpAwzPcdDVZit3ml9pHpVVGtCTsFADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-linkout.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-linkout.gif",
"text": "R0lGODlhFAALANUCAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAIALAAAAAAUAAsAAAYwQIEQQCwajcLhkRhoOpGCZdHZREqN1KuUGtAen1UvMwzoip/aKJYsVU7N6aS4mAwCADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-lockbg.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-lockbg.gif",
"text": "R0lGODlhBAAEAJECAP////8CAv///wAAACH5BAEAAAIALAAAAAAEAAQAAAIHRC4WkstQAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-lock.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-lock.gif",
"text": "R0lGODlhDQAUAMIGAGFhYbm5ucLCwt3d3fHx8f39/QAAAAAAACH5BAEKAAcALAAAAAANABQAAAMqeLrc/jDKuYq1DyvNSvNfKFYdYZ6mRkTgunFtJx/uNtcHaOfse/0cCiUBADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-logo.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-logo.gif",
"text": "R0lGODlhEAAQANU5AJeXl5qamufn55ubm/X19dbW1q2trYGBgYyMjLe3t8PDw+Dg4IuLi4aGhllZWdvb28LCwmVlZWZmZm1tbW9vb66urubm5sXFxYeHh25ublpaWmlpadra2qKiooCAgGpqanh4eJCQkOvr68zMzHNzc5GRkcfHx9zc3MbGxqSkpGNjY1JSUqysrPT09PLy8vPz89DQ0HZ2dnd3d7i4uM/Pz2BgYKGhoVFRUVBQUP///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADkALAAAAAAQABAAAAbEwJyL5prJYghGLDYbWnICBw4HcIk2tZELMHU8bLewLVeo1QI52hRng61nuUGDNCA8cOHZ7HAAqDIQOTkEERMAHgczMS9QeDaPYDgtOS9HBAsDJXCCaR0BBQsyIB81KTQ0nIIwCWYUEmYhNDCpOTAVZhEyARgYF7OpKAMGRjKMCysajIITNwSUMjMINgo3OAYwNBfVCjYMMxzVbCYNCQYBJyx4N9xTN2MQZhVpazYW4QgvZTUJW+2oAjZoKJLhKgY0gKiCAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-main-h.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-main-h.gif",
"text": "R0lGODlhCgAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAACgAUAAAIKgBVuXoFi5UqVaxeufrHsKHDhxAjSpxIsaLFixgzatzIcWKpj6ZKhRwZEAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-main-v.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-main-v.gif",
"text": "R0lGODlhFAAKAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAKAAAINABN/RtIsKBBgqoEHlxY0FUphhD/vVIY8SAsihULssKYcaCqhx0LpgIZcuAqkiVdcez4KiAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-merge.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-merge.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIxjI+pywoBnpQQvobRNbueDmpiRkbmiUZjuWYh6XFwbKV2NzvtK3973phUVEIc8IgoAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hd.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIjgBNlRJoqmCpgQUFIkRoCts1bA4hSpzo8OFBceEyZsQoriNHjBkL/htJsqRJkiJNljlpUuDJMmRYkhz4ssxKmTRVkrEp06VKmzxPpiy5E+jNkjlL2ty5U6ipk0ybCi0FFSjOpz+POq0pc+RQkjG7/jsotqcpjRo7hgOZNuPAiBCvPYw4d+JBgwwXKiQoMCAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hh.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIhQBLmRo4sJRAggYFHjR47Rq2hw8bQnQIEdvAcOIyhtuIcaPGjuEE/htJsqRJkqZKnVR5sqRIky9b/jN4kqDMmSxdKpQ5sGbKnitNBUXoM+jCojBTxiwJVGdTk09HKr25dGTVpDVvWs2pFaopjxnFeewYFqO4gRXTVpSI7dpPgnALJkRYKiAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-hn.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIiQBLCSxlimBBggNNHUSIraHDaw6xQYyIrWA4ceIuYrwYTqNHcQrXiRSpbqTJkwRPriul8mRBlS9HljQZ0mXMlilRCjTVct3NkQWDtqwp86BCni5Z6jQKEylNhTltNiWaVOXOnj6V0tSK0ylQrCKpgn2qEWPGjmY3oi0ocSLFiNcmDpxrEGHdugEBADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vd.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIlABNlTJFsNTAgQINClxIEJu4fxAjSpQoDttAbOEmaoxYsWHGjRrDXWv4EOREkRdLmowYDhvJlRJbGnT4r0wZMjZx5rT5r+LMjzdt7uT5T6YpjBGFktFZhqVFU9c+QgwqlOLIUkglCm0a0+VRlUm5UvSaFWZRsmBXGqVptufIo1JhGo3atqdLrHHVXkNY8OBCvwQLBgQAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vh.gif",
"text": "R0lGODlhFAAUAKIAANfX1+Hh4eLi4tjY2KWlpaampv///wAAACH5BAAAAAAALAAAAAAUABQAAANkSEW6vLDANoS5OGcxZNUgxjFfCAYAaZkaqgwB23YELG/01yj8Uxichc3AkxgZl1FtZXDsCBiUMIaJSHAe5sXxywRoAGpmAQoWSjfDd5q+rGvi2+gcl63PWllw2VYPdkYSPkc9CQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-more-vn.gif",
"text": "R0lGODlhFAAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAUAAAIjwBLlTIlcCDBggcHGjSFLdy6hxAjRhSHzRRDhxIzPgyHTeA1h+o0SqRIEJs4kRk5CmyIcmTHUixFhoTIseRJhQRzCiS4TiXMk+sWKlS48dpAkxBx6oRIcSXQhxYXRqx5UaLBUhJrwsQY0WJGkqU+tpxa8edYpi9jnlXJ8OlYcUbNnl0HFulctgstHsyp92pAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-movefrom.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-movefrom.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAI7jI+pwO2sDJQHBBstvnUnvIURR5UeMpHcWanhg5ZuS8+2JFK5Xqce2KtdHkThKHNMspLDBvOTehqliQIAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-movefromoff.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-movefromoff.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAIwjI+pEOwNlVyTzXveixRjHVndBZRixqHGeX4UyLGeOscICK/1uOt9Y2p5TD9fEVEAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-moveinsert.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-moveinsert.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAI4jI+pkOAPnWGIqonrPdTi+ARds2WeKILMqJUsWprcuUxgTEt4HcP8LKFlNkKYykdyEXcXVaQXKwAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-moveinsertoff.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-moveinsertoff.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAIzjI+pkOzxmJGqwtlsXvfdf1AaiESfJI4baaFhqgHyDJdLreJ2lXpq3MKYfkEe0WjyHREFADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-movepaste.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-movepaste.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAI2jI+poL0ODYtu0nfxAbx7LiVWM42BKYYI83WnWkbxydLta3uyWK+uOasIc7+hMQVBSVqfjKMAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-movepasteoff.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-movepasteoff.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAIxjI+poL0ODYtu0nfxYTx0a2VT6InNV6ajZHpg2anATGcbya6Ibj8ozurZgLBiTIgoAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-multilinedialog.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-multilinedialog.gif",
"text": "R0lGODlhEgAMAIAAAAQEBP///yH5BAEAAAEALAAAAAASAAwAAAIWjI+JwO0KY3JA2htow/zo30lbSJZBAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-paneslider-h.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-paneslider-h.gif",
"text": "R0lGODlhCQAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAACQAUAAAIZgBLmRpoSqDBa9gSKiyITZxDceGuDcQW7p/FiKVKXat4UaIpihb/icM2kaNIkh/FhQyHsuFKbAJBWhxZ8JrKmTBThqRZyiVOhiZ5+hR5TaDNnRJ73vzHsuRDljGxXUOYkGBBgxkDAgA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-paneslider-v.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-paneslider-v.gif",
"text": "R0lGODlhFAAJAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAJAAAIWQBNCTRViiDBggUFIkSI7Rq2hw8dQpz4UCA2cRjDaRSncSNGjNgKXvxHsqRJk+GuEcQW7qTLkilLlRr50qU4bBbDfeTIsePOlCshXhsasehEmQcHIjy4MGFAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-pasteformats.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-pasteformats.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI6jI+pwO2tAjAT1ZruuxFH2YHTKIafxCxnmZUe2Z6wtc4HiVNgbO735/EJfyrKJlWUuYaqXHBxfK4UBQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-paste.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-paste.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI7jI+pwO2tAjAT1ZruuxFH2YHTeHjldy7L5lCi+3GZtIG2hXIkQ/OpeVMFXSwbEPgrKnPMWLPDgqCmgQIAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-peerbg.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-peerbg.gif",
"text": "R0lGODlhBAAEAJEAAP////8AAP///wAAACH5BAEAAAIALAAAAAAEAAQAAAIHjHESIMJdAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-range2.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-range2.gif",
"text": "R0lGODlhBAAEAIAAAKampv///yH5BAEAAAEALAAAAAAEAAQAAAIFRB6GelAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-recalc.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-recalc.gif",
"text": "R0lGODlhFAAUAMQBAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAEALAAAAAAUABQAAAU7YCCOZGmeAYCuKaCyKem+byzL7qjW7Sz6uhMPGOP9cLTgigjT5ZpIaFSqrFKFM+MvC9M2mV5T+EpehQAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-redo.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-redo.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIwjI+pyx0Aozuxgmmtq1Qy310fpICJaaDhoj5k+Z5xmskiotnsvLLjPekFhcOikVEAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-scrollarea-h.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-scrollarea-h.gif",
"text": "R0lGODlhCgAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAACgAUAAAIPwBNlTJFcKDAUtiwXUvIMGG4hxDDiXu4rqLFi/8yatzIsaPHjyBDihxJsqTJiyjXSZQ4EaI4hQ0ZXhtI0+DAgAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-scrollarea-v.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-scrollarea-v.gif",
"text": "R0lGODlhFAAKAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAKAAAIUABNYRO37p/BgwgNrguHzZSpawQTSvy38JrDgQUnIlwnDlupUtjCZdSosONHjCQPLmwIUmTKkixDjiS50lSpa+HUvaTIsJTAiC8rngSasmZAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-sumdialog.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-sumdialog.gif",
"text": "R0lGODlhEgAMAIAAAAQEBP///yH5BAEAAAEALAAAAAASAAwAAAIcjI+pwO16nIQRJEsNy3Tzi31aKHpRJj1QqopZAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-swapcolors.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-swapcolors.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEAAAEALAAAAAAUABQAAAI3jI+py40A3IJQvhiq1YYz32GfeICJaV7USpaZ1L5ORNJuG+PyW+/2o9CJfh3frnjiKW0xi1NSAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hd.gif",
"text": "R0lGODlhDwAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAADwAUAAAIZQBNlRJYaqCpgwcHFvzHsKHDhgIfSmQ48GGZiw8PWiRDJqOpjWU8gny40OHFjg41OiSDMeVHkxxFrmwJ8WXDMixJlrKIUyfPkCl3rszpsORNmhRtMsQJtOZEiRWfukSYkGDVUgEBADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hh.gif",
"text": "R0lGODlhDwAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAADwAUAAAIWQBLmRookKCpggdN/VvIsCHDgw4jLoTYMKFDig8HXlRYUWPHjaUcCtzIMePFkR87lpwYsmEplCZdvtxIkqbMlf9gLhTYMmZGnDpzBg0qMSfOojwTDkz4smBAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-hn.gif",
"text": "R0lGODlhDwAUAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAADwAUAAAIkABNCRxYqpTAggdLYVvIsCFDgdjCSZwoUVw4cdgKYrNocaA4i+EymtpYEeFFidggVgxn0NRHiylHXrRosNREcdcgcmQpcGa4nKauUTx4EqMphRRrggxpkKREoiCBRpyplGPMqRehwjxKkubRmRgNXluqtGJKpCBr3rx6MhzRk2x9vnwpleG1hXcbIkyIcK/AgAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vd.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vd.gif",
"text": "R0lGODlhFAAPAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAPAAAIWQBNCRRYqtTAgggJmjL4r6HDhxAdCoxIEeLEihgZYqyocWPEi2TKiBw5MqTIhgsblixDxqRIkyhNqSRJk2TDgh4ppswJESfPhzt/oiwl1KHBggsVHlx41GBAADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vh.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vh.gif",
"text": "R0lGODlhFAAPAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAPAAAIVgBLmRpYSqCpggILEiRY6p/DhxAjPhQosWLEgRYz/qOoseLBjh5NOVxocODBgw03pkxokqHClB83mjTIEuVIkSAv4sz5ECPPnjt/+vypEuXJozONmgoIADs="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vn.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-thumb-vn.gif",
"text": "R0lGODlhFAAPAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmNjY2RkZGVlZWZmZmdnZ2hoaGlpaWpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4CAgIGBgYKCgoODg4SEhIWFhYaGhoeHh4iIiImJiYqKiouLi4yMjI2NjY6Ojo+Pj5CQkJGRkZKSkpOTk5SUlJWVlZaWlpeXl5iYmJmZmZqampubm5ycnJ2dnZ6enp+fn6CgoKGhoaKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq6ysrK2tra6urq+vr7CwsLGxsbKysrOzs7S0tLW1tba2tre3t7i4uLm5ubq6uru7u7y8vL29vb6+vr+/v8DAwMHBwcLCwsPDw8TExMXFxcbGxsfHx8jIyMnJycrKysvLy8zMzM3Nzc7Ozs/Pz9DQ0NHR0dLS0tPT09TU1NXV1dbW1tfX19jY2NnZ2dra2tvb29zc3N3d3d7e3t/f3+Dg4OHh4eLi4uPj4+Tk5OXl5ebm5ufn5+jo6Onp6erq6uvr6+zs7O3t7e7u7u/v7/Dw8PHx8fLy8vPz8/T09PX19fb29vf39/j4+Pn5+fr6+vv7+/z8/P39/f7+/v///ywAAAAAFAAPAAAIjgBNCSxVaiBBUwQLIixIENs1bA4fRoToEOK1awixhRMnbqNHjh07bsRWEJvIkyhBiiNZymS4lxtFvlQpDqMplxw/wszZkaSpa+EEGhTKsGA4nxoRKl0odOFRgSaLNp1qqmZDnjNjhhSJDerHkFnBrsw4E+RXjyNL7kR7sqzNiw8vWpxLEeJBhksTKtVrKiAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-trackingline-h.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-trackingline-h.gif",
"text": "R0lGODlhAgAIAJECAKampqWlpf///wAAACH5BAEAAAIALAAAAAACAAgAAAIHjCEpAaZSAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-trackingline-v.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-trackingline-v.gif",
"text": "R0lGODlhCAACAJECAKWlpaampv///wAAACH5BAEAAAIALAAAAAAIAAIAAAIHRCRxYhiACgA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-undo.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-undo.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAIxjI+py30Ao3uxzopBs4YviYCKSGkfNKKpmZDlyXZZq4beu8JMbPNT4PoFL7Wf8WgoAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhidebottom.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhidebottom.gif",
"text": "R0lGODlhDAAJAKEBAMzMzP///////////yH5BAEKAAIALAAAAAAMAAkAAAIUjI8BycvogJzxUKeghAkb/1wiIBQAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhideleft.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhideleft.gif",
"text": "R0lGODlhCQAMAKEBAMzMzP///////////yH5BAEKAAIALAAAAAAJAAwAAAIWRI5niavd3AIU0vrChUomz2ShcJVAAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhideright.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhideright.gif",
"text": "R0lGODlhCQAMAKEBAMzMzP///////////yH5BAEKAAIALAAAAAAJAAwAAAIWjG+AqMkHWpCx0TphdInCt3BhRUZCAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhidetop.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unhidetop.gif",
"text": "R0lGODlhDAAJAKEBAMzMzP///////////yH5BAEKAAIALAAAAAAMAAkAAAIUhI8gwe0BXnSTHdpStmnWt4GYmBUAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unlock.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unlock.gif",
"text": "R0lGODlhDQAUAMIGAGFhYbm5ucLCwt3d3fHx8f39/QAAAAAAACH5BAEKAAcALAAAAAANABQAAAMreLrc/jDKU2p9V2VWWp+fFEZjQZzomRGkwmrb92qcWy/yTVMtZf2WiZCRAAA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-unmerge.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-unmerge.gif",
"text": "R0lGODlhFAAUAIABAP///////yH5BAEAAAEALAAAAAAUABQAAAI0jI+pywoBnpQQvobRNbueDmpiRkbmiUYjt3rs14bw/NbuDaa6Smay/cO1eotJRWXsEJeNAgA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-wikiflag.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-wikiflag.gif",
"text": "R0lGODlhDQAMAJEAABrH7P///////wAAACH5BAEAAAIALAAAAAANAAwAAAIijI8hEuD/FAPJ0NWyzZjSfU1aFpJm6Z2SlnJihULQWiFLAQA7"
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-wikilinkflag.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-wikilinkflag.gif",
"text": "R0lGODlhEAAMAJEAABrH7P///////wAAACH5BAEAAAIALAAAAAAQAAwAAAIplIKpagEP4wsNrGWrUxblY3Ve922htGmiQ1LglojluXoufNmVxN/5VQAAOw=="
},
"$:/plugins/rboue/SocialCalc/Lib/Images/sc-save.gif": {
"type": "image/gif",
"title": "$:/plugins/rboue/SocialCalc/Lib/Images/sc-save.gif",
"text": "R0lGODlhFAAUAIAAAP///////yH5BAEKAAEALAAAAAAUABQAAAI2jI+pCw0Lg3tRzWodTnefXk2ixoyiZZgkJTWp+VLdGMvuR8Y6cuM2G1nlSjeV8Xc81ZJAT6IAADs="
},
"$:/plugins/rboue/SocialCalc/config.json": {
"title": "$:/plugins/rboue/SocialCalc/config.json",
"type": "application/json",
"text": "{\n\"\":\"Localisation\",\n \"LANG\": \"en-GB\",\n\n\"\":\"Graphics of the Graph tab. Actually the only choice is \\\"native\\\".\",\n \"graphics\": \"native\",\n\n\"\":\"Visualization mode. \\\"edit\\\" to modify the sheet. \\\"view\\\" to view the sheet in read-only mode.\",\n \"mode\": \"edit\",\n\n\"\":\"Display grid (\\\"yes\\\") or no (\\\"no\\\").\",\n \"displayGrid\": \"yes\",\n\n\"\":\"Height of widget in pixel when in tiddler editor.\",\n \"heightInTiddlerEditor\": \"400\",\n\n\n\"\":\"\"\n}"
},
"$:/plugins/rboue/SocialCalc/edit-socialcalc.js": {
"text": "/*\\\ntitle: $:/plugins/rboue/SocialCalc/edit-socialcalc.js\ntype: application/javascript\nmodule-type: widget\n\nThe edit-socialcalc widget edit a SocialCalc sheet stored in a tiddler.\n\n```\n<$edit-socialcalc tiddler=\"myTiddler\" height=\"400\"/>\n```\n\nThe widget displays a SocialCalc sheet stored in the specified tiddler.\nThe width and height attribute are interpreted as a number of pixels, and do not need to include the \"px\" suffix.\nThe mode attribute defines the type of display : \"edit\" to edit the data (default value), \"view\" to\ndisplay without modification\nThe grid attribute defines the display grid behaviour : \"yes\" to display the grid (default\nvalue), \"no\" otherwise.\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CONST_NODE_ID_PREFIX = \"SocialCalcWidget\"; // prefix of root node's id attribute\nvar CONST_NODE_CLASS = \"SocialCalcWidget\"; // class of root node\nvar CONST_MIN_HEIGHT = 300; // root node minimal height\nvar CONST_PLUGIN_PATH = \"$:/plugins/rboue/SocialCalc\";\nvar CONST_CONFIG_TIDDLER = \"$:/config/rboue/SocialCalc\";\nvar CONST_CONFIG_DEFAULT_TIDDLER = CONST_PLUGIN_PATH+\"/config.json\";\nvar CONST_SHEET_TIDDLER_TYPE = \"application/x-socialcalc\"; // type of sheet tiddler\n\n// Get session configuration.\nvar sessionConfig = null;\nvar configTiddler = $tw.wiki.getTiddler(CONST_CONFIG_TIDDLER);\nif ((typeof(configTiddler) != \"undefined\") && configTiddler) {\n sessionConfig = $tw.wiki.getTiddlerData(configTiddler, null)\n}\nif (!sessionConfig) {\n var configTiddlerDefault = $tw.wiki.getTiddler(CONST_CONFIG_DEFAULT_TIDDLER);\n if ((typeof(configTiddlerDefault) != \"undefined\") && configTiddlerDefault) {\n sessionConfig = $tw.wiki.getTiddlerData(configTiddlerDefault, null)\n }\n}\n\n// Create objects\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar SocialCalc = require(\"./Lib/socialcalc-min.js\").SocialCalc;\nvar Graph = require(\"./Lib/graph.js\").Graph;\n Graph.init(SocialCalc, sessionConfig);\nvar TiddlyWiki = require(\"./tiddlywiki.js\").TiddlyWiki;\n TiddlyWiki.init(SocialCalc, sessionConfig);\n\nvar EditSCWidget = function(parseTreeNode,options) {\n this.initialise(parseTreeNode,options);\n};\nEditSCWidget.instanceNb = 0; // count class instances\n\n// Inherit from the base widget class\nEditSCWidget.prototype = new Widget();\n\n//=======================================================================================\n\n// Render this widget into the DOM\nEditSCWidget.prototype.render = function(parent, nextSibling) {\n var fonc = \"EditSCWidget.render\";\n var self = this;\n\n // Debug tools\n var hack = {\n flagActiv: true, // Activate the logs\n log: function(mess, flagNoLog, fonc) {\n if (!hack.flagActiv || flagNoLog) return;\n var id = \"[]\";\n var ss = SocialCalc.GetSpreadsheetControlObject();\n if (ss) id = \"[\"+ss.idPrefix+\"]\";\n console.log(id+(fonc ? fonc+\": \" : \"\")+mess);\n },\n // Following are flags activating logs for specific fonctionnalities.\n // Value : false to activate, true to desactivate (no log).\n bug: false, // current bug investigation\n com: true, // command execution\n save: true, // tiddlywiki-save commande\n recalc: true, // recalc\n recalcLink: true, // recalc : page link in formula\n link: true, // page link in formula loaded as tiddler\n url: true, // text-link cell\n filesystem: true, // filesystem\n keyboard: true, // keyboard\n loc: true // localization\n };\n if (!window.hack) window.hack = hack;\n\n this.parentDomNode = parent;\n this.computeAttributes();\n this.flagEditWidget = this.execute();\n\n // Create element and assign attributes\n this.nodeRoot = this.document.createElement(\"div\");\n this.nodeRootId = CONST_NODE_ID_PREFIX + \"-\" + ++EditSCWidget.instanceNb;\n this.nodeRoot.setAttribute(\"id\", this.nodeRootId);\n this.nodeRoot.setAttribute(\"class\", CONST_NODE_CLASS);\n if (this[\"class\"])\n this.nodeRoot.setAttribute(\"class\", CONST_NODE_CLASS + \" \" + this[\"class\"]);\n if (this.width)\n this.nodeRoot.setAttribute(\"width\", \"\"+this.width+\"px\");\n if (this.height)\n this.nodeRoot.setAttribute(\"height\", \"\"+this.height+\"px\");\n\n // Insert element\n parent.insertBefore(this.nodeRoot, nextSibling);\n this.domNodes.push(this.nodeRoot);\n\n // Get data tiddler\n if (!this.tiddler) {\n nodeRoot.innerHTML = \"Error: you must specify a SocialCalc data tiddler\";\n return;\n }\n\n var tiddler = null;\n var tiddler1 = this.wiki.getTiddler(this.tiddler);\n if ((typeof(tiddler1) == \"undefined\") || !tiddler1) {\n this.wiki.addTiddler(new $tw.Tiddler({title: this.tiddler, type: CONST_SHEET_TIDDLER_TYPE, text: \"\"}));\n tiddler = this.wiki.getTiddler(this.tiddler);\n } else\n tiddler = tiddler1;\n\n // Get widget configuration\n this.flagView = false;\n if (this.mode && (this.mode.toLowerCase() == \"view\") ||\n (sessionConfig && sessionConfig.mode && (sessionConfig.mode.toLowerCase() == \"view\")))\n this.flagView = true;\n this.flagDisplayGrid = true;\n if (this.grid && (this.grid.toLowerCase() == \"no\") ||\n (sessionConfig && sessionConfig.grid && (sessionConfig.grid.toLowerCase() == \"no\")))\n this.flagDisplayGrid = false;\n if (sessionConfig && sessionConfig.heightInTiddlerEditor && this.flagEditWidget)\n this.height = sessionConfig.heightInTiddlerEditor;\n \n var widgetConfig = {\n mode: this.flagView ? \"view\" : \"edit\"\n };\n if (sessionConfig && sessionConfig.filesystem) {\n widgetConfig.filesystem = {};\n if (sessionConfig.filesystem.PATH)\n widgetConfig.filesystem.PATH = sessionConfig.filesystem.PATH;\n }\n\n // Get Socialcalc and adapt it to TiddlyWiki\n if (!SocialCalc) {\n this.nodeRoot.innerHTML = \"Error: SocialCalc missing !\";\n return;\n }\n\n // Hack : execution of handlers defined with raw HTML, like onclick=\"SocialCalc.Bazz()\".\n // SocialCalc must be defined at top level.\n if (!window.SocialCalc) window.SocialCalc = SocialCalc;\n // Hack : TiddlyWiki must be defined at top level.\n if (!window.TiddlyWiki) window.TiddlyWiki = TiddlyWiki;\n\n this.tiddlyWiki = new TiddlyWiki(this, this.tiddler, widgetConfig);\n this.setSheetGeometry(this.nodeRoot);\n\n // Activate wiki-text\n if (Document && Document.Parser) {\n SocialCalc.Callbacks.expand_wiki = function(val){\n return \"<div class=\\\"wiki\\\">\" + new Document.Parser.Wikitext().parse(val, new Document.Emitter.HTML()) + \"</div>\";\n };\n }\n\n hack.log(\"tiddler: \"+this.tiddler, hack.com, fonc);\n\n if (!this.flagView) {\n // Edit mode\n\n // Create spreadsheet\n this.spreadsheet = new SocialCalc.SpreadsheetControl(\"SocialCalc-\"+EditSCWidget.instanceNb+\"-\", this.tiddlyWiki);\n\n // Add graph tab\n // Hack : execution of handlers defined with raw HTML, like onclick=\"Graph.Bazz()\".\n // Graph must be defined at top level.\n if (!window.Graph) window.Graph = Graph;\n Graph.addGraphTab(this.spreadsheet);\n \n // Initialise UI\n this.spreadsheet.InitializeSpreadsheetControl(this.nodeRootId, 0, 0, 0);\n this.tiddlyWiki.addImportExportUI(this.spreadsheet);\n \n // Execute initial commands\n this.spreadsheet.ExecuteCommand(\"redisplay\", \"\");\n \n // Load data from tiddler\n this.loadData(tiddler);\n \n // Add new commands\n this.tiddlyWiki.addNewCommands(this.spreadsheet, this.tiddler);\n \n // Start monitoring\n this.tiddlyWiki.monitor(this.spreadsheet);\n\n } else {\n // View mode\n\n // Create spreadsheet\n this.spreadsheet = new SocialCalc.SpreadsheetViewer(\"SocialCalc-\"+EditSCWidget.instanceNb+\"-\", this.tiddlyWiki);\n if (!this.flagDisplayGrid)\n this.spreadsheet.context.showGrid = false;\n\n // Initialise UI\n this.spreadsheet.InitializeSpreadsheetViewer(this.nodeRootId, 0, 0, 0);\n\n // Execute initial commands\n this.spreadsheet.editor.EditorScheduleSheetCommands(\"redisplay\");\n\n // Load data from tiddler\n this.loadData(tiddler); \n }\n};\n \n//=======================================================================================\n\n// Compute the internal state of the widget\nEditSCWidget.prototype.execute = function() {\n var fonc = \"EditSCWidget.execute\";\n\n // Get our parameters\n\n var flagEditWidget = false;\n this.tiddler = this.getAttribute(\"tiddler\", this.getVariable(\"currentTiddler\"));\n var tiddler = this.wiki.getTiddler(this.tiddler);\n if (this.tiddler && tiddler && tiddler.isDraft()) {\n // The tiddler is a draft.\n // We suspect that widget is used as default editor for tiddlers of type application/x-socialcalc.\n flagEditWidget = true;\n }\n\n this.width = this.getAttribute(\"width\");\n this.height = this.getAttribute(\"height\");\n this.mode = this.getAttribute(\"mode\");\n this.grid = this.getAttribute(\"grid\");\n this[\"class\"] = this.getAttribute(\"class\");\n\n return flagEditWidget;\n};\n\n// Selectively refreshes the widget if needed. Returns true if the widget or any\n// of its children needed re-rendering\nEditSCWidget.prototype.refresh = function(changedTiddlers) {\n var fonc = \"EditSCWidget.refresh\";\n SocialCalc.SetSpreadsheetControlObject(this.spreadsheet);\n\n // Resize calc sheet\n this.setSheetGeometry(this.nodeRoot);\n SocialCalc.DoOnResize(this.spreadsheet);\n if (this.spreadsheet.currentTab && this.spreadsheet.tabs[this.spreadsheet.currentTab].name == \"graph\")\n Graph.DoGraph(false, false);\n\n var changedAttributes = this.computeAttributes();\n if (changedAttributes.tiddler ||\n changedAttributes.width ||\n changedAttributes.height ||\n changedAttributes.mode ||\n changedAttributes.grid ||\n changedAttributes[\"class\"]) {\n this.refreshSelf();\n return true;\n } else if (changedTiddlers[this.tiddler]) {\n // Remove tiddler from sheet cache to force a reload and a recalc in other pages.\n TiddlyWiki.removeTiddlerFromSheetCache(this.tiddler);\n this.refreshSelf();\n return true;\n } else if (this.spreadsheet.editor.context.sheetobj.attribs.recalc != \"off\") {\n // Recalc to update cells with references to external sheets, if any\n this.spreadsheet.editor.EditorScheduleSheetCommands(\"recalc\");\n return true;\n } else {\n return false;\t\t\n }\n};\n\n// Geometry preparation for sheet display\nEditSCWidget.prototype.setSheetGeometry = function(nodeRoot) {\n var calcWidth = nodeRoot.offsetWidth; // maximal width\n if (this.width && (this.width <= calcWidth))\n calcWidth = this.width;\n var calcHeight = CONST_MIN_HEIGHT;\n if (this.height)\n calcHeight = this.height;\n\n TiddlyWiki.modifyViewport(calcWidth, calcHeight);\n}\n\n// Load sheet\nEditSCWidget.prototype.loadData = function(tiddler) {\n var fonc = \"EditSCWidget.loadData\";\n if (!tiddler) return;\n\n var calcData = tiddler.fields.text;\n var parts = this.spreadsheet.DecodeSpreadsheetSave(calcData);\n if (parts) {\n if (parts.sheet) {\n this.spreadsheet.sheet.ResetSheet();\n this.spreadsheet.sheet.ParseSheetSave(calcData.substring(parts.sheet.start, parts.sheet.end));\n }\n if (parts.edit) {\n this.spreadsheet.editor.LoadEditorSettings(calcData.substring(parts.edit.start, parts.edit.end));\n }\n }\n if (this.spreadsheet.editor.context.sheetobj.attribs.recalc == \"off\")\n this.spreadsheet.editor.ScheduleRender();\n else {\n this.spreadsheet.editor.EditorScheduleSheetCommands(\"recalc\");\n }\n}\n\nexports[\"edit-socialcalc\"] = EditSCWidget;\n\n})();\n",
"title": "$:/plugins/rboue/SocialCalc/edit-socialcalc.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/config/EditorTypeMappings/application/x-socialcalc": {
"title": "$:/config/EditorTypeMappings/application/x-socialcalc",
"text": "socialcalc"
},
"$:/plugins/rboue/SocialCalc/icon": {
"created": "20150122113649353",
"modified": "20150122113650949",
"title": "$:/plugins/rboue/SocialCalc/icon",
"type": "image/png",
"text": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCAYZvJsQjgAAABl0RVh0Q29tbWVudABDcmVhdGVk\nIHdpdGggR0lNUFeBDhcAABHaSURBVHja7Z15VJNX3se/N7IoWElQgwiEVUBZBJdSSweFEZdaWjew\nIrZqO9O302l9562n9cx5zxydMzOnp6eli+2r09KilipuoxVKlUarUOqGBRcUiBKIiQjGLEAggZD7\n/kHTwRGyB7I837845Fnuc3+f53eX53d/l1BK4UqilOLBgwdob2+HQqGAQqGAUqmEWq2GUDMxPFWe\n22To/CrOvohw7wfCsWPHgs1mw8/PD2w2GwEBAfD39wchxKXqizg7ACqVCiKRCCKRCGKxGMHtm+36\nQGLuRyQ4OBihoaEICQmBr68vA8BISqfTQSQSQSAQoPJ2j9E32t4Sct4jUVFRiIqKAo/HA4vFYgCw\nh1tvampCXV0dvOtyHbrAvfH7SVxcHMLDw52iuXBoANra2nDp0iV4XnveKdupvoRiMnfuXAQEBDAA\nmOVWhUKcO3cOE1t+7xI9VFnY52TevHkICwtjADDk5uvr61FRUYEw2ZuuNTT5RS0T80laWhpiYmIc\npnlwCAAaGxvxww8/uKzhhwIhPT0d06ZNc28A7ty5gxMnToAn/ZNbGP6R55/8IVmyZAmCg4PdC4De\n3l6cOnUKrNpstzT8I5p1hGRkZMDT09P1ARAIBGg6nMwYfghF5VwhkZGRrgmAWq1GSUkJJtzayBjf\ngLpjvyLLli2Dl5fXiNxvRKat2trasL3wdD5jfOPyqV9P//blifD79++7hgeoqalB+4nfMIa3QAFL\nfyRJSUnOCQClFHw+H7rqFYzxrZBnynGSnp5ut3kDuzQBWq0WBw4cYIxvA/VdeJYePHgQWq3WOQDQ\naDQoKioCR/gyY3wbid30Ev3666+h0WgcG4DOzk78vfBkeGDrHxnj21hT7r5G/154Mryzs9MxAVAq\nlTh6dOfPo/193pWVKs9t+kdRZX5HR4djdQK7urpQtWMK89aPJAyv3yPjx48ffQ+gVqvxbtHpcMYk\nI6t3i06Hq9Xq0fUAWq0WRUVFYNr80dG9qZ+SdevWwcPDY+Q9gE6nw6FDhxjjj3LH8PDhw7DmJbbY\nA5SXl4NeXskY3wHkmXKcZGRkjJwHqKmpYYzvQOq78Cytr68fGQDa29uZuX0HVMvROdSSOQKzAOjr\n68MHR6rzmep2TB04cAD9/f326wOUlZVhzJUc5u13YLHmHCWZmZm29wDNzc2M8Z1AuuoV9M6dO7YF\noLe3Fw374xnjO4l2fXslT6fT2a4J4PP56L+0nAFgBNXs/z6ZPn06OBwOfHx80N/fD5VKBbFYDK/r\na43awi+dT5544gnrAWhvb0fNFxEuZ3wx9yPC5XIxbtw4AAMBLDKZDOyml0b1WaW8f5KFCxciICBg\n2HJQSnH16lVyryzVYFlTXhUTNpttHQB79+5FgOQPLgFA57TdJD4+HhEREdRQ0KVUKs2pr68/pKpc\nMqLPHZR1nsTHm97UarVafPPNN2R844tDnqOM/JLk5ORYDsDt27dx6+BMpzd+R1QhycjIeHvixInv\nmNWh0ulQU1NDpOXz7V4HcevrSXBwsNn3+SX0jgwXfRWz9joxtCaRZejCe76vc/qvfNwllSQ7O5ua\na3wAYLFYmD17Nn3qjTa0Bn5it8V8kdm1FhkfAAghWLhwIe2K3jNk+U6dOmWZB6irq4P4eIpTv/0z\nN94iU6bYJk6BUopTp04RW3eGe6YXkeXLl9O+vj6cPHmSnD17Fh0dHQgMDMTSpUuRkmKaDdRqNc5+\nMGnI32Jz60hoaKh5AOzatQvh8i1OC0DyS03+XC5XZuvrlpaWElvmK0h5VUxqa2vxyiuvoLGx8ZHr\nLly4kBQUFCA0NNToPX/88UcyVL9FyvsnWbdunekA3Lp1C7cPJTmt8X9ZYmWX8ut0OhQVFRFbdIxl\nYZ8THx8frF69mhqK+p00aVLOhQsXDkVEGB6N9fT0oOLDyUP+NiPvJgkJCTGtD3D+/Hnn9fuzjjxk\n/I6ODpSXl5Pdu3eTvXv3kjNnzhBrImlYLBZWrVplE7i4XC42bNhw21jIt1QqPfjCCy8Y/e4/btw4\nSAI+HrIvUFVVZVonUCaTYfKd/3Lat3/+/IEee01NDVmxYgXhcrlYvHgx3bhxI33xxRdpeno65XK5\n2LRpExEKhRZ17Hx9feHz1HdWdwq1F5+jCoUiwpRjq6qqKJ/PN3rPwMDAIf/PEb5M5XK5cQCqq6ud\n9uUf++S3xNvbG9u3bydz5syhx44do0PF0nd2dqKwsJBOnz6d7tmzxyJDmto5M6StB6eZde+ysjKj\nxzz22GPD/nb58mXDAPT39zt1oMfcuXOxZcsWsm3bNmrKXLhGo8HGjRvpzp07zYbAy8sLZPa/rPIC\nYrE425zjm5ubjR5jKD6w/9LyR+rlIQAEAoHTvv13p+wgx44dQ35+vlkAU0qxefNmev78ebONGRsb\na1WZvb29D5lzvI+Pj9FjjAWF3Lp1a3gA6urqnBYAHo+HLVu2WHRuX18fXn/9dbODKy2dvNHL3BxB\niYmJxkcWMsMj3xs3bgwNgFarxXBzys4g7cXnaGtrq8Xlr66uNtsLsFgstAfvtLgZ2Lroksnl9fLy\nwpo1awzXgVZr9GPWuJt5dHDU0K8ACIVCOLM+PZdhda+8pKTE7HOMfW0zprS0NJPK/dZbb5GwsDBq\nxL2bdK3BfQmWK7T/ANDQ0GD1NSxpAr29va2655tvvomEhASDhsvJySHbtm2jxiaoLl48/rMp9xxs\n618B4PQc6XJmAGQyWba115BKpSNebu+6XFpWVobt27eT4ODgh0CYOXMmKSwsJMXFxXTMmDEGr3Pp\n0iUSIPlrsin3PCvU5T8EgFKpREfjAafOe+7n53fI2mtwOByzz+np6bG67J+V/hy+detW2tLSQhsb\nG0l1dTWRSCSktraWbtiwgRrLDiIUConi9G9N7k8sUOT8Sb/CmAUMJGx0dg03A2aOwsPDLfE8Vt83\nVZ7b9LcvT0R0dHQ0TZs2jc6ePZtOnTrVJINeuXKFNBYnmN35FYvFrgXA/z5dY/UIJisry6zjKaWY\neu91m4ycUuW5TRd2BkfU1taaFKepUqnw7bffGg0LG04ikejfANy9e9fpAajgFK83NA1qTJGRkSQ9\nPd2symxtbbV5kEjbd0/RP+/67oPKykoilUpzBg/Zent70dTUREpLS8mPHwfA4+oai+FrbW0FABCd\nTofydx5zmaDPJX9WWXTewYMHSXa2ealry8vLiTNPnS/a2klYQ30hclbR5MNk6dKlZr+Vr732mtnG\nV6lUTr9AVqlUgjUaQx97idSsprt378amTZtMgoDFYuGdd94hO3bsMNuQFRUVTr99mFQqhUt5AGAg\n8KGgoADFxcUkLCxsWCMlJSURPp9P3n77bWpuEkaZTPaZK2Q6l8vl8FAoFC4FgE/9elpd/QNZs2YN\nzc7Oxrlz50hFRQXu3r0LFosFHo+HzMxMJCYmWmRAjUaD0tKCuQEuUFcKhQIeSqUSfnAtyfjpVDK1\ngQQFBdHU1FSamppqmz4GpSgpKSEBkr+6RKdZqVSC1d3dDVfU9b0xtL6+3mbttEajwb59+8hjgg0u\nM2JSqVRgCdST8uCiajk6h/70009W50JUKBRNe/bsIZNEr7jUGsmenh6QE//wdflVv21Bf6mZM+eZ\nWdOnTzerw9fV1YUzZ84QZ9230KSRkzsAoJeY+xFJTk5GdHQ0HS7LJqUUYrGYXL9+3S32NHIrAAZr\nQvQa1e2e9PH67/mUUiiVSrfbwcxtAWA0IBZTBQwAjBgAGDEAMHJPAKo4+yKYanBPCTnvEVbEWJmQ\nqQr3lI+PD1imrDdj5MIAWLuyhZHzis1mMwAwADAAuDcAkydPZmrCTcXlchkP4M6aMGECWIQQiLkf\nEaY63Et3p+wgwC8zgcHBwUyNuJn0NmcBA+lVGLmX9EkjGQ/AADCQW66CU7yeqRb3kJDzHvH19f03\nAAAwP8KriKka91BUVNSvf3sM/qfgMlM55qot6P+Iv78//Pz84OHhAS8vL3h7e4PFGni3ent7odVq\nodFooNFoIJPJIJfLRzX2cEgAeDweBIw9DUoZ+SUJDQ0Fj8cDl8vV5+2x0JC/Q3d3N8RiMWlpaUFL\nSwtC7v/3iEAxOGv4Q4smjh07hnE385gg0UHSJR0iCQkJVieFNEUajQY3b94k165dA1f8ql3up4nb\nR5599tmhARAIBGg6nOz2AFRwitfnzY8siomJoXpXPtLq6urCuXPnht0LyGL3P7CXwtAA9Pf3g/+u\nn1sDELjsJ5KQkGD2knF7qbOzE2fOnCGm7BVoijLf7iCDoX4I7zFjxsDj8W/cclr43tRPyW82tyMx\nMdFhjK8fomdlZdHQFdVWF8rriRLynx7tEf+WnJzsdsaXhX1O8vLyqCNHR8XGxtL4FxqsgiApKemR\n/z0CgL+/P+ThBW7jBSZEr1GtXr3aaCZOR1BQUBANee6iRbZRRHxBhkqEOWQPx5Q9Z11FPlFvjPf0\n9HSa8s6YMYO2TMw3G4Inn3xyyP8PCUBYWBiEnPfcwgtER0dTJyyzWceLJn0w5I5hwwIAAOnp6W7h\nAcaOHet0ZdZveG2qDNlyWABiYmLcIlBEKpXOcbYy379/3+RjWwM/IYOnfk0GAAAWLFjg8h7g8lBb\naTmwenp6YE7Gkvnz5xv83SAAkZGRLj8iIDWrqUgkcopnpJSirKzM5LJ2x35FjGVANzrPuXjxYpf3\nAje/nkElEglxdOOfPHmSmLOv06JFi4weYxQADoeDMXOPuXxf4PreGFpbW+uQz9nT04P9+/cTUrPa\nZOP7pfN/DfqwCgB9L9IdIobavnuK/mXX8YgbN244BAgajQZ8Pp9UfDgZE1t+b7Lx70z+kKSkpJjW\nBJqaQ6+5uRkN++Pd5kPR/ZBdZNasWYiOjqaGduO0h+RyOf/atWuZPVVPW1Tfw+0UbhUAAMDn89F/\nabnbfS1Uz/iaxMTEgMfj2eV7AaUU7e3tRCgUoq6uDsHtmy2u43GpZSQtLc30TrA5APT396OgoABh\nsjfd9pNxBad4/bxgFHG5XLDZbLDZbA6bzZZ5eXmZZOiuri4oFAqiUCggl8shkUjg3/w7m9Rne/BO\nkpeXB3O+ZpqdRrW9vR01X0QwUUMGAInwbCvy8vICpRRqtRqhD/5nROrryT+2EnO3zbEoj25DQwOa\n/zWbgcCBFJtbR0JDQ80+z6J4p5iYGKu3TmdkO3mmHLfI+BYDAACZmZnQxO1jIBjtoWLcPmLNhzuL\nASCEICsrC4qILxgIRknKyC9JVlYWrAlhsyrklRCCVatW/brUmNHI6e6UHWTlypWwNn7R6phnDw8P\n5Obmuk0AiSOo2f99kpubC1tMUNkk6N3b2xtr165FW9Bfahjz2Fdn2Ac/WLt2rdXb1ls1DBxOarUa\n+/fvt9l+uoweVmvgJ+T555+3aRSTTQEABmYLjxw5Ar/bmxgIbKiOqEKycuVK2Dp62eYAAANTnqWl\npbDVahZ3V19CMVm2bBnssWDFLgDoITh9+jS0F59jILBCXk+UkAULFsBeq5XsBoBeLS0tqN8Xx0Bg\ngeJfaCBBQUF2vYfdAQCA7u5uHD16FK6275699CD0M7J8+XKMxFK1EQFA3yRcvHgRitO/ZSAwIHbG\nKfL4449jpBaojhgAeonFYpSWliJcvoUBYZCa/d8nzzzzDOzt8kcdAL03uHr1Ku6VpTIQAJjydBVJ\nTEzEaCxLHxUA9Orq6sL3338Pn/r1bglCd+xXZNGiRTAletclAdBLIBDg7NmzI5YkabTVMjGfZGRk\nwNCSLbcCQC+hUIjKykoESP5AXdXwaWlpAwE1DpKFxKEA0EsikaCyshIc4csuAYIs7HMyb948hIWF\nOVzZHBIAvTo7O3H16lV0VSx2ShDGp50kM2fOxHA7lTMAmDFqaGpqQl1dHbzrch26wL3x+0lcXBzC\nw8PhSMmmnBqAwdLpdBCJRBAIBKi83ROeKs9tGtV+C+c9EhUVhaioKPB4PIxWXkG3AeA/pVKpIBKJ\nIBKJIJFIENT2hl0fSBLwMQkKCkJoaChCQkJGdQjHADCMOjo6IJVKoVQqoVAooFAo0N3dDZVKZXSR\nRsvEfOLr6wsfHx/9yh+w2WxMmjQJ5i66cAb9P0ino5gBTAIlAAAAAElFTkSuQmCC\n"
},
"$:/plugins/rboue/SocialCalc/license": {
"title": "$:/plugins/rboue/SocialCalc/license",
"text": "!Plugin license\nCopyright (C) 2015 René Boué (rboue) <rboue01 (at) gmail (dot) com><br>\nAll rights reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http://www.gnu.org/licenses/>.\n\n!Modification of the ~SocialCalc code\nSee [[CHANGES.txt|$:/plugins/rboue/SocialCalc/CHANGES.txt]] tiddler.\n\n!Traduction française\nMartin Gubri pour [[Framasoft|http://www.framasoft.org/]].\n\n<<<\nJuste pour préciser : j'avais traduit une bonne partie d'Ethercalc, mais\nje m'étais en partie servi de la traduction partielle qu'avait fait le\n[[CRDP de Versailles|http://www.crdp.ac-versailles.fr/]].\n<<<\n\nA voir : [[Framacalc|http://www.framacalc.org]].\n\n!~SocialCalc license\n(c) Copyright 2009 Socialtext, Inc.<br>\nAll Rights Reserved.<br>\n\nOriginal components licensed under different licenses. Some are licensed under the Common Public Attribution License (CPAL) and others under the Artistic License 2.0. Check the contents of each file for a statement of the license for that file. Files without license information (e.g., image files) are licensed under the Artistic License 2.0.<br>\nSee [[LEGAL.txt|$:/plugins/rboue/SocialCalc/LEGAL.txt]] and [[LICENSE.txt|$:/plugins/rboue/SocialCalc/LICENSE.txt]] for details.<br>\n\nThe ~JavaScript ~SocialCalc code was initially coded by Dan Bricklin of Software Garden, Inc., for ~Socialtext, Inc.<br>\nBased in part on the ~SocialCalc 1.1.0 code written in Perl.<br>\nThe ~SocialCalc 1.1.0 code was:<br>\n\n Portions (c) Copyright 2005, 2006, 2007 Software Garden, Inc.\n All Rights Reserved.\n Portions (c) Copyright 2007 Socialtext, Inc.\n All Rights Reserved.<br>\n\nThe Perl ~SocialCalc started as modifications to the wikiCalc(R) program, version 1.0.<br>\nwikiCalc 1.0 was written by Software Garden, Inc.<br>\n\nwikiCalc, Garden, and Software Garden are registered trademarks of Software Garden, Inc.<br>\nSocialtext, ~SocialCalc, and the Socialtext logo and Dreamcatcher are trademarks of Socialtext, Inc.<br>\nDan Bricklin's is a registered trademark of Daniel Bricklin."
},
"$:/plugins/rboue/SocialCalc/parser.js": {
"text": "/*\\\ntitle: $:/plugins/rboue/SocialCalc/parser.js\ntype: application/javascript\nmodule-type: parser\n\nThe SocialCalc parser parses SocialCalc's save format into single text node (like \"text/plain\" parser)\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar SocialCalcParser = function(type,text,options) {\n this.tree = [{\n type: \"codeblock\",\n attributes: {\n code: {type: \"string\", value: text},\n language: {type: \"string\", value: type}\n }\n }];\n};\n\nexports[\"application/x-socialcalc\"] = SocialCalcParser;\n\n})();\n\n",
"title": "$:/plugins/rboue/SocialCalc/parser.js",
"type": "application/javascript",
"module-type": "parser"
},
"$:/plugins/rboue/SocialCalc/readme": {
"title": "$:/plugins/rboue/SocialCalc/readme",
"text": "~SocialCalc for ~TiddlyWiki."
},
"$:/plugins/rboue/SocialCalc/tiddlywiki.js": {
"text": "/*\\\ntitle: $:/plugins/rboue/SocialCalc/tiddlywiki.js\ntype: application/javascript\nmodule-type: library\n\n Adaptation of SocialCalc to TiddlyWiki.\n\n\\*/\n(function() {\n\n // TiddlyWiki environnement for a SocialCalc sheet\n // Manage all interactions and interfaces with TiddlyWiki system.\n //\n var TiddlyWiki = function(widget, tiddlerTitle, widgetConfiguration) {\n this.widget = widget; // widget\n this.tiddlerTitle = tiddlerTitle; // title of the sheet data tiddler\n this.widgetConfiguration = widgetConfiguration; // widget's configuration object\n this.flagView = (this.widgetConfiguration.mode && this.widgetConfiguration.mode == \"view\") ? true : false; // display mode\n\n // Management of notification that sheet needs saving (You ! Your sheet has been modified.\n // Remember to save it !)\n // Notification consists of changing background color of the toobar save button.\n this.saveTodo = {\n flagStart: false, // start monitoring anything related to saving of data\n button: {\n image: TiddlyWiki.pathImages+\"/sc-save.gif\", // image tiddler\n idSuffix: \"button_save\", // suffix of id attribute (prefix is stylesheet.idPrefix)\n index: null, // index of saveButton in SocialCalc.ButtonInfo.registeredElements (read at start)\n normalBackgroundColor: null, // initial background color (read at start)\n needSavingBackgroundColor: \"#0000ff\", // new background when need saving\n style: null, // initial style (read at start)\n needSavingStyle: null // style used when need saving\n }\n }\n\n // Enable/block key events propagation (keyboard share between input box and grid)\n // Allow to forbid tiddler scrolling by the browser when we just want to move current\n // cell in the grid with up and down keys.\n this.inputboxHasKeyboard = false;\n // Callback to monitor commands : function(cmd) {}\n this.monitorCallback = null;\n };\n\n // Static members\n\n // Overall parameters\n TiddlyWiki.pluginPath = \"$:/plugins/rboue/SocialCalc\";\n TiddlyWiki.configTiddler = \"$:/config/rboue/SocialCalc\";\n TiddlyWiki.configDefaultTiddler = TiddlyWiki.pluginPath + \"/config.json\";\n TiddlyWiki.pathImages = TiddlyWiki.pluginPath + \"/Lib/Images\";\n TiddlyWiki.curentLanguageTiddler = \"$:/language\";\n TiddlyWiki.defaultLanguage = \"en-GB\";\n TiddlyWiki.pathLanguages = TiddlyWiki.pluginPath + \"/Languages\";\n TiddlyWiki.saveNotificationTiddlerSuffix = \"--save-notification\";\n TiddlyWiki.saveCommandKeyword = \"tiddlywiki-save\"; // keyword of save command\n TiddlyWiki.exportCommandKeyword = \"tiddlywiki-export\"; // keyword of export command\n TiddlyWiki.importCommandKeyword = \"tiddlywiki-import\"; // keyword of import command\n TiddlyWiki.sheetTiddlerType = \"application/x-socialcalc\"; // type of tiddler with sheet data\n TiddlyWiki.dataTiddlerType = \"text/plain\"; // type of tiddler with import/export data\n\n // Initialized at TiddlyWiki session opening\n TiddlyWiki.sessionConfiguration = null; // Session configuration\n TiddlyWiki.currentLanguage = null; // current language\n\n // Static initialisations\n TiddlyWiki.init = function(sc, sessionConfiguration) {\n TiddlyWiki.sessionConfiguration = sessionConfiguration;\n\n // Normalization of sheet names.\n // Sheet name are tiddler title and therefore could have Uppercase/lowercase characters.\n sc.Callbacks.NormalizeSheetName = function(sheetName) {return sheetName;};\n\n // Add class attribute to DOM nodes pertaining to sheet visual\n sc.ConstantsSetClasses(\"SocialCalc-\");\n\n // Background images redefinition\n sc.Constants.defaultCommentStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultCommentStyle);\n sc.Constants.defaultReadonlyStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultReadonlyStyle);\n sc.Constants.defaultUnhideLeftStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultUnhideLeftStyle);\n sc.Constants.defaultUnhideRightStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultUnhideRightStyle);\n sc.Constants.defaultUnhideTopStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultUnhideTopStyle);\n sc.Constants.defaultUnhideBottomStyle = TiddlyWiki.getModifiedCssImageStyle(sc.Constants.defaultUnhideBottomStyle);\n\n // Management of indirect calc data (data referenced in other sheet).\n // With TiddlyWiki, other sheets are tiddlers with SocialCalc data.\n sc.RecalcInfo.LoadSheet = function(pageName) {\n var spreadsheet = sc.GetSpreadsheetControlObject();\n if (spreadsheet && spreadsheet.tiddlyWiki)\n return spreadsheet.tiddlyWiki.getCalcPage(pageName);\n return false;\n };\n\n // Localization with current langage.\n TiddlyWiki.localize(sc);\n };\n\n // Localization with current langage.\n TiddlyWiki.localize = function(sc) {\n var fonc = \"TiddlyWiki.localize\";\n\n // Get configuration\n var configLang = (TiddlyWiki.sessionConfiguration ? TiddlyWiki.sessionConfiguration.LANG : null);\n\n // Replace all strings in SocialCalc.Constants with a translation of the current language\n // <lang> kept in $<colon>/plugins/SocialCalc/Languages/<lang> tiddler.\n // Current language read in $<colon>/language tiddler.\n // Default language is \"en-GB\". It is statically implemented and don't needs translation.\n\n // Current language\n var language = null;\n if (configLang) {\n language = configLang;\n } else {\n language = $tw.wiki.getTiddlerText(TiddlyWiki.curentLanguageTiddler);\n language = language.replace(/^\\$\\/:languages\\//, \"\");\n }\n TiddlyWiki.currentLanguage = language;\n \n if (language == TiddlyWiki.defaultLanguage) return;\n //console.log(fonc+\":language = \"+language);\n\n // Read translations\n var translations = $tw.wiki.getTiddlerData(TiddlyWiki.pathLanguages + \"/\" + language);\n if (!translations) return;\n for (var trans in translations) {\n //console.log(fonc+\": \"+trans + \" = \"+translations[trans]);\n if (typeof(sc.Constants[trans]) == \"undefined\") continue;\n sc.Constants[trans] = translations[trans];\n }\n };\n\n // Redefine viewport geometry (now a tiddler)\n TiddlyWiki.modifyViewport = function(width, height) {\n // Ugly hack...\n SocialCalc.GetViewportInfo = function () {\n return {\n width: width,\n height: height,\n horizontalScrol: null,\n verticalScroll: null\n };\n }\n };\n\n // Modify CSS style of image with tiddler raw image syntax\n TiddlyWiki.getModifiedCssImageStyle = function(style) {\n var pattern = \".*?url(.+).*\";\n var regexp = \".*?url[(][\\\"]?.*?images/\\(.+?\\)[\\\"]?[)].*$\";\n\n if (!style) return false;\n if (!style.match(pattern)) return false;\n // File image extraction\n var reg = new RegExp(regexp, \"\");\n var tab = reg.exec(style);\n if (! tab || tab.length < 2) return false;\n // Get tiddler\n var tiddlerName = TiddlyWiki.pathImages+\"/\"+tab[1];\n var src = TiddlyWiki.getRawTiddlerImage(tiddlerName);\n if (!src) return false;\n var newStyle = style.replace(/url[(].+?[)]/, \"url(\"+src+\")\");\n \n return(newStyle);\n };\n\n // Modify \"src\" attribute of <img> node with tiddler raw image data\n TiddlyWiki.getModifiedImgSrc = function(src) {\n var regexp = \".*images/\\(.+?\\)$\";\n\n if (!src) return false;\n // File image extraction\n var reg = new RegExp(regexp, \"\");\n var tab = reg.exec(src);\n if (! tab || tab.length < 2) return false;\n // Get tiddler\n var tiddlerName = TiddlyWiki.pathImages+\"/\"+tab[1];\n var newSrc = TiddlyWiki.getRawTiddlerImage(tiddlerName);\n if (!newSrc) return false;\n\n return newSrc;\n };\n\n // Get CSS raw source of a tiddler image\n TiddlyWiki.getRawTiddlerImage = function(tiddlerName) {\n if (!$tw || !$tw.wiki) return false;\n // Check if it is an image tiddler\n if (!$tw.wiki.isImageTiddler(tiddlerName)) return false;\n var tiddler = $tw.wiki.getTiddler(tiddlerName);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) return false;\n var text = tiddler.fields.text;\n if (!text) return false;\n var type = tiddler.fields.type;\n // Render the appropriate element for the image type\n var src = \"\";\n switch(type) {\n case \"image/svg+xml\":\n src = \"data:image/svg+xml,\" + encodeURIComponent(text);\n break;\n default:\n src = \"data:\" + type + \";base64,\" + text;\n break;\n }\n\n return src;\n }; \n\n // Execute extension command\n TiddlyWiki.executeExtensionCmd = function(spreadsheet, com) {\n spreadsheet.editor.EditorScheduleSheetCommands(\"startcmdextension \"+com);\n };\n\n // Remove tiddler from sheet cache\n TiddlyWiki.removeTiddlerFromSheetCache = function(tiddlerTitle) {\n var fonc = \"TiddlyWiki.removeTiddlerFromSheetCache\";\n var sfsc = SocialCalc.Formula.SheetCache;\n if (sfsc.tiddlersToSheets[tiddlerTitle])\n sfsc.tiddlersToSheets[tiddlerTitle] = undefined;\n for (var sheetname in sfsc.sheets) {\n if (sfsc.sheets[sheetname].tiddlerTitle == tiddlerTitle) {\n delete sfsc.sheets[sheetname];\n sfsc.sheets[sheetname] = undefined;\n }\n }\n hack.log(\"Tiddler removed from cache: \"+tiddlerTitle, hack.recalcLink, fonc);\n };\n\n // Navigate to a tiddler.\n // Called by cell's link (cf. SocialCalc.expand_text_link()).\n TiddlyWiki.navigateToTiddler = function(tiddlerTitle) {\n var fonc = \"TiddlyWiki.navigateToTiddler\";\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n\n // Send a \"tm-navigate\" event from widget to tiddler\n var bounds = spreadsheet.tiddlyWiki.widget.domNodes[0].getBoundingClientRect();\n spreadsheet.tiddlyWiki.widget.dispatchEvent({\n type: \"tm-navigate\",\n navigateTo: tiddlerTitle,\n navigateFromTitle: spreadsheet.tiddlyWiki.tiddlerTitle,\n navigateFromNode: spreadsheet.tiddlyWiki.widget,\n navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height},\n navigateSuppressNavigation: false\n });\n };\n\n // Instance members\n\n TiddlyWiki.prototype = {\n\n // Resolve file path.\n //\n // Following behaviour apply only if SocialCalc's configuration's object property \"filesystem\"\n // is defined. If not, file is assumed to be a tiddler's title.\n //\n // File path resolution is inspired by Unix.\n // We make assumption that tiddler title follows classical Unix Path pattern\n // like : /dir1/dir2/ ... /dir/file. If not the case, file should be\n // in the directories of the PATH (see below), or completely out of path convention.\n // There is no notion of curent directory (if any).\n //\n // Unlike Unix, there is no notion of root directory or \"/\". TiddlyWiki has no\n // real filesystem so we can't rely on a root node. Relative versus absolute\n // path is deduced from the following. If the first caracter of a file\n // path is \"/\", and there is no more \"/\" after that, then the path is absolute.\n // In that case, the behavior is identical to Unix. A file path beginning with a \"/\"\n // will be directly converted in a tiddler title.\n // By default (and unlike Unix), malformed path like multiple \"/\" instead of one\n // are not accepted. For example \"//\" is not reduced to \"/\" and treated like a\n // path separator. It is the responsibility of the user to be clear about the significance of\n // it's file reference, path-like name or tiddler title.\n // With optionnal <flagNormalize> parameter set, malformed path are normalized like\n // Unix does.\n //\n // A file is searched under a collection of path directories, pre-defined in the PATH\n // variable. Those directories are absolute.\n // Syntax of the PATH variable :\n // <path1>';'<path2>';' ... ';'<pathN>\n // The PATH is defined in the widget's configuration object, under filesystem.PATH property.\n // The widget's configuration object is searched first in $:/config/SocialCalc tiddler of\n // \"application/json\" type, then in $:/plugins/SocialCalc/config-defaults tiddler.\n //\n // Search algorithm :\n // <file> : input file path.\n // PATH <- value of a \"path\"\n // if <PATH> exists then\n // for all <dir> in <PATH>\n // if tiddler <dir>/<file> found then return <dir>/<file>\n // end for\n // end if\n // if tiddler <file> found then return file\n //\n resolvePath: function(file, flagNormalize) {\n var fonc = \"TiddlyWiki.resolvePath\";\n\n hack.log(\"==<<== file = \"+file, hack.filesystem, fonc);\n\n if (!file) return null;\n var tiddlerTitle = \"\";\n var tiddler = false;\n if (!this.widgetConfiguration || !this.widgetConfiguration.filesystem) {\n hack.log(\"no filesystem in widget's configuration !\", hack.filesystem, fonc);\n return(file);\n }\n\n // Get PATH\n var tabPath = null;\n if (this.widgetConfiguration.filesystem.PATH && this.widgetConfiguration.filesystem.PATH != \"\")\n tabPath = this.widgetConfiguration.filesystem.PATH.split(/[\\s]*;[\\s]*/);\n hack.log(\"tabPath = \"+(tabPath ? tabPath.join(\" | \"): tabPath), hack.filesystem, fonc);\n\n var flagFind = false;\n \n if (!flagFind && tabPath) {\n // Search under PATH directories\n for (var i = 0; i < tabPath.length; i++) {\n var file1 = tabPath[i] + \"/\" + file;\n if (flagNormalize) {\n // File normalization\n file1 = file.replace(/[\\/][\\/]+/g, \"/\").replace(/\\/\\.\\//g, \"/\");\n }\n tiddlerTitle = file1;\n var tiddler2 = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler2) != \"undefined\") && tiddler2) {\n flagFind = true;\n break;\n }\n }\n }\n \n // Maybe a tiddler already\n if (!flagFind) {\n if (flagNormalize) {\n // File normalization\n file = file.replace(/[\\/][\\/]+/g, \"/\").replace(/\\/\\.\\//g, \"/\");\n }\n tiddlerTitle = file;\n }\n\n hack.log(\"==>>== tiddler = \"+tiddlerTitle, hack.filesystem, fonc);\n return tiddlerTitle;\n },\n\n // Get a tiddler calc page referenced in a page\n //\n // Status :\n // True if page found and loaded, false otherwise.\n //\n // A page reference appears in formulae to access data on other pages.\n // Exemple :\n // =\"My root calc data page\"!C3 aims to access C3 cell in a page named\n // \"My root calc data page\".\n // If widget's configuration object property \"filesystem\" is defined this page name is\n // a file path. Otherwise this is a tiddler's title.\n //\n getCalcPage: function(pageName) {\n var fonc = \"TiddlyWiki.getCalcPage\";\n\n hack.log(\"==<<== pageName = \"+pageName, hack.link, fonc);\n\n var spreadsheet = SocialCalc.GetSpreadsheetControlObject();\n var tiddlerTitle = this.resolvePath(pageName);\n hack.log(\"tiddlerTitle = \"+tiddlerTitle, hack.link, fonc);\n\n // Is the tiddler already referenced in cache ?\n if (SocialCalc.Formula.SheetCache.tiddlersToSheets[tiddlerTitle]) {\n // We just add the page to the cache\n SocialCalc.Formula.AddSheetToCache(pageName, null, null, tiddlerTitle);\n // Fake call to continue recalc\n SocialCalc.RecalcLoadedSheet(pageName, null, false, null, tiddlerTitle);\n hack.log(\"Sheet already in cache, tiddler not loaded: \"+tiddlerTitle, hack.recalcLink, fonc);\n } else {\n // We read the tiddler\n var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) return false;\n hack.log(\"checked tiddler\", hack.link, fonc);\n var calcData = tiddler.fields.text;\n if (!calcData) return false;\n hack.log(\"checked calcData\", hack.link, fonc);\n var parts = spreadsheet.DecodeSpreadsheetSave(calcData);\n if (!parts) return false;\n hack.log(\"checked parts\", hack.link, fonc);\n var page = calcData.substring(parts.sheet.start, parts.sheet.end);\n \n // Tell Socialcalc to load this sheet page and recalc\n SocialCalc.RecalcLoadedSheet(pageName, page, true, null, tiddlerTitle);\n hack.log(\"Tiddler loaded: \"+tiddlerTitle, hack.recalcLink, fonc);\n }\n return true;\n },\n\n // Add UI for extension commands.\n addExtensionCmdUI: function(spreadsheet) {\n // Save command button\n // First button on the left in the toobar.\n var scc = SocialCalc.Constants;\n var SCLoc = SocialCalc.LocalizeString;\n \n var divToolbar = null;\n var tabDiv = spreadsheet.spreadsheetDiv.getElementsByTagName(\"div\");\n if (!tabDiv || tabDiv.length == 0) return;\n for (var i = 0; i < tabDiv.length; i++) {\n if (tabDiv[i].getAttribute(\"id\") == spreadsheet.idPrefix+\"edittools\") {\n divToolbar = tabDiv[i];\n break;\n }\n }\n if (!divToolbar) return;\n var saveButton = document.createElement(\"img\");\n if (!saveButton) return;\n saveButton.id = spreadsheet.idPrefix + this.saveTodo.button.id;\n saveButton.style = \"vertical-align: bottom; border: 1px solid rgb(64, 64, 64); background-color: rgb(64, 64, 64); margin-right: 8px;\";\n saveButton.src = TiddlyWiki.getRawTiddlerImage(this.saveTodo.button.image);\n divToolbar.insertBefore(saveButton, divToolbar.getElementsByTagName(\"img\")[0]);\n var saveButtonStyle = {\n name: \"saveButton\",\n normalstyle: \"border:1px solid \"+scc.ISCButtonBorderNormal+\";background-color:\"+scc.ISCButtonBorderNormal+\";\",\n hoverstyle: \"border:1px solid \"+scc.ISCButtonBorderHover+\";background-color:\"+scc.ISCButtonBorderNormal+\";\",\n downstyle: \"border:1px solid \"+scc.ISCButtonBorderDown+\";background-color:\"+scc.ISCButtonDownBackground+\";\"\n };\n var saveButtonNeedSavingStyle = {\n name: \"saveButton\",\n normalstyle: \"border:1px solid \"+scc.ISCButtonBorderNormal+\";background-color:\"+this.saveTodo.button.needSavingBackgroundColor+\";\",\n hoverstyle: \"border:1px solid \"+scc.ISCButtonBorderHover+\";background-color:\"+this.saveTodo.button.needSavingBackgroundColor+\";\",\n downstyle: \"border:1px solid \"+scc.ISCButtonBorderDown+\";background-color:\"+this.saveTodo.button.needSavingBackgroundColor+\";\"\n };\n SocialCalc.TooltipRegister(saveButton, SCLoc(\"Save changes\"), {}, spreadsheet.spreadsheetDiv);\n var self = this;\n SocialCalc.ButtonRegister(spreadsheet.editor, saveButton, saveButtonStyle, {\n MouseDown: function() {\n TiddlyWiki.executeExtensionCmd(spreadsheet, TiddlyWiki.saveCommandKeyword);\n },\n Disabled: function() {}\n });\n\n // Remember initial style data\n this.saveTodo.button.index = SocialCalc.ButtonInfo.registeredElements.length - 1;\n this.saveTodo.button.style = saveButtonStyle;\n this.saveTodo.button.normalBackgroundColor = saveButton.style.backgroundColor;\n\n // Remember need saving style\n this.saveTodo.button.needSavingStyle = saveButtonNeedSavingStyle;\n },\n\n // Change the save button visual\n changeSaveButtonVisual: function(flagNeedSavingStyle) {\n // Get registered button element\n if (!SocialCalc.ButtonInfo.registeredElements || this.saveTodo.button.index == null) return;\n var elem = SocialCalc.ButtonInfo.registeredElements[this.saveTodo.button.index];\n if (elem.name != \"saveButton\") return;\n // Change style\n if (flagNeedSavingStyle) {\n elem.element.style.backgroundColor = this.saveTodo.button.needSavingBackgroundColor;\n elem.normalstyle = this.saveTodo.button.needSavingStyle.normalstyle;\n elem.hoverstyle = this.saveTodo.button.needSavingStyle.hoverstyle;\n elem.downstyle = this.saveTodo.button.needSavingStyle.downstyle;\n } else {\n elem.element.style.backgroundColor = this.saveTodo.button.normalBackgroundColor;\n elem.normalstyle = this.saveTodo.button.style.normalstyle;\n elem.hoverstyle = this.saveTodo.button.style.hoverstyle;\n elem.downstyle = this.saveTodo.button.style.downstyle;\n this.saveTodo.flagStart = false;\n }\n },\n\n // Add UI for import/export (cf. Clipboard tab).\n addImportExportUI: function(spreadsheet) {\n // The UI skeleton is defined in HTML. See SocialCalc.SpreadsheetControl(), clipboard tab.\n \n if (!spreadsheet.importExport) spreadsheet.importExport = {};\n\n // Populate format selection\n var select = document.getElementById(spreadsheet.idPrefix+\"clipboard-export-select-format\");\n if (!select) return;\n var tabFormat = [\"Tab-delimited\", \"CSV\", \"SocialCalc-save\"];\n select.length = 0;\n for (i=0; i < tabFormat.length; i++) {\n var name = tabFormat[i];\n select.options[i] = new Option(name, name);\n }\n select.options[0].selected = true;\n\n // Click on Export button\n var buttonExport = document.getElementById(spreadsheet.idPrefix+\"clipboard-export\");\n if (!buttonExport) return;\n buttonExport.addEventListener(\"click\", function() {\n TiddlyWiki.executeExtensionCmd(spreadsheet, TiddlyWiki.exportCommandKeyword);\n }, false);\n\n // Click on Import button \n var buttonImport = document.getElementById(spreadsheet.idPrefix+\"clipboard-import\");\n if (!buttonImport) return;\n buttonImport.addEventListener(\"DOMNodeRemoved\", function() {\n TiddlyWiki.executeExtensionCmd(spreadsheet, TiddlyWiki.importCommandKeyword);\n }, false);\n },\n\n // Tab click management for import/export (cf. Clipboard tab).\n clickImportExportUI: function(spreadsheet) {\n // Refresh export selection\n var tabNames = [];\n var select = document.getElementById(spreadsheet.idPrefix+\"clipboard-export-select-source\");\n if (!select) return;\n for (name in spreadsheet.sheet.names) {\n tabNames.push(name);\n }\n tabNames.sort();\n select.length = 0;\n select.options[0] = new Option(SocialCalc.LocalizeString(\"[Clipboard]\"));\n for (i=0; i < tabNames.length; i++) {\n var name = tabNames[i];\n select.options[i+1] = new Option(name, name);\n }\n select.options[0].selected = true;\n },\n\n // Add new commands\n addNewCommands: function(spreadsheet, sheetTiddlerTitle) {\n var self = this;\n\n // Extension commands callback\n var comTiddlywiki = function(cmdname, data, sheet, cmd, saveundo) {\n var fonc = \"addNewCommands/comTiddlywiki\";\n if (!cmdname || !sheet) return;\n\n if (cmdname == TiddlyWiki.saveCommandKeyword) {\n // SAVE SHEET TO TIDDLER\n // Activated by Ctrl-S or the toolbar save button.\n\n // Serialize sheet data\n var calcData = SocialCalc.SpreadsheetControlCreateSpreadsheetSave(spreadsheet);\n\n // Save data to tiddler\n if (!sheetTiddlerTitle) return;\n var tiddler = $tw.wiki.getTiddler(sheetTiddlerTitle);\n if (typeof(tiddler) == \"undefined\" || !tiddler) return;\n $tw.wiki.addTiddler(new $tw.Tiddler(tiddler, {type: TiddlyWiki.sheetTiddlerType, text: calcData}));\n \n // Remove tiddler from sheet cache to force a reload, then a recalc of all\n // sheets in SocialCalc widgets with references to this sheet.\n TiddlyWiki.removeTiddlerFromSheetCache(sheetTiddlerTitle);\n \n // Notification\n var language = TiddlyWiki.currentLanguage ? TiddlyWiki.currentLanguage : \"en-GB\";\n var tiddlerTitle = TiddlyWiki.pathLanguages + \"/\" + language + TiddlyWiki.saveNotificationTiddlerSuffix;\n var tiddlerNotification = $tw.wiki.getTiddler(tiddlerTitle);\n if ($tw.notifier) {\n if (typeof(tiddlerNotification) != \"undefined\" && tiddlerNotification)\n $tw.notifier.display(tiddlerTitle);\n else {\n // Try with default language\n tiddlerTitle = TiddlyWiki.pathLanguages + \"/\" + TiddlyWiki.defaultLanguage + TiddlyWiki.saveNotificationTiddlerSuffix;\n var tiddlerNotification1 = $tw.wiki.getTiddler(tiddlerTitle);\n if (typeof(tiddlerNotification1) != \"undefined\" && tiddlerNotification1)\n $tw.notifier.display(tiddlerTitle);\n }\n }\n\n // Give the save button it's normal aspect\n spreadsheet.tiddlyWiki.changeSaveButtonVisual(false);\n\n } else if (cmdname == TiddlyWiki.exportCommandKeyword) {\n // EXPORT DATA TO TIDDLER\n // Set type to \"text/plain\" and \"format\" field to \"tab\", \"csv\" or \"scsave\".\n\n var inputTiddler = document.getElementById(spreadsheet.idPrefix+\"clipboard-tiddler\");\n if (!inputTiddler) return;\n var tiddlerTitle = self.resolvePath(inputTiddler.value);\n if (!tiddlerTitle) return;\n\n // Choosen format\n var select = document.getElementById(spreadsheet.idPrefix+\"clipboard-export-select-format\");\n if (!select) return;\n var format = select.options[select.selectedIndex >= 0 ? select.selectedIndex : 0].text;\n if (format == \"Tab-delimited\") format = \"tab\";\n else if (format == \"CSV\") format = \"csv\";\n else format = \"scsave\";\n\n // Read and format data\n var data = \"\";\n select = document.getElementById(spreadsheet.idPrefix+\"clipboard-export-select-source\");\n if (!select) return;\n if (select.selectedIndex <= 0) {\n // Clipboard\n data = SocialCalc.ConvertSaveToOtherFormat(SocialCalc.Clipboard.clipboard, format);\n } else {\n // Named selection\n var name = spreadsheet.sheet.names[select.options[select.selectedIndex].text.toUpperCase()];\n if (!name || !name.definition) return;\n var sel = name.definition;\n var data = SocialCalc.ConvertSaveToOtherFormat(SocialCalc.CreateSheetSave(spreadsheet.editor.context.sheetobj, sel), format);\n }\n\n // Save data to tiddler\n var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n if (typeof(tiddler) != \"undefined\" && tiddler) {\n // Ask confirmation before smashing tiddler\n spreadsheet.tiddlyWiki.createDialog(spreadsheet, SocialCalc.Constants.s_clipboard_export_error_tiddler_exists + \" : <b>\"+tiddlerTitle+\"</b>.<br>\" + SocialCalc.Constants.s_clipboard_export_error_tiddler_overwrite, true, function() {\n $tw.wiki.addTiddler(new $tw.Tiddler({title: tiddlerTitle, type: TiddlyWiki.dataTiddlerType, text: data, format: format}));\n });\n } else\n $tw.wiki.addTiddler(new $tw.Tiddler({title: tiddlerTitle, type: TiddlyWiki.dataTiddlerType, text: data, format: format}));\n\n } else if (cmdname == TiddlyWiki.importCommandKeyword) {\n // IMPORT DATA TIDDLER TO CLIPBOARD\n // Expect \"format\" field to be \"tab\", \"csv\" or \"scsave\". If no format field, assume\n // Tab-delimited format.\n // Don't check tiddler's type.\n\n var inputTiddler = document.getElementById(spreadsheet.idPrefix+\"clipboard-tiddler\");\n if (!inputTiddler) return;\n var tiddlerTitle = self.resolvePath(inputTiddler.value);\n if (!tiddlerTitle) return;\n var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n if (typeof(tiddler) == \"undefined\" || !tiddler) return;\n var format = null;\n if (tiddler.fields)\n var format = tiddler.fields.format;\n if (format && (format != \"tab\") && (format != \"csv\") && (format != \"scsave\")) {\n alert(SocialCalc.Constants.s_clipboard_import_error_tiddler_format);\n return;\n }\n if (!format) format = \"tab\";\n var data = tiddler.fields.text;\n\n // Fill clipboard area with data\n var radioTab = document.getElementById(spreadsheet.idPrefix+\"clipboardformat-tab\");\n radioTab.click();\n SocialCalc.Clipboard.clipboard = SocialCalc.ConvertOtherFormatToSave(data, format) ;\n SocialCalc.SpreadsheetControlClipboardFormat(\"tab\");\n }\n };\n if (!spreadsheet.sheet || !spreadsheet.sheet.sci) return;\n spreadsheet.sheet.sci.CmdExtensionCallbacks[TiddlyWiki.saveCommandKeyword] = {func:comTiddlywiki, data:null};\n spreadsheet.sheet.sci.CmdExtensionCallbacks[TiddlyWiki.exportCommandKeyword] = {func:comTiddlywiki, data:null};\n spreadsheet.sheet.sci.CmdExtensionCallbacks[TiddlyWiki.importCommandKeyword] = {func:comTiddlywiki, data:null};\n \n // Add UI for the commands (buttons in the toolbar)\n this.addExtensionCmdUI(spreadsheet);\n },\n\n // Create a simple modal dialog to query a OK or Cancel answer and do something if OK\n createDialog: function(spreadsheet, mess, flagDoIfOK, func) {\n // (Inspired by SocialCalc.SpreadsheetControl.DoFunctionList())\n\n self = this;\n var scc = SocialCalc.Constants;\n var idp = spreadsheet.idPrefix+\"dialog\";\n\n // Visual\n var win = document.createElement(\"div\");\n win.id = idp;\n win.style.position = \"absolute\";\n var vp = SocialCalc.GetViewportInfo();\n var pos = SocialCalc.GetElementPositionWithScroll(spreadsheet.spreadsheetDiv);\n win.style.top = ((vp.height/2)-pos.top)+\"px\";\n win.style.left = ((vp.width/2)-pos.left)+\"px\";\n win.style.zIndex = 100;\n win.style.backgroundColor = \"#FFF\";\n win.style.border = \"1px solid black\";\n\n var str =\n '<div class=\"SocialCalc-dialog\" style=\"width:100%;background-color:#DDD;\">'+\n ' <table>'+\n ' <tr>'+\n ' <td>'+\n ' <div style=\"padding:6px 6px 6px 6px;font-size:small;\">'+ mess + '</div>'+\n ' </td>'+\n ' </tr>'+\n ' <tr>'+\n ' <td>'+\n ' <div style=\"text-align:right;padding:12px 6px 6px 6px;font-size:small;\">'+\n ' <input type=\"button\" value=\"%loc!OK!\" id=\"'+idp+'-ok\" style=\"font-size:smaller;\"> '+\n ' <input type=\"button\" value=\"%loc!Cancel!\" id=\"'+idp+'-cancel\" style=\"font-size:smaller;\">'+\n ' </div>'+\n ' </td>'+\n ' </tr>'+\n ' </table>'+\n '</div>';\n\n win.innerHTML = SocialCalc.LocalizeSubstrings(str);\n spreadsheet.spreadsheetDiv.appendChild(win);\n\n // Buttons behaviour\n var deleteWin = function() {\n if (win.parentNode)\n win.parentNode.removeChild(win);\n SocialCalc.KeyboardFocus();\n };\n var buttonOK = document.getElementById(idp+\"-ok\");\n buttonOK.addEventListener(\"click\", function() {\n if (flagDoIfOK && func) func();\n deleteWin();\n }, false);\n var buttonCancel = document.getElementById(idp+\"-cancel\");\n buttonCancel.addEventListener(\"click\", function() {\n deleteWin();\n }, false);\n },\n\n // Monitoring\n monitor: function(spreadsheet) {\n var self = this;\n\n // Register an editor callback (called at almost every steps)\n this.monitorCallback = function(cmdComplete) {\n //console.log(\"TiddlyWiki.monitorCallback: cmd = \"+cmdComplete);\n var tabTokens = cmdComplete.toLowerCase().split(/[\\s]+/);\n var cmd = tabTokens[0];\n var doChange = function(tab) {\n var tabCmdNoChange = [\"copy\", \"cut\", \"clearclipboard\", \"recalc\", \"redisplay\"];\n var cmd = tab[0];\n for (var i = 0; i < tabCmdNoChange.length; i++) {\n if (cmd == tabCmdNoChange[i]) return false;\n }\n if (cmd == \"loadclipboard\" && tabTokens.length == 1) return false;\n return true;\n };\n\n // Change button color when need saving\n if (self.saveTodo.flagStart && doChange(tabTokens)) {\n self.changeSaveButtonVisual(true);\n }\n }\n }\n\n };\n\n exports.TiddlyWiki = TiddlyWiki;\n\n})();",
"title": "$:/plugins/rboue/SocialCalc/tiddlywiki.js",
"type": "application/javascript",
"module-type": "library"
}
}
}
{
"tiddlers": {
"$:/plugins/rboue/Three.js/Lib/three-min.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/three-min.js",
"module-type": "library",
"text": "(function(){\nvar THREE={REVISION:\"68\"};TiddlyWiki||\"object\"!==typeof module||(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;\nTHREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;\nTHREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005;\nTHREE.LinearFilter=1006;THREE.LinearMipMapNearestFilter=1007;THREE.LinearMipMapLinearFilter=1008;THREE.UnsignedByteType=1009;THREE.ByteType=1010;THREE.ShortType=1011;THREE.UnsignedShortType=1012;THREE.IntType=1013;THREE.UnsignedIntType=1014;THREE.FloatType=1015;THREE.UnsignedShort4444Type=1016;THREE.UnsignedShort5551Type=1017;THREE.UnsignedShort565Type=1018;THREE.AlphaFormat=1019;THREE.RGBFormat=1020;THREE.RGBAFormat=1021;THREE.LuminanceFormat=1022;THREE.LuminanceAlphaFormat=1023;\nTHREE.RGB_S3TC_DXT1_Format=2001;THREE.RGBA_S3TC_DXT1_Format=2002;THREE.RGBA_S3TC_DXT3_Format=2003;THREE.RGBA_S3TC_DXT5_Format=2004;THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)};\nTHREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){a instanceof THREE.Color?this.copy(a):\"number\"===typeof a?this.setHex(a):\"string\"===typeof a&&this.setStyle(a);return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:\n.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\\((\\d+), ?(\\d+), ?(\\d+)\\)$/i.test(a))return a=/^rgb\\((\\d+), ?(\\d+), ?(\\d+)\\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\\((\\d+)\\%, ?(\\d+)\\%, ?(\\d+)\\%\\)$/i.test(a))return a=/^rgb\\((\\d+)\\%, ?(\\d+)\\%, ?(\\d+)\\%\\)$/i.exec(a),this.r=\nMath.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\\#([0-9a-f]{6})$/i.test(a))return a=/^\\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g=\na.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<<\n8^255*this.b<<0},getHexString:function(){return(\"000000\"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(c<d?6:0);break;case c:g=(d-b)/k+2;break;case d:g=(b-c)/k+4}g/=6}a.h=g;a.s=f;a.l=h;return a},getStyle:function(){return\"rgb(\"+(255*this.r|0)+\",\"+(255*this.g|0)+\",\"+(255*this.b|0)+\")\"},offsetHSL:function(a,\nb,c){var d=this.getHSL();d.h+=a;d.s+=b;d.l+=c;this.setHSL(d.h,d.s,d.l);return this},add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,b){this.r=a.r+b.r;this.g=a.g+b.g;this.b=a.b+b.b;return this},addScalar:function(a){this.r+=a;this.g+=a;this.b+=a;return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*=a;this.b*=a;return this},lerp:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;\nthis.b+=(a.b-this.b)*b;return this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){this.r=a[0];this.g=a[1];this.b=a[2];return this},toArray:function(){return[this.r,this.g,this.b]},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};\nTHREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,\ndarkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,\ngrey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,\nlime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,\npalegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,\ntomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};THREE.Quaternion=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1};\nTHREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;\nthis._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===a instanceof THREE.Euler)throw Error(\"THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);\"XYZ\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):\"YXZ\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=\nc*d*h-f*g*e,this._w=c*d*e+f*g*h):\"ZXY\"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):\"ZYX\"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):\"YZX\"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):\"XZY\"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,\nb){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],l=c+f+b;0<l?(c=.5/Math.sqrt(l+1),this._w=.25/c,this._x=(k-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=\n.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=\n-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},\nmultiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.\"),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn(\"THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.\");\nreturn a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+\nthis._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,\nthis._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};\nTHREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error(\"index is out of range: \"+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,\nb){if(void 0!==b)return console.warn(\"THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},\nsubVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);return this},clamp:function(a,\nb){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},\nroundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=\nthis.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a){this.x=a[0];this.y=a[1];return this},toArray:function(){return[this.x,this.y]},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};\nTHREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(\"index is out of range: \"+\na);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),\nthis.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.\"),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=\na.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error(\"THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.\");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x,\nc=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=\n(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,l=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-l*-f;this.y=k*a+b*-f+l*-e-h*-g;this.z=l*a+b*-g+h*-f-k*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;\nthis.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=\nb.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=\n0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+\nMath.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.\"),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=\ne*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this},projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===\na&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error(\"THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.\")},\nsetEulerFromQuaternion:function(a,b){console.error(\"THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.\")},getPositionFromMatrix:function(a){console.warn(\"THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().\");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn(\"THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().\");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,\nb){console.warn(\"THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().\");return this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=\na;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1};\nTHREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error(\"index is out of range: \"+a);}},getComponent:function(a){switch(a){case 0:return this.x;\ncase 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(\"index is out of range: \"+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.\"),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},\naddVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn(\"THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.\"),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=\nthis.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},\nsetAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var l=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+l-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;l=(l+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>l?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>l?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),\nb=d/c,d=k/c):.01>l?(c=b=.707106781,d=0):(d=Math.sqrt(l),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+l-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);\nreturn this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);\nreturn this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);\nreturn this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},\nsetLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,\nthis.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders=\"XYZ YZX ZXY XZY YXZ ZYX\".split(\" \");THREE.Euler.DefaultOrder=\"XYZ\";\nTHREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=\na._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;\"XYZ\"===b?(this._y=Math.asin(c(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=Math.atan2(q,k),this._z=0)):\"YXZ\"===b?(this._x=Math.asin(-c(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)):(this._y=\nMath.atan2(-n,e),this._z=0)):\"ZXY\"===b?(this._x=Math.asin(c(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):\"ZYX\"===b?(this._y=Math.asin(-c(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):\"YZX\"===b?(this._z=Math.asin(c(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(g,d))):\"XZY\"===b?(this._z=Math.asin(-c(f,\n-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,e)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn(\"THREE.Euler: .setFromRotationMatrix() given unsupported order: \"+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,f=a.y*a.y,g=a.z*a.z,h=a.w*a.w;b=b||this._order;\"XYZ\"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-f+g),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*(a.z*a.w-a.x*\na.y),h+e-f-g)):\"YXZ\"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-f+g),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+f-g)):\"ZXY\"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-f+g),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+f-g)):\"ZYX\"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-f+g),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-f-g)):\"YZX\"===b?(this._x=Math.atan2(2*\n(a.x*a.w-a.z*a.y),h-e+f-g),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-f-g),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):\"XZY\"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+f-g),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-f-g),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn(\"THREE.Euler: .setFromQuaternion() given unsupported order: \"+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);\nthis.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};\nTHREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};\nTHREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,\nb){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);\nthis.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)};\nTHREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(d);this.max.copy(b).add(d);return this}}(),copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=\nthis.min.y=Infinity;this.max.x=this.max.y=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(a){return(a||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);\nthis.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>\nthis.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&\na.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)};\nTHREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(d);this.max.copy(b).add(d);return this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;b.updateMatrixWorld(!0);\nthis.makeEmpty();b.traverse(function(b){if(void 0!==b.geometry&&void 0!==b.geometry.vertices)for(var e=b.geometry.vertices,f=0,g=e.length;f<g;f++)a.copy(e[f]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)});return this}}(),copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},\ncenter:function(a){return(a||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(a){return(a||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y||a.z<\nthis.min.z||a.z>this.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<\nthis.min.z||a.min.z>this.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);\nthis.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);\na[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};\nTHREE.Matrix3=function(a,b,c,d,e,f,g,h,k){var l=this.elements=new Float32Array(9);l[0]=void 0!==a?a:1;l[3]=b||0;l[6]=c||0;l[1]=d||0;l[4]=void 0!==e?e:1;l[7]=f||0;l[2]=g||0;l[5]=h||0;l[8]=void 0!==k?k:1};\nTHREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,g,h,k){var l=this.elements;l[0]=a;l[3]=b;l[6]=c;l[1]=d;l[4]=e;l[7]=f;l[2]=g;l[5]=h;l[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.\");return a.applyMatrix3(this)},\nmultiplyVector3Array:function(a){console.warn(\"THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.\");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=\na;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],k=a[7],a=a[8];return b*f*a-b*g*k-c*e*a+c*g*h+d*e*k-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];\nc=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error(\"Matrix3.getInverse(): can't invert matrix, determinant is 0\");console.warn(\"Matrix3.getInverse(): can't invert matrix, determinant is 0\");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];\na[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],\na[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p){var v=this.elements=new Float32Array(16);v[0]=void 0!==a?a:1;v[4]=b||0;v[8]=c||0;v[12]=d||0;v[1]=e||0;v[5]=void 0!==f?f:1;v[9]=g||0;v[13]=h||0;v[2]=k||0;v[6]=l||0;v[10]=void 0!==n?n:1;v[14]=q||0;v[3]=r||0;v[7]=t||0;v[11]=s||0;v[15]=void 0!==p?p:1};\nTHREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=h;v[2]=k;v[6]=l;v[10]=n;v[14]=q;v[3]=r;v[7]=t;v[11]=s;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn(\"THREEMatrix4: .extractPosition() has been renamed to .copyPosition().\");return this.copyPosition(a)},\ncopyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&\nconsole.error(\"THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.\");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if(\"XYZ\"===a.order){a=f*h;var k=f*e,l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=l+k*d;b[10]=f*g}else\"YXZ\"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,\nb[10]=f*g):\"ZXY\"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):\"ZYX\"===a.order?(a=f*h,k=f*e,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):\"YZX\"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):\"XZY\"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*\ne-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn(\"THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().\");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-\n(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),\nmultiply:function(a,b){return void 0!==b?(console.warn(\"THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.\"),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],q=c[9],r=c[13],t=c[2],s=c[6],p=c[10],v=c[14],w=c[3],u=c[7],D=c[11],c=c[15],A=d[0],x=d[4],C=d[8],I=d[12],z=d[1],y=d[5],K=d[9],N=d[13],ba=d[2],P=d[6],O=d[10],J=d[14],E=d[3],\nQ=d[7],L=d[11],d=d[15];e[0]=f*A+g*z+h*ba+k*E;e[4]=f*x+g*y+h*P+k*Q;e[8]=f*C+g*K+h*O+k*L;e[12]=f*I+g*N+h*J+k*d;e[1]=l*A+n*z+q*ba+r*E;e[5]=l*x+n*y+q*P+r*Q;e[9]=l*C+n*K+q*O+r*L;e[13]=l*I+n*N+q*J+r*d;e[2]=t*A+s*z+p*ba+v*E;e[6]=t*x+s*y+p*P+v*Q;e[10]=t*C+s*K+p*O+v*L;e[14]=t*I+s*N+p*J+v*d;e[3]=w*A+u*z+D*ba+c*E;e[7]=w*x+u*y+D*P+c*Q;e[11]=w*C+u*K+D*O+c*L;e[15]=w*I+u*N+D*J+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];\nc[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.\");\nreturn a.applyProjection(this)},multiplyVector4:function(a){console.warn(\"THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn(\"THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.\");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=\nb.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn(\"THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.\");a.transformDirection(this)},crossVector:function(a){console.warn(\"THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.\");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=\na[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],n=a[6],q=a[10],r=a[14];return a[3]*(+e*h*n-d*k*n-e*g*q+c*k*q+d*g*r-c*h*r)+a[7]*(+b*h*r-b*k*q+e*f*q-d*f*r+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*r-e*f*n+c*f*r+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*q+d*f*n-c*f*q+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,\nb){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn(\"THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.\");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=\nthis.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],q=d[13],r=d[2],t=d[6],s=d[10],p=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=n*p*w-q*s*w+q*t*u-l*p*u-n*t*d+l*s*d;c[4]=h*s*w-g*p*w-h*t*u+f*p*u+g*t*d-f*s*d;c[8]=g*q*w-h*n*w+h*l*u-f*q*u-g*l*d+f*n*d;c[12]=h*n*t-g*q*t-h*l*s+f*q*s+g*l*p-f*n*p;c[1]=q*s*v-n*p*v-q*r*u+k*p*u+n*r*d-k*s*d;c[5]=g*p*v-h*s*v+h*r*u-e*p*u-g*r*d+e*s*d;c[9]=h*n*v-g*q*v-h*k*\nu+e*q*u+g*k*d-e*n*d;c[13]=g*q*r-h*n*r+h*k*s-e*q*s-g*k*p+e*n*p;c[2]=l*p*v-q*t*v+q*r*w-k*p*w-l*r*d+k*t*d;c[6]=h*t*v-f*p*v-h*r*w+e*p*w+f*r*d-e*t*d;c[10]=f*q*v-h*l*v+h*k*w-e*q*w-f*k*d+e*l*d;c[14]=h*l*r-f*q*r-h*k*t+e*q*t+f*k*p-e*l*p;c[3]=n*t*v-l*s*v-n*r*w+k*s*w+l*r*u-k*t*u;c[7]=f*s*v-g*t*v+g*r*w-e*s*w-f*r*u+e*t*u;c[11]=g*l*v-f*n*v-g*k*w+e*n*w+f*k*u-e*l*u;c[15]=f*n*r-g*l*r+g*k*t-e*n*t-f*k*s+e*l*s;c=e*c[0]+k*c[4]+r*c[8]+v*c[12];if(0==c){if(b)throw Error(\"Matrix4.getInverse(): can't invert matrix, determinant is 0\");\nconsole.warn(\"Matrix4.getInverse(): can't invert matrix, determinant is 0\");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn(\"THREE.Matrix4: .translate() has been removed.\")},rotateX:function(a){console.warn(\"THREE.Matrix4: .rotateX() has been removed.\")},rotateY:function(a){console.warn(\"THREE.Matrix4: .rotateY() has been removed.\")},rotateZ:function(a){console.warn(\"THREE.Matrix4: .rotateZ() has been removed.\")},rotateByAxis:function(a,b){console.warn(\"THREE.Matrix4: .rotateByAxis() has been removed.\")},\nscale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,\n0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,\n0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,l=1/k;b.elements[0]*=c;b.elements[1]*=\nc;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=l;b.elements[9]*=l;b.elements[10]*=l;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));\nvar e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a=\nthis.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};\nTHREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);\nvar d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(.5),f=b.clone().sub(a).normalize(),g=.5*a.distanceTo(b),h=\nthis.origin.clone().sub(e);a=-this.direction.dot(f);b=h.dot(this.direction);var k=-h.dot(f),l=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=g*n,0<=h?q>=-r?q<=r?(g=1/n,h*=g,q*=g,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+l):(q=g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):(q=-g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l):q<=-r?(h=Math.max(0,-(-a*g+b)),q=0<h?-g:Math.min(Math.max(-g,-k),g),a=-h*h+q*(q+2*k)+l):q<=r?(h=0,q=Math.min(Math.max(-g,-k),g),a=q*(q+2*k)+l):(h=Math.max(0,-(a*g+b)),q=0<h?g:Math.min(Math.max(-g,\n-k),g),a=-h*h+q*(q+2*k)+l)):(q=0<a?-g:g,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+l);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(f.clone().multiplyScalar(q).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;if(e>f)return null;f=Math.sqrt(f-e);e=d-f;\nd+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;\nreturn function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==\nc)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;\ne=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0};\nTHREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f<g;f++)e=Math.max(e,d.distanceToSquared(b[f]));this.radius=Math.sqrt(e);return this}}(),copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=\nthis.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);\nreturn a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};\nTHREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};\nTHREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],q=c[9],r=c[10],t=c[11],s=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(f-a,l-g,t-n,c-s).normalize();b[1].setComponents(f+\na,l+g,t+n,c+s).normalize();b[2].setComponents(f+d,l+h,t+q,c+p).normalize();b[3].setComponents(f-d,l-h,t-q,c-p).normalize();b[4].setComponents(f-e,l-k,t-r,c-v).normalize();b[5].setComponents(f+e,l+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,\nc=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),\ncontainsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};\nTHREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,\nc);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,\nb){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);if(0==f){if(0==this.distanceToPoint(b.start))return d.copy(b.start)}else return f=-(b.start.dot(this.normal)+this.constant)/f,0>f||1<f?void 0:d.copy(e).multiplyScalar(f).add(b.start)}}(),\ncoplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);g.applyMatrix4(d);this.setFromNormalAndCoplanarPoint(f,g);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&\na.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}};\nTHREE.Math={generateUUID:function(){var a=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".split(\"\"),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]=\"-\":14==e?b[e]=\"4\":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join(\"\")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=\nb)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},sign:function(a){return 0>a?-1:0<a?1:0},degToRad:function(){var a=Math.PI/180;return function(b){return b*\na}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}};\nTHREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,n,q,r;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+\n2;l=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,q.x,r.x,g,h,k);d.y=b(l.y,n.y,q.y,r.y,g,h,k);d.z=b(l.z,n.z,q.z,r.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=\na/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(k.copy(d).clone());\nh.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();\nTHREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0==l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}();\nTHREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();\nTHREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||\nnew THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},\nclone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};\nTHREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),\na=.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};\nTHREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&\nc[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};\n(function(a){a.Raycaster=function(b,c,f,g){this.ray=new a.Ray(b,c);this.near=f||0;this.far=g||Infinity;this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,f,g){a.raycast(b,f);if(!0===g){a=a.children;g=0;for(var h=a.length;g<h;g++)c(a[g],b,f,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1E-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},intersectObject:function(a,e){var f=[];c(a,this,f,e);\nf.sort(b);return f},intersectObjects:function(a,e){for(var f=[],g=0,h=a.length;g<h;g++)c(a[g],this,f,e);f.sort(b);return f}}})(THREE);\nTHREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.parent=void 0;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},\nscale:{enumerable:!0,value:d}});this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);\nTHREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn(\"THREE.Object3D: .eulerOrder has been moved to .rotation.order.\");return this.rotation.order},set eulerOrder(a){console.warn(\"THREE.Object3D: .eulerOrder has been moved to .rotation.order.\");this.rotation.order=a},get useQuaternion(){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},set useQuaternion(a){console.warn(\"THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.\")},\napplyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){a.setFromAxisAngle(b,\nc);this.quaternion.multiply(a);return this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));\nreturn this}}(),translate:function(a,b){console.warn(\"THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.\");return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,\nb)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error(\"THREE.Object3D.add:\",\na,\"can't be added as a child of itself.\"),this;if(a instanceof THREE.Object3D){void 0!==a.parent&&a.parent.remove(a);a.parent=this;a.dispatchEvent({type:\"added\"});this.children.push(a);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.__addObject(a)}else console.error(\"THREE.Object3D.add:\",a,\"is not an instance of THREE.Object3D.\");return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);\nif(-1!==b){a.parent=void 0;a.dispatchEvent({type:\"removed\"});this.children.splice(b,1);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.__removeObject(a)}},raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverseVisible(a)}},getObjectById:function(a,b){for(var c=0,d=this.children.length;c<\nd;c++){var e=this.children[c];if(e.id===a||!0===b&&(e=e.getObjectById(a,b),void 0!==e))return e}},getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn(\"THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().\");return this.getObjectByName(a,b)},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);\nthis.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);\na.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===\nb)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;\nTHREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;r.push(a);t++;q++;return a}return r[q++]}function b(){if(p===w){var a=new THREE.RenderableFace;v.push(a);w++;p++;return a}return v[p++]}function c(){if(D===x){var a=new THREE.RenderableLine;A.push(a);x++;D++;return a}return A[D++]}function d(){if(I===y){var a=new THREE.RenderableSprite;z.push(a);y++;I++;return a}return z[I++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function f(a,b){var c=0,d=\n1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var g,h,k=[],l=0,n,q,r=[],t=0,s,p,v=[],w=0,u,D,A=[],x=0,C,I,z=[],y=0,K={objects:[],lights:[],elements:[]},N=new THREE.Vector3,ba=new THREE.Vector3,P=new THREE.Vector3,O=new THREE.Vector3,J=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,\n-1,-1),new THREE.Vector3(1,1,1)),Q=new THREE.Box3,L=Array(3),R=new THREE.Matrix4,B=new THREE.Matrix4,S,V=new THREE.Matrix4,W=new THREE.Matrix3,H=new THREE.Frustum,oa=new THREE.Vector4,$=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);B.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(B)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);B.multiplyMatrices(c.matrixWorld,\na);return b.applyProjection(B)}}();this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var X=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(S);c.copy(b).applyMatrix4(B);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a,\nb,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(Q.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l,\ncheckBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;K.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t);\ns.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;K.elements.push(s)}}}};this.projectScene=function(n,t,w,v){I=D=p=0;K.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));B.multiplyMatrices(t.projectionMatrix,\nR);H.setFromMatrix(B);h=0;K.objects.length=0;K.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)K.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===H.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(O.setFromMatrixPosition(a.matrixWorld),O.applyProjection(B),g.z=O.z);K.objects.push(g)}});\n!0===w&&K.objects.sort(e);n=0;for(w=K.objects.length;n<w;n++){var A=K.objects[n].object,x=A.geometry;X.setObject(A);S=A.matrixWorld;q=0;if(A instanceof THREE.Mesh)if(x instanceof THREE.BufferGeometry){var z=x.attributes,A=x.offsets;if(void 0!==z.position){for(var G=z.position.array,x=0,y=G.length;x<y;x+=3)X.pushVertex(G[x],G[x+1],G[x+2]);if(void 0!==z.normal)for(var L=z.normal.array,x=0,y=L.length;x<y;x+=3)X.pushNormal(L[x],L[x+1],L[x+2]);if(void 0!==z.uv)for(L=z.uv.array,x=0,y=L.length;x<y;x+=2)X.pushUv(L[x],\nL[x+1]);if(void 0!==z.index)if(z=z.index.array,0<A.length)for(n=0;n<A.length;n++)for(y=A[n],G=y.index,x=y.start,y=y.start+y.count;x<y;x+=3)X.pushTriangle(z[x]+G,z[x+1]+G,z[x+2]+G);else for(x=0,y=z.length;x<y;x+=3)X.pushTriangle(z[x],z[x+1],z[x+2]);else for(x=0,y=G.length/3;x<y;x+=3)X.pushTriangle(x,x+1,x+2)}}else{if(x instanceof THREE.Geometry){var Q=x.vertices,y=x.faces,z=x.faceVertexUvs[0];W.getNormalMatrix(S);for(var G=A.material instanceof THREE.MeshFaceMaterial,L=!0===G?A.material:null,E=0,ca=\nQ.length;E<ca;E++){var la=Q[E];X.pushVertex(la.x,la.y,la.z)}Q=0;for(E=y.length;Q<E;Q++){var ca=y[Q],qa=!0===G?L.materials[ca.materialIndex]:A.material;if(void 0!==qa){var ua=qa.side,la=r[ca.a],ja=r[ca.b],Fa=r[ca.c];if(!0===qa.morphTargets){var va=x.morphTargets,Ka=A.morphTargetInfluences,aa=la.position,ra=ja.position,Da=Fa.position;N.set(0,0,0);ba.set(0,0,0);P.set(0,0,0);for(var Qa=0,cb=va.length;Qa<cb;Qa++){var Ga=Ka[Qa];if(0!==Ga){var xa=va[Qa].vertices;N.x+=(xa[ca.a].x-aa.x)*Ga;N.y+=(xa[ca.a].y-\naa.y)*Ga;N.z+=(xa[ca.a].z-aa.z)*Ga;ba.x+=(xa[ca.b].x-ra.x)*Ga;ba.y+=(xa[ca.b].y-ra.y)*Ga;ba.z+=(xa[ca.b].z-ra.z)*Ga;P.x+=(xa[ca.c].x-Da.x)*Ga;P.y+=(xa[ca.c].y-Da.y)*Ga;P.z+=(xa[ca.c].z-Da.z)*Ga}}la.position.add(N);ja.position.add(ba);Fa.position.add(P);X.projectVertex(la);X.projectVertex(ja);X.projectVertex(Fa)}if(!1!==X.checkTriangleVisibility(la,ja,Fa)){va=X.checkBackfaceCulling(la,ja,Fa);if(ua!==THREE.DoubleSide){if(ua===THREE.FrontSide&&!1===va)continue;if(ua===THREE.BackSide&&!0===va)continue}s=\nb();s.id=A.id;s.v1.copy(la);s.v2.copy(ja);s.v3.copy(Fa);s.normalModel.copy(ca.normal);!1!==va||ua!==THREE.BackSide&&ua!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(W).normalize();Ka=ca.vertexNormals;aa=0;for(ra=Math.min(Ka.length,3);aa<ra;aa++)Da=s.vertexNormalsModel[aa],Da.copy(Ka[aa]),!1!==va||ua!==THREE.BackSide&&ua!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();s.vertexNormalsLength=Ka.length;ua=z[Q];if(void 0!==ua)for(va=0;3>va;va++)s.uvs[va].copy(ua[va]);\ns.color=ca.color;s.material=qa;s.z=(la.positionScreen.z+ja.positionScreen.z+Fa.positionScreen.z)/3;K.elements.push(s)}}}}}else if(A instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(z=x.attributes,void 0!==z.position){G=z.position.array;x=0;for(y=G.length;x<y;x+=3)X.pushVertex(G[x],G[x+1],G[x+2]);if(void 0!==z.index)for(z=z.index.array,x=0,y=z.length;x<y;x+=2)X.pushLine(z[x],z[x+1]);else for(z=A.type===THREE.LinePieces?2:1,x=0,y=G.length/3-1;x<y;x+=z)X.pushLine(x,x+1)}}else{if(x instanceof\nTHREE.Geometry&&(V.multiplyMatrices(B,S),Q=A.geometry.vertices,0!==Q.length))for(la=a(),la.positionScreen.copy(Q[0]).applyMatrix4(V),z=A.type===THREE.LinePieces?2:1,E=1,ca=Q.length;E<ca;E++)la=a(),la.positionScreen.copy(Q[E]).applyMatrix4(V),0<(E+1)%z||(ja=r[q-2],oa.copy(la.positionScreen),$.copy(ja.positionScreen),!0===f(oa,$)&&(oa.multiplyScalar(1/oa.w),$.multiplyScalar(1/$.w),u=c(),u.id=A.id,u.v1.positionScreen.copy(oa),u.v2.positionScreen.copy($),u.z=Math.max(oa.z,$.z),u.material=A.material,A.material.vertexColors===\nTHREE.VertexColors&&(u.vertexColors[0].copy(A.geometry.colors[E]),u.vertexColors[1].copy(A.geometry.colors[E-1])),K.elements.push(u)))}else A instanceof THREE.Sprite&&(J.set(S.elements[12],S.elements[13],S.elements[14],1),J.applyMatrix4(B),x=1/J.w,J.z*=x,-1<=J.z&&1>=J.z&&(C=d(),C.id=A.id,C.x=J.x*x,C.y=J.y*x,C.z=J.z,C.object=A,C.rotation=A.rotation,C.scale.x=A.scale.x*Math.abs(C.x-(J.x+t.projectionMatrix.elements[0])/(J.w+t.projectionMatrix.elements[12])),C.scale.y=A.scale.y*Math.abs(C.y-(J.y+t.projectionMatrix.elements[5])/\n(J.w+t.projectionMatrix.elements[13])),C.material=A.material,K.elements.push(C)))}!0===v&&K.elements.sort(e);return K}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0};\nTHREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};\nTHREE.Face4=function(a,b,c,d,e,f,g){console.warn(\"THREE.Face4 has been removed. A THREE.Face3 will be created instead.\");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b};\nTHREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=\nc;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){console.warn(\"THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Uint8Attribute=function(a,b){console.warn(\"THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint8ClampedAttribute=function(a,b){console.warn(\"THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Int16Attribute=function(a,b){console.warn(\"THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint16Attribute=function(a,b){console.warn(\"THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Int32Attribute=function(a,b){console.warn(\"THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Uint32Attribute=function(a,b){console.warn(\"THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.Float32Attribute=function(a,b){console.warn(\"THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};THREE.Float64Attribute=function(a,b){console.warn(\"THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.\");return new THREE.BufferAttribute(a,b)};\nTHREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.attributes={};this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};\nTHREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn(\"THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).\"),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),\nb.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute(\"position\",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute(\"normal\",new THREE.BufferAttribute(l,3));if(f!==\nTHREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute(\"color\",new THREE.BufferAttribute(n,3))}if(!0===g){var q=new Float32Array(6*d.length);this.addAttribute(\"uvs\",new THREE.BufferAttribute(q,2))}for(var r=0,t=0,s=0;r<d.length;r++,t+=6,s+=9){var p=d[r],v=c[p.a],w=c[p.b],u=c[p.c];k[s]=v.x;k[s+1]=v.y;k[s+2]=v.z;k[s+3]=w.x;k[s+4]=w.y;k[s+5]=w.z;k[s+6]=u.x;k[s+7]=u.y;k[s+8]=u.z;!0===h?(v=p.vertexNormals[0],w=p.vertexNormals[1],u=p.vertexNormals[2],l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=\nw.x,l[s+4]=w.y,l[s+5]=w.z,l[s+6]=u.x,l[s+7]=u.y,l[s+8]=u.z):(v=p.normal,l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=v.x,l[s+4]=v.y,l[s+5]=v.z,l[s+6]=v.x,l[s+7]=v.y,l[s+8]=v.z);f===THREE.FaceColors?(p=p.color,n[s]=p.r,n[s+1]=p.g,n[s+2]=p.b,n[s+3]=p.r,n[s+4]=p.g,n[s+5]=p.b,n[s+6]=p.r,n[s+7]=p.g,n[s+8]=p.b):f===THREE.VertexColors&&(v=p.vertexColors[0],w=p.vertexColors[1],p=p.vertexColors[2],n[s]=v.r,n[s+1]=v.g,n[s+2]=v.b,n[s+3]=w.r,n[s+4]=w.g,n[s+5]=w.b,n[s+6]=p.r,n[s+7]=p.g,n[s+8]=p.b);!0===g&&(p=e[0][r][0],\nv=e[0][r][1],w=e[0][r][2],q[t]=p.x,q[t+1]=p.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=w.x,q[t+5]=w.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=this.attributes.position.array;if(a){var b=this.boundingBox;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var c=3,d=a.length;c<d;c+=3){var e=a[c],f=a[c+1],g=a[c+2];e<b.min.x?b.min.x=e:e>b.max.x&&(b.max.x=e);f<b.min.y?b.min.y=f:f>b.max.y&&\n(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&\n(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.')}}}(),\ncomputeFaceNormals:function(){},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else for(a=0,b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0;var e=this.attributes.position.array,f=this.attributes.normal.array,g,h,k,l,n,q,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;\nif(this.attributes.index){var w=this.attributes.index.array,u=0<this.offsets.length?this.offsets:[{start:0,count:w.length,index:0}];c=0;for(d=u.length;c<d;++c){b=u[c].start;g=u[c].count;var D=u[c].index;a=b;for(b+=g;a<b;a+=3)g=D+w[a],h=D+w[a+1],k=D+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],r.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],t.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,\nf[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],r.set(l,n,q),l=e[a+3],n=e[a+4],q=e[a+5],t.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];p=d[3*b+1];v=d[3*\nb+2];w=d[3*c];u=d[3*c+1];D=d[3*c+2];A=f[2*a];x=f[2*a+1];C=f[2*b];I=f[2*b+1];z=f[2*c];y=f[2*c+1];K=s-q;N=w-q;ba=p-r;P=u-r;O=v-t;J=D-t;E=C-A;Q=z-A;L=I-x;R=y-x;B=1/(E*R-Q*L);S.set((R*K-L*N)*B,(R*ba-L*P)*B,(R*O-L*J)*B);V.set((E*N-Q*K)*B,(E*P-Q*ba)*B,(E*J-Q*O)*B);k[a].add(S);k[b].add(S);k[c].add(S);l[a].add(V);l[b].add(V);l[c].add(V)}function b(a){za.x=e[3*a];za.y=e[3*a+1];za.z=e[3*a+2];Oa.copy(za);G=k[a];Ea.copy(G);Ea.sub(za.multiplyScalar(za.dot(G))).normalize();Aa.crossVectors(Oa,G);Ba=Aa.dot(l[a]);\nPa=0>Ba?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Pa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn(\"Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()\");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=\n{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,r,t,s,p,v,w,u,D,A,x,C,I,z,y,K,N,ba,P,O,J,E,Q,L,R,B,S=new THREE.Vector3,V=new THREE.Vector3,W,H,oa,$,X,T=this.offsets,n=0;for(H=T.length;n<H;++n){W=T[n].start;oa=T[n].count;var ya=T[n].index,g=W;for(W+=oa;g<W;g+=3)oa=ya+c[g],$=ya+c[g+1],X=ya+c[g+2],a(oa,$,X)}var Ea=new THREE.Vector3,Aa=new THREE.Vector3,za=new THREE.Vector3,Oa=new THREE.Vector3,\nPa,G,Ba,n=0;for(H=T.length;n<H;++n)for(W=T[n].start,oa=T[n].count,ya=T[n].index,g=W,W+=oa;g<W;g+=3)oa=ya+c[g],$=ya+c[g+1],X=ya+c[g+2],b(oa),b($),b(X)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=0;c<\nd;c++){for(var p=n=0;3>p;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]<k.index?(q[2*p]=s,q[2*p+1]=-1,l++):(q[2*p]=s,q[2*p+1]=r[s]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log(\"BufferGeometry.merge(): TODO\")},normalizeNormals:function(){for(var a=this.attributes.normal.array,\nb,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if(\"index\"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if(\"index\"!=\nf)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)\"index\"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,\narray:null},d=0,g=b.length;d<g;d++){var h=b[d];if(e instanceof h){f.array=new h(e);break}}a.attributes[c]=f}d=0;for(g=this.offsets.length;d<g;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);\nTHREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=\nthis.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};\nTHREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},\ncenter:function(){this.computeBoundingBox();var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},\ncomputeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],\nd[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||\n(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=\n0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=\ne.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p,v,w=[],u=[];c=new THREE.Vector3;var D=new THREE.Vector3,A=new THREE.Vector3,x=new THREE.Vector3,C=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],n=f[1],q=f[2],\nf=h.x-g.x,r=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,p=q.x-l.x,n=n.y-l.y,l=q.y-l.y,q=1/(k*l-p*n),c.set((l*f-n*r)*q,(l*t-n*s)*q,(l*h-n*g)*q),D.set((k*r-p*f)*q,(k*s-p*t)*q,(k*g-p*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(D),u[v].add(D),u[e].add(D);D=[\"a\",\"b\",\"c\",\"d\"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[D[c]],v=w[d],A.copy(v),A.sub(C.multiplyScalar(C.dot(v))).normalize(),x.crossVectors(e.vertexNormals[c],\nv),d=x.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(A.x,A.y,A.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},\nmerge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error(\"THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.\",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=g.length;n<q;n++){var r=g[n].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}n=0;for(q=k.length;n<q;n++){var g=k[n],t,s=g.vertexNormals,p=\ng.vertexColors,r=new THREE.Face3(g.a+e,g.b+e,g.c+e);r.normal.copy(g.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(f=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(g.color);b=0;for(f=p.length;b<f;b++)t=p[b],r.vertexColors.push(t.clone());r.materialIndex=g.materialIndex+c;h.push(r)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));l.push(d)}}},mergeVertices:function(){var a=\n{},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+\"_\"+Math.round(d.y*e)+\"_\"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,\n1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k,l=this.morphTargets.length,n=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+\"_\"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=\nk,this.geometryGroupsList.push(k)),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+\"_\"+h[f].counter,g in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:f,vertices:0,numMorphTargets:l,numMorphNormals:n},this.geometryGroups[g]=k,this.geometryGroupsList.push(k))),this.geometryGroups[g].faces3.push(d),this.geometryGroups[g].vertices+=3}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=\nb.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};\nTHREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};\nTHREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));this.add(g);var h=new THREE.PerspectiveCamera(90,\n1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,r=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=\n2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=r;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);\nTHREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};\nTHREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};\nTHREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};\nTHREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};\nTHREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;THREE.Camera.prototype.clone.call(this,a);a.fov=this.fov;a.aspect=this.aspect;a.near=this.near;a.far=this.far;return a};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};\nTHREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};\nTHREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=.5;this.quadraticAttenuation=.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=new THREE.Vector3(0,\n0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,.99,.998];this.shadowCascadeFarZ=[.99,.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;a.shadowCameraNear=this.shadowCameraNear;a.shadowCameraFar=this.shadowCameraFar;a.shadowCameraLeft=this.shadowCameraLeft;a.shadowCameraRight=this.shadowCameraRight;a.shadowCameraTop=this.shadowCameraTop;a.shadowCameraBottom=this.shadowCameraBottom;a.shadowCameraVisible=\nthis.shadowCameraVisible;a.shadowBias=this.shadowBias;a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;a.shadowCascade=this.shadowCascade;a.shadowCascadeOffset.copy(this.shadowCascadeOffset);a.shadowCascadeCount=this.shadowCascadeCount;a.shadowCascadeBias=this.shadowCascadeBias.slice(0);a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0);a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0);a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0);\na.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0);return a};THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a);this.position.set(0,100,0);this.groundColor=new THREE.Color(b);this.intensity=void 0!==c?c:1};THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype);THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;THREE.Light.prototype.clone.call(this,a);a.groundColor.copy(this.groundColor);a.intensity=this.intensity;return a};\nTHREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0};THREE.PointLight.prototype=Object.create(THREE.Light.prototype);THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;THREE.Light.prototype.clone.call(this,a);a.intensity=this.intensity;a.distance=this.distance;return a};\nTHREE.SpotLight=function(a,b,c,d,e){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.exponent=void 0!==e?e:10;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowMatrix=this.shadowCamera=this.shadowMapSize=\nthis.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);\nTHREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.distance=this.distance;a.angle=this.angle;a.exponent=this.exponent;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;a.shadowCameraNear=this.shadowCameraNear;a.shadowCameraFar=this.shadowCameraFar;a.shadowCameraFov=this.shadowCameraFov;a.shadowCameraVisible=this.shadowCameraVisible;a.shadowBias=this.shadowBias;a.shadowDarkness=\nthis.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.shadowMapHeight;return a};THREE.Cache=function(){this.files={}};THREE.Cache.prototype={constructor:THREE.Cache,add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};\nTHREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};\nTHREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement(\"div\");a.style.position=\"absolute\";a.style.right=\"0px\";a.style.top=\"0px\";a.style.fontSize=\"0.8em\";a.style.textAlign=\"left\";a.style.background=\"rgba(0,0,0,0.25)\";a.style.color=\"#fff\";a.style.width=\"120px\";a.style.padding=\"0.5em 0.5em 0.5em 0.5em\";a.style.zIndex=1E3;a.innerHTML=\"Loading ...\";return a},updateProgress:function(a){var b=\"Loaded \",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+\n\"%\"):b+((a.loaded/1024).toFixed(2)+\" KB\");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split(\"/\");if(1===a.length)return\"./\";a.pop();return a.join(\"/\")+\"/\"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,\nd,e,g,h,k,p){var v=b+e,w,u=THREE.Loader.Handlers.get(v);null!==u?w=u.load(v):(w=new THREE.Texture,u=f.imageLoader,u.crossOrigin=f.crossOrigin,u.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement(\"canvas\");e.width=b;e.height=d;e.getContext(\"2d\").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),\n1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));p&&(w.anisotropy=p);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g=\"MeshLambertMaterial\",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();\"phong\"===k?g=\"MeshPhongMaterial\":\n\"basic\"===k&&(g=\"MeshBasicMaterial\")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&(\"face\"===\na.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,\"map\",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,\na.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,\"lightMap\",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,\"bumpMap\",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,\"normalMap\",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,\"specularMap\",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&&\nb&&d(h,\"alphaMap\",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormal?(g=THREE.ShaderLib.normalmap,k=THREE.UniformsUtils.clone(g.uniforms),k.tNormal.value=h.normalMap,a.mapNormalFactor&&k.uNormalScale.value.set(a.mapNormalFactor,a.mapNormalFactor),h.map&&(k.tDiffuse.value=h.map,k.enableDiffuse.value=!0),h.specularMap&&(k.tSpecular.value=h.specularMap,k.enableSpecular.value=!0),h.lightMap&&(k.tAO.value=h.lightMap,\nk.enableAO.value=!0),k.diffuse.value.setHex(h.color),k.specular.value.setHex(h.specular),k.ambient.value.setHex(h.ambient),k.shininess.value=h.shininess,void 0!==h.opacity&&(k.opacity.value=h.opacity),g=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:k,lights:!0,fog:!0}),h.transparent&&(g.transparent=!0)):g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}};\nTHREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;b<c;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}};THREE.XHRLoader=function(a){this.cache=new THREE.Cache;this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=e.cache.get(a);void 0!==f?b&&b(f):TiddlyWiki&&a.match(/^tw:/)?(f=TiddlyWiki.load(a),e.manager.itemStart(a),void 0!==b&&(e.cache.add(a,f),b(f),e.manager.itemEnd(f)),hack.log(\"url: \"+a+\": loaded\",hack.loader,\"THREE.XHRLoader.load\")):(f=new XMLHttpRequest,f.open(\"GET\",a,!0),f.addEventListener(\"load\",function(c){e.cache.add(a,this.response);b&&b(this.response);e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener(\"progress\",\nfunction(a){c(a)},!1),void 0!==d&&f.addEventListener(\"error\",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(f.responseType=this.responseType),f.send(null),e.manager.itemStart(a))},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.ImageLoader=function(a){this.cache=new THREE.Cache;this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=e.cache.get(a);if(void 0!==f)b(f);else return f=document.createElement(\"img\"),TiddlyWiki&&a.match(/^tw:/)&&(hack.log(\"url: \"+a+(f.crossOrigin?' [crossOrigin=\"'+f.crossOrigin+'\"]':\"\")+\": to be loaded\",hack.loader,\"THREE.ImageLoader.load\"),a=TiddlyWiki.load(a)),void 0!==b&&f.addEventListener(\"load\",function(c){e.cache.add(a,this);b(this);e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener(\"progress\",\nfunction(a){c(a)},!1),void 0!==d&&f.addEventListener(\"error\",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),f.src=a,e.manager.itemStart(a),f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);\nTHREE.JSONLoader.prototype.load=function(a,b,c){c=c&&\"string\"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};\nTHREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){if(TiddlyWiki&&b.match(/^tw:/)){var f=JSON.parse(TiddlyWiki.load(b));void 0!==f.metadata&&\"scene\"===f.metadata.type?console.error('THREE.JSONLoader: \"'+b+'\" seems to be a Scene. Use THREE.SceneLoader instead.'):(f=a.parse(f,d),c(f.geometry,f.materials),a.onLoadComplete(),hack.log(\"url: \"+b+\": loaded\",hack.loader,\"THREE.JSONLoader.loadAjaxJSON\"))}else{var g=new XMLHttpRequest,h=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===\ng.status||0===g.status){if(g.responseText){var f=JSON.parse(g.responseText);if(void 0!==f.metadata&&\"scene\"===f.metadata.type){console.error('THREE.JSONLoader: \"'+b+'\" seems to be a Scene. Use THREE.SceneLoader instead.');return}f=a.parse(f,d);c(f.geometry,f.materials)}else console.error('THREE.JSONLoader: \"'+b+'\" seems to be unreachable or the file is empty.');a.onLoadComplete()}else console.error(\"THREE.JSONLoader: Couldn't load \\\"\"+b+'\" ('+g.status+\")\");else g.readyState===g.LOADING?e&&(0===h&&\n(h=g.getResponseHeader(\"Content-Length\")),e({total:h,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&void 0!==e&&(h=g.getResponseHeader(\"Content-Length\"))};g.open(\"GET\",b,!0);g.withCredentials=this.withCredentials;g.send(null)}};\nTHREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,q,r,t,s,p,v,w,u=a.faces;n=a.vertices;var D=a.normals,A=a.colors,x=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&x++;for(d=0;d<x;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,n=b&64,b&=128,t){t=new THREE.Face3;\nt.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]),p.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],\nD[q++],D[q]),2!==d&&t.vertexNormals.push(s),0!==d&&p.vertexNormals.push(s);n&&(n=u[k++],n=A[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=A[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<x;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],\nw=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(D[q++],D[q++],D[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(D[q++],D[q++],D[q]),t.vertexNormals.push(s);n&&(n=u[k++],t.color.setHex(A[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(A[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],\n1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn(\"When skinning, number of vertices (\"+c.vertices.length+\"), skinIndices (\"+c.skinIndices.length+\n\"), and skinWeights (\"+c.skinWeights.length+\") should match.\");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=\n0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};\nTHREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader;f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.attributes,d;for(d in c){var e=c[d];b.attributes[d]={itemSize:e.itemSize,array:new self[e.type](e.array)}}c=a.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));a=a.boundingSphere;\nvoid 0!==a&&(b.boundingSphere=new THREE.Sphere((new THREE.Vector3).fromArray(void 0!==a.center?a.center:[0,0,0]),a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader;f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];void 0!==a.color&&b.color.setHex(a.color);void 0!==a.ambient&&b.ambient.setHex(a.ambient);void 0!==a.emissive&&b.emissive.setHex(a.emissive);void 0!==a.specular&&b.specular.setHex(a.specular);void 0!==a.shininess&&\n(b.shininess=a.shininess);void 0!==a.uniforms&&(b.uniforms=a.uniforms);void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors);void 0!==a.blending&&(b.blending=a.blending);void 0!==a.side&&(b.side=a.side);void 0!==a.opacity&&(b.opacity=a.opacity);void 0!==a.transparent&&(b.transparent=a.transparent);void 0!==a.wireframe&&(b.wireframe=a.wireframe);if(void 0!==a.materials)for(var c=\n0,d=a.materials.length;c<d;c++)b.materials.push(this.parse(a.materials[c]));return b}};THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=this.parseGeometries(a.geometries),c=this.parseMaterials(a.materials);return this.parseObject(a.object,b,c)},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,\ne=0,f=a.length;e<f;e++){var g,h=a[e];switch(h.type){case \"PlaneGeometry\":g=new THREE.PlaneGeometry(h.width,h.height,h.widthSegments,h.heightSegments);break;case \"BoxGeometry\":case \"CubeGeometry\":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case \"CircleGeometry\":g=new THREE.CircleGeometry(h.radius,h.segments);break;case \"CylinderGeometry\":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);\nbreak;case \"SphereGeometry\":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case \"IcosahedronGeometry\":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case \"TorusGeometry\":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case \"TorusKnotGeometry\":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case \"BufferGeometry\":g=\nd.parse(h.data);break;case \"Geometry\":g=c.parse(h.data).geometry}g.uuid=h.uuid;void 0!==h.name&&(g.name=h.name);b[h.uuid]=g}return b},parseMaterials:function(a){var b={};if(void 0!==a)for(var c=new THREE.MaterialLoader,d=0,e=a.length;d<e;d++){var f=a[d],g=c.parse(f);g.uuid=f.uuid;void 0!==f.name&&(g.name=f.name);b[f.uuid]=g}return b},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;switch(b.type){case \"Scene\":e=new THREE.Scene;break;case \"PerspectiveCamera\":e=new THREE.PerspectiveCamera(b.fov,\nb.aspect,b.near,b.far);break;case \"OrthographicCamera\":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case \"AmbientLight\":e=new THREE.AmbientLight(b.color);break;case \"DirectionalLight\":e=new THREE.DirectionalLight(b.color,b.intensity);break;case \"PointLight\":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case \"SpotLight\":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case \"HemisphereLight\":e=new THREE.HemisphereLight(b.color,\nb.groundColor,b.intensity);break;case \"Mesh\":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error(\"THREE.ObjectLoader: Undefined geometry \"+b.geometry);void 0===f&&console.error(\"THREE.ObjectLoader: Undefined material \"+b.material);e=new THREE.Mesh(e,f);break;case \"Sprite\":f=d[b.material];void 0===f&&console.error(\"THREE.ObjectLoader: Undefined material \"+b.material);e=new THREE.Sprite(f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?\n(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);if(void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};\nTHREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};\nTHREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};\nTHREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn(\"THREE.Material: '\"+b+\"' parameter is undefined.\");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]=\"overdraw\"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;\na.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);\nTHREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap=\"round\";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};\nTHREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.scale=this.scale;a.dashSize=this.dashSize;a.gapSize=this.gapSize;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};\nTHREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=!1;this.setValues(a)};\nTHREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;\na.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a};\nTHREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\n\"round\";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;\na.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};\nTHREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=\n1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap=\"round\";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.bumpMap=this.bumpMap;a.bumpScale=this.bumpScale;a.normalMap=this.normalMap;a.normalScale.copy(this.normalScale);\na.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a};\nTHREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};\nTHREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.shading=THREE.FlatShading;this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};\nTHREE.MeshFaceMaterial=function(a){this.materials=a instanceof Array?a:[]};THREE.MeshFaceMaterial.prototype.clone=function(){for(var a=new THREE.MeshFaceMaterial,b=0;b<this.materials.length;b++)a.materials.push(this.materials[b].clone());return a};THREE.PointCloudMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.PointCloudMaterial.prototype.clone=function(){var a=new THREE.PointCloudMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleBasicMaterial=function(a){console.warn(\"THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial.\");return new THREE.PointCloudMaterial(a)};\nTHREE.ParticleSystemMaterial=function(a){console.warn(\"THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial.\");return new THREE.PointCloudMaterial(a)};\nTHREE.ShaderMaterial=function(a){THREE.Material.call(this);this.defines={};this.uniforms={};this.attributes=null;this.vertexShader=\"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";this.fragmentShader=\"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";this.shading=THREE.SmoothShading;this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=\n!1;this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.setValues(a)};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;THREE.Material.prototype.clone.call(this,a);a.fragmentShader=this.fragmentShader;a.vertexShader=this.vertexShader;a.uniforms=THREE.UniformsUtils.clone(this.uniforms);a.attributes=this.attributes;a.defines=this.defines;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.fog=this.fog;a.lights=this.lights;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=\nthis.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.RawShaderMaterial=function(a){THREE.ShaderMaterial.call(this,a)};THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.RawShaderMaterial.prototype.clone=function(){var a=new THREE.RawShaderMaterial;THREE.ShaderMaterial.prototype.clone.call(this,a);return a};THREE.SpriteMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.rotation=0;this.fog=!1;this.setValues(a)};\nTHREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.rotation=this.rotation;a.fog=this.fog;return a};THREE.SpriteCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(a,c){};this.setValues(a)};THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype);\nTHREE.SpriteCanvasMaterial.prototype.clone=function(){var a=new THREE.SpriteCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};THREE.ParticleCanvasMaterial=THREE.SpriteCanvasMaterial;\nTHREE.Texture=function(a,b,c,d,e,f,g,h,k){this.id=THREE.TextureIdCount++;this.uuid=THREE.Math.generateUUID();this.name=\"\";this.image=void 0!==a?a:THREE.Texture.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:THREE.Texture.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==k?k:1;this.format=void 0!==\ng?g:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this._needsUpdate=!1;this.onUpdate=null};THREE.Texture.DEFAULT_IMAGE=void 0;THREE.Texture.DEFAULT_MAPPING=new THREE.UVMapping;\nTHREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},clone:function(a){void 0===a&&(a=new THREE.Texture);a.image=this.image;a.mipmaps=this.mipmaps.slice(0);a.mapping=this.mapping;a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.format=this.format;a.type=this.type;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=\nthis.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:\"update\"})},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.images=a};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);\nTHREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);\nTHREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};\nTHREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);\nd.push({distance:l,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,q=f.offsets;0===q.length&&(q=[{start:0,count:l.length,index:0}]);for(var r=0,t=q.length;r<t;++r)for(var s=q[r].start,p=q[r].index,f=s,s=s+q[r].count;f<s;f++){var v=p+l[f];k.set(n[3*v],n[3*v+1],n[3*v+2]);g(k,v)}}else for(l=n.length/3,f=0;f<l;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,\nf=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn(\"THREE.ParticleSystem has been renamed to THREE.PointCloud.\");return new THREE.PointCloud(a,b)};\nTHREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),g instanceof THREE.Geometry))for(var g=g.vertices,h=g.length,k=new THREE.Vector3,l=new THREE.Vector3,n=this.type===THREE.LineStrip?\n1:2,q=0;q<h-1;q+=n)if(!(b.distanceSqToSegment(g[q],g[q+1],l,k)>f)){var r=b.origin.distanceTo(l);r<d.near||r>d.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};\nTHREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};\nTHREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log(\"THREE.Mesh.getMorphTargetIndexByName: morph target \"+a+\" does not exist. Returning 0.\");return 0};\nTHREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=\nthis.material;if(void 0!==l){var n=k.attributes,q,r,t=g.precision;if(void 0!==n.index){var s=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var n=v[w].start,D=v[w].index,k=n,A=n+v[w].count;k<A;k+=3){n=D+s[k];q=D+s[k+1];r=D+s[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*q],p[3*q+1],p[3*q+2]);f.set(p[3*r],p[3*r+1],p[3*r+2]);var x=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==\nTHREE.DoubleSide);if(null!==x){x.applyMatrix4(this.matrixWorld);var C=g.ray.origin.distanceTo(x);C<t||C<g.near||C>g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this})}}}else for(p=n.position.array,s=k=0,A=p.length;k<A;k+=3,s+=9)n=k,q=k+1,r=k+2,d.set(p[s],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),f.set(p[s+6],p[s+7],p[s+8]),x=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==x&&(x.applyMatrix4(this.matrixWorld),\nC=g.ray.origin.distanceTo(x),C<t||C<g.near||C>g.far||h.push({distance:C,point:x,indices:[n,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,p=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(D=k.faces[w],l=!0===s?p[D.materialIndex]:this.material,void 0!==l){n=v[D.a];q=v[D.b];r=v[D.c];if(!0===l.morphTargets){x=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);\ne.set(0,0,0);f.set(0,0,0);for(var A=0,I=x.length;A<I;A++){var z=C[A];if(0!==z){var y=x[A].vertices;d.x+=(y[D.a].x-n.x)*z;d.y+=(y[D.a].y-n.y)*z;d.z+=(y[D.a].z-n.z)*z;e.x+=(y[D.b].x-q.x)*z;e.y+=(y[D.b].y-q.y)*z;e.z+=(y[D.b].z-q.z)*z;f.x+=(y[D.c].x-r.x)*z;f.y+=(y[D.c].y-r.y)*z;f.z+=(y[D.c].z-r.z)*z}}d.add(n);e.add(q);f.add(r);n=d;q=e;r=f}x=l.side===THREE.BackSide?b.intersectTriangle(r,q,n,!0):b.intersectTriangle(n,q,r,l.side!==THREE.DoubleSide);null!==x&&(x.applyMatrix4(this.matrixWorld),C=g.ray.origin.distanceTo(x),\nC<t||C<g.near||C>g.far||h.push({distance:C,point:x,face:D,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Bone.prototype.updateMatrixWorld=function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a);this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};\nTHREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),\nthis.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn(\"THREE.Skeleton bonInverses is the wrong length.\"),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};\nTHREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};\nTHREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;b<c;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);b=0;for(c=this.bones.length;b<c;b++)if(a=this.bones[b])a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)};\nTHREE.Skeleton.prototype.update=function(){for(var a=new THREE.Matrix4,b=0,c=this.bones.length;b<c;b++)a.multiplyMatrices(this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)};\nTHREE.SkinnedMesh=function(a,b,c){THREE.Mesh.call(this,a,b);this.bindMode=\"attached\";this.bindMatrix=new THREE.Matrix4;this.bindMatrixInverse=new THREE.Matrix4;a=[];if(this.geometry&&void 0!==this.geometry.bones){for(var d,e,f,g,h=0,k=this.geometry.bones.length;h<k;++h)d=this.geometry.bones[h],e=d.pos,f=d.rotq,g=d.scl,b=new THREE.Bone(this),a.push(b),b.name=d.name,b.position.set(e[0],e[1],e[2]),b.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?b.scale.set(g[0],g[1],g[2]):b.scale.set(1,1,1);h=0;for(k=\nthis.geometry.bones.length;h<k;++h)d=this.geometry.bones[h],-1!==d.parent?a[d.parent].add(a[h]):this.add(a[h])}this.normalizeSkinWeights();this.updateMatrixWorld(!0);this.bind(new THREE.Skeleton(a,void 0,c))};THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)};THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()};\nTHREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;a<this.geometry.skinIndices.length;a++){var b=this.geometry.skinWeights[a],c=1/b.lengthManhattan();Infinity!==c?b.multiplyScalar(c):b.set(1)}};\nTHREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0);\"attached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):\"detached\"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn(\"THREE.SkinnedMesh unreckognized bindMode: \"+this.bindMode)};\nTHREE.SkinnedMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.SkinnedMesh(this.geometry,this.material,this.useVertexTexture));THREE.Mesh.prototype.clone.call(this,a);return a};THREE.MorphAnimMesh=function(a,b){THREE.Mesh.call(this,a,b);this.duration=1E3;this.mirroredLoop=!1;this.currentKeyframe=this.lastKeyframe=this.time=0;this.direction=1;this.directionBackwards=!1;this.setFrameRange(0,this.geometry.morphTargets.length-1)};THREE.MorphAnimMesh.prototype=Object.create(THREE.Mesh.prototype);\nTHREE.MorphAnimMesh.prototype.setFrameRange=function(a,b){this.startKeyframe=a;this.endKeyframe=b;this.length=this.endKeyframe-this.startKeyframe+1};THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1;this.directionBackwards=!1};THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1;this.directionBackwards=!0};\nTHREE.MorphAnimMesh.prototype.parseAnimations=function(){var a=this.geometry;a.animations||(a.animations={});for(var b,c=a.animations,d=/([a-z]+)_?(\\d+)/,e=0,f=a.morphTargets.length;e<f;e++){var g=a.morphTargets[e].name.match(d);if(g&&1<g.length){g=g[1];c[g]||(c[g]={start:Infinity,end:-Infinity});var h=c[g];e<h.start&&(h.start=e);e>h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b};\nTHREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn(\"animation[\"+a+\"] undefined\")};\nTHREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&&\n(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};\nTHREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e<f;e++)d[e]=0;-1<a&&(d[a]=1-c);-1<b&&(d[b]=c)};\nTHREE.MorphAnimMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material));a.duration=this.duration;a.mirroredLoop=this.mirroredLoop;a.time=this.time;a.lastKeyframe=this.lastKeyframe;a.currentKeyframe=this.currentKeyframe;a.direction=this.direction;a.directionBackwards=this.directionBackwards;THREE.Mesh.prototype.clone.call(this,a);return a};THREE.LOD=function(){THREE.Object3D.call(this);this.objects=[]};THREE.LOD.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=0;c<this.objects.length&&!(b<this.objects[c].distance);c++);this.objects.splice(c,0,{distance:b,object:a});this.add(a)};THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=1,c=this.objects.length;b<c&&!(a<this.objects[b].distance);b++);return this.objects[b-1].object};\nTHREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}();\nTHREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(1<this.objects.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);this.objects[0].object.visible=!0;for(var d=1,e=this.objects.length;d<e;d++)if(c>=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;d<e;d++)this.objects[d].object.visible=!1}}}();\nTHREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;b<c;b++){var d=this.objects[b].object.clone();d.visible=0===b;a.addLevel(d,this.objects[b].distance)}return a};\nTHREE.Sprite=function(){var a=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0]),b=new THREE.BufferGeometry;b.addAttribute(\"position\",new THREE.BufferAttribute(a,3));return function(a){THREE.Object3D.call(this);this.geometry=b;this.material=void 0!==a?a:new THREE.SpriteMaterial}}();THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0};\nTHREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:\"objectAdded\",object:a});a.dispatchEvent({type:\"addedToScene\",scene:this});for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};\nTHREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1);if(a.shadowCascadeArray)for(b=0;b<a.shadowCascadeArray.length;b++)this.__removeObject(a.shadowCascadeArray[b])}else a instanceof THREE.Camera||(this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1));this.dispatchEvent({type:\"objectRemoved\",object:a});a.dispatchEvent({type:\"removedFromScene\",scene:this});for(b=\n0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name=\"\";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};\nTHREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name=\"\";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};\nTHREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);n(c);q(d);r(a.getStyle());O.stroke();ra.expandByScalar(2*b)}function c(a){t(a.getStyle());O.fill()}function d(a){e(a.target)}function e(a){if(!(a instanceof THREE.CompressedTexture)){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement(\"canvas\");e.width=d.width;e.height=d.height;var f=e.getContext(\"2d\");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Ca[a.id]=O.createPattern(e,!0===\nb&&!0===c?\"repeat\":!0===b&&!1===c?\"repeat-x\":!1===b&&!0===c?\"repeat-y\":\"no-repeat\")}}function f(a,b,c,f,g,h,k,l,n,r,q,s,p){if(!(p instanceof THREE.DataTexture)){!1===p.hasEventListener(\"update\",d)&&(void 0!==p.image&&0<p.image.width&&e(p),p.addEventListener(\"update\",d));var m=Ca[p.id];if(void 0!==m){t(m);var m=p.offset.x/p.repeat.x,w=p.offset.y/p.repeat.y,u=p.image.width*p.repeat.x;p=p.image.height*p.repeat.y;k=(k+m)*u;l=(l+w)*p;c-=a;f-=b;g-=a;h-=b;n=(n+m)*u-k;r=(r+w)*p-l;q=(q+m)*u-k;s=(s+w)*p-l;\np=n*s-q*r;0!==p&&(m=1/p,p=(s*c-r*g)*m,r=(s*f-r*h)*m,c=(n*g-q*c)*m,f=(n*h-q*f)*m,a=a-p*k-c*l,b=b-r*k-f*l,O.save(),O.transform(p,r,c,f,a,b),O.fill(),O.restore())}else t(\"rgba(0,0,0,1)\"),O.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){Q!==a&&(Q=O.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?O.globalCompositeOperation=\"source-over\":a===THREE.AdditiveBlending?O.globalCompositeOperation=\"lighter\":\na===THREE.SubtractiveBlending&&(O.globalCompositeOperation=\"darker\"),L=a)}function l(a){S!==a&&(S=O.lineWidth=a)}function n(a){V!==a&&(V=O.lineCap=a)}function q(a){W!==a&&(W=O.lineJoin=a)}function r(a){R!==a&&(R=O.strokeStyle=a)}function t(a){B!==a&&(B=O.fillStyle=a)}function s(a){H.length!==a.length&&(O.setLineDash(a),H=a)}console.log(\"THREE.CanvasRenderer\",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,w,u,D,A=new THREE.Projector,x=void 0!==a.canvas?a.canvas:document.createElement(\"canvas\"),\nC=x.width,I=x.height,z=Math.floor(C/2),y=Math.floor(I/2),K=0,N=0,ba=C,P=I,O=x.getContext(\"2d\",{alpha:!0===a.alpha}),J=new THREE.Color(0),E=0,Q=1,L=0,R=null,B=null,S=null,V=null,W=null,H=[],oa,$,X,T;new THREE.RenderableVertex;new THREE.RenderableVertex;var ya,Ea,Aa,za,Oa,Pa,G=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var Ba=new THREE.Color,Ya=new THREE.Color,Za=new THREE.Color,Ca={},ca,la,qa,ua,ja,Fa,va,Ka=new THREE.Box2,aa=new THREE.Box2,ra=new THREE.Box2,Da=\nnew THREE.Color,Qa=new THREE.Color,cb=new THREE.Color,Ga=new THREE.Vector3,xa=new THREE.Vector3,ma=new THREE.Vector3,Ja=new THREE.Matrix3;void 0===O.setLineDash&&(O.setLineDash=function(){});this.domElement=x;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=\nfunction(a,b,c){C=a*this.devicePixelRatio;I=b*this.devicePixelRatio;x.width=C;x.height=I;z=Math.floor(C/2);y=Math.floor(I/2);!1!==c&&(x.style.width=a+\"px\",x.style.height=b+\"px\");Ka.min.set(-z,-y);Ka.max.set(z,y);aa.min.set(-z,-y);aa.max.set(z,y);Q=1;L=0;W=V=S=B=R=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){K=a*this.devicePixelRatio;N=b*this.devicePixelRatio;ba=c*this.devicePixelRatio;P=d*this.devicePixelRatio};this.setScissor=function(){};this.enableScissorTest=function(){};\nthis.setClearColor=function(a,b){J.set(a);E=void 0!==b?b:1;aa.min.set(-z,-y);aa.max.set(z,y)};this.setClearColorHex=function(a,b){console.warn(\"THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.\");this.setClearColor(a,b)};this.getClearColor=function(){return J};this.getClearAlpha=function(){return E};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===aa.empty()&&(aa.intersect(Ka),aa.expandByScalar(2),aa.min.x+=z,aa.min.y=-aa.min.y+y,aa.max.x+=\nz,aa.max.y=-aa.max.y+y,1>E&&O.clearRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0),0<E&&(k(THREE.NormalBlending),h(1),t(\"rgba(\"+Math.floor(255*J.r)+\",\"+Math.floor(255*J.g)+\",\"+Math.floor(255*J.b)+\",\"+E+\")\"),O.fillRect(aa.min.x|0,aa.min.y|0,aa.max.x-aa.min.x|0,aa.max.y-aa.min.y|0)),aa.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,x){if(!1===x instanceof THREE.Camera)console.error(\"THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.\");\nelse{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.faces=0;O.setTransform(ba/C,0,0,-P/I,K,I-N);O.translate(z,y);w=A.projectScene(a,x,this.sortObjects,this.sortElements);u=w.elements;D=w.lights;oa=x;Ja.getNormalMatrix(x.matrixWorldInverse);Da.setRGB(0,0,0);Qa.setRGB(0,0,0);cb.setRGB(0,0,0);for(var L=0,Q=D.length;L<Q;L++){var E=D[L],H=E.color;E instanceof THREE.AmbientLight?Da.add(H):E instanceof THREE.DirectionalLight?Qa.add(H):E instanceof THREE.PointLight&&cb.add(H)}L=\n0;for(Q=u.length;L<Q;L++){var J=u[L],B=J.material;if(void 0!==B&&0!==B.opacity){ra.makeEmpty();if(J instanceof THREE.RenderableSprite){$=J;$.x*=z;$.y*=y;var E=$,R=J,H=B;h(H.opacity);k(H.blending);var ea=R.scale.x*z,R=R.scale.y*y,J=.5*Math.sqrt(ea*ea+R*R);ra.min.set(E.x-J,E.y-J);ra.max.set(E.x+J,E.y+J);if(H instanceof THREE.SpriteMaterial){var da=H.map;if(null!==da&&void 0!==da.image){!1===da.hasEventListener(\"update\",d)&&(0<da.image.width&&e(da),da.addEventListener(\"update\",d));J=Ca[da.id];void 0!==\nJ?t(J):t(\"rgba( 0, 0, 0, 1 )\");var S=da.image,J=S.width*da.offset.x,B=S.height*da.offset.y,V=S.width*da.repeat.x,da=S.height*da.repeat.y,S=ea/V,m=R/da;O.save();O.translate(E.x,E.y);0!==H.rotation&&O.rotate(H.rotation);O.translate(-ea/2,-R/2);O.scale(S,m);O.translate(-J,-B);O.fillRect(J,B,V,da)}else t(H.color.getStyle()),O.save(),O.translate(E.x,E.y),0!==H.rotation&&O.rotate(H.rotation),O.scale(ea,-R),O.fillRect(-.5,-.5,1,1);O.restore()}else H instanceof THREE.SpriteCanvasMaterial&&(r(H.color.getStyle()),\nt(H.color.getStyle()),O.save(),O.translate(E.x,E.y),0!==H.rotation&&O.rotate(H.rotation),O.scale(ea,R),H.program(O),O.restore())}else if(J instanceof THREE.RenderableLine){if($=J.v1,X=J.v2,$.positionScreen.x*=z,$.positionScreen.y*=y,X.positionScreen.x*=z,X.positionScreen.y*=y,ra.setFromPoints([$.positionScreen,X.positionScreen]),!0===Ka.isIntersectionBox(ra))if(E=$,H=X,ea=J,R=B,h(R.opacity),k(R.blending),O.beginPath(),O.moveTo(E.positionScreen.x,E.positionScreen.y),O.lineTo(H.positionScreen.x,H.positionScreen.y),\nR instanceof THREE.LineBasicMaterial){l(R.linewidth);n(R.linecap);q(R.linejoin);if(R.vertexColors!==THREE.VertexColors)r(R.color.getStyle());else if(J=ea.vertexColors[0].getStyle(),ea=ea.vertexColors[1].getStyle(),J===ea)r(J);else{try{var W=O.createLinearGradient(E.positionScreen.x,E.positionScreen.y,H.positionScreen.x,H.positionScreen.y);W.addColorStop(0,J);W.addColorStop(1,ea)}catch(xb){W=J}r(W)}O.stroke();ra.expandByScalar(2*R.linewidth)}else R instanceof THREE.LineDashedMaterial&&(l(R.linewidth),\nn(R.linecap),q(R.linejoin),r(R.color.getStyle()),s([R.dashSize,R.gapSize]),O.stroke(),ra.expandByScalar(2*R.linewidth),s([]))}else if(J instanceof THREE.RenderableFace){$=J.v1;X=J.v2;T=J.v3;if(-1>$.positionScreen.z||1<$.positionScreen.z)continue;if(-1>X.positionScreen.z||1<X.positionScreen.z)continue;if(-1>T.positionScreen.z||1<T.positionScreen.z)continue;$.positionScreen.x*=z;$.positionScreen.y*=y;X.positionScreen.x*=z;X.positionScreen.y*=y;T.positionScreen.x*=z;T.positionScreen.y*=y;0<B.overdraw&&\n(g($.positionScreen,X.positionScreen,B.overdraw),g(X.positionScreen,T.positionScreen,B.overdraw),g(T.positionScreen,$.positionScreen,B.overdraw));ra.setFromPoints([$.positionScreen,X.positionScreen,T.positionScreen]);if(!0===Ka.isIntersectionBox(ra)){H=$;ea=X;R=T;E=B;v.info.render.vertices+=3;v.info.render.faces++;h(E.opacity);k(E.blending);ya=H.positionScreen.x;Ea=H.positionScreen.y;Aa=ea.positionScreen.x;za=ea.positionScreen.y;Oa=R.positionScreen.x;Pa=R.positionScreen.y;var B=ya,V=Ea,da=Aa,S=za,\nm=Oa,Ta=Pa;O.beginPath();O.moveTo(B,V);O.lineTo(da,S);O.lineTo(m,Ta);O.closePath();if((E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial)&&null===E.map){Ba.copy(E.color);Ya.copy(E.emissive);E.vertexColors===THREE.FaceColors&&Ba.multiply(J.color);G.copy(Da);xa.copy(H.positionWorld).add(ea.positionWorld).add(R.positionWorld).divideScalar(3);H=xa;ea=J.normalModel;R=G;J=0;for(B=D.length;J<B;J++)V=D[J],Za.copy(V.color),V instanceof THREE.DirectionalLight?(da=Ga.setFromMatrixPosition(V.matrixWorld).normalize(),\nS=ea.dot(da),0>=S||(S*=V.intensity,R.add(Za.multiplyScalar(S)))):V instanceof THREE.PointLight&&(da=Ga.setFromMatrixPosition(V.matrixWorld),S=ea.dot(Ga.subVectors(da,H).normalize()),0>=S||(S*=0==V.distance?1:1-Math.min(H.distanceTo(da)/V.distance,1),0!=S&&(S*=V.intensity,R.add(Za.multiplyScalar(S)))));G.multiply(Ba).add(Ya);!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof\nTHREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof THREE.UVMapping&&(ca=J.uvs,f(ya,Ea,Aa,za,Oa,Pa,ca[0].x,ca[0].y,ca[1].x,ca[1].y,ca[2].x,ca[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=.5*ma.x+.5,qa=.5*ma.y+.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=.5*ma.x+.5,ja=.5*ma.y+.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=.5*ma.x+.5,va=.5*ma.y+.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,\nua,ja,Fa,va,E.envMap)):E.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ma.copy(J.vertexNormalsModel[0]).applyMatrix3(Ja),la=-.5*ma.x+.5,qa=-.5*ma.y+.5,ma.copy(J.vertexNormalsModel[1]).applyMatrix3(Ja),ua=-.5*ma.x+.5,ja=-.5*ma.y+.5,ma.copy(J.vertexNormalsModel[2]).applyMatrix3(Ja),Fa=-.5*ma.x+.5,va=-.5*ma.y+.5,f(ya,Ea,Aa,za,Oa,Pa,la,qa,ua,ja,Fa,va,E.envMap)):(G.copy(E.color),E.vertexColors===THREE.FaceColors&&G.multiply(J.color),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,\nE.wireframeLinejoin):c(G)):(E instanceof THREE.MeshDepthMaterial?G.r=G.g=G.b=1-p(H.positionScreen.z*H.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(ma.copy(J.normalModel).applyMatrix3(Ja),G.setRGB(ma.x,ma.y,ma.z).multiplyScalar(.5).addScalar(.5)):G.setRGB(1,1,1),!0===E.wireframe?b(G,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(G))}}aa.union(ra)}}O.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={};THREE.ShaderChunk.alphatest_fragment=\"#ifdef ALPHATEST\\n\\n\\tif ( gl_FragColor.a < ALPHATEST ) discard;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.lights_lambert_vertex=\"vLightFront = vec3( 0.0 );\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tvLightBack = vec3( 0.0 );\\n\\n#endif\\n\\ntransformedNormal = normalize( transformedNormal );\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\\n\\n\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\n\\tfloat dotProduct = dot( transformedNormal, dirVector );\\n\\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t#endif\\n\\n\\t#endif\\n\\n\\t#ifdef WRAP_AROUND\\n\\n\\t\\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t#endif\\n\\n\\t#endif\\n\\n\\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\\n\\n\\t#endif\\n\\n}\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\n\\t\\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\t\\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t\\tvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\\n\\n\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\\n\\n\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\n\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\n\\t\\t\\tfloat lDistance = 1.0;\\n\\t\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\n\\t\\t\\tlVector = normalize( lVector );\\n\\n\\t\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\t\\t\\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\\n\\n\\t\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\t\\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\\n\\n\\t\\t\\t\\t#endif\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\\n\\t\\t\\t\\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\\n\\n\\t\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\t\\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\\n\\n\\t\\t\\t\\t#endif\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\tvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\\n\\n\\t\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\t\\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t}\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\n\\t\\tfloat dotProduct = dot( transformedNormal, lVector );\\n\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\t\\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\\n\\n\\t\\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\t\\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n#endif\\n\\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\\n\\n#endif\";\nTHREE.ShaderChunk.map_particle_pars_fragment=\"#ifdef USE_MAP\\n\\n\\tuniform sampler2D map;\\n\\n#endif\";THREE.ShaderChunk.default_vertex=\"vec4 mvPosition;\\n\\n#ifdef USE_SKINNING\\n\\n\\tmvPosition = modelViewMatrix * skinned;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS )\\n\\n\\tmvPosition = modelViewMatrix * vec4( morphed, 1.0 );\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS )\\n\\n\\tmvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\n#endif\\n\\ngl_Position = projectionMatrix * mvPosition;\";\nTHREE.ShaderChunk.map_pars_fragment=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvarying vec2 vUv;\\n\\n#endif\\n\\n#ifdef USE_MAP\\n\\n\\tuniform sampler2D map;\\n\\n#endif\";THREE.ShaderChunk.skinnormal_vertex=\"#ifdef USE_SKINNING\\n\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\n\\t#ifdef USE_MORPHNORMALS\\n\\n\\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\\n\\n\\t#else\\n\\n\\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\\n\\n\\t#endif\\n\\n#endif\\n\";\nTHREE.ShaderChunk.logdepthbuf_pars_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tvarying float vFragDepth;\\n\\n\\t#endif\\n\\n\\tuniform float logDepthBufFC;\\n\\n#endif\";THREE.ShaderChunk.lightmap_pars_vertex=\"#ifdef USE_LIGHTMAP\\n\\n\\tvarying vec2 vUv2;\\n\\n#endif\";THREE.ShaderChunk.lights_phong_fragment=\"vec3 normal = normalize( vNormal );\\nvec3 viewPosition = normalize( vViewPosition );\\n\\n#ifdef DOUBLE_SIDED\\n\\n\\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\\n\\n#endif\\n\\n#ifdef USE_NORMALMAP\\n\\n\\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n\\n#elif defined( USE_BUMPMAP )\\n\\n\\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tvec3 pointDiffuse = vec3( 0.0 );\\n\\tvec3 pointSpecular = vec3( 0.0 );\\n\\n\\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\n\\t\\t\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tpointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\\n\\n\\t\\t\\t\\t// specular\\n\\n\\t\\tvec3 pointHalfVector = normalize( lVector + viewPosition );\\n\\t\\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\\n\\t\\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\\n\\t\\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tvec3 spotDiffuse = vec3( 0.0 );\\n\\tvec3 spotSpecular = vec3( 0.0 );\\n\\n\\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\\n\\n\\t\\tfloat lDistance = 1.0;\\n\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\tlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\n\\t\\tlVector = normalize( lVector );\\n\\n\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\\n\\n\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\n\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\n\\t\\t\\t\\t\\t// diffuse\\n\\n\\t\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\t\\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\t\\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\t\\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t\\tspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\\n\\n\\t\\t\\t\\t\\t// specular\\n\\n\\t\\t\\tvec3 spotHalfVector = normalize( lVector + viewPosition );\\n\\t\\t\\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\\n\\t\\t\\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\\n\\n\\t\\t}\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tvec3 dirDiffuse = vec3( 0.0 );\\n\\tvec3 dirSpecular = vec3( 0.0 );\\n\\n\\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\t\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\n\\t\\t\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, dirVector );\\n\\n\\t\\t#ifdef WRAP_AROUND\\n\\n\\t\\t\\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\\n\\t\\t\\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\\n\\n\\t\\t\\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tdirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\\n\\n\\t\\t// specular\\n\\n\\t\\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\\n\\t\\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\\n\\t\\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\\n\\n\\t\\t/*\\n\\t\\t// fresnel term from skin shader\\n\\t\\tconst float F0 = 0.128;\\n\\n\\t\\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\\n\\t\\tfloat exponential = pow( base, 5.0 );\\n\\n\\t\\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\\n\\t\\t*/\\n\\n\\t\\t/*\\n\\t\\t// fresnel term from fresnel shader\\n\\t\\tconst float mFresnelBias = 0.08;\\n\\t\\tconst float mFresnelScale = 0.3;\\n\\t\\tconst float mFresnelPower = 5.0;\\n\\n\\t\\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\\n\\t\\t*/\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\t// \\t\\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\\n\\n\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\\n\\t\\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\\n\\n\\n\\t}\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tvec3 hemiDiffuse = vec3( 0.0 );\\n\\tvec3 hemiSpecular = vec3( 0.0 );\\n\\n\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\n\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\n\\t\\t// diffuse\\n\\n\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\n\\t\\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\n\\t\\themiDiffuse += diffuse * hemiColor;\\n\\n\\t\\t// specular (sky light)\\n\\n\\t\\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\\n\\t\\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\\n\\t\\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\\n\\n\\t\\t// specular (ground light)\\n\\n\\t\\tvec3 lVectorGround = -lVector;\\n\\n\\t\\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\\n\\t\\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\\n\\t\\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\\n\\n\\t\\tfloat dotProductGround = dot( normal, lVectorGround );\\n\\n\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\n\\t\\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\\n\\t\\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\\n\\t\\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\\n\\n\\t}\\n\\n#endif\\n\\nvec3 totalDiffuse = vec3( 0.0 );\\nvec3 totalSpecular = vec3( 0.0 );\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\ttotalDiffuse += dirDiffuse;\\n\\ttotalSpecular += dirSpecular;\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\ttotalDiffuse += hemiDiffuse;\\n\\ttotalSpecular += hemiSpecular;\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\ttotalDiffuse += pointDiffuse;\\n\\ttotalSpecular += pointSpecular;\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\ttotalDiffuse += spotDiffuse;\\n\\ttotalSpecular += spotSpecular;\\n\\n#endif\\n\\n#ifdef METAL\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\\n\\n#else\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\\n\\n#endif\";\nTHREE.ShaderChunk.fog_pars_fragment=\"#ifdef USE_FOG\\n\\n\\tuniform vec3 fogColor;\\n\\n\\t#ifdef FOG_EXP2\\n\\n\\t\\tuniform float fogDensity;\\n\\n\\t#else\\n\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.morphnormal_vertex=\"#ifdef USE_MORPHNORMALS\\n\\n\\tvec3 morphedNormal = vec3( 0.0 );\\n\\n\\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\\n\\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\\n\\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\\n\\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\\n\\n\\tmorphedNormal += normal;\\n\\n#endif\";\nTHREE.ShaderChunk.envmap_pars_fragment=\"#ifdef USE_ENVMAP\\n\\n\\tuniform float reflectivity;\\n\\tuniform samplerCube envMap;\\n\\tuniform float flipEnvMap;\\n\\tuniform int combine;\\n\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\\n\\n\\t\\tuniform bool useRefract;\\n\\t\\tuniform float refractionRatio;\\n\\n\\t#else\\n\\n\\t\\tvarying vec3 vReflect;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.logdepthbuf_fragment=\"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\\n\\n\\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\\n\\n#endif\";\nTHREE.ShaderChunk.normalmap_pars_fragment=\"#ifdef USE_NORMALMAP\\n\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n\\n\\t\\t\\t// Per-Pixel Tangent Space Normal Mapping\\n\\t\\t\\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\\n\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\\n\\n\\t\\tvec3 q0 = dFdx( eye_pos.xyz );\\n\\t\\tvec3 q1 = dFdy( eye_pos.xyz );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\n\\t\\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\\n\\t\\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\\n\\t\\tvec3 N = normalize( surf_norm );\\n\\n\\t\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t\\tmapN.xy = normalScale * mapN.xy;\\n\\t\\tmat3 tsn = mat3( S, T, N );\\n\\t\\treturn normalize( tsn * mapN );\\n\\n\\t}\\n\\n#endif\\n\";\nTHREE.ShaderChunk.lights_phong_pars_vertex=\"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvarying vec3 vWorldPosition;\\n\\n#endif\\n\";THREE.ShaderChunk.lightmap_pars_fragment=\"#ifdef USE_LIGHTMAP\\n\\n\\tvarying vec2 vUv2;\\n\\tuniform sampler2D lightMap;\\n\\n#endif\";THREE.ShaderChunk.shadowmap_vertex=\"#ifdef USE_SHADOWMAP\\n\\n\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\n\\t\\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.lights_phong_vertex=\"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvWorldPosition = worldPosition.xyz;\\n\\n#endif\";THREE.ShaderChunk.map_fragment=\"#ifdef USE_MAP\\n\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\ttexelColor.xyz *= texelColor.xyz;\\n\\n\\t#endif\\n\\n\\tgl_FragColor = gl_FragColor * texelColor;\\n\\n#endif\";THREE.ShaderChunk.lightmap_vertex=\"#ifdef USE_LIGHTMAP\\n\\n\\tvUv2 = uv2;\\n\\n#endif\";\nTHREE.ShaderChunk.map_particle_fragment=\"#ifdef USE_MAP\\n\\n\\tgl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\\n\\n#endif\";THREE.ShaderChunk.color_pars_fragment=\"#ifdef USE_COLOR\\n\\n\\tvarying vec3 vColor;\\n\\n#endif\\n\";THREE.ShaderChunk.color_vertex=\"#ifdef USE_COLOR\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\tvColor = color * color;\\n\\n\\t#else\\n\\n\\t\\tvColor = color;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.skinning_vertex=\"#ifdef USE_SKINNING\\n\\n\\t#ifdef USE_MORPHTARGETS\\n\\n\\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\\n\\n\\t#else\\n\\n\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\n\\t#endif\\n\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\tskinned = bindMatrixInverse * skinned;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.envmap_pars_vertex=\"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\\n\\n\\tvarying vec3 vReflect;\\n\\n\\tuniform float refractionRatio;\\n\\tuniform bool useRefract;\\n\\n#endif\\n\";THREE.ShaderChunk.linear_to_gamma_fragment=\"#ifdef GAMMA_OUTPUT\\n\\n\\tgl_FragColor.xyz = sqrt( gl_FragColor.xyz );\\n\\n#endif\";THREE.ShaderChunk.color_pars_vertex=\"#ifdef USE_COLOR\\n\\n\\tvarying vec3 vColor;\\n\\n#endif\";THREE.ShaderChunk.lights_lambert_pars_vertex=\"uniform vec3 ambient;\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\n\\nuniform vec3 ambientLightColor;\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\n#endif\\n\\n#ifdef WRAP_AROUND\\n\\n\\tuniform vec3 wrapRGB;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.map_pars_vertex=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvarying vec2 vUv;\\n\\tuniform vec4 offsetRepeat;\\n\\n#endif\\n\";THREE.ShaderChunk.envmap_fragment=\"#ifdef USE_ENVMAP\\n\\n\\tvec3 reflectVec;\\n\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\\n\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\n\\t\\t// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\\n\\t\\t// Transforming Normal Vectors with the Inverse Transformation\\n\\n\\t\\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\\n\\n\\t\\tif ( useRefract ) {\\n\\n\\t\\t\\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\n\\t\\t} else { \\n\\n\\t\\t\\treflectVec = reflect( cameraToVertex, worldNormal );\\n\\n\\t\\t}\\n\\n\\t#else\\n\\n\\t\\treflectVec = vReflect;\\n\\n\\t#endif\\n\\n\\t#ifdef DOUBLE_SIDED\\n\\n\\t\\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\\n\\t\\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\n\\t#else\\n\\n\\t\\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\n\\t#endif\\n\\n\\t#ifdef GAMMA_INPUT\\n\\n\\t\\tcubeColor.xyz *= cubeColor.xyz;\\n\\n\\t#endif\\n\\n\\tif ( combine == 1 ) {\\n\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\\n\\n\\t} else if ( combine == 2 ) {\\n\\n\\t\\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\\n\\n\\t} else {\\n\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.specularmap_pars_fragment=\"#ifdef USE_SPECULARMAP\\n\\n\\tuniform sampler2D specularMap;\\n\\n#endif\";THREE.ShaderChunk.logdepthbuf_vertex=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\tgl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\n#else\\n\\n\\t\\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.morphtarget_pars_vertex=\"#ifdef USE_MORPHTARGETS\\n\\n\\t#ifndef USE_MORPHNORMALS\\n\\n\\tuniform float morphTargetInfluences[ 8 ];\\n\\n\\t#else\\n\\n\\tuniform float morphTargetInfluences[ 4 ];\\n\\n\\t#endif\\n\\n#endif\";\nTHREE.ShaderChunk.specularmap_fragment=\"float specularStrength;\\n\\n#ifdef USE_SPECULARMAP\\n\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n\\n#else\\n\\n\\tspecularStrength = 1.0;\\n\\n#endif\";THREE.ShaderChunk.fog_fragment=\"#ifdef USE_FOG\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\\n\\t#else\\n\\n\\t\\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\\n\\t#endif\\n\\n\\t#ifdef FOG_EXP2\\n\\n\\t\\tconst float LOG2 = 1.442695;\\n\\t\\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\\n\\t\\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n\\n\\t#else\\n\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\\n\\n\\t#endif\\n\\t\\n\\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\\n\\n#endif\";\nTHREE.ShaderChunk.bumpmap_pars_fragment=\"#ifdef USE_BUMPMAP\\n\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\n\\t\\t\\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\\n\\t\\t\\t//\\thttp://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\\n\\n\\t\\t\\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\\n\\n\\tvec2 dHdxy_fwd() {\\n\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\n\\t\\treturn vec2( dBx, dBy );\\n\\n\\t}\\n\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\\n\\n\\t\\tvec3 vSigmaX = dFdx( surf_pos );\\n\\t\\tvec3 vSigmaY = dFdy( surf_pos );\\n\\t\\tvec3 vN = surf_norm;\\t\\t// normalized\\n\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\n\\t\\tfloat fDet = dot( vSigmaX, R1 );\\n\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.defaultnormal_vertex=\"vec3 objectNormal;\\n\\n#ifdef USE_SKINNING\\n\\n\\tobjectNormal = skinnedNormal.xyz;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS )\\n\\n\\tobjectNormal = morphedNormal;\\n\\n#endif\\n\\n#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS )\\n\\n\\tobjectNormal = normal;\\n\\n#endif\\n\\n#ifdef FLIP_SIDED\\n\\n\\tobjectNormal = -objectNormal;\\n\\n#endif\\n\\nvec3 transformedNormal = normalMatrix * objectNormal;\";\nTHREE.ShaderChunk.lights_phong_pars_fragment=\"uniform vec3 ambientLightColor;\\n\\n#if MAX_DIR_LIGHTS > 0\\n\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_HEMI_LIGHTS > 0\\n\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_POINT_LIGHTS > 0\\n\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0\\n\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n\\n#endif\\n\\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\\n\\n\\tvarying vec3 vWorldPosition;\\n\\n#endif\\n\\n#ifdef WRAP_AROUND\\n\\n\\tuniform vec3 wrapRGB;\\n\\n#endif\\n\\nvarying vec3 vViewPosition;\\nvarying vec3 vNormal;\";\nTHREE.ShaderChunk.skinbase_vertex=\"#ifdef USE_SKINNING\\n\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n\\n#endif\";THREE.ShaderChunk.map_vertex=\"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\\n\\n\\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\\n\\n#endif\";\nTHREE.ShaderChunk.lightmap_fragment=\"#ifdef USE_LIGHTMAP\\n\\n\\tgl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\\n\\n#endif\";THREE.ShaderChunk.shadowmap_pars_vertex=\"#ifdef USE_SHADOWMAP\\n\\n\\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\\n\\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\\n\\n#endif\";THREE.ShaderChunk.color_fragment=\"#ifdef USE_COLOR\\n\\n\\tgl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\\n\\n#endif\";THREE.ShaderChunk.morphtarget_vertex=\"#ifdef USE_MORPHTARGETS\\n\\n\\tvec3 morphed = vec3( 0.0 );\\n\\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\\n\\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\\n\\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\\n\\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\\n\\n\\t#ifndef USE_MORPHNORMALS\\n\\n\\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\\n\\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\\n\\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\\n\\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\\n\\n\\t#endif\\n\\n\\tmorphed += position;\\n\\n#endif\";\nTHREE.ShaderChunk.envmap_vertex=\"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\\n\\n\\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\\n\\tworldNormal = normalize( worldNormal );\\n\\n\\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\n\\tif ( useRefract ) {\\n\\n\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\n\\t} else {\\n\\n\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.shadowmap_fragment=\"#ifdef USE_SHADOWMAP\\n\\n\\t#ifdef SHADOWMAP_DEBUG\\n\\n\\t\\tvec3 frustumColors[3];\\n\\t\\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\\n\\t\\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\\n\\t\\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\\n\\n\\t#endif\\n\\n\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\tint inFrustumCount = 0;\\n\\n\\t#endif\\n\\n\\tfloat fDepth;\\n\\tvec3 shadowColor = vec3( 1.0 );\\n\\n\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\n\\t\\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\\n\\n\\t\\t\\t\\t// if ( something && something ) breaks ATI OpenGL shader compiler\\n\\t\\t\\t\\t// if ( all( something, something ) ) using this instead\\n\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\n\\t\\t\\t\\t// don't shadow pixels outside of light frustum\\n\\t\\t\\t\\t// use just first frustum (for cascades)\\n\\t\\t\\t\\t// don't shadow pixels behind far plane of light frustum\\n\\n\\t\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\t\\tinFrustumCount += int( inFrustum );\\n\\t\\t\\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\\n\\n\\t\\t#else\\n\\n\\t\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\n\\t\\t#endif\\n\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\n\\t\\tif ( frustumTest ) {\\n\\n\\t\\t\\tshadowCoord.z += shadowBias[ i ];\\n\\n\\t\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\n\\t\\t\\t\\t\\t\\t// Percentage-close filtering\\n\\t\\t\\t\\t\\t\\t// (9 pixel kernel)\\n\\t\\t\\t\\t\\t\\t// http://fabiensanglard.net/shadowmappingPCF/\\n\\n\\t\\t\\t\\tfloat shadow = 0.0;\\n\\n\\t\\t/*\\n\\t\\t\\t\\t\\t\\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\\n\\t\\t\\t\\t\\t\\t// must enroll loop manually\\n\\n\\t\\t\\t\\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\\n\\t\\t\\t\\t\\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\\n\\n\\t\\t\\t\\t\\t\\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\\n\\n\\t\\t\\t\\t\\t\\t\\t\\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\\n\\t\\t\\t\\t\\t\\t\\t\\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\\n\\n\\t\\t\\t\\t\\t\\tfloat fDepth = unpackDepth( rgbaDepth );\\n\\n\\t\\t\\t\\t\\t\\tif ( fDepth < shadowCoord.z )\\n\\t\\t\\t\\t\\t\\t\\tshadow += 1.0;\\n\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tshadow /= 9.0;\\n\\n\\t\\t*/\\n\\n\\t\\t\\t\\tconst float shadowDelta = 1.0 / 9.0;\\n\\n\\t\\t\\t\\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\\n\\t\\t\\t\\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\\n\\n\\t\\t\\t\\tfloat dx0 = -1.25 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy0 = -1.25 * yPixelOffset;\\n\\t\\t\\t\\tfloat dx1 = 1.25 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy1 = 1.25 * yPixelOffset;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\\n\\n\\t\\t\\t\\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\\n\\n\\t\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\n\\t\\t\\t\\t\\t\\t// Percentage-close filtering\\n\\t\\t\\t\\t\\t\\t// (9 pixel kernel)\\n\\t\\t\\t\\t\\t\\t// http://fabiensanglard.net/shadowmappingPCF/\\n\\n\\t\\t\\t\\tfloat shadow = 0.0;\\n\\n\\t\\t\\t\\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\\n\\t\\t\\t\\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\\n\\n\\t\\t\\t\\tfloat dx0 = -1.0 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy0 = -1.0 * yPixelOffset;\\n\\t\\t\\t\\tfloat dx1 = 1.0 * xPixelOffset;\\n\\t\\t\\t\\tfloat dy1 = 1.0 * yPixelOffset;\\n\\n\\t\\t\\t\\tmat3 shadowKernel;\\n\\t\\t\\t\\tmat3 depthKernel;\\n\\n\\t\\t\\t\\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\\n\\t\\t\\t\\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\\n\\t\\t\\t\\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\\n\\t\\t\\t\\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\\n\\t\\t\\t\\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\\n\\n\\t\\t\\t\\tvec3 shadowZ = vec3( shadowCoord.z );\\n\\t\\t\\t\\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[0] *= vec3(0.25);\\n\\n\\t\\t\\t\\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[1] *= vec3(0.25);\\n\\n\\t\\t\\t\\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\\n\\t\\t\\t\\tshadowKernel[2] *= vec3(0.25);\\n\\n\\t\\t\\t\\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\\n\\n\\t\\t\\t\\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\\n\\t\\t\\t\\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\\n\\n\\t\\t\\t\\tvec4 shadowValues;\\n\\t\\t\\t\\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\\n\\t\\t\\t\\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\\n\\n\\t\\t\\t\\tshadow = dot( shadowValues, vec4( 1.0 ) );\\n\\n\\t\\t\\t\\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\\n\\t\\t\\t\\tfloat fDepth = unpackDepth( rgbaDepth );\\n\\n\\t\\t\\t\\tif ( fDepth < shadowCoord.z )\\n\\n\\t\\t// spot with multiple shadows is darker\\n\\n\\t\\t\\t\\t\\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\\n\\n\\t\\t// spot with multiple shadows has the same color as single shadow spot\\n\\n\\t\\t// \\t\\t\\t\\t\\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t}\\n\\n\\n\\t\\t#ifdef SHADOWMAP_DEBUG\\n\\n\\t\\t\\t#ifdef SHADOWMAP_CASCADE\\n\\n\\t\\t\\t\\tif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\\n\\n\\t\\t\\t#else\\n\\n\\t\\t\\t\\tif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\\n\\n\\t\\t\\t#endif\\n\\n\\t\\t#endif\\n\\n\\t}\\n\\n\\t#ifdef GAMMA_OUTPUT\\n\\n\\t\\tshadowColor *= shadowColor;\\n\\n\\t#endif\\n\\n\\tgl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\\n\\n#endif\\n\";\nTHREE.ShaderChunk.worldpos_vertex=\"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\\n\\n\\t#ifdef USE_SKINNING\\n\\n\\t\\tvec4 worldPosition = modelMatrix * skinned;\\n\\n\\t#endif\\n\\n\\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\\n\\n\\t\\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\\n\\n\\t#endif\\n\\n\\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\\n\\n\\t\\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\\n\\n\\t#endif\\n\\n#endif\";\nTHREE.ShaderChunk.shadowmap_pars_fragment=\"#ifdef USE_SHADOWMAP\\n\\n\\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\\n\\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\\n\\n\\tuniform float shadowDarkness[ MAX_SHADOWS ];\\n\\tuniform float shadowBias[ MAX_SHADOWS ];\\n\\n\\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\\n\\n\\tfloat unpackDepth( const in vec4 rgba_depth ) {\\n\\n\\t\\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\\n\\t\\tfloat depth = dot( rgba_depth, bit_shift );\\n\\t\\treturn depth;\\n\\n\\t}\\n\\n#endif\";\nTHREE.ShaderChunk.skinning_pars_vertex=\"#ifdef USE_SKINNING\\n\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\n\\t#ifdef BONE_TEXTURE\\n\\n\\t\\tuniform sampler2D boneTexture;\\n\\t\\tuniform int boneTextureWidth;\\n\\t\\tuniform int boneTextureHeight;\\n\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureWidth ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureWidth ) );\\n\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureWidth );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureHeight );\\n\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\n\\t\\t\\treturn bone;\\n\\n\\t\\t}\\n\\n\\t#else\\n\\n\\t\\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\\n\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\n\\t\\t\\tmat4 bone = boneGlobalMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\n\\t\\t}\\n\\n\\t#endif\\n\\n#endif\\n\";\nTHREE.ShaderChunk.logdepthbuf_pars_fragment=\"#ifdef USE_LOGDEPTHBUF\\n\\n\\tuniform float logDepthBufFC;\\n\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\n\\t\\t#extension GL_EXT_frag_depth : enable\\n\\t\\tvarying float vFragDepth;\\n\\n\\t#endif\\n\\n#endif\";THREE.ShaderChunk.alphamap_fragment=\"#ifdef USE_ALPHAMAP\\n\\n\\tgl_FragColor.a *= texture2D( alphaMap, vUv ).g;\\n\\n#endif\\n\";THREE.ShaderChunk.alphamap_pars_fragment=\"#ifdef USE_ALPHAMAP\\n\\n\\tuniform sampler2D alphaMap;\\n\\n#endif\\n\";\nTHREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b<a.length;b++)for(c in d=this.clone(a[b]),d)e[c]=d[c];return e},clone:function(a){var b,c,d,e={};for(b in a)for(c in e[b]={},a[b])d=a[b][c],e[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector2||d instanceof THREE.Vector3||d instanceof THREE.Vector4||d instanceof THREE.Matrix4||d instanceof THREE.Texture?d.clone():d instanceof Array?d.slice():d;return e}};\nTHREE.UniformsLib={common:{diffuse:{type:\"c\",value:new THREE.Color(15658734)},opacity:{type:\"f\",value:1},map:{type:\"t\",value:null},offsetRepeat:{type:\"v4\",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:\"t\",value:null},specularMap:{type:\"t\",value:null},alphaMap:{type:\"t\",value:null},envMap:{type:\"t\",value:null},flipEnvMap:{type:\"f\",value:-1},useRefract:{type:\"i\",value:0},reflectivity:{type:\"f\",value:1},refractionRatio:{type:\"f\",value:.98},combine:{type:\"i\",value:0},morphTargetInfluences:{type:\"f\",\nvalue:0}},bump:{bumpMap:{type:\"t\",value:null},bumpScale:{type:\"f\",value:1}},normalmap:{normalMap:{type:\"t\",value:null},normalScale:{type:\"v2\",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:\"f\",value:2.5E-4},fogNear:{type:\"f\",value:1},fogFar:{type:\"f\",value:2E3},fogColor:{type:\"c\",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:\"fv\",value:[]},directionalLightDirection:{type:\"fv\",value:[]},directionalLightColor:{type:\"fv\",value:[]},hemisphereLightDirection:{type:\"fv\",value:[]},\nhemisphereLightSkyColor:{type:\"fv\",value:[]},hemisphereLightGroundColor:{type:\"fv\",value:[]},pointLightColor:{type:\"fv\",value:[]},pointLightPosition:{type:\"fv\",value:[]},pointLightDistance:{type:\"fv1\",value:[]},spotLightColor:{type:\"fv\",value:[]},spotLightPosition:{type:\"fv\",value:[]},spotLightDirection:{type:\"fv\",value:[]},spotLightDistance:{type:\"fv1\",value:[]},spotLightAngleCos:{type:\"fv1\",value:[]},spotLightExponent:{type:\"fv1\",value:[]}},particle:{psColor:{type:\"c\",value:new THREE.Color(15658734)},\nopacity:{type:\"f\",value:1},size:{type:\"f\",value:1},scale:{type:\"f\",value:1},map:{type:\"t\",value:null},fogDensity:{type:\"f\",value:2.5E-4},fogNear:{type:\"f\",value:1},fogFar:{type:\"f\",value:2E3},fogColor:{type:\"c\",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:\"tv\",value:[]},shadowMapSize:{type:\"v2v\",value:[]},shadowBias:{type:\"fv1\",value:[]},shadowDarkness:{type:\"fv1\",value:[]},shadowMatrix:{type:\"m4v\",value:[]}}};\nTHREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,\nTHREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,\"\\t#ifdef USE_ENVMAP\",THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,\"\\t#endif\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),\nfragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( diffuse, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,\nTHREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,\n{ambient:{type:\"c\",value:new THREE.Color(16777215)},emissive:{type:\"c\",value:new THREE.Color(0)},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),vertexShader:[\"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,\nTHREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,\nTHREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float opacity;\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,\nTHREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,\"\\t#ifdef DOUBLE_SIDED\\n\\t\\tif ( gl_FrontFacing )\\n\\t\\t\\tgl_FragColor.xyz *= vLightFront;\\n\\t\\telse\\n\\t\\t\\tgl_FragColor.xyz *= vLightBack;\\n\\t#else\\n\\t\\tgl_FragColor.xyz *= vLightFront;\\n\\t#endif\",\nTHREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.bump,THREE.UniformsLib.normalmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:\"c\",value:new THREE.Color(16777215)},emissive:{type:\"c\",value:new THREE.Color(0)},\nspecular:{type:\"c\",value:new THREE.Color(1118481)},shininess:{type:\"f\",value:30},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),vertexShader:[\"#define PHONG\\nvarying vec3 vViewPosition;\\nvarying vec3 vNormal;\",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,\nTHREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,\"\\tvNormal = normalize( transformedNormal );\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"\\tvViewPosition = -mvPosition.xyz;\",\nTHREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform vec3 ambient;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,\nTHREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,\nTHREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:[\"uniform float size;\\nuniform float scale;\",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,\nTHREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.color_vertex,\"\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );\\n\\t#else\\n\\t\\tgl_PointSize = size;\\n\\t#endif\\n\\tgl_Position = projectionMatrix * mvPosition;\",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 psColor;\\nuniform float opacity;\",\nTHREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( psColor, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,\nTHREE.UniformsLib.fog,{scale:{type:\"f\",value:1},dashSize:{type:\"f\",value:1},totalSize:{type:\"f\",value:2}}]),vertexShader:[\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.color_vertex,\"\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\",THREE.ShaderChunk.logdepthbuf_vertex,\n\"}\"].join(\"\\n\"),fragmentShader:[\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tgl_FragColor = vec4( diffuse, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,\n\"}\"].join(\"\\n\")},depth:{uniforms:{mNear:{type:\"f\",value:1},mFar:{type:\"f\",value:2E3},opacity:{type:\"f\",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float mNear;\\nuniform float mFar;\\nuniform float opacity;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\",THREE.ShaderChunk.logdepthbuf_fragment,\n\"\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\\t#else\\n\\t\\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\\t#endif\\n\\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\\n\\tgl_FragColor = vec4( vec3( color ), opacity );\\n}\"].join(\"\\n\")},normal:{uniforms:{opacity:{type:\"f\",value:1}},vertexShader:[\"varying vec3 vNormal;\",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\\n\\tvNormal = normalize( normalMatrix * normal );\",\nTHREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform float opacity;\\nvarying vec3 vNormal;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\",THREE.ShaderChunk.logdepthbuf_fragment,\"}\"].join(\"\\n\")},normalmap:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:\"i\",\nvalue:0},enableDiffuse:{type:\"i\",value:0},enableSpecular:{type:\"i\",value:0},enableReflection:{type:\"i\",value:0},enableDisplacement:{type:\"i\",value:0},tDisplacement:{type:\"t\",value:null},tDiffuse:{type:\"t\",value:null},tCube:{type:\"t\",value:null},tNormal:{type:\"t\",value:null},tSpecular:{type:\"t\",value:null},tAO:{type:\"t\",value:null},uNormalScale:{type:\"v2\",value:new THREE.Vector2(1,1)},uDisplacementBias:{type:\"f\",value:0},uDisplacementScale:{type:\"f\",value:1},diffuse:{type:\"c\",value:new THREE.Color(16777215)},\nspecular:{type:\"c\",value:new THREE.Color(1118481)},ambient:{type:\"c\",value:new THREE.Color(16777215)},shininess:{type:\"f\",value:30},opacity:{type:\"f\",value:1},useRefract:{type:\"i\",value:0},refractionRatio:{type:\"f\",value:.98},reflectivity:{type:\"f\",value:.5},uOffset:{type:\"v2\",value:new THREE.Vector2(0,0)},uRepeat:{type:\"v2\",value:new THREE.Vector2(1,1)},wrapRGB:{type:\"v3\",value:new THREE.Vector3(1,1,1)}}]),fragmentShader:[\"uniform vec3 ambient;\\nuniform vec3 diffuse;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\nuniform bool enableDiffuse;\\nuniform bool enableSpecular;\\nuniform bool enableAO;\\nuniform bool enableReflection;\\nuniform sampler2D tDiffuse;\\nuniform sampler2D tNormal;\\nuniform sampler2D tSpecular;\\nuniform sampler2D tAO;\\nuniform samplerCube tCube;\\nuniform vec2 uNormalScale;\\nuniform bool useRefract;\\nuniform float refractionRatio;\\nuniform float reflectivity;\\nvarying vec3 vTangent;\\nvarying vec3 vBinormal;\\nvarying vec3 vNormal;\\nvarying vec2 vUv;\\nuniform vec3 ambientLightColor;\\n#if MAX_DIR_LIGHTS > 0\\n\\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\\n\\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\\n#endif\\n#if MAX_HEMI_LIGHTS > 0\\n\\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\\n\\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\\n#endif\\n#if MAX_POINT_LIGHTS > 0\\n\\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\\n\\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\\n\\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\\n#endif\\n#if MAX_SPOT_LIGHTS > 0\\n\\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\\n\\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\\n\\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\\n#endif\\n#ifdef WRAP_AROUND\\n\\tuniform vec3 wrapRGB;\\n#endif\\nvarying vec3 vWorldPosition;\\nvarying vec3 vViewPosition;\",\nTHREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\",THREE.ShaderChunk.logdepthbuf_fragment,\"\\tgl_FragColor = vec4( vec3( 1.0 ), opacity );\\n\\tvec3 specularTex = vec3( 1.0 );\\n\\tvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\\n\\tnormalTex.xy *= uNormalScale;\\n\\tnormalTex = normalize( normalTex );\\n\\tif( enableDiffuse ) {\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tvec4 texelColor = texture2D( tDiffuse, vUv );\\n\\t\\t\\ttexelColor.xyz *= texelColor.xyz;\\n\\t\\t\\tgl_FragColor = gl_FragColor * texelColor;\\n\\t\\t#else\\n\\t\\t\\tgl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\\n\\t\\t#endif\\n\\t}\\n\\tif( enableAO ) {\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tvec4 aoColor = texture2D( tAO, vUv );\\n\\t\\t\\taoColor.xyz *= aoColor.xyz;\\n\\t\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\\n\\t\\t#else\\n\\t\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\\n\\t\\t#endif\\n\\t}\",\nTHREE.ShaderChunk.alphatest_fragment,\"\\tif( enableSpecular )\\n\\t\\tspecularTex = texture2D( tSpecular, vUv ).xyz;\\n\\tmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\\n\\tvec3 finalNormal = tsb * normalTex;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tfinalNormal = -finalNormal;\\n\\t#endif\\n\\tvec3 normal = normalize( finalNormal );\\n\\tvec3 viewPosition = normalize( vViewPosition );\\n\\t#if MAX_POINT_LIGHTS > 0\\n\\t\\tvec3 pointDiffuse = vec3( 0.0 );\\n\\t\\tvec3 pointSpecular = vec3( 0.0 );\\n\\t\\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\\n\\t\\t\\tvec3 pointVector = lPosition.xyz + vViewPosition.xyz;\\n\\t\\t\\tfloat pointDistance = 1.0;\\n\\t\\t\\tif ( pointLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tpointDistance = 1.0 - min( ( length( pointVector ) / pointLightDistance[ i ] ), 1.0 );\\n\\t\\t\\tpointVector = normalize( pointVector );\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\tfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\\n\\t\\t\\t\\tfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t\\tpointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\\n\\t\\t\\tvec3 pointHalfVector = normalize( pointVector + viewPosition );\\n\\t\\t\\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\\n\\t\\t\\tfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( pointVector, pointHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tpointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_SPOT_LIGHTS > 0\\n\\t\\tvec3 spotDiffuse = vec3( 0.0 );\\n\\t\\tvec3 spotSpecular = vec3( 0.0 );\\n\\t\\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\\n\\t\\t\\tvec3 spotVector = lPosition.xyz + vViewPosition.xyz;\\n\\t\\t\\tfloat spotDistance = 1.0;\\n\\t\\t\\tif ( spotLightDistance[ i ] > 0.0 )\\n\\t\\t\\t\\tspotDistance = 1.0 - min( ( length( spotVector ) / spotLightDistance[ i ] ), 1.0 );\\n\\t\\t\\tspotVector = normalize( spotVector );\\n\\t\\t\\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\\n\\t\\t\\tif ( spotEffect > spotLightAngleCos[ i ] ) {\\n\\t\\t\\t\\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\\n\\t\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeightFull = max( dot( normal, spotVector ), 0.0 );\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeightHalf = max( 0.5 * dot( normal, spotVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\t\\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\tfloat spotDiffuseWeight = max( dot( normal, spotVector ), 0.0 );\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tspotDiffuse += spotDistance * spotLightColor[ i ] * diffuse * spotDiffuseWeight * spotEffect;\\n\\t\\t\\t\\tvec3 spotHalfVector = normalize( spotVector + viewPosition );\\n\\t\\t\\t\\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\\n\\t\\t\\t\\tfloat spotSpecularWeight = specularTex.r * max( pow( spotDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( spotVector, spotHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\t\\tspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * spotDistance * specularNormalization * spotEffect;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_DIR_LIGHTS > 0\\n\\t\\tvec3 dirDiffuse = vec3( 0.0 );\\n\\t\\tvec3 dirSpecular = vec3( 0.0 );\\n\\t\\tfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\\n\\t\\t\\tvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\\n\\t\\t\\tvec3 dirVector = normalize( lDirection.xyz );\\n\\t\\t\\t#ifdef WRAP_AROUND\\n\\t\\t\\t\\tfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\\n\\t\\t\\t\\tfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\\n\\t\\t\\t\\tvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\\n\\t\\t\\t#else\\n\\t\\t\\t\\tfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\\n\\t\\t\\t#endif\\n\\t\\t\\tdirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\\n\\t\\t\\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\\n\\t\\t\\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\\n\\t\\t\\tfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\\n\\t\\t\\tdirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\\n\\t\\t}\\n\\t#endif\\n\\t#if MAX_HEMI_LIGHTS > 0\\n\\t\\tvec3 hemiDiffuse = vec3( 0.0 );\\n\\t\\tvec3 hemiSpecular = vec3( 0.0 );\\n\\t\\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tvec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\\n\\t\\t\\tvec3 lVector = normalize( lDirection.xyz );\\n\\t\\t\\tfloat dotProduct = dot( normal, lVector );\\n\\t\\t\\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\\n\\t\\t\\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\\n\\t\\t\\themiDiffuse += diffuse * hemiColor;\\n\\t\\t\\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\\n\\t\\t\\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\\n\\t\\t\\tfloat hemiSpecularWeightSky = specularTex.r * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\\n\\t\\t\\tvec3 lVectorGround = -lVector;\\n\\t\\t\\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\\n\\t\\t\\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\\n\\t\\t\\tfloat hemiSpecularWeightGround = specularTex.r * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\\n\\t\\t\\tfloat dotProductGround = dot( normal, lVectorGround );\\n\\t\\t\\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\\n\\t\\t\\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\\n\\t\\t\\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\\n\\t\\t\\themiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\\n\\t\\t}\\n\\t#endif\\n\\tvec3 totalDiffuse = vec3( 0.0 );\\n\\tvec3 totalSpecular = vec3( 0.0 );\\n\\t#if MAX_DIR_LIGHTS > 0\\n\\t\\ttotalDiffuse += dirDiffuse;\\n\\t\\ttotalSpecular += dirSpecular;\\n\\t#endif\\n\\t#if MAX_HEMI_LIGHTS > 0\\n\\t\\ttotalDiffuse += hemiDiffuse;\\n\\t\\ttotalSpecular += hemiSpecular;\\n\\t#endif\\n\\t#if MAX_POINT_LIGHTS > 0\\n\\t\\ttotalDiffuse += pointDiffuse;\\n\\t\\ttotalSpecular += pointSpecular;\\n\\t#endif\\n\\t#if MAX_SPOT_LIGHTS > 0\\n\\t\\ttotalDiffuse += spotDiffuse;\\n\\t\\ttotalSpecular += spotSpecular;\\n\\t#endif\\n\\t#ifdef METAL\\n\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\\n\\t#else\\n\\t\\tgl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\\n\\t#endif\\n\\tif ( enableReflection ) {\\n\\t\\tvec3 vReflect;\\n\\t\\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\\n\\t\\tif ( useRefract ) {\\n\\t\\t\\tvReflect = refract( cameraToVertex, normal, refractionRatio );\\n\\t\\t} else {\\n\\t\\t\\tvReflect = reflect( cameraToVertex, normal );\\n\\t\\t}\\n\\t\\tvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\\n\\t\\t#ifdef GAMMA_INPUT\\n\\t\\t\\tcubeColor.xyz *= cubeColor.xyz;\\n\\t\\t#endif\\n\\t\\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * reflectivity );\\n\\t}\",\nTHREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,\"}\"].join(\"\\n\"),vertexShader:[\"attribute vec4 tangent;\\nuniform vec2 uOffset;\\nuniform vec2 uRepeat;\\nuniform bool enableDisplacement;\\n#ifdef VERTEX_TEXTURES\\n\\tuniform sampler2D tDisplacement;\\n\\tuniform float uDisplacementScale;\\n\\tuniform float uDisplacementBias;\\n#endif\\nvarying vec3 vTangent;\\nvarying vec3 vBinormal;\\nvarying vec3 vNormal;\\nvarying vec2 vUv;\\nvarying vec3 vWorldPosition;\\nvarying vec3 vViewPosition;\",\nTHREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,\"\\t#ifdef USE_SKINNING\\n\\t\\tvNormal = normalize( normalMatrix * skinnedNormal.xyz );\\n\\t\\tvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\\n\\t\\tvTangent = normalize( normalMatrix * skinnedTangent.xyz );\\n\\t#else\\n\\t\\tvNormal = normalize( normalMatrix * normal );\\n\\t\\tvTangent = normalize( normalMatrix * tangent.xyz );\\n\\t#endif\\n\\tvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\tvUv = uv * uRepeat + uOffset;\\n\\tvec3 displacedPosition;\\n\\t#ifdef VERTEX_TEXTURES\\n\\t\\tif ( enableDisplacement ) {\\n\\t\\t\\tvec3 dv = texture2D( tDisplacement, uv ).xyz;\\n\\t\\t\\tfloat df = uDisplacementScale * dv.x + uDisplacementBias;\\n\\t\\t\\tdisplacedPosition = position + normalize( normal ) * df;\\n\\t\\t} else {\\n\\t\\t\\t#ifdef USE_SKINNING\\n\\t\\t\\t\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\t\\t\\t\\tvec4 skinned = vec4( 0.0 );\\n\\t\\t\\t\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\t\\t\\t\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\t\\t\\t\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\t\\t\\t\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\t\\t\\t\\tskinned = bindMatrixInverse * skinned;\\n\\t\\t\\t\\tdisplacedPosition = skinned.xyz;\\n\\t\\t\\t#else\\n\\t\\t\\t\\tdisplacedPosition = position;\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifdef USE_SKINNING\\n\\t\\t\\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\\n\\t\\t\\tvec4 skinned = vec4( 0.0 );\\n\\t\\t\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\t\\t\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\t\\t\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\t\\t\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\t\\t\\tskinned = bindMatrixInverse * skinned;\\n\\t\\t\\tdisplacedPosition = skinned.xyz;\\n\\t\\t#else\\n\\t\\t\\tdisplacedPosition = position;\\n\\t\\t#endif\\n\\t#endif\\n\\tvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\\n\\tvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\",\nTHREE.ShaderChunk.logdepthbuf_vertex,\"\\tvWorldPosition = worldPosition.xyz;\\n\\tvViewPosition = -mvPosition.xyz;\\n\\t#ifdef USE_SHADOWMAP\\n\\t\\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\\n\\t\\t\\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\\n\\t\\t}\\n\\t#endif\\n}\"].join(\"\\n\")},cube:{uniforms:{tCube:{type:\"t\",value:null},tFlip:{type:\"f\",value:-1}},vertexShader:[\"varying vec3 vWorldPosition;\",THREE.ShaderChunk.logdepthbuf_pars_vertex,\"void main() {\\n\\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\\n\\tvWorldPosition = worldPosition.xyz;\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\nTHREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[\"uniform samplerCube tCube;\\nuniform float tFlip;\\nvarying vec3 vWorldPosition;\",THREE.ShaderChunk.logdepthbuf_pars_fragment,\"void main() {\\n\\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\",THREE.ShaderChunk.logdepthbuf_fragment,\"}\"].join(\"\\n\")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,\n\"void main() {\",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,\"}\"].join(\"\\n\"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,\"vec4 pack_depth( const in float depth ) {\\n\\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\\n\\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\\n\\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\\n\\tres -= res.xxyz * bit_mask;\\n\\treturn res;\\n}\\nvoid main() {\",\nTHREE.ShaderChunk.logdepthbuf_fragment,\"\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\\n\\t#else\\n\\t\\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\\n\\t#endif\\n}\"].join(\"\\n\")}};\nTHREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;\"v2\"===f.type?g=2:\"v3\"===f.type?g=3:\"v4\"===f.type?g=4:\"c\"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}\nfunction c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),n=f(g),r=e(g),p=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);r&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));p&&(a.__colorArray=new Float32Array(3*h));n&&(0<c.faceVertexUvs.length&&(a.__uvArray=new Float32Array(2*h)),1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*h)));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&\n(a.__skinIndexArray=new Float32Array(4*h),a.__skinWeightArray=new Float32Array(4*h));c=null!==Eb&&21845<k?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*k);a.__lineArray=new c(2*l);if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,n=a.numMorphTargets;c<n;c++)a.__morphTargetsArrays.push(new Float32Array(3*h));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,n=a.numMorphNormals;c<n;c++)a.__morphNormalsArrays.push(new Float32Array(3*h));a.__webglFaceCount=3*k;a.__webglLineCount=\n2*l;if(g.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var q in g.attributes){var k=g.attributes[q],l={},s;for(s in k)l[s]=k[s];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,\"v2\"===l.type?c=2:\"v3\"===l.type?c=3:\"v4\"===l.type?c=4:\"c\"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=q,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=\n!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a.alphaMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a){for(var b in a.attributes){var c=\n\"index\"===b?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,d=a.attributes[b];d.buffer=m.createBuffer();m.bindBuffer(c,d.buffer);m.bufferData(c,d.array,m.STATIC_DRAW)}}function h(a,b,c,d){for(var e in b){var f=b[e],g=c[e];if(0<=f)if(g){var h=g.itemSize;m.bindBuffer(m.ARRAY_BUFFER,g.buffer);l(f);m.vertexAttribPointer(f,h,m.FLOAT,!1,0,d*h*4)}else a.defaultAttributeValues&&(2===a.defaultAttributeValues[e].length?m.vertexAttrib2fv(f,a.defaultAttributeValues[e]):3===a.defaultAttributeValues[e].length&&m.vertexAttrib3fv(f,\na.defaultAttributeValues[e]))}n()}function k(){for(var a=0,b=pb.length;a<b;a++)pb[a]=0}function l(a){pb[a]=1;0===tb[a]&&(m.enableVertexAttribArray(a),tb[a]=1)}function n(){for(var a=0,b=tb.length;a<b;a++)tb[a]!==pb[a]&&(m.disableVertexAttribArray(a),tb[a]=0)}function q(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function r(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function t(a,b){return b[0]-a[0]}function s(a,b,h){if(!1!==b.visible){var k=a.__webglObjects[b.id];if(k&&(!1===b.frustumCulled||!0===jc.intersectsObject(b))){var l=\nb.geometry,n,r,p;if(l instanceof THREE.BufferGeometry){var q=m.DYNAMIC_DRAW,w=l.attributes,u,v;for(u in w)v=w[u],v.needsUpdate&&(\"index\"===u?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,v.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,v.array,q)):(m.bindBuffer(m.ARRAY_BUFFER,v.buffer),m.bufferData(m.ARRAY_BUFFER,v.array,q)),v.needsUpdate=!1)}else if(b instanceof THREE.Mesh){if(l.buffersNeedUpdate||l.groupsNeedUpdate)l instanceof THREE.BufferGeometry?g(l):b instanceof THREE.Mesh&&D(a,b,l);for(var A=0,z=l.geometryGroupsList.length;A<\nz;A++)if(n=l.geometryGroupsList[A],p=d(b,n),(l.buffersNeedUpdate||l.groupsNeedUpdate)&&c(n,b),r=p.attributes&&x(p),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var y=n,E=b,I=m.DYNAMIC_DRAW,J=!l.dynamic,L=p;if(y.__inittedArrays){var K=e(L),H=L.vertexColors?L.vertexColors:!1,Q=f(L),O=K===THREE.SmoothShading,B=void 0,N=void 0,P=void 0,T=void 0,R=void 0,ba=void 0,S=void 0,$=void 0,X=void 0,V=void 0,\nza=void 0,ga=void 0,ha=void 0,ia=void 0,Ea=void 0,aa=void 0,da=void 0,ya=void 0,U=void 0,ca=void 0,W=void 0,Ba=void 0,Aa=void 0,la=void 0,ma=void 0,oa=void 0,ra=void 0,ua=void 0,va=void 0,ja=void 0,Fa=void 0,Da=void 0,Ga=void 0,Ya=void 0,qa=void 0,Ka=void 0,xa=void 0,Ca=void 0,Ja=void 0,Qa=void 0,db=0,eb=0,Sa=0,Za=0,Ta=0,gb=0,Ua=0,ub=0,$a=0,wa=0,Ha=0,M=0,Ra=void 0,hb=y.__vertexArray,cb=y.__uvArray,fb=y.__uv2Array,yb=y.__normalArray,Va=y.__tangentArray,ib=y.__colorArray,Wa=y.__skinIndexArray,Xa=y.__skinWeightArray,\ntb=y.__morphTargetsArrays,wb=y.__morphNormalsArrays,sb=y.__webglCustomAttributesList,F=void 0,pb=y.__faceArray,zb=y.__lineArray,La=E.geometry,Db=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Eb=La.normalsNeedUpdate,Ob=La.tangentsNeedUpdate,Pb=La.colorsNeedUpdate,Sb=La.morphTargetsNeedUpdate,lc=La.vertices,ka=y.faces3,jb=La.faces,Hb=La.faceVertexUvs[0],Ib=La.faceVertexUvs[1],mc=La.skinIndices,Vb=La.skinWeights,Wb=La.morphTargets,Jb=La.morphNormals;if(La.verticesNeedUpdate){B=0;for(N=ka.length;B<N;B++)T=\njb[ka[B]],ga=lc[T.a],ha=lc[T.b],ia=lc[T.c],hb[eb]=ga.x,hb[eb+1]=ga.y,hb[eb+2]=ga.z,hb[eb+3]=ha.x,hb[eb+4]=ha.y,hb[eb+5]=ha.z,hb[eb+6]=ia.x,hb[eb+7]=ia.y,hb[eb+8]=ia.z,eb+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,hb,I)}if(Sb)for(qa=0,Ka=Wb.length;qa<Ka;qa++){B=Ha=0;for(N=ka.length;B<N;B++)Ja=ka[B],T=jb[Ja],ga=Wb[qa].vertices[T.a],ha=Wb[qa].vertices[T.b],ia=Wb[qa].vertices[T.c],xa=tb[qa],xa[Ha]=ga.x,xa[Ha+1]=ga.y,xa[Ha+2]=ga.z,xa[Ha+3]=ha.x,xa[Ha+4]=ha.y,xa[Ha+\n5]=ha.z,xa[Ha+6]=ia.x,xa[Ha+7]=ia.y,xa[Ha+8]=ia.z,L.morphNormals&&(O?(Qa=Jb[qa].vertexNormals[Ja],ya=Qa.a,U=Qa.b,ca=Qa.c):ca=U=ya=Jb[qa].faceNormals[Ja],Ca=wb[qa],Ca[Ha]=ya.x,Ca[Ha+1]=ya.y,Ca[Ha+2]=ya.z,Ca[Ha+3]=U.x,Ca[Ha+4]=U.y,Ca[Ha+5]=U.z,Ca[Ha+6]=ca.x,Ca[Ha+7]=ca.y,Ca[Ha+8]=ca.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphTargetsBuffers[qa]);m.bufferData(m.ARRAY_BUFFER,tb[qa],I);L.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphNormalsBuffers[qa]),m.bufferData(m.ARRAY_BUFFER,wb[qa],\nI))}if(Vb.length){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],la=Vb[T.a],ma=Vb[T.b],oa=Vb[T.c],Xa[wa]=la.x,Xa[wa+1]=la.y,Xa[wa+2]=la.z,Xa[wa+3]=la.w,Xa[wa+4]=ma.x,Xa[wa+5]=ma.y,Xa[wa+6]=ma.z,Xa[wa+7]=ma.w,Xa[wa+8]=oa.x,Xa[wa+9]=oa.y,Xa[wa+10]=oa.z,Xa[wa+11]=oa.w,ra=mc[T.a],ua=mc[T.b],va=mc[T.c],Wa[wa]=ra.x,Wa[wa+1]=ra.y,Wa[wa+2]=ra.z,Wa[wa+3]=ra.w,Wa[wa+4]=ua.x,Wa[wa+5]=ua.y,Wa[wa+6]=ua.z,Wa[wa+7]=ua.w,Wa[wa+8]=va.x,Wa[wa+9]=va.y,Wa[wa+10]=va.z,Wa[wa+11]=va.w,wa+=12;0<wa&&(m.bindBuffer(m.ARRAY_BUFFER,\ny.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,I),m.bindBuffer(m.ARRAY_BUFFER,y.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Xa,I))}if(Pb&&H){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],S=T.vertexColors,$=T.color,3===S.length&&H===THREE.VertexColors?(W=S[0],Ba=S[1],Aa=S[2]):Aa=Ba=W=$,ib[$a]=W.r,ib[$a+1]=W.g,ib[$a+2]=W.b,ib[$a+3]=Ba.r,ib[$a+4]=Ba.g,ib[$a+5]=Ba.b,ib[$a+6]=Aa.r,ib[$a+7]=Aa.g,ib[$a+8]=Aa.b,$a+=9;0<$a&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,\nib,I))}if(Ob&&La.hasTangents){B=0;for(N=ka.length;B<N;B++)T=jb[ka[B]],X=T.vertexTangents,Ea=X[0],aa=X[1],da=X[2],Va[Ua]=Ea.x,Va[Ua+1]=Ea.y,Va[Ua+2]=Ea.z,Va[Ua+3]=Ea.w,Va[Ua+4]=aa.x,Va[Ua+5]=aa.y,Va[Ua+6]=aa.z,Va[Ua+7]=aa.w,Va[Ua+8]=da.x,Va[Ua+9]=da.y,Va[Ua+10]=da.z,Va[Ua+11]=da.w,Ua+=12;m.bindBuffer(m.ARRAY_BUFFER,y.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Va,I)}if(Eb&&K){B=0;for(N=ka.length;B<N;B++)if(T=jb[ka[B]],R=T.vertexNormals,ba=T.normal,3===R.length&&O)for(ja=0;3>ja;ja++)Da=R[ja],\nyb[gb]=Da.x,yb[gb+1]=Da.y,yb[gb+2]=Da.z,gb+=3;else for(ja=0;3>ja;ja++)yb[gb]=ba.x,yb[gb+1]=ba.y,yb[gb+2]=ba.z,gb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,I)}if(xb&&Hb&&Q){B=0;for(N=ka.length;B<N;B++)if(P=ka[B],V=Hb[P],void 0!==V)for(ja=0;3>ja;ja++)Ga=V[ja],cb[Sa]=Ga.x,cb[Sa+1]=Ga.y,Sa+=2;0<Sa&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,I))}if(xb&&Ib&&Q){B=0;for(N=ka.length;B<N;B++)if(P=ka[B],za=Ib[P],void 0!==za)for(ja=\n0;3>ja;ja++)Ya=za[ja],fb[Za]=Ya.x,fb[Za+1]=Ya.y,Za+=2;0<Za&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,fb,I))}if(Db){B=0;for(N=ka.length;B<N;B++)pb[Ta]=db,pb[Ta+1]=db+1,pb[Ta+2]=db+2,Ta+=3,zb[ub]=db,zb[ub+1]=db+1,zb[ub+2]=db,zb[ub+3]=db+2,zb[ub+4]=db+1,zb[ub+5]=db+2,ub+=6,db+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,pb,I);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,\nzb,I)}if(sb)for(ja=0,Fa=sb.length;ja<Fa;ja++)if(F=sb[ja],F.__original.needsUpdate){M=0;if(1===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],F.array[M]=F.value[T.a],F.array[M+1]=F.value[T.b],F.array[M+2]=F.value[T.c],M+=3;else{if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],F.array[M]=Ra,F.array[M+1]=Ra,F.array[M+2]=Ra,M+=3}else if(2===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],ga=\nF.value[T.a],ha=F.value[T.b],ia=F.value[T.c],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ha.x,F.array[M+3]=ha.y,F.array[M+4]=ia.x,F.array[M+5]=ia.y,M+=6;else{if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ha.x,F.array[M+3]=ha.y,F.array[M+4]=ia.x,F.array[M+5]=ia.y,M+=6}else if(3===F.size){var ta;ta=\"c\"===F.type?[\"r\",\"g\",\"b\"]:[\"x\",\"y\",\"z\"];if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],\nga=F.value[T.a],ha=F.value[T.b],ia=F.value[T.c],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9;else if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+\n7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9;else if(\"faceVertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],ga=Ra[0],ha=Ra[1],ia=Ra[2],F.array[M]=ga[ta[0]],F.array[M+1]=ga[ta[1]],F.array[M+2]=ga[ta[2]],F.array[M+3]=ha[ta[0]],F.array[M+4]=ha[ta[1]],F.array[M+5]=ha[ta[2]],F.array[M+6]=ia[ta[0]],F.array[M+7]=ia[ta[1]],F.array[M+8]=ia[ta[2]],M+=9}else if(4===F.size)if(void 0===F.boundTo||\"vertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)T=jb[ka[B]],ga=F.value[T.a],ha=F.value[T.b],ia=F.value[T.c],\nF.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,F.array[M+11]=ia.w,M+=12;else if(\"faces\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)ia=ha=ga=Ra=F.value[ka[B]],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,\nF.array[M+11]=ia.w,M+=12;else if(\"faceVertices\"===F.boundTo)for(B=0,N=ka.length;B<N;B++)Ra=F.value[ka[B]],ga=Ra[0],ha=Ra[1],ia=Ra[2],F.array[M]=ga.x,F.array[M+1]=ga.y,F.array[M+2]=ga.z,F.array[M+3]=ga.w,F.array[M+4]=ha.x,F.array[M+5]=ha.y,F.array[M+6]=ha.z,F.array[M+7]=ha.w,F.array[M+8]=ia.x,F.array[M+9]=ia.y,F.array[M+10]=ia.z,F.array[M+11]=ia.w,M+=12;m.bindBuffer(m.ARRAY_BUFFER,F.buffer);m.bufferData(m.ARRAY_BUFFER,F.array,I)}J&&(delete y.__inittedArrays,delete y.__colorArray,delete y.__normalArray,\ndelete y.__tangentArray,delete y.__uvArray,delete y.__uv2Array,delete y.__faceArray,delete y.__vertexArray,delete y.__lineArray,delete y.__skinIndexArray,delete y.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;p.attributes&&C(p)}else if(b instanceof THREE.Line){p=d(b,l);r=p.attributes&&x(p);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||\nr){var Xb=m.DYNAMIC_DRAW,Kb,Lb,Mb,Yb,sa,Zb,Nb=l.vertices,Qb=l.colors,Rb=l.lineDistances,ec=Nb.length,fc=Qb.length,gc=Rb.length,$b=l.__vertexArray,ac=l.__colorArray,Tb=l.__lineDistanceArray,hc=l.colorsNeedUpdate,ic=l.lineDistancesNeedUpdate,nc=l.__webglCustomAttributesList,bc,uc,Ia,Fb,Ma,pa;if(l.verticesNeedUpdate){for(Kb=0;Kb<ec;Kb++)Yb=Nb[Kb],sa=3*Kb,$b[sa]=Yb.x,$b[sa+1]=Yb.y,$b[sa+2]=Yb.z;m.bindBuffer(m.ARRAY_BUFFER,l.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,$b,Xb)}if(hc){for(Lb=0;Lb<fc;Lb++)Zb=\nQb[Lb],sa=3*Lb,ac[sa]=Zb.r,ac[sa+1]=Zb.g,ac[sa+2]=Zb.b;m.bindBuffer(m.ARRAY_BUFFER,l.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,ac,Xb)}if(ic){for(Mb=0;Mb<gc;Mb++)Tb[Mb]=Rb[Mb];m.bindBuffer(m.ARRAY_BUFFER,l.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,Tb,Xb)}if(nc)for(bc=0,uc=nc.length;bc<uc;bc++)if(pa=nc[bc],pa.needsUpdate&&(void 0===pa.boundTo||\"vertices\"===pa.boundTo)){sa=0;Fb=pa.value.length;if(1===pa.size)for(Ia=0;Ia<Fb;Ia++)pa.array[Ia]=pa.value[Ia];else if(2===pa.size)for(Ia=\n0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,sa+=2;else if(3===pa.size)if(\"c\"===pa.type)for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.r,pa.array[sa+1]=Ma.g,pa.array[sa+2]=Ma.b,sa+=3;else for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,pa.array[sa+2]=Ma.z,sa+=3;else if(4===pa.size)for(Ia=0;Ia<Fb;Ia++)Ma=pa.value[Ia],pa.array[sa]=Ma.x,pa.array[sa+1]=Ma.y,pa.array[sa+2]=Ma.z,pa.array[sa+3]=Ma.w,sa+=4;m.bindBuffer(m.ARRAY_BUFFER,pa.buffer);m.bufferData(m.ARRAY_BUFFER,\npa.array,Xb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;p.attributes&&C(p)}else if(b instanceof THREE.PointCloud){p=d(b,l);r=p.attributes&&x(p);if(l.verticesNeedUpdate||l.colorsNeedUpdate||b.sortParticles||r){var oc=m.DYNAMIC_DRAW,Na,kb,lb,Z,mb,vb,cc=l.vertices,pc=cc.length,qc=l.colors,vc=qc.length,Ab=l.__vertexArray,Bb=l.__colorArray,qb=l.__sortArray,wc=l.verticesNeedUpdate,xc=l.colorsNeedUpdate,rb=l.__webglCustomAttributesList,ab,Gb,fa,bb,na,Y;if(b.sortParticles){kc.copy(Ub);\nkc.multiply(b.matrixWorld);for(Na=0;Na<pc;Na++)lb=cc[Na],ea.copy(lb),ea.applyProjection(kc),qb[Na]=[ea.z,Na];qb.sort(t);for(Na=0;Na<pc;Na++)lb=cc[qb[Na][1]],Z=3*Na,Ab[Z]=lb.x,Ab[Z+1]=lb.y,Ab[Z+2]=lb.z;for(kb=0;kb<vc;kb++)Z=3*kb,vb=qc[qb[kb][1]],Bb[Z]=vb.r,Bb[Z+1]=vb.g,Bb[Z+2]=vb.b;if(rb)for(ab=0,Gb=rb.length;ab<Gb;ab++)if(Y=rb[ab],void 0===Y.boundTo||\"vertices\"===Y.boundTo)if(Z=0,bb=Y.value.length,1===Y.size)for(fa=0;fa<bb;fa++)mb=qb[fa][1],Y.array[fa]=Y.value[mb];else if(2===Y.size)for(fa=0;fa<bb;fa++)mb=\nqb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Z+=2;else if(3===Y.size)if(\"c\"===Y.type)for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.r,Y.array[Z+1]=na.g,Y.array[Z+2]=na.b,Z+=3;else for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Z+=3;else if(4===Y.size)for(fa=0;fa<bb;fa++)mb=qb[fa][1],na=Y.value[mb],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Y.array[Z+3]=na.w,Z+=4}else{if(wc)for(Na=0;Na<pc;Na++)lb=cc[Na],Z=3*\nNa,Ab[Z]=lb.x,Ab[Z+1]=lb.y,Ab[Z+2]=lb.z;if(xc)for(kb=0;kb<vc;kb++)vb=qc[kb],Z=3*kb,Bb[Z]=vb.r,Bb[Z+1]=vb.g,Bb[Z+2]=vb.b;if(rb)for(ab=0,Gb=rb.length;ab<Gb;ab++)if(Y=rb[ab],Y.needsUpdate&&(void 0===Y.boundTo||\"vertices\"===Y.boundTo))if(bb=Y.value.length,Z=0,1===Y.size)for(fa=0;fa<bb;fa++)Y.array[fa]=Y.value[fa];else if(2===Y.size)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Z+=2;else if(3===Y.size)if(\"c\"===Y.type)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.r,Y.array[Z+1]=\nna.g,Y.array[Z+2]=na.b,Z+=3;else for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Z+=3;else if(4===Y.size)for(fa=0;fa<bb;fa++)na=Y.value[fa],Y.array[Z]=na.x,Y.array[Z+1]=na.y,Y.array[Z+2]=na.z,Y.array[Z+3]=na.w,Z+=4}if(wc||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,l.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,Ab,oc);if(xc||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,l.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,Bb,oc);if(rb)for(ab=0,Gb=rb.length;ab<\nGb;ab++)if(Y=rb[ab],Y.needsUpdate||b.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,Y.buffer),m.bufferData(m.ARRAY_BUFFER,Y.array,oc)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;p.attributes&&C(p)}for(var Cb=0,rc=k.length;Cb<rc;Cb++){var dc=k[Cb],nb=dc,yc=nb.object,sc=nb.buffer,tc=yc.geometry,ob=yc.material;ob instanceof THREE.MeshFaceMaterial?(ob=ob.materials[tc instanceof THREE.BufferGeometry?0:sc.materialIndex],ob.transparent?(nb.material=ob,Pa.push(nb)):(nb.material=ob,Oa.push(nb))):ob&&(ob.transparent?\n(nb.material=ob,Pa.push(nb)):(nb.material=ob,Oa.push(nb)));dc.render=!0;!0===G.sortObjects&&(null!==b.renderDepth?dc.z=b.renderDepth:(ea.setFromMatrixPosition(b.matrixWorld),ea.applyProjection(Ub),dc.z=ea.z))}}Cb=0;for(rc=b.children.length;Cb<rc;Cb++)s(a,b.children[Cb],h)}}function p(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)la=Ya=null,Ca=ca=ja=ua=Da=ra=Fa=-1,fb=!0,a[d].render(b,c,Hb,Ib),la=Ya=null,Ca=ca=ja=ua=Da=ra=Fa=-1,fb=!0}function v(a,b,c,d,e,f){for(var g,h,k,m=a.length-1;-1!==m;m--){g=\na[m];h=g.object;k=g.buffer;N(h,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&G.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);G.setDepthTest(g.depthTest);G.setDepthWrite(g.depthWrite);J(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}G.setMaterialFaces(g);k instanceof THREE.BufferGeometry?G.renderBufferDirect(b,c,d,g,k,h):G.renderBuffer(b,c,d,g,k,h)}}function w(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;\nf&&G.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);G.setDepthTest(h.depthTest);G.setDepthWrite(h.depthWrite);J(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}G.renderImmediateObject(c,d,e,h,k)}}function u(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function D(a,b,d){var e,f=!1;e=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete a.__webglObjects[b.id],d.makeGroups(e instanceof THREE.MeshFaceMaterial,\nEb?4294967296:65535),d.groupsNeedUpdate=!1;for(var g=0,h=d.geometryGroupsList.length;g<h;g++){e=d.geometryGroupsList[g];if(e.__webglVertexBuffer)f=!1;else{f=e;f.__webglVertexBuffer=m.createBuffer();f.__webglNormalBuffer=m.createBuffer();f.__webglTangentBuffer=m.createBuffer();f.__webglColorBuffer=m.createBuffer();f.__webglUVBuffer=m.createBuffer();f.__webglUV2Buffer=m.createBuffer();f.__webglSkinIndicesBuffer=m.createBuffer();f.__webglSkinWeightsBuffer=m.createBuffer();f.__webglFaceBuffer=m.createBuffer();\nf.__webglLineBuffer=m.createBuffer();var k=void 0,l=void 0;if(f.numMorphTargets)for(f.__webglMorphTargetsBuffers=[],k=0,l=f.numMorphTargets;k<l;k++)f.__webglMorphTargetsBuffers.push(m.createBuffer());if(f.numMorphNormals)for(f.__webglMorphNormalsBuffers=[],k=0,l=f.numMorphNormals;k<l;k++)f.__webglMorphNormalsBuffers.push(m.createBuffer());G.info.memory.geometries++;c(e,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=\n!0;f=d.colorsNeedUpdate=!0}(f||void 0===b.__webglActive)&&A(a.__webglObjects,e,b)}b.__webglActive=!0}function A(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function x(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function C(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function I(a,b){if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete b.__webglObjects[a.id];else if(a instanceof\nTHREE.ImmediateRenderObject||a.immediateRenderCallback)for(var c=b.__webglObjectsImmediate,d=c.length-1;0<=d;d--)c[d].object===a&&c.splice(d,1);delete a.__webglActive}function z(a,b,c,d,e){qa=0;d.needsUpdate&&(d.program&&Nb(d),G.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets));var f=!1,g=!1,h=!1,k=d.program,l=k.uniforms,n=d.__webglShader.uniforms;k.id!==Ya&&(m.useProgram(k.program),Ya=k.id,\nh=g=f=!0);d.id!==Ca&&(-1===Ca&&(h=!0),Ca=d.id,g=!0);if(f||a!==la)m.uniformMatrix4fv(l.projectionMatrix,!1,a.projectionMatrix.elements),Ea&&m.uniform1f(l.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==la&&(la=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==l.cameraPosition&&(ea.setFromMatrixPosition(a.matrixWorld),m.uniform3f(l.cameraPosition,ea.x,ea.y,ea.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof\nTHREE.ShaderMaterial||d.skinning)&&null!==l.viewMatrix&&m.uniformMatrix4fv(l.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&null!==l.bindMatrix&&m.uniformMatrix4fv(l.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==l.bindMatrixInverse&&m.uniformMatrix4fv(l.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Ob&&e.skeleton&&e.skeleton.useVertexTexture?(null!==l.boneTexture&&(f=K(),m.uniform1i(l.boneTexture,f),G.setTexture(e.skeleton.boneTexture,f)),null!==l.boneTextureWidth&&\nm.uniform1i(l.boneTextureWidth,e.skeleton.boneTextureWidth),null!==l.boneTextureHeight&&m.uniform1i(l.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&null!==l.boneGlobalMatrices&&m.uniformMatrix4fv(l.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(g){c&&d.fog&&(n.fogColor.value=c.color,c instanceof THREE.Fog?(n.fogNear.value=c.near,n.fogFar.value=c.far):c instanceof THREE.FogExp2&&(n.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof\nTHREE.MeshLambertMaterial||d.lights){if(fb){var h=!0,p,r=f=0,q=0,s,t,w,u=Jb,v=u.directional.colors,x=u.directional.positions,D=u.point.colors,A=u.point.positions,z=u.point.distances,C=u.spot.colors,I=u.spot.positions,L=u.spot.distances,N=u.spot.directions,J=u.spot.anglesCos,T=u.spot.exponents,H=u.hemi.skyColors,Q=u.hemi.groundColors,O=u.hemi.positions,R=0,X=0,V=0,$=0,za=0,aa=0,ya=0,ca=0,W=p=0;c=w=W=0;for(g=b.length;c<g;c++)p=b[c],p.onlyShadow||(s=p.color,t=p.intensity,w=p.distance,p instanceof THREE.AmbientLight?\np.visible&&(G.gammaInput?(f+=s.r*s.r,r+=s.g*s.g,q+=s.b*s.b):(f+=s.r,r+=s.g,q+=s.b)):p instanceof THREE.DirectionalLight?(za+=1,p.visible&&(da.setFromMatrixPosition(p.matrixWorld),ea.setFromMatrixPosition(p.target.matrixWorld),da.sub(ea),da.normalize(),p=3*R,x[p]=da.x,x[p+1]=da.y,x[p+2]=da.z,G.gammaInput?ba(v,p,s,t*t):P(v,p,s,t),R+=1)):p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*X,G.gammaInput?ba(D,W,s,t*t):P(D,W,s,t),ea.setFromMatrixPosition(p.matrixWorld),A[W]=ea.x,A[W+1]=ea.y,A[W+2]=ea.z,\nz[X]=w,X+=1)):p instanceof THREE.SpotLight?(ya+=1,p.visible&&(W=3*V,G.gammaInput?ba(C,W,s,t*t):P(C,W,s,t),ea.setFromMatrixPosition(p.matrixWorld),I[W]=ea.x,I[W+1]=ea.y,I[W+2]=ea.z,L[V]=w,da.copy(ea),ea.setFromMatrixPosition(p.target.matrixWorld),da.sub(ea),da.normalize(),N[W]=da.x,N[W+1]=da.y,N[W+2]=da.z,J[V]=Math.cos(p.angle),T[V]=p.exponent,V+=1)):p instanceof THREE.HemisphereLight&&(ca+=1,p.visible&&(da.setFromMatrixPosition(p.matrixWorld),da.normalize(),w=3*$,O[w]=da.x,O[w+1]=da.y,O[w+2]=da.z,\ns=p.color,p=p.groundColor,G.gammaInput?(t*=t,ba(H,w,s,t),ba(Q,w,p,t)):(P(H,w,s,t),P(Q,w,p,t)),$+=1)));c=3*R;for(g=Math.max(v.length,3*za);c<g;c++)v[c]=0;c=3*X;for(g=Math.max(D.length,3*aa);c<g;c++)D[c]=0;c=3*V;for(g=Math.max(C.length,3*ya);c<g;c++)C[c]=0;c=3*$;for(g=Math.max(H.length,3*ca);c<g;c++)H[c]=0;c=3*$;for(g=Math.max(Q.length,3*ca);c<g;c++)Q[c]=0;u.directional.length=R;u.point.length=X;u.spot.length=V;u.hemi.length=$;u.ambient[0]=f;u.ambient[1]=r;u.ambient[2]=q;fb=!1}h?(h=Jb,n.ambientLightColor.value=\nh.ambient,n.directionalLightColor.value=h.directional.colors,n.directionalLightDirection.value=h.directional.positions,n.pointLightColor.value=h.point.colors,n.pointLightPosition.value=h.point.positions,n.pointLightDistance.value=h.point.distances,n.spotLightColor.value=h.spot.colors,n.spotLightPosition.value=h.spot.positions,n.spotLightDistance.value=h.spot.distances,n.spotLightDirection.value=h.spot.directions,n.spotLightAngleCos.value=h.spot.anglesCos,n.spotLightExponent.value=h.spot.exponents,\nn.hemisphereLightSkyColor.value=h.hemi.skyColors,n.hemisphereLightGroundColor.value=h.hemi.groundColors,n.hemisphereLightDirection.value=h.hemi.positions,y(n,!0)):y(n,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){n.opacity.value=d.opacity;G.gammaInput?n.diffuse.value.copyGammaToLinear(d.color):n.diffuse.value=d.color;n.map.value=d.map;n.lightMap.value=d.lightMap;n.specularMap.value=d.specularMap;n.alphaMap.value=d.alphaMap;\nd.bumpMap&&(n.bumpMap.value=d.bumpMap,n.bumpScale.value=d.bumpScale);d.normalMap&&(n.normalMap.value=d.normalMap,n.normalScale.value.copy(d.normalScale));var U;d.map?U=d.map:d.specularMap?U=d.specularMap:d.normalMap?U=d.normalMap:d.bumpMap?U=d.bumpMap:d.alphaMap&&(U=d.alphaMap);void 0!==U&&(h=U.offset,U=U.repeat,n.offsetRepeat.value.set(h.x,h.y,U.x,U.y));n.envMap.value=d.envMap;n.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;n.reflectivity.value=d.reflectivity;n.refractionRatio.value=\nd.refractionRatio;n.combine.value=d.combine;n.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity,n.dashSize.value=d.dashSize,n.totalSize.value=d.dashSize+d.gapSize,n.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(n.psColor.value=d.color,n.opacity.value=d.opacity,n.size.value=d.size,\nn.scale.value=S.height/2,n.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(n.shininess.value=d.shininess,G.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive),n.specular.value.copyGammaToLinear(d.specular)):(n.ambient.value=d.ambient,n.emissive.value=d.emissive,n.specular.value=d.specular),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(G.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive)):\n(n.ambient.value=d.ambient,n.emissive.value=d.emissive),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(n.mNear.value=a.near,n.mFar.value=a.far,n.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(n.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&n.shadowMatrix)for(U=a=0,h=b.length;U<h;U++)c=b[U],c.castShadow&&(c instanceof THREE.SpotLight||c instanceof THREE.DirectionalLight&&!c.shadowCascade)&&(n.shadowMap.value[a]=c.shadowMap,n.shadowMapSize.value[a]=\nc.shadowMapSize,n.shadowMatrix.value[a]=c.shadowMatrix,n.shadowDarkness.value[a]=c.shadowDarkness,n.shadowBias.value[a]=c.shadowBias,a++);b=d.uniformsList;d=0;for(n=b.length;d<n;d++)if(a=b[d][0],!1!==a.needsUpdate)switch(c=a.type,h=a.value,U=b[d][1],c){case \"1i\":m.uniform1i(U,h);break;case \"1f\":m.uniform1f(U,h);break;case \"2f\":m.uniform2f(U,h[0],h[1]);break;case \"3f\":m.uniform3f(U,h[0],h[1],h[2]);break;case \"4f\":m.uniform4f(U,h[0],h[1],h[2],h[3]);break;case \"1iv\":m.uniform1iv(U,h);break;case \"3iv\":m.uniform3iv(U,\nh);break;case \"1fv\":m.uniform1fv(U,h);break;case \"2fv\":m.uniform2fv(U,h);break;case \"3fv\":m.uniform3fv(U,h);break;case \"4fv\":m.uniform4fv(U,h);break;case \"Matrix3fv\":m.uniformMatrix3fv(U,!1,h);break;case \"Matrix4fv\":m.uniformMatrix4fv(U,!1,h);break;case \"i\":m.uniform1i(U,h);break;case \"f\":m.uniform1f(U,h);break;case \"v2\":m.uniform2f(U,h.x,h.y);break;case \"v3\":m.uniform3f(U,h.x,h.y,h.z);break;case \"v4\":m.uniform4f(U,h.x,h.y,h.z,h.w);break;case \"c\":m.uniform3f(U,h.r,h.g,h.b);break;case \"iv1\":m.uniform1iv(U,\nh);break;case \"iv\":m.uniform3iv(U,h);break;case \"fv1\":m.uniform1fv(U,h);break;case \"fv\":m.uniform3fv(U,h);break;case \"v2v\":void 0===a._array&&(a._array=new Float32Array(2*h.length));c=0;for(g=h.length;c<g;c++)f=2*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y;m.uniform2fv(U,a._array);break;case \"v3v\":void 0===a._array&&(a._array=new Float32Array(3*h.length));c=0;for(g=h.length;c<g;c++)f=3*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z;m.uniform3fv(U,a._array);break;case \"v4v\":void 0===\na._array&&(a._array=new Float32Array(4*h.length));c=0;for(g=h.length;c<g;c++)f=4*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z,a._array[f+3]=h[c].w;m.uniform4fv(U,a._array);break;case \"m3\":m.uniformMatrix3fv(U,!1,h.elements);break;case \"m3v\":void 0===a._array&&(a._array=new Float32Array(9*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,9*c);m.uniformMatrix3fv(U,!1,a._array);break;case \"m4\":m.uniformMatrix4fv(U,!1,h.elements);break;case \"m4v\":void 0===a._array&&\n(a._array=new Float32Array(16*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,16*c);m.uniformMatrix4fv(U,!1,a._array);break;case \"t\":f=h;h=K();m.uniform1i(U,h);if(!f)continue;if(f instanceof THREE.CubeTexture||f.image instanceof Array&&6===f.image.length){if(a=f,U=h,6===a.image.length)if(a.needsUpdate){a.image.__webglTextureCube||(a.addEventListener(\"dispose\",Pb),a.image.__webglTextureCube=m.createTexture(),G.info.memory.textures++);m.activeTexture(m.TEXTURE0+U);m.bindTexture(m.TEXTURE_CUBE_MAP,\na.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);U=a instanceof THREE.CompressedTexture;h=[];for(c=0;6>c;c++)G.autoScaleCubemaps&&!U?(g=c,f=a.image[c],q=sc,f.width<=q&&f.height<=q||(u=Math.max(f.width,f.height),r=Math.floor(f.width*q/u),q=Math.floor(f.height*q/u),u=document.createElement(\"canvas\"),u.width=r,u.height=q,u.getContext(\"2d\").drawImage(f,0,0,f.width,f.height,0,0,r,q),f=u),h[g]=f):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height);\nf=B(a.format);r=B(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v<x;v++)q=u[v],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,q.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,f,r,q.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,f,f,r,h[c]);a.generateMipmaps&&g&&m.generateMipmap(m.TEXTURE_CUBE_MAP);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+\nU),m.bindTexture(m.TEXTURE_CUBE_MAP,a.image.__webglTextureCube)}else f instanceof THREE.WebGLRenderTargetCube?(a=f,m.activeTexture(m.TEXTURE0+h),m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture)):G.setTexture(f,h);break;case \"tv\":void 0===a._array&&(a._array=[]);c=0;for(g=a.value.length;c<g;c++)a._array[c]=K();m.uniform1iv(U,a._array);c=0;for(g=a.value.length;c<g;c++)f=a.value[c],h=a._array[c],f&&G.setTexture(f,h);break;default:console.warn(\"THREE.WebGLRenderer: Unknown uniform type: \"+c)}}m.uniformMatrix4fv(l.modelViewMatrix,\n!1,e._modelViewMatrix.elements);l.normalMatrix&&m.uniformMatrix3fv(l.normalMatrix,!1,e._normalMatrix.elements);null!==l.modelMatrix&&m.uniformMatrix4fv(l.modelMatrix,!1,e.matrixWorld.elements);return k}function y(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=\nb;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function K(){var a=qa;a>=Qb&&console.warn(\"WebGLRenderer: trying to use \"+a+\" texture units while this GPU supports only \"+Qb);qa+=1;return a}function N(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}\nfunction ba(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function P(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function O(a){a!==xa&&(m.lineWidth(a),xa=a)}function J(a,b,c){Qa!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Qa=a);!a||cb===b&&Ga===c||(m.polygonOffset(b,c),cb=b,Ga=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,B(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,B(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,B(b.magFilter)),m.texParameteri(a,\nm.TEXTURE_MIN_FILTER,B(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));Ta&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,Ta.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Rb)),b.__oldAnisotropy=b.anisotropy)}function Q(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?\n(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function L(a){a instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture),\nm.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,a.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null))}function R(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function B(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;\nif(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;\nif(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;\nif(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;\nif(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Sa){if(a===THREE.RGB_S3TC_DXT1_Format)return Sa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}\nconsole.log(\"THREE.WebGLRenderer\",THREE.REVISION);a=a||{};var S=void 0!==a.canvas?a.canvas:document.createElement(\"canvas\"),V=void 0!==a.context?a.context:null,W=void 0!==a.precision?a.precision:\"highp\",H=void 0!==a.alpha?a.alpha:!1,oa=void 0!==a.depth?a.depth:!0,$=void 0!==a.stencil?a.stencil:!0,X=void 0!==a.antialias?a.antialias:!1,T=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ya=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ea=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:\n!1,Aa=new THREE.Color(0),za=0,Oa=[],Pa=[];this.domElement=S;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=\n!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var G=this,Ba=[],Ya=null,Za=null,Ca=-1,ca=null,la=null,qa=0,ua=-1,ja=-1,Fa=-1,va=-1,Ka=-1,aa=-1,ra=-1,Da=-1,Qa=null,cb=null,Ga=null,xa=null,ma=0,Ja=0,wb=S.width,sb=S.height,Hb=0,Ib=0,pb=new Uint8Array(16),tb=new Uint8Array(16),jc=new THREE.Frustum,Ub=new THREE.Matrix4,kc=new THREE.Matrix4,\nea=new THREE.Vector3,da=new THREE.Vector3,fb=!0,Jb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,Db,xb,Ta,Sa,Eb;(function(){try{var a={alpha:H,depth:oa,stencil:$,antialias:X,premultipliedAlpha:T,preserveDrawingBuffer:ya};m=V||S.getContext(\"webgl\",a)||S.getContext(\"experimental-webgl\",\na);if(null===m)throw\"Error creating WebGL context.\";}catch(b){console.error(b)}Db=m.getExtension(\"OES_texture_float\");m.getExtension(\"OES_texture_float_linear\");xb=m.getExtension(\"OES_standard_derivatives\");Ta=m.getExtension(\"EXT_texture_filter_anisotropic\")||m.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||m.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\");Sa=m.getExtension(\"WEBGL_compressed_texture_s3tc\")||m.getExtension(\"MOZ_WEBGL_compressed_texture_s3tc\")||m.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\");\nEb=m.getExtension(\"OES_element_index_uint\");null===Db&&console.log(\"THREE.WebGLRenderer: Float textures not supported.\");null===xb&&console.log(\"THREE.WebGLRenderer: Standard derivatives not supported.\");null===Ta&&console.log(\"THREE.WebGLRenderer: Anisotropic texture filtering not supported.\");null===Sa&&console.log(\"THREE.WebGLRenderer: S3TC compressed textures not supported.\");null===Eb&&console.log(\"THREE.WebGLRenderer: elementindex as unsigned integer not supported.\");void 0===m.getShaderPrecisionFormat&&\n(m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ea&&m.getExtension(\"EXT_frag_depth\")})();m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(ma,Ja,wb,sb);m.clearColor(Aa.r,Aa.g,Aa.b,za);this.context=m;var Qb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),tc=\nm.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var sc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Rb=Ta?m.getParameter(Ta.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Sb=0<tc,Ob=Sb&&Db;Sa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var zc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),Ac=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var Bc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),\nCc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);var Dc=0<zc.precision&&0<Bc.precision,ec=0<Ac.precision&&0<Cc.precision;\"highp\"!==W||Dc||(ec?(W=\"mediump\",console.warn(\"THREE.WebGLRenderer: highp not supported, using mediump.\")):(W=\"lowp\",console.warn(\"THREE.WebGLRenderer: highp and mediump not supported, using lowp.\")));\"mediump\"!==W||ec||(W=\"lowp\",console.warn(\"THREE.WebGLRenderer: mediump not supported, using lowp.\"));this.getContext=\nfunction(){return m};this.supportsVertexTextures=function(){return Sb};this.supportsFloatTextures=function(){return Db};this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Sa};this.getMaxAnisotropy=function(){return Rb};this.getPrecision=function(){return W};this.setSize=function(a,b,c){S.width=a*this.devicePixelRatio;S.height=b*this.devicePixelRatio;!1!==c&&(S.style.width=a+\"px\",S.style.height=b+\"px\");this.setViewport(0,0,a,b)};this.setViewport=\nfunction(a,b,c,d){ma=a*this.devicePixelRatio;Ja=b*this.devicePixelRatio;wb=c*this.devicePixelRatio;sb=d*this.devicePixelRatio;m.viewport(ma,Ja,wb,sb)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColor=function(a,b){Aa.set(a);za=void 0!==b?b:1;m.clearColor(Aa.r,Aa.g,Aa.b,za)};this.setClearColorHex=function(a,\nb){console.warn(\"THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.\");this.setClearColor(a,b)};this.getClearColor=function(){return Aa};this.getClearAlpha=function(){return za};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=\nfunction(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Ya=null;Ca=ca=Da=ra=Fa=-1;fb=!0;ja=ua=-1;fc(a);this.shadowMapPlugin.update(a,b)};var gc=function(a){a=a.target;a.removeEventListener(\"dispose\",gc);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){a=\na.attributes;for(var b in a)void 0!==a[b].buffer&&m.deleteBuffer(a[b].buffer);G.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)m.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)m.deleteBuffer(d.__webglMorphNormalsBuffers[e]);Tb(d)}}else Tb(a)},Pb=function(a){a=a.target;a.removeEventListener(\"dispose\",\nPb);a.image&&a.image.__webglTextureCube?m.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,m.deleteTexture(a.__webglTexture));G.info.memory.textures--},hc=function(a){a=a.target;a.removeEventListener(\"dispose\",hc);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);\nG.info.memory.textures--},ic=function(a){a=a.target;a.removeEventListener(\"dispose\",ic);Nb(a)},Tb=function(a){void 0!==a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer);\nvoid 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);\nG.info.memory.geometries--},Nb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Ba.length;a<c;a++)if(d=Ba[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Ba.length;a<c;a++)d=Ba[a],d.program!==b&&e.push(d);Ba=e;m.deleteProgram(b);G.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){k();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&\n(a.__webglNormalBuffer=m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),l(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,\ne,f,g,h,p,r,q,s,t,u,w=3*a.count;for(u=0;u<w;u+=9)t=a.normalArray,d=t[u],e=t[u+1],f=t[u+2],g=t[u+3],p=t[u+4],q=t[u+5],h=t[u+6],r=t[u+7],s=t[u+8],d=(d+g+h)/3,e=(e+p+r)/3,f=(f+q+s)/3,t[u]=d,t[u+1]=e,t[u+2]=f,t[u+3]=d,t[u+4]=e,t[u+5]=f,t[u+6]=d,t[u+7]=e,t[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);l(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,\nm.DYNAMIC_DRAW),l(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),l(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));n();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var g=z(a,b,c,d,f);a=g.attributes;b=e.attributes;c=!1;g=16777215*\ne.id+2*g.id+(d.wireframe?1:0);g!==ca&&(ca=g,c=!0);c&&k();if(f instanceof THREE.Mesh)if(g=b.index){var l,n;g.array instanceof Uint32Array?(l=m.UNSIGNED_INT,n=4):(l=m.UNSIGNED_SHORT,n=2);e=e.offsets;if(0===e.length)c&&(h(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),m.drawElements(m.TRIANGLES,g.array.length,l,0),G.info.render.calls++,G.info.render.vertices+=g.array.length,G.info.render.faces+=g.array.length/3;else{c=!0;for(var p=0,r=e.length;p<r;p++){var q=e[p].index;c&&(h(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,\ng.buffer));m.drawElements(m.TRIANGLES,e[p].count,l,e[p].start*n);G.info.render.calls++;G.info.render.vertices+=e[p].count;G.info.render.faces+=e[p].count/3}}}else c&&h(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),G.info.render.calls++,G.info.render.vertices+=d.array.length/3,G.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&h(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/\n3;else if(f instanceof THREE.Line)if(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,O(d.linewidth),g=b.index)if(g.array instanceof Uint32Array?(l=m.UNSIGNED_INT,n=4):(l=m.UNSIGNED_SHORT,n=2),e=e.offsets,0===e.length)c&&(h(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),m.drawElements(f,g.array.length,l,0),G.info.render.calls++,G.info.render.vertices+=g.array.length;else for(1<e.length&&(c=!0),p=0,r=e.length;p<r;p++)q=e[p].index,c&&(h(d,a,b,q),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,g.buffer)),\nm.drawElements(f,e[p].count,l,e[p].start*n),G.info.render.calls++,G.info.render.vertices+=e[p].count;else c&&h(d,a,b,0),d=b.position,m.drawArrays(f,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,h;c=z(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==ca&&(ca=c,a=!0);a&&k();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),l(b.position),\nm.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),l(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),l(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;h=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<\nd.numSupportedMorphTargets&&p<h.length;)0<=c[\"morphTarget\"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[h[p]]),l(c[\"morphTarget\"+p]),m.vertexAttribPointer(c[\"morphTarget\"+p],3,m.FLOAT,!1,0,0)),0<=c[\"morphNormal\"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[h[p]]),l(c[\"morphNormal\"+p]),m.vertexAttribPointer(c[\"morphNormal\"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[h[p]],p++}else{h=[];g=f.morphTargetInfluences;var r,q=g.length;for(r=\n0;r<q;r++)p=g[r],0<p&&h.push([p,r]);h.length>d.numSupportedMorphTargets?(h.sort(t),h.length=d.numSupportedMorphTargets):h.length>d.numSupportedMorphNormals?h.sort(t):0===h.length&&h.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)h[p]?(r=h[p][1],0<=c[\"morphTarget\"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),l(c[\"morphTarget\"+p]),m.vertexAttribPointer(c[\"morphTarget\"+p],3,m.FLOAT,!1,0,0)),0<=c[\"morphNormal\"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[r]),\nl(c[\"morphNormal\"+p]),m.vertexAttribPointer(c[\"morphNormal\"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[r]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&m.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(g=0,h=e.__webglCustomAttributesList.length;g<h;g++)c=e.__webglCustomAttributesList[g],0<=b[c.buffer.belongsToAttribute]&&(m.bindBuffer(m.ARRAY_BUFFER,c.buffer),l(b[c.buffer.belongsToAttribute]),\nm.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),l(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),l(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,\ne.__webglTangentBuffer),l(b.tangent),m.vertexAttribPointer(b.tangent,4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),l(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),l(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,\nd.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),l(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),l(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),l(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}n();f instanceof THREE.Mesh?\n(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?(O(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),G.info.render.calls++,G.info.render.vertices+=e.__webglFaceCount,G.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,\nO(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),G.info.render.calls++):f instanceof THREE.PointCloud&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),G.info.render.calls++,G.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){function e(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update();for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}if(!1===b instanceof THREE.Camera)console.error(\"THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.\");else{var f,\ng,h,k,m=a.__lights,l=a.fog;Ca=-1;la=null;fb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();e(a);b.matrixWorldInverse.getInverse(b.matrixWorld);Ub.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);jc.setFromMatrix(Ub);fc(a);Oa.length=0;Pa.length=0;s(a,a,b);!0===G.sortObjects&&(Oa.sort(q),Pa.sort(r));p(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||\nd)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);k=a.__webglObjectsImmediate;d=0;for(f=k.length;d<f;d++)g=k[d],h=g.object,h.visible&&(N(h,b),u(g));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),J(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),v(Oa,b,m,l,!0,d),v(Pa,b,m,l,!0,d),w(a.__webglObjectsImmediate,\"\",b,m,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),\nv(Oa,b,m,l,!1,d),w(a.__webglObjectsImmediate,\"opaque\",b,m,l,!1,d),v(Pa,b,m,l,!0,d),w(a.__webglObjectsImmediate,\"transparent\",b,m,l,!0,d));p(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&L(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);ca=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,m,jc):e.render(function(a){G.renderBufferImmediate(a,\nf,d)})};var fc=function(a){a.__webglObjects||(a.__webglObjects={},a.__webglObjectsImmediate=[]);for(;a.__objectsAdded.length;){var c=a.__objectsAdded[0],d=a,e=void 0,f=void 0;void 0===c.__webglInit&&(c.__webglInit=!0,c._modelViewMatrix=new THREE.Matrix4,c._normalMatrix=new THREE.Matrix3);e=c.geometry;if(void 0!==e&&void 0===e.__webglInit)if(e.__webglInit=!0,e.addEventListener(\"dispose\",gc),e instanceof THREE.BufferGeometry)g(e);else if(c instanceof THREE.Mesh)void 0!==c.__webglActive&&I(c,d),D(d,\nc,e);else if(c instanceof THREE.Line){if(!e.__webglVertexBuffer){f=e;f.__webglVertexBuffer=m.createBuffer();f.__webglColorBuffer=m.createBuffer();f.__webglLineDistanceBuffer=m.createBuffer();G.info.memory.geometries++;var f=e,h=c,k=f.vertices.length;f.__vertexArray=new Float32Array(3*k);f.__colorArray=new Float32Array(3*k);f.__lineDistanceArray=new Float32Array(1*k);f.__webglLineCount=k;b(f,h);e.verticesNeedUpdate=!0;e.colorsNeedUpdate=!0;e.lineDistancesNeedUpdate=!0}}else c instanceof THREE.PointCloud&&\n!e.__webglVertexBuffer&&(f=e,f.__webglVertexBuffer=m.createBuffer(),f.__webglColorBuffer=m.createBuffer(),G.info.memory.geometries++,f=e,h=c,k=f.vertices.length,f.__vertexArray=new Float32Array(3*k),f.__colorArray=new Float32Array(3*k),f.__sortArray=[],f.__webglParticleCount=k,b(f,h),e.verticesNeedUpdate=!0,e.colorsNeedUpdate=!0);if(void 0===c.__webglActive){if(c instanceof THREE.Mesh)if(e=c.geometry,e instanceof THREE.BufferGeometry)A(d.__webglObjects,e,c);else{if(e instanceof THREE.Geometry)for(h=\n0,k=e.geometryGroupsList.length;h<k;h++)f=e.geometryGroupsList[h],A(d.__webglObjects,f,c)}else c instanceof THREE.Line||c instanceof THREE.PointCloud?(e=c.geometry,A(d.__webglObjects,e,c)):(c instanceof THREE.ImmediateRenderObject||c.immediateRenderCallback)&&d.__webglObjectsImmediate.push({id:null,object:c,opaque:null,transparent:null,z:0});c.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)I(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1)};this.initMaterial=\nfunction(a,b,c,d){var e,f,g,h;a.addEventListener(\"dispose\",ic);var k,l,n,p;a instanceof THREE.MeshDepthMaterial?p=\"depth\":a instanceof THREE.MeshNormalMaterial?p=\"normal\":a instanceof THREE.MeshBasicMaterial?p=\"basic\":a instanceof THREE.MeshLambertMaterial?p=\"lambert\":a instanceof THREE.MeshPhongMaterial?p=\"phong\":a instanceof THREE.LineBasicMaterial?p=\"basic\":a instanceof THREE.LineDashedMaterial?p=\"dashed\":a instanceof THREE.PointCloudMaterial&&(p=\"particle_basic\");p?(e=THREE.ShaderLib[p],a.__webglShader=\n{uniforms:THREE.UniformsUtils.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}):a.__webglShader={uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader};n=h=g=f=e=0;for(var r=b.length;n<r;n++){var q=b[n];q.onlyShadow||!1===q.visible||(q instanceof THREE.DirectionalLight&&e++,q instanceof THREE.PointLight&&f++,q instanceof THREE.SpotLight&&g++,q instanceof THREE.HemisphereLight&&h++)}r=n=0;for(q=b.length;r<q;r++){var s=b[r];s.castShadow&&(s instanceof\nTHREE.SpotLight&&n++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&n++)}b=n;Ob&&d&&d.skeleton&&d.skeleton.useVertexTexture?n=1024:(n=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),n=Math.floor((n-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(n=Math.min(d.skeleton.bones.length,n),n<d.skeleton.bones.length&&console.warn(\"WebGLRenderer: too many bones - \"+d.skeleton.bones.length+\", this GPU supports just \"+n+\" (try OpenGL instead of ANGLE)\")));c={precision:W,supportsVertexTextures:Sb,map:!!a.map,\nenvMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,alphaMap:!!a.alphaMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:Ea,skinning:a.skinning,maxBones:n,useVertexTexture:Ob&&d&&d.skeleton&&d.skeleton.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,\nmaxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:b,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow&&0<b,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=[];p?d.push(p):(d.push(a.fragmentShader),d.push(a.vertexShader));for(var t in a.defines)d.push(t),d.push(a.defines[t]);for(l in c)d.push(l),\nd.push(c[l]);p=d.join();var u;l=0;for(t=Ba.length;l<t;l++)if(d=Ba[l],d.code===p){u=d;u.usedTimes++;break}void 0===u&&(u=new THREE.WebGLProgram(this,p,a,c),Ba.push(u),G.info.memory.programs=Ba.length);a.program=u;u=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=0,t=\"morphTarget\",l=0;l<this.maxMorphTargets;l++)p=t+l,0<=u[p]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,t=\"morphNormal\",l=0;l<this.maxMorphNormals;l++)p=t+l,0<=u[p]&&a.numSupportedMorphNormals++;\na.uniformsList=[];for(k in a.__webglShader.uniforms)(l=a.program.uniforms[k])&&a.uniformsList.push([a.__webglShader.uniforms[k],l])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;\nua!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),ua=b);ja!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),ja=a)};this.setDepthTest=function(a){ra!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),ra=a)};this.setDepthWrite=function(a){Da!==a&&(m.depthMask(a),Da=a)};this.setBlending=function(a,b,c,d){a!==Fa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),\nm.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Fa=a);if(a===THREE.CustomBlending){if(b!==va&&(m.blendEquation(B(b)),va=b),c!==Ka||d!==aa)m.blendFunc(B(c),B(d)),Ka=c,aa=d}else aa=\nKa=va=null};this.setTexture=function(a,b){hack.log(\"\",hack.render,\"THREE.WebGLRenderer.setTexture\");if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener(\"dispose\",Pb),a.__webglTexture=m.createTexture(),G.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&\nTHREE.Math.isPowerOfTwo(c.height),e=B(a.format),f=B(a.type);E(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):\nm.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===\na.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener(\"dispose\",hc);a.__webglTexture=m.createTexture();G.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=B(a.format),e=B(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);E(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();\nm.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);Q(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),\nE(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):\nQ(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=wb,a=sb,d=ma,e=Ja);b!==Za&&(m.bindFramebuffer(m.FRAMEBUFFER,b),m.viewport(d,e,c,a),Za=b);Hb=c;Ib=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);\nthis.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};\nTHREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:\nTHREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};\nTHREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;\na.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:\"dispose\"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);\nTHREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,l=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q=\"position\");var r=\"SHADOWMAP_TYPE_BASIC\";e.shadowMapType===THREE.PCFShadowMap?r=\"SHADOWMAP_TYPE_PCF\":e.shadowMapType===THREE.PCFSoftShadowMap&&(r=\"SHADOWMAP_TYPE_PCF_SOFT\");var t,s;t=[];for(var p in g)s=g[p],!1!==s&&(s=\"#define \"+p+\" \"+s,t.push(s));\nt=t.join(\"\\n\");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d=\"\":(d=[\"precision \"+e.precision+\" float;\",\"precision \"+e.precision+\" int;\",t,e.supportsVertexTextures?\"#define VERTEX_TEXTURES\":\"\",b.gammaInput?\"#define GAMMA_INPUT\":\"\",b.gammaOutput?\"#define GAMMA_OUTPUT\":\"\",\"#define MAX_DIR_LIGHTS \"+e.maxDirLights,\"#define MAX_POINT_LIGHTS \"+e.maxPointLights,\"#define MAX_SPOT_LIGHTS \"+e.maxSpotLights,\"#define MAX_HEMI_LIGHTS \"+e.maxHemiLights,\"#define MAX_SHADOWS \"+e.maxShadows,\"#define MAX_BONES \"+\ne.maxBones,e.map?\"#define USE_MAP\":\"\",e.envMap?\"#define USE_ENVMAP\":\"\",e.lightMap?\"#define USE_LIGHTMAP\":\"\",e.bumpMap?\"#define USE_BUMPMAP\":\"\",e.normalMap?\"#define USE_NORMALMAP\":\"\",e.specularMap?\"#define USE_SPECULARMAP\":\"\",e.alphaMap?\"#define USE_ALPHAMAP\":\"\",e.vertexColors?\"#define USE_COLOR\":\"\",e.skinning?\"#define USE_SKINNING\":\"\",e.useVertexTexture?\"#define BONE_TEXTURE\":\"\",e.morphTargets?\"#define USE_MORPHTARGETS\":\"\",e.morphNormals?\"#define USE_MORPHNORMALS\":\"\",e.wrapAround?\"#define WRAP_AROUND\":\n\"\",e.doubleSided?\"#define DOUBLE_SIDED\":\"\",e.flipSided?\"#define FLIP_SIDED\":\"\",e.shadowMapEnabled?\"#define USE_SHADOWMAP\":\"\",e.shadowMapEnabled?\"#define \"+r:\"\",e.shadowMapDebug?\"#define SHADOWMAP_DEBUG\":\"\",e.shadowMapCascade?\"#define SHADOWMAP_CASCADE\":\"\",e.sizeAttenuation?\"#define USE_SIZEATTENUATION\":\"\",e.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",\"uniform mat4 modelMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform mat4 viewMatrix;\\nuniform mat3 normalMatrix;\\nuniform vec3 cameraPosition;\\nattribute vec3 position;\\nattribute vec3 normal;\\nattribute vec2 uv;\\nattribute vec2 uv2;\\n#ifdef USE_COLOR\\n\\tattribute vec3 color;\\n#endif\\n#ifdef USE_MORPHTARGETS\\n\\tattribute vec3 morphTarget0;\\n\\tattribute vec3 morphTarget1;\\n\\tattribute vec3 morphTarget2;\\n\\tattribute vec3 morphTarget3;\\n\\t#ifdef USE_MORPHNORMALS\\n\\t\\tattribute vec3 morphNormal0;\\n\\t\\tattribute vec3 morphNormal1;\\n\\t\\tattribute vec3 morphNormal2;\\n\\t\\tattribute vec3 morphNormal3;\\n\\t#else\\n\\t\\tattribute vec3 morphTarget4;\\n\\t\\tattribute vec3 morphTarget5;\\n\\t\\tattribute vec3 morphTarget6;\\n\\t\\tattribute vec3 morphTarget7;\\n\\t#endif\\n#endif\\n#ifdef USE_SKINNING\\n\\tattribute vec4 skinIndex;\\n\\tattribute vec4 skinWeight;\\n#endif\\n\"].join(\"\\n\"),\nb=[\"precision \"+e.precision+\" float;\",\"precision \"+e.precision+\" int;\",e.bumpMap||e.normalMap?\"#extension GL_OES_standard_derivatives : enable\":\"\",t,\"#define MAX_DIR_LIGHTS \"+e.maxDirLights,\"#define MAX_POINT_LIGHTS \"+e.maxPointLights,\"#define MAX_SPOT_LIGHTS \"+e.maxSpotLights,\"#define MAX_HEMI_LIGHTS \"+e.maxHemiLights,\"#define MAX_SHADOWS \"+e.maxShadows,e.alphaTest?\"#define ALPHATEST \"+e.alphaTest:\"\",b.gammaInput?\"#define GAMMA_INPUT\":\"\",b.gammaOutput?\"#define GAMMA_OUTPUT\":\"\",e.useFog&&e.fog?\"#define USE_FOG\":\n\"\",e.useFog&&e.fogExp?\"#define FOG_EXP2\":\"\",e.map?\"#define USE_MAP\":\"\",e.envMap?\"#define USE_ENVMAP\":\"\",e.lightMap?\"#define USE_LIGHTMAP\":\"\",e.bumpMap?\"#define USE_BUMPMAP\":\"\",e.normalMap?\"#define USE_NORMALMAP\":\"\",e.specularMap?\"#define USE_SPECULARMAP\":\"\",e.alphaMap?\"#define USE_ALPHAMAP\":\"\",e.vertexColors?\"#define USE_COLOR\":\"\",e.metal?\"#define METAL\":\"\",e.wrapAround?\"#define WRAP_AROUND\":\"\",e.doubleSided?\"#define DOUBLE_SIDED\":\"\",e.flipSided?\"#define FLIP_SIDED\":\"\",e.shadowMapEnabled?\"#define USE_SHADOWMAP\":\n\"\",e.shadowMapEnabled?\"#define \"+r:\"\",e.shadowMapDebug?\"#define SHADOWMAP_DEBUG\":\"\",e.shadowMapCascade?\"#define SHADOWMAP_CASCADE\":\"\",e.logarithmicDepthBuffer?\"#define USE_LOGDEPTHBUF\":\"\",\"uniform mat4 viewMatrix;\\nuniform vec3 cameraPosition;\\n\"].join(\"\\n\"));l=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+l);n=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+n);f.attachShader(g,l);f.attachShader(g,n);void 0!==q&&f.bindAttribLocation(g,0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error(\"THREE.WebGLProgram: Could not initialise shader.\"),\nconsole.error(\"gl.VALIDATE_STATUS\",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error(\"gl.getError()\",f.getError()));\"\"!==f.getProgramInfoLog(g)&&console.warn(\"THREE.WebGLProgram: gl.getProgramInfoLog()\",f.getProgramInfoLog(g));f.deleteShader(l);f.deleteShader(n);q=\"viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse\".split(\" \");e.useVertexTexture?(q.push(\"boneTexture\"),q.push(\"boneTextureWidth\"),q.push(\"boneTextureHeight\")):\nq.push(\"boneGlobalMatrices\");e.logarithmicDepthBuffer&&q.push(\"logDepthBufFC\");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)r=h[q],v[r]=f.getUniformLocation(g,r);this.uniforms=v;q=\"position normal uv uv2 tangent color skinIndex skinWeight lineDistance\".split(\" \");for(h=0;h<e.maxMorphTargets;h++)q.push(\"morphTarget\"+h);for(h=0;h<e.maxMorphNormals;h++)q.push(\"morphNormal\"+h);for(var w in k)q.push(w);e=q;k={};w=0;for(h=e.length;w<h;w++)v=e[w],k[v]=f.getAttribLocation(g,v);this.attributes=\nk;this.id=a++;this.code=c;this.usedTimes=1;this.program=g;this.vertexShader=l;this.fragmentShader=n;return this}}();\nTHREE.WebGLShader=function(){var a=function(a){a=a.split(\"\\n\");for(var c=0;c<a.length;c++)a[c]=c+1+\": \"+a[c];return a.join(\"\\n\")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error(\"THREE.WebGLShader: Shader couldn't compile.\");\"\"!==b.getShaderInfoLog(c)&&(console.warn(\"THREE.WebGLShader: gl.getShaderInfoLog()\",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();\nTHREE.RenderableVertex=function(){this.position=new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};\nTHREE.RenderableFace=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.normalModel=new THREE.Vector3;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsLength=0;this.color=new THREE.Color;this.material=null;this.uvs=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2];this.z=0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};\nTHREE.RenderableSprite=function(){this.id=0;this.object=null;this.rotation=this.z=this.y=this.x=0;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};\nTHREE.GeometryUtils={merge:function(a,b,c){console.warn(\"THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.\");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn(\"THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.\");return a.center()}};\nTHREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&\nc(f))})};d=0;for(var h=a.length;d<h;++d)b(d);return f},loadCompressedTexture:function(){console.error(\"THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.\")},loadCompressedTextureCube:function(){console.error(\"THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.\")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement(\"canvas\");\nf.width=d;f.height=e;var g=f.getContext(\"2d\");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var r=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+s)]/255*b]);v.push([-1,-1,h[4*(r*d+s)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255*\nb]);v.push([-1,1,h[4*(t*d+s)]/255*b]);r=[];s=v.length;for(t=0;t<s;t++){var p=v[t],u=v[(t+1)%s],p=[p[0]-w[0],p[1]-w[1],p[2]-w[2]],u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];r.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}v=[0,0,0];for(t=0;t<r.length;t++)v[0]+=r[t][0],v[1]+=r[t][1],v[2]+=r[t][2];v[0]/=r.length;v[1]/=r.length;v[2]/=r.length;w=4*(q*d+n);l[w]=(v[0]+1)/2*255|0;l[w+1]=(v[1]+1)/2*255|0;l[w+2]=255*v[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,\nb,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};\nTHREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};\nTHREE.FontUtils={faces:{},face:\"helvetiker\",weight:\"normal\",style:\"normal\",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw\"The font \"+this.face+\" with \"+this.weight+\" weight and \"+this.style+\" style is missing.\";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=\na},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(\"\"),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,q,r,t,s,p,v,w=b.glyphs[a]||b.glyphs[\"?\"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(\" \")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case \"m\":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);\nbreak;case \"l\":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case \"q\":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,n);if(g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++){var u=g/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,s,n)}break;case \"b\":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,s=b[a++]*c,p=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,s,p,v,k,n),g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++)u=g/h,THREE.Shape.Utils.b3(u,q,t,p,k),THREE.Shape.Utils.b3(u,\nr,s,v,n)}return{offset:w.ha*c,path:e}}}};\nTHREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:\"helvetiker\",e=void 0!==b.weight?b.weight:\"normal\",f=void 0!==b.style?b.style:\"normal\";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};\n(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log(\"Warning, unable to triangulate polygon!\");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var r;a:{var t=r=void 0,s=void 0,p=void 0,v=void 0,w=void 0,u=void 0,D=void 0,A=void 0,\nt=a[g[k]].x,s=a[g[k]].y,p=a[g[l]].x,v=a[g[l]].y,w=a[g[n]].x,u=a[g[n]].y;if(1E-10>(p-t)*(u-s)-(v-s)*(w-t))r=!1;else{var x=void 0,C=void 0,I=void 0,z=void 0,y=void 0,K=void 0,N=void 0,ba=void 0,P=void 0,O=void 0,P=ba=N=A=D=void 0,x=w-p,C=u-v,I=t-w,z=s-u,y=p-t,K=v-s;for(r=0;r<e;r++)if(D=a[g[r]].x,A=a[g[r]].y,!(D===t&&A===s||D===p&&A===v||D===w&&A===u)&&(N=D-t,ba=A-s,P=D-p,O=A-v,D-=w,A-=u,P=x*O-C*P,N=y*ba-K*N,ba=I*A-z*D,-1E-10<=P&&-1E-10<=ba&&-1E-10<=N)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],\na[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log(\"Warning, getPoint() not implemented!\");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};\nTHREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};\nTHREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};\nTHREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};\nTHREE.Curve.prototype.getTangentAt=function(a){a=this.getUtoTmapping(a);return this.getTangent(a)};\nTHREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a,b,c,d,e){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a);d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}};\nTHREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};\nTHREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};\nTHREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};\nTHREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,n,q=a[0]instanceof THREE.Vector3;n=q?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),q&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};q&&(a.maxZ=d,a.minZ=g);return a};\nTHREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};\nTHREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};\nTHREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(this.translationWorld,this.quaternionWorld,this.scaleWorld),this.matrix.decompose(this.translationObject,this.quaternionObject,this.scaleObject),this.matrixWorld.compose(this.translationWorld,this.quaternionObject,this.scaleWorld)):this.matrixWorld.copy(this.matrix),\nthis.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.quaternionWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.quaternionObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;\nTHREE.Path=function(a){THREE.CurvePath.call(this);this.actions=[];a&&this.fromPoints(a)};THREE.Path.prototype=Object.create(THREE.CurvePath.prototype);THREE.PathActions={MOVE_TO:\"moveTo\",LINE_TO:\"lineTo\",QUADRATIC_CURVE_TO:\"quadraticCurveTo\",BEZIER_CURVE_TO:\"bezierCurveTo\",CSPLINE_THRU:\"splineThru\",ARC:\"arc\",ELLIPSE:\"ellipse\"};THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)};\nTHREE.Path.prototype.moveTo=function(a,b){var c=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:c})};THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d);this.actions.push({action:THREE.PathActions.LINE_TO,args:c})};\nTHREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f);this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})};\nTHREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h);this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})};\nTHREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};\nTHREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};\nTHREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};\nTHREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log(\"tata\"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,n,q,r,t,s,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];q=f[0];r=f[1];0<c.length?(g=c[c.length-1],t=g.x,\ns=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b2(p,t,q,h),p=THREE.Shape.Utils.b2(p,s,r,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];q=f[0];r=f[1];l=f[2];n=f[3];0<c.length?(g=c[c.length-1],t=g.x,s=g.y):(g=this.actions[d-1].args,t=g[g.length-2],s=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b3(p,t,q,l,h),p=THREE.Shape.Utils.b3(p,s,r,n,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.CSPLINE_THRU:g=\nthis.actions[d-1].args;p=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=g;f++)c.push(p.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];r=f[2];l=f[3];g=f[4];q=!!f[5];t=g-l;s=2*a;for(f=1;f<=s;f++)p=f/s,q||(p=1-p),p=l+p*t,g=h+r*Math.cos(p),p=k+r*Math.sin(p),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],r=f[2],n=f[3],l=f[4],g=f[5],q=!!f[6],t=g-l,s=2*a,f=1;f<=s;f++)p=f/s,q||\n(p=1-p),p=l+p*t,g=h+r*Math.cos(p),p=k+n*Math.sin(p),c.push(new THREE.Vector2(g,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};\nTHREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=\nh.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),l=a?!l:l;\nh=[];var n=[],q=[],r=0,t;n[r]=void 0;q[r]=[];var s,p;s=0;for(p=e.length;s<p;s++)g=e[s],t=g.getPoints(),f=THREE.Shape.Utils.isClockWise(t),(f=a?!f:f)?(!l&&n[r]&&r++,n[r]={s:new THREE.Shape,p:t},n[r].s.actions=g.actions,n[r].s.curves=g.curves,l&&r++,q[r]=[]):q[r].push({h:g,p:t[0]});if(!n[0])return c(e);if(1<n.length){s=!1;p=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=q[g],l=0;l<f.length;l++){r=f[l];t=!0;for(var v=0;v<n.length;v++)d(r.p,n[v].p)&&(g!=v&&p.push({froms:g,tos:v,\nhole:l}),t?(t=!1,h[v].push(r)):s=!0);t&&h[g].push(r)}0<p.length&&(s||(q=h))}s=0;for(p=n.length;s<p;s++)for(h=n[s].s,k.push(h),g=q[s],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};\nTHREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};\nTHREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};\nTHREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,q=a.y-d.y,I=h*k-g*l,z=h*n-g*q;if(1E-10<Math.abs(I)){if(0<I){if(0>z||z>I)return[];k=l*n-k*q;if(0>k||k>I)return[]}else{if(0<z||z<I)return[];k=l*n-k*q;if(0<k||k<I)return[]}if(0==k)return!f||0!=z&&z!=I?[a]:[];if(k==I)return!f||0!=z&&z!=I?[b]:[];if(0==z)return[d];\nif(z==I)return[e];f=k/I;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=z||l*n!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,I=d.x,l=e,d=e.x):(b=e,I=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,I=d.y,l=e,d=e.y):(b=e,I=e.y,l=d,d=d.y));return k<=I?a<I?[]:a==I?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:\n[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+\":\"+h[f].y,void 0!==n[l]&&console.log(\"Duplicate point\",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;\nd=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,q,C,I,z,y=[],K,N,ba,P=0;for(n=b.length;P<n;P++)l.push(P);K=0;for(var O=2*l.length;0<l.length;){O--;if(0>O){console.log(\"Infinite Loop! Holes left:\"+\nl.length+\", Probably Hole outside Shape!\");break}for(q=K;q<h.length;q++){C=h[q];n=-1;for(P=0;P<l.length;P++)if(I=l[P],z=C.x+\":\"+C.y+\":\"+I,void 0===y[z]){k=b[I];for(N=0;N<k.length;N++)if(I=k[N],c(q,N)&&!f(C,I)&&!g(C,I)){n=N;l.splice(P,1);K=h.slice(0,q+1);I=h.slice(q);N=k.slice(n);ba=k.slice(0,n+1);h=K.concat(N).concat(ba).concat(I);K=q;break}if(0<=n)break;y[z]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+\":\"+k[h].y,\nl=n[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,\nb)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};\nTHREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};\nTHREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);\nTHREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};\nTHREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e-=a;c[0]=0==a?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b};\nTHREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);\nTHREE.EllipseCurve.prototype.getPoint=function(a){var b;b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);b=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;a=this.aX+this.xRadius*Math.cos(b);b=this.aY+this.yRadius*Math.sin(b);return new THREE.Vector2(a,b)};THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);\nTHREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b});THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)});\nTHREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)});\nTHREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;a*=d.length-1;e=Math.floor(a);a-=e;c[0]=0==e?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b});\nTHREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e-=a;a+=0<a?0:(Math.floor(Math.abs(a)/d.length)+1)*d.length;c[0]=(a-1)%d.length;c[1]=a%d.length;c[2]=(a+1)%d.length;c[3]=(a+2)%d.length;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);b.z=THREE.Curve.Utils.interpolate(d[c[0]].z,\nd[c[1]].z,d[c[2]].z,d[c[3]].z,e);return b});\nTHREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn(\"THREE.AnimationHandler.add() has been deprecated.\")},get:function(){console.warn(\"THREE.AnimationHandler.get() has been deprecated.\")},remove:function(){console.warn(\"THREE.AnimationHandler.remove() has been deprecated.\")},animations:[],init:function(a){if(!0!==a.initialized){for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(0>a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=\n0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;c<a.hierarchy[b].keys.length;c++)for(var e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++){var f=a.hierarchy[b].keys[c].morphTargets[e];d[f]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var g=\n{};for(f in d){for(e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++)if(a.hierarchy[b].keys[c].morphTargets[e]===f){g[f]=a.hierarchy[b].keys[c].morphTargetsInfluences[e];break}e===a.hierarchy[b].keys[c].morphTargets.length&&(g[f]=0)}a.hierarchy[b].keys[c].morphTargetsInfluences=g}}for(c=1;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].time===a.hierarchy[b].keys[c-1].time&&(a.hierarchy[b].keys.splice(c,1),c--);for(c=0;c<a.hierarchy[b].keys.length;c++)a.hierarchy[b].keys[c].index=c}a.initialized=\n!0;return a}},parse:function(a){var b=function(a,c){c.push(a);for(var d=0;d<a.children.length;d++)b(a.children[d],c)},c=[];if(a instanceof THREE.SkinnedMesh)for(var d=0;d<a.skeleton.bones.length;d++)c.push(a.skeleton.bones[d]);else b(a,c);return c},play:function(a){-1===this.animations.indexOf(a)&&this.animations.push(a)},stop:function(a){a=this.animations.indexOf(a);-1!==a&&this.animations.splice(a,1)},update:function(a){for(var b=0;b<this.animations.length;b++)this.animations[b].update(a)}};\nTHREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};THREE.Animation.prototype.keyTypes=[\"pos\",\"rot\",\"scl\"];THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)};\nTHREE.Animation.prototype.stop=function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)};\nTHREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={});void 0===c.animationCache[this.data.name]&&(c.animationCache[this.data.name]={},c.animationCache[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].nextKey={pos:0,rot:0,scl:0},c.animationCache[this.data.name].originalMatrix=c.matrix);for(var c=c.animationCache[this.data.name],d=0;3>d;d++){for(var e=\nthis.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.time<this.currentTime&&g.index>f.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}};\nTHREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,s,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];p=a[c[3]];c=e*e;r=e*c;d[0]=f(q[0],t[0],s[0],p[0],e,c,r);d[1]=f(q[1],t[1],s[1],p[1],e,c,r);d[2]=f(q[2],t[2],s[2],p[2],e,c,r);return d},f=function(a,b,c,d,e,f,r){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*r+\n(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(!0===this.loop&&this.currentTime>f)this.currentTime%=f,this.reset();else if(!1===this.loop&&this.currentTime>f){this.stop();return}f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache[this.data.name],n=0;3>n;n++){var q=this.keyTypes[n],r=l.prevKey[q],t=l.nextKey[q];if(t.time<=this.currentTime){r=this.data.hierarchy[f].keys[0];\nfor(t=this.getNextKeyWith(q,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(q,f,t.index+1);l.prevKey[q]=r;l.nextKey[q]=t}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-r.time)/(t.time-r.time),p=r[q],v=t[q];0>s&&(s=0);1<s&&(s=1);if(\"pos\"===q)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=p[0]+(v[0]-p[0])*s,c.y=p[1]+(v[1]-p[1])*s,c.z=p[2]+(v[2]-p[2])*s,k instanceof THREE.Bone?(r=this.weight/(this.weight+k.accumulatedPosWeight),k.position.lerp(c,\nr),k.accumulatedPosWeight+=this.weight):k.position.copy(c);else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith(\"pos\",f,r.index-1).pos,a[1]=p,a[2]=v,a[3]=this.getNextKeyWith(\"pos\",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=1,k instanceof THREE.Bone&&(r=this.weight/(this.weight+k.accumulatedPosWeight),k.accumulatedPosWeight+=this.weight),q=k.position,q.x+=(t[0]-q.x)*r,q.y+=(t[1]-q.y)*r,q.z+=(t[2]-\nq.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(q),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else\"rot\"===q?(THREE.Quaternion.slerp(p,v,d,s),k instanceof THREE.Bone?0===k.accumulatedRotWeight?(k.quaternion.copy(d),k.accumulatedRotWeight=this.weight):(r=this.weight/(this.weight+k.accumulatedRotWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),k.accumulatedRotWeight+=this.weight):k.quaternion.copy(d)):\n\"scl\"===q&&(c.x=p[0]+(v[0]-p[0])*s,c.y=p[1]+(v[1]-p[1])*s,c.z=p[2]+(v[2]-p[2])*s,k instanceof THREE.Bone?(r=this.weight/(this.weight+k.accumulatedSclWeight),k.scale.lerp(c,r),k.accumulatedSclWeight+=this.weight):k.scale.copy(c))}return!0}}}();\nTHREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};\nTHREE.Animation.prototype.getPrevKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};\nTHREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();\nd.matrixWorldNeedsUpdate=!0}}};\nTHREE.KeyFrameAnimation.prototype.play=function(a){this.currentTime=void 0!==a?a:0;if(!1===this.isPlaying){this.isPlaying=!0;var b=this.hierarchy.length,c,d;for(a=0;a<b;a++)c=this.hierarchy[a],d=this.data.hierarchy[a],void 0===d.animationCache&&(d.animationCache={},d.animationCache.prevKey=null,d.animationCache.nextKey=null,d.animationCache.originalMatrix=c.matrix),c=this.data.hierarchy[a].keys,c.length&&(d.animationCache.prevKey=c[0],d.animationCache.nextKey=c[1],this.startTime=Math.min(c[0].time,\nthis.startTime),this.endTime=Math.max(c[c.length-1].time,this.endTime));this.update(0)}this.isPaused=!1;THREE.AnimationHandler.play(this)};THREE.KeyFrameAnimation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.stop(this);for(var a=0;a<this.data.hierarchy.length;a++){var b=this.hierarchy[a],c=this.data.hierarchy[a];if(void 0!==c.animationCache){var d=c.animationCache.originalMatrix;d.copy(b.matrix);b.matrix=d;delete c.animationCache}}};\nTHREE.KeyFrameAnimation.prototype.update=function(a){if(!1!==this.isPlaying){this.currentTime+=a*this.timeScale;a=this.data.length;!0===this.loop&&this.currentTime>a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.time<this.currentTime&&g.index>f.index;)f=g,g=e[f.index+1];d.prevKey=\nf;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;c<b.length;c++)if(b[c].hasTarget(a))return b[c];return b[0]};\nTHREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.isPlaying=!1};\nTHREE.MorphAnimation.prototype={play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(){var a=0,b=0;return function(c){if(!1!==this.isPlaying){this.currentTime+=c;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]=\n0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()};\nTHREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,p){var v,w=h.widthSegments,u=h.heightSegments,D=e/2,A=f/2,x=h.vertices.length;if(\"x\"===a&&\"y\"===b||\"y\"===a&&\"x\"===b)v=\"z\";else if(\"x\"===a&&\"z\"===b||\"z\"===a&&\"x\"===b)v=\"y\",u=h.depthSegments;else if(\"z\"===a&&\"y\"===b||\"y\"===a&&\"z\"===b)v=\"x\",w=h.depthSegments;var C=w+1,I=u+1,z=e/w,y=f/u,K=new THREE.Vector3;K[v]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<C;f++){var N=new THREE.Vector3;N[a]=(f*z-D)*c;N[b]=(e*y-A)*d;N[v]=g;h.vertices.push(N)}for(e=\n0;e<u;e++)for(f=0;f<w;f++)A=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),D=new THREE.Vector2((f+1)/w,1-e/u),A=new THREE.Face3(A+x,a+x,c+x),A.normal.copy(K),A.vertexNormals.push(K.clone(),K.clone(),K.clone()),A.materialIndex=p,h.faces.push(A),h.faceVertexUvs[0].push([d,g,D]),A=new THREE.Face3(a+x,b+x,c+x),A.normal.copy(K),A.vertexNormals.push(K.clone(),K.clone(),K.clone()),A.materialIndex=p,h.faces.push(A),\nh.faceVertexUvs[0].push([g.clone(),v,D.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g(\"z\",\"y\",-1,-1,c,b,d,0);g(\"z\",\"y\",1,-1,c,b,-d,1);g(\"x\",\"z\",1,1,a,c,e,2);g(\"x\",\"z\",1,-1,a,c,-e,3);g(\"x\",\"y\",1,-1,a,b,f,4);g(\"x\",\"y\",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=\nb;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn(\"THEE.CubeGeometry has been renamed to THREE.BoxGeometry.\");return new THREE.BoxGeometry(a,b,c,d,e,f)};\nTHREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],n=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=s*Math.sin(p*Math.PI*2);v.y=-t*c+g;v.z=s*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(p,\n1-t))}l.push(q);n.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=l[k][h],s=l[k+1][h],p=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),D=r.clone(),A=r.clone(),x=n[k][h].clone(),C=n[k+1][h].clone(),I=n[k+1][h+1].clone(),z=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,\ns,v,[w,u,A]));this.faceVertexUvs[0].push([x,C,z]);this.faces.push(new THREE.Face3(s,p,v,[u.clone(),D,A.clone()]));this.faceVertexUvs[0].push([C.clone(),I,z.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=l[0][h],s=l[0][h+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),D=new THREE.Vector3(0,1,0),x=n[0][h].clone(),C=n[0][h+1].clone(),I=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(t,s,p,[w,u,D])),this.faceVertexUvs[0].push([x,\nC,I]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=l[k][h+1],s=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),D=new THREE.Vector3(0,-1,0),x=n[k][h+1].clone(),C=n[k][h].clone(),I=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,s,p,[w,u,D])),this.faceVertexUvs[0].push([x,C,I]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.ExtrudeGeometry=function(a,b){\"undefined\"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};\nTHREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log(\"die\");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&\n(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(H=c.length;0<=--H;){e=H;f=H-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=S*g,l=S*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,x=f,p=p+ba,k=k+ba,q=q+ba,l=l+ba;N.faces.push(new THREE.Face3(p,k,l,null,null,u));N.faces.push(new THREE.Face3(k,q,l,null,null,u));p=D.generateSideWallUV(N,a,r,b,p,k,q,l,s,v,w,x);N.faceVertexUvs[0].push([p[0],\np[1],p[3]]);N.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=ba;d+=ba;e+=ba;N.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?D.generateBottomUV(N,a,b,c,d,e):D.generateTopUV(N,a,b,c,d,e);N.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:\n!0,r=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,v=!1,w=b.material,u=b.extrudeMaterial,D=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,A,x,C,I;s&&(p=s.getSpacedPoints(t),v=!0,q=!1,A=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),x=new THREE.Vector3,C=new THREE.Vector3,I=new THREE.Vector3);q||(l=k=n=0);var z,y,K,N=this,ba=this.vertices.length,s=a.extractPoints(r),r=s.shape,P=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=\nr.reverse();y=0;for(K=P.length;y<K;y++)z=P[y],THREE.Shape.Utils.isClockWise(z)&&(P[y]=z.reverse());s=!1}var O=THREE.Shape.Utils.triangulateShape(r,P),J=r;y=0;for(K=P.length;y<K;y++)z=P[y],r=r.concat(z);var E,Q,L,R,B,S=r.length,V,W=O.length,s=[],H=0;L=J.length;E=L-1;for(Q=H+1;H<L;H++,E++,Q++)E===L&&(E=0),Q===L&&(Q=0),s[H]=d(J[H],J[E],J[Q]);var oa=[],$,X=s.concat();y=0;for(K=P.length;y<K;y++){z=P[y];$=[];H=0;L=z.length;E=L-1;for(Q=H+1;H<L;H++,E++,Q++)E===L&&(E=0),Q===L&&(Q=0),$[H]=d(z[H],z[E],z[Q]);\noa.push($);X=X.concat($)}for(E=0;E<n;E++){L=E/n;R=k*(1-L);Q=l*Math.sin(L*Math.PI/2);H=0;for(L=J.length;H<L;H++)B=c(J[H],s[H],Q),f(B.x,B.y,-R);y=0;for(K=P.length;y<K;y++)for(z=P[y],$=oa[y],H=0,L=z.length;H<L;H++)B=c(z[H],$[H],Q),f(B.x,B.y,-R)}Q=l;for(H=0;H<S;H++)B=q?c(r[H],X[H],Q):r[H],v?(C.copy(A.normals[0]).multiplyScalar(B.x),x.copy(A.binormals[0]).multiplyScalar(B.y),I.copy(p[0]).add(C).add(x),f(I.x,I.y,I.z)):f(B.x,B.y,0);for(L=1;L<=t;L++)for(H=0;H<S;H++)B=q?c(r[H],X[H],Q):r[H],v?(C.copy(A.normals[L]).multiplyScalar(B.x),\nx.copy(A.binormals[L]).multiplyScalar(B.y),I.copy(p[L]).add(C).add(x),f(I.x,I.y,I.z)):f(B.x,B.y,h/t*L);for(E=n-1;0<=E;E--){L=E/n;R=k*(1-L);Q=l*Math.sin(L*Math.PI/2);H=0;for(L=J.length;H<L;H++)B=c(J[H],s[H],Q),f(B.x,B.y,h+R);y=0;for(K=P.length;y<K;y++)for(z=P[y],$=oa[y],H=0,L=z.length;H<L;H++)B=c(z[H],$[H],Q),v?f(B.x,B.y+p[t-1].y,p[t-1].x+R):f(B.x,B.y,h+R)}(function(){if(q){var a;a=0*S;for(H=0;H<W;H++)V=O[H],g(V[2]+a,V[1]+a,V[0]+a,!0);a=t+2*n;a*=S;for(H=0;H<W;H++)V=O[H],g(V[0]+a,V[1]+a,V[2]+a,!1)}else{for(H=\n0;H<W;H++)V=O[H],g(V[2],V[1],V[0],!0);for(H=0;H<W;H++)V=O[H],g(V[0]+S*t,V[1]+S*t,V[2]+S*t,!1)}})();(function(){var a=0;e(J,a);a+=J.length;y=0;for(K=P.length;y<K;y++)z=P[y],e(z,a),a+=z.length})()};\nTHREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;\nn=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var r=a.vertices[h].y;a=a.vertices[h].z;return.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;\nTHREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};\nTHREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],\nk=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,g,l))};\nTHREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=l*r.x-n*r.y;t.y=n*r.x+l*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,r=g*f,t=k*e,s=r+f,p=t+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(r,\nt),new THREE.Vector2(s,t),new THREE.Vector2(r,p)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,p),new THREE.Vector2(r,p)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1;d=d||1;var g=c+1,h=d+1,k=a/c,l=b/d,n=new THREE.Vector3(0,0,1);for(a=0;a<h;a++){var q=a*l-f;for(b=0;b<g;b++)this.vertices.push(new THREE.Vector3(b*k-e,-q,0))}for(a=0;a<d;a++)for(b=0;b<c;b++){var r=b+g*a,e=b+g*(a+1),f=b+1+g*(a+1),h=b+1+g*a,k=new THREE.Vector2(b/c,1-a/d),l=new THREE.Vector2(b/c,1-(a+1)/d),q=new THREE.Vector2((b+1)/c,1-(a+1)/d),t=new THREE.Vector2((b+\n1)/c,1-a/d),r=new THREE.Face3(r,e,h);r.normal.copy(n);r.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(r);this.faceVertexUvs[0].push([k,l,t]);r=new THREE.Face3(e,f,h);r.normal.copy(n);r.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(r);this.faceVertexUvs[0].push([l.clone(),q,t.clone()])}};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,q=e+g/c*f;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=q=g+e,l=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(f,\nl,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=q,l=q+c+2,n=q+1,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this);this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var q=[],r=[];for(h=0;h<=b;h++){var t=h/b,s=k/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+t*e)*Math.sin(f+s*g);p.y=a*Math.cos(f+s*g);p.z=\na*Math.sin(d+t*e)*Math.sin(f+s*g);this.vertices.push(p);q.push(this.vertices.length-1);r.push(new THREE.Vector2(t,1-s))}l.push(q);n.push(r)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var q=this.vertices[d].clone().normalize(),r=this.vertices[e].clone().normalize(),t=this.vertices[f].clone().normalize(),s=this.vertices[g].clone().normalize(),p=n[k][h+1].clone(),v=n[k][h].clone(),w=n[k+1][h].clone(),u=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+\nv.x)/2,this.faces.push(new THREE.Face3(d,f,g,[q,t,s])),this.faceVertexUvs[0].push([p,w,u])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,f,[q,r,t])),this.faceVertexUvs[0].push([p,v,w])):(this.faces.push(new THREE.Face3(d,e,g,[q,r,s])),this.faceVertexUvs[0].push([p,v,u]),this.faces.push(new THREE.Face3(e,f,g,[r.clone(),t,s.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,\na)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);\nTHREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,q=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var r=new THREE.Vector3;r.x=(a+b*Math.cos(q))*Math.cos(n);r.y=(a+b*Math.cos(q))*Math.sin(n);r.z=b*Math.sin(q);this.vertices.push(r);g.push(new THREE.Vector2(l/d,k/c));h.push(r.clone().sub(f).normalize())}for(k=\n1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=0;r<c;++r){k[r]=Array(d);var t=r/c*2*e*Math.PI,\ns=h(t,f,e,a,g),t=h(t+.01,f,e,a,g);l.subVectors(t,s);n.addVectors(t,s);q.crossVectors(l,n);n.crossVectors(q,l);q.normalize();n.normalize();for(t=0;t<d;++t){var p=t/d*2*Math.PI,v=-b*Math.cos(p),p=b*Math.sin(p),w=new THREE.Vector3;w.x=s.x+v*n.x+p*q.x;w.y=s.y+v*n.y+p*q.y;w.z=s.z+v*n.z+p*q.z;k[r][t]=this.vertices.push(w)-1}}for(r=0;r<c;++r)for(t=0;t<d;++t)e=(r+1)%c,f=(t+1)%d,a=k[r][t],b=k[e][t],e=k[e][f],f=k[r][f],g=new THREE.Vector2(r/c,t/d),l=new THREE.Vector2((r+1)/c,t/d),n=new THREE.Vector2((r+1)/\nc,(t+1)/d),q=new THREE.Vector2(r/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,q]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var f=[],g,h,k=b+1,l,n,q,r,t=new THREE.Vector3,s,p,v;s=new THREE.TubeGeometry.FrenetFrames(a,b,e);p=s.normals;v=s.binormals;this.tangents=s.tangents;this.normals=p;this.binormals=v;for(s=0;s<k;s++)for(f[s]=[],l=s/(k-1),r=a.getPointAt(l),g=p[s],h=v[s],l=0;l<d;l++)n=l/d*2*Math.PI,q=-c*Math.cos(n),n=c*Math.sin(n),t.copy(r),t.x+=q*g.x+n*\nh.x,t.y+=q*g.y+n*h.y,t.z+=q*g.z+n*h.z,f[s][l]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(s=0;s<b;s++)for(l=0;l<d;l++)k=e?(s+1)%b:s+1,t=(l+1)%d,a=f[s][l],c=f[k][l],k=f[k][t],t=f[s][t],p=new THREE.Vector2(s/b,l/d),v=new THREE.Vector2((s+1)/b,l/d),g=new THREE.Vector2((s+1)/b,(l+1)/d),h=new THREE.Vector2(s/b,(l+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([p,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),g,h.clone()]);this.computeFaceNormals();\nthis.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,q;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],\nd).normalize();f[0].crossVectors(e[0],h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],\nf[l])};\nTHREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){var c=\nMath.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(g.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)l[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?f(l[n][d+1],l[n+1][d],l[n][d]):f(l[n][d+1],l[n+1][d+1],l[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,\na.y));return a.clone()}THREE.Geometry.call(this);c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var q=[],r=l=0,n=b.length;l<n;l+=3,r++){var t=a[b[l]],s=a[b[l+1]],p=a[b[l+2]];q[r]=new THREE.Face3(t.index,s.index,p.index,[t.clone(),s.clone(),p.clone()])}for(var v=new THREE.Vector3,l=0,n=q.length;l<n;l++)g(q[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,q=b[2].x,r=Math.max(d,Math.max(a,\nq)),t=Math.min(d,Math.min(a,q)),.9<r&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.IcosahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b)};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var q,r,t,s;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,q=new THREE.Vector2(h/b,g/c),r=new THREE.Vector2((h+1)/b,g/c),t=new THREE.Vector2((h+1)/b,(g+1)/c),s=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,d,k)),f.push([q,r,s]),e.push(new THREE.Face3(d,l,k)),\nf.push([r.clone(),t,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);\nTHREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute(\"position\",new THREE.BufferAttribute(b,3));a.addAttribute(\"color\",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);\nthis.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(c);this.setLength(e,g,h)}}();THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();\nTHREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,a,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};\nTHREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute(\"position\",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y;\nd[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrixAutoUpdate=\n!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};\nTHREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b(\"n1\",\"n2\",16755200);b(\"n2\",\"n4\",16755200);b(\"n4\",\"n3\",16755200);b(\"n3\",\"n1\",16755200);b(\"f1\",\"f2\",16755200);b(\"f2\",\"f4\",16755200);b(\"f4\",\"f3\",16755200);b(\"f3\",\"f1\",16755200);b(\"n1\",\"f1\",16755200);\nb(\"n2\",\"f2\",16755200);b(\"n3\",\"f3\",16755200);b(\"n4\",\"f4\",16755200);b(\"p\",\"n1\",16711680);b(\"p\",\"n2\",16711680);b(\"p\",\"n3\",16711680);b(\"p\",\"n4\",16711680);b(\"u1\",\"u2\",43775);b(\"u2\",\"u3\",43775);b(\"u3\",\"u1\",43775);b(\"c\",\"t\",16777215);b(\"p\",\"c\",3355443);b(\"cn1\",\"cn2\",3355443);b(\"cn3\",\"cn4\",3355443);b(\"cf1\",\"cf2\",3355443);b(\"cf3\",\"cf4\",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};\nTHREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,g,h,k){a.set(g,h,k);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d)for(g=0,h=d.length;g<h;g++)e.geometry.vertices[d[g]].copy(a)}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d(\"c\",0,0,-1);d(\"t\",0,0,1);d(\"n1\",-1,-1,-1);d(\"n2\",1,-1,-1);d(\"n3\",-1,1,-1);d(\"n4\",1,1,-1);d(\"f1\",-1,-1,1);d(\"f2\",1,-1,1);d(\"f3\",-1,1,1);d(\"f4\",1,1,1);d(\"u1\",.7,\n1.1,-1);d(\"u2\",-.7,1.1,-1);d(\"u3\",0,2,-1);d(\"cf1\",-1,0,1);d(\"cf2\",1,0,1);d(\"cf3\",0,-1,1);d(\"cf4\",0,1,1);d(\"cn1\",-1,0,-1);d(\"cn2\",1,0,-1);d(\"cn3\",0,-1,-1);d(\"cn4\",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();\nTHREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Line(c,d);this.add(this.lightPlane);\nc=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};\nTHREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();\nTHREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=[\"a\",\"b\",\"c\"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var l=k.vertices,k=k.faces,n=0,q=0,r=k.length;q<r;q++)for(var t=k[q],s=0;3>s;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute(\"position\",new THREE.Float32Attribute(6*n,3));d=h.attributes.position.array;\nf=0;for(p in e)if(g=e[p],void 0===g.face2||.9999>k[g.face1].normal.dot(k[g.face2].normal))n=l[g.vert1],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z,n=l[g.vert2],d[f++]=n.x,d[f++]=n.y,d[f++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;b<g;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}this.geometry.verticesNeedUpdate=!0;return this};\nTHREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};\nTHREE.HemisphereLightHelper=function(a,b,c,d){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];a=new THREE.SphereGeometry(b,4,2);a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(b=0;8>b;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere);\nthis.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()};\nTHREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}();\nTHREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};\nTHREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};\nTHREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;c<this.bones.length;c++)this.bones[c].parent instanceof THREE.Bone&&(b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3),b.colors.push(new THREE.Color(0,0,1)),b.colors.push(new THREE.Color(0,1,0)));c=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});THREE.Line.call(this,b,c,THREE.LinePieces);this.root=a;this.matrixWorld=a.matrixWorld;\nthis.matrixAutoUpdate=!1;this.update()};THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype);THREE.SkeletonHelper.prototype.getBoneList=function(a){var b=[];a instanceof THREE.Bone&&b.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,this.getBoneList(a.children[c]));return b};\nTHREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new THREE.Matrix4).getInverse(this.root.matrixWorld),c=new THREE.Matrix4,d=0,e=0;e<this.bones.length;e++){var f=this.bones[e];f.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,f.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,f.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};\nTHREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);\nTHREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();\nTHREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=[\"a\",\"b\",\"c\",\"d\"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],q=0,r=n.vertexNormals.length;q<r;q++){var t=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);\nb.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();\nTHREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);\nTHREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=[\"a\",\"b\",\"c\",\"d\"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],q=0,r=n.vertexTangents.length;q<r;q++){var t=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(g);b.copy(t).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);\nh+=1}this.geometry.verticesNeedUpdate=!0;return this}}();\nTHREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=[\"a\",\"b\",\"c\"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,l=a.geometry.faces,n=0,q=new Uint32Array(6*l.length),r=0,t=l.length;r<t;r++)for(var s=l[r],p=0;3>p;p++){d[0]=s[g[p]];d[1]=s[g[(p+1)%3]];d.sort(f);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(p=0;2>p;p++)n=\nk[q[2*r+p]],g=6*r+3*p,d[g+0]=n.x,d[g+1]=n.y,d[g+2]=n.z;h.addAttribute(\"position\",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,l=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),s=0,w=l.length;s<w;++s)for(var p=l[s].start,v=l[s].count,g=l[s].index,r=p,u=p+v;r<u;r+=3)for(p=0;3>p;p++)d[0]=g+t[r+p],d[1]=g+t[r+(p+1)%3],d.sort(f),v=d.toString(),\nvoid 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(p=0;2>p;p++)g=6*r+3*p,n=3*q[2*r+p],d[g+0]=k[n],d[g+1]=k[n+1],d[g+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;r<t;r++)for(p=0;3>p;p++)g=18*r+6*p,q=9*r+3*p,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],n=9*r+(p+1)%3*3,d[g+3]=k[n],d[g+4]=k[n+1],d[g+5]=k[n+2];h.addAttribute(\"position\",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),\nTHREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};\nTHREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};\nTHREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=c.x*Math.PI*.25,c.rotation+=.25*(c.wantedRotation-c.rotation)};\nTHREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation(\"__default\",0,c-1,c/1);this.setAnimationWeight(\"__default\",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);\nTHREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};\nTHREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;f<g;f++){var h=e.morphTargets[f].name.match(b);if(h&&1<h.length){var k=h[1];d[k]||(d[k]={start:Infinity,end:-Infinity});h=d[k];f<h.start&&(h.start=f);f>h.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c};\nTHREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)};\nTHREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};\nTHREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn(\"animation[\"+a+\"] undefined\")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};\nTHREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;\nf!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};\nTHREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g=\"precision \"+b+\" float;\\n\";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,f,g,h,k,l,n,q,r,t,s;this.init=function(b){c=b.context;d=b;e=b.getPrecision();f=new Float32Array(16);g=new Uint16Array(6);b=0;f[b++]=-1;f[b++]=\n-1;f[b++]=0;f[b++]=0;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=1;f[b++]=-1;f[b++]=1;f[b++]=0;f[b++]=1;b=0;g[b++]=0;g[b++]=1;g[b++]=2;g[b++]=0;g[b++]=2;g[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,f,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,g,c.STATIC_DRAW);l=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,l);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16,\n16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);\nc.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};s={};t.vertex=c.getAttribLocation(r,\"position\");t.uv=c.getAttribLocation(r,\"uv\");s.renderType=c.getUniformLocation(r,\"renderType\");s.map=c.getUniformLocation(r,\"map\");s.occlusionMap=c.getUniformLocation(r,\"occlusionMap\");s.opacity=\nc.getUniformLocation(r,\"opacity\");s.color=c.getUniformLocation(r,\"color\");s.scale=c.getUniformLocation(r,\"scale\");s.rotation=c.getUniformLocation(r,\"rotation\");s.screenPosition=c.getUniformLocation(r,\"screenPosition\")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var D=g/f,A=.5*f,x=.5*g,C=16/g,I=new THREE.Vector2(C*D,C),z=new THREE.Vector3(1,1,0),y=new THREE.Vector2(1,1),K=s,C=t;c.useProgram(r);\nc.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(K.occlusionMap,0);c.uniform1i(K.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var N=0,ba=b.length;N<ba;N++){C=16/g;I.set(C*D,C);var P=b[N];a.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);\na.applyProjection(e.projectionMatrix);z.copy(a);y.x=z.x*A+A;y.y=z.y*x+x;if(q||0<y.x&&y.x<f&&0<y.y&&y.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,l);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,y.x-8,y.y-8,16,16,0);c.uniform1i(K.renderType,0);c.uniform2f(K.scale,I.x,I.y);c.uniform3f(K.screenPosition,z.x,z.y,z.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,\n0,c.RGBA,y.x-8,y.y-8,16,16,0);c.uniform1i(K.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,l);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);P.positionScreen.copy(z);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();c.uniform1i(K.renderType,2);c.enable(c.BLEND);for(var O=0,J=P.lensFlares.length;O<J;O++){var E=P.lensFlares[O];.001<E.opacity&&.001<E.scale&&(z.x=E.x,z.y=E.y,z.z=E.z,C=E.size*E.scale/g,I.x=C*D,I.y=C,c.uniform3f(K.screenPosition,\nz.x,z.y,z.z),c.uniform2f(K.scale,I.x,I.y),c.uniform1f(K.rotation,E.rotation),c.uniform1f(K.opacity,E.opacity),c.uniform3f(K.color,E.color.r,E.color.g,E.color.b),d.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),d.setTexture(E.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}}}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(!0)}}};\nTHREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var e=b.__webglObjects[c.id];if(e&&c.castShadow&&(!1===c.frustumCulled||!0===h.intersectsObject(c)))for(var f=0,g=e.length;f<g;f++){var k=e[f];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);r.push(k)}f=0;for(g=c.children.length;f<g;f++)a(b,c.children[f],d)}}var b,c,d,e,f,g,h=new THREE.Frustum,k=new THREE.Matrix4,l=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=[];this.init=function(a){b=a.context;\nc=a;a=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(a.uniforms);d=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h});e=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0});f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,skinning:!0});g=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,\nmorphTargets:!0,skinning:!0});d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0;g._shadowPass=!0};this.render=function(a,b){c.shadowMapEnabled&&c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(t,s){var p,v,w,u,D,A,x,C,I=[];u=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);p=0;for(v=t.__lights.length;p<v;p++)if(w=t.__lights[p],w.castShadow)if(w instanceof\nTHREE.DirectionalLight&&w.shadowCascade)for(D=0;D<w.shadowCascadeCount;D++){var z;if(w.shadowCascadeArray[D])z=w.shadowCascadeArray[D];else{x=w;var y=D;z=new THREE.DirectionalLight;z.isVirtual=!0;z.onlyShadow=!0;z.castShadow=!0;z.shadowCameraNear=x.shadowCameraNear;z.shadowCameraFar=x.shadowCameraFar;z.shadowCameraLeft=x.shadowCameraLeft;z.shadowCameraRight=x.shadowCameraRight;z.shadowCameraBottom=x.shadowCameraBottom;z.shadowCameraTop=x.shadowCameraTop;z.shadowCameraVisible=x.shadowCameraVisible;\nz.shadowDarkness=x.shadowDarkness;z.shadowBias=x.shadowCascadeBias[y];z.shadowMapWidth=x.shadowCascadeWidth[y];z.shadowMapHeight=x.shadowCascadeHeight[y];z.pointsWorld=[];z.pointsFrustum=[];C=z.pointsWorld;A=z.pointsFrustum;for(var K=0;8>K;K++)C[K]=new THREE.Vector3,A[K]=new THREE.Vector3;C=x.shadowCascadeNearZ[y];x=x.shadowCascadeFarZ[y];A[0].set(-1,-1,C);A[1].set(1,-1,C);A[2].set(-1,1,C);A[3].set(1,1,C);A[4].set(-1,-1,x);A[5].set(1,-1,x);A[6].set(-1,1,x);A[7].set(1,1,x);z.originalCamera=s;A=new THREE.Gyroscope;\nA.position.copy(w.shadowCascadeOffset);A.add(z);A.add(z.target);s.add(A);w.shadowCascadeArray[D]=z;console.log(\"Created virtualLight\",z)}y=w;C=D;x=y.shadowCascadeArray[C];x.position.copy(y.position);x.target.position.copy(y.target.position);x.lookAt(x.target);x.shadowCameraVisible=y.shadowCameraVisible;x.shadowDarkness=y.shadowDarkness;x.shadowBias=y.shadowCascadeBias[C];A=y.shadowCascadeNearZ[C];y=y.shadowCascadeFarZ[C];x=x.pointsFrustum;x[0].z=A;x[1].z=A;x[2].z=A;x[3].z=A;x[4].z=y;x[5].z=y;x[6].z=\ny;x[7].z=y;I[u]=z;u++}else I[u]=w,u++;p=0;for(v=I.length;p<v;p++){w=I[p];w.shadowMap||(D=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(D=THREE.NearestFilter),w.shadowMap=new THREE.WebGLRenderTarget(w.shadowMapWidth,w.shadowMapHeight,{minFilter:D,magFilter:D,format:THREE.RGBAFormat}),w.shadowMapSize=new THREE.Vector2(w.shadowMapWidth,w.shadowMapHeight),w.shadowMatrix=new THREE.Matrix4);if(!w.shadowCamera){if(w instanceof THREE.SpotLight)w.shadowCamera=new THREE.PerspectiveCamera(w.shadowCameraFov,\nw.shadowMapWidth/w.shadowMapHeight,w.shadowCameraNear,w.shadowCameraFar);else if(w instanceof THREE.DirectionalLight)w.shadowCamera=new THREE.OrthographicCamera(w.shadowCameraLeft,w.shadowCameraRight,w.shadowCameraTop,w.shadowCameraBottom,w.shadowCameraNear,w.shadowCameraFar);else{console.error(\"Unsupported light type for shadow\");continue}t.add(w.shadowCamera);!0===t.autoUpdate&&t.updateMatrixWorld()}w.shadowCameraVisible&&!w.cameraHelper&&(w.cameraHelper=new THREE.CameraHelper(w.shadowCamera),w.shadowCamera.add(w.cameraHelper));\nif(w.isVirtual&&z.originalCamera==s){D=s;u=w.shadowCamera;A=w.pointsFrustum;x=w.pointsWorld;l.set(Infinity,Infinity,Infinity);n.set(-Infinity,-Infinity,-Infinity);for(y=0;8>y;y++)C=x[y],C.copy(A[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,D),C.applyMatrix4(u.matrixWorldInverse),C.x<l.x&&(l.x=C.x),C.x>n.x&&(n.x=C.x),C.y<l.y&&(l.y=C.y),C.y>n.y&&(n.y=C.y),C.z<l.z&&(l.z=C.z),C.z>n.z&&(n.z=C.z);u.left=l.x;u.right=n.x;u.top=n.y;u.bottom=l.y;u.updateProjectionMatrix()}u=w.shadowMap;A=w.shadowMatrix;\nD=w.shadowCamera;D.position.setFromMatrixPosition(w.matrixWorld);q.setFromMatrixPosition(w.target.matrixWorld);D.lookAt(q);D.updateMatrixWorld();D.matrixWorldInverse.getInverse(D.matrixWorld);w.cameraHelper&&(w.cameraHelper.visible=w.shadowCameraVisible);w.shadowCameraVisible&&w.cameraHelper.update();A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);A.multiply(D.projectionMatrix);A.multiply(D.matrixWorldInverse);k.multiplyMatrices(D.projectionMatrix,D.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(u);\nc.clear();r.length=0;a(t,t,D);w=0;for(u=r.length;w<u;w++)x=r[w],A=x.object,x=x.buffer,y=A.material instanceof THREE.MeshFaceMaterial?A.material.materials[0]:A.material,C=void 0!==A.geometry.morphTargets&&0<A.geometry.morphTargets.length&&y.morphTargets,K=A instanceof THREE.SkinnedMesh&&y.skinning,C=A.customDepthMaterial?A.customDepthMaterial:K?C?g:f:C?e:d,c.setMaterialFaces(y),x instanceof THREE.BufferGeometry?c.renderBufferDirect(D,t.__lights,null,C,x,A):c.renderBuffer(D,t.__lights,null,C,x,A);y=\nt.__webglObjectsImmediate;w=0;for(u=y.length;w<u;w++)x=y[w],A=x.object,A.visible&&A.castShadow&&(A._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld),c.renderImmediateObject(D,t.__lights,null,d,A))}p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;\nTHREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,n,q,r,t,s,p,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,D,A,x=[],C,I,z,y,K;this.init=function(w){u=w.context;D=w;C=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);I=new Uint16Array([0,1,2,0,2,3]);z=u.createBuffer();y=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,z);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.bufferData(u.ELEMENT_ARRAY_BUFFER,I,u.STATIC_DRAW);w=u.createProgram();\nvar x=u.createShader(u.VERTEX_SHADER),P=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(x,[\"precision \"+D.getPrecision()+\" float;\",\"uniform mat4 modelViewMatrix;\\nuniform mat4 projectionMatrix;\\nuniform float rotation;\\nuniform vec2 scale;\\nuniform vec2 uvOffset;\\nuniform vec2 uvScale;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvoid main() {\\nvUV = uvOffset + uv * uvScale;\\nvec2 alignedPosition = position * scale;\\nvec2 rotatedPosition;\\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\nvec4 finalPosition;\\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\nfinalPosition.xy += rotatedPosition;\\nfinalPosition = projectionMatrix * finalPosition;\\ngl_Position = finalPosition;\\n}\"].join(\"\\n\"));\nu.shaderSource(P,[\"precision \"+D.getPrecision()+\" float;\",\"uniform vec3 color;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform int fogType;\\nuniform vec3 fogColor;\\nuniform float fogDensity;\\nuniform float fogNear;\\nuniform float fogFar;\\nuniform float alphaTest;\\nvarying vec2 vUV;\\nvoid main() {\\nvec4 texture = texture2D( map, vUV );\\nif ( texture.a < alphaTest ) discard;\\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\\nif ( fogType > 0 ) {\\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\nfloat fogFactor = 0.0;\\nif ( fogType == 1 ) {\\nfogFactor = smoothstep( fogNear, fogFar, depth );\\n} else {\\nconst float LOG2 = 1.442695;\\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\\n}\\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\\n}\\n}\"].join(\"\\n\"));\nu.compileShader(x);u.compileShader(P);u.attachShader(w,x);u.attachShader(w,P);u.linkProgram(w);K=w;p=u.getAttribLocation(K,\"position\");v=u.getAttribLocation(K,\"uv\");a=u.getUniformLocation(K,\"uvOffset\");b=u.getUniformLocation(K,\"uvScale\");c=u.getUniformLocation(K,\"rotation\");d=u.getUniformLocation(K,\"scale\");e=u.getUniformLocation(K,\"color\");f=u.getUniformLocation(K,\"map\");g=u.getUniformLocation(K,\"opacity\");h=u.getUniformLocation(K,\"modelViewMatrix\");k=u.getUniformLocation(K,\"projectionMatrix\");l=\nu.getUniformLocation(K,\"fogType\");n=u.getUniformLocation(K,\"fogDensity\");q=u.getUniformLocation(K,\"fogNear\");r=u.getUniformLocation(K,\"fogFar\");t=u.getUniformLocation(K,\"fogColor\");s=u.getUniformLocation(K,\"alphaTest\");w=document.createElement(\"canvas\");w.width=8;w.height=8;x=w.getContext(\"2d\");x.fillStyle=\"white\";x.fillRect(0,0,8,8);A=new THREE.Texture(w);A.needsUpdate=!0};this.render=function(C,I,P,O){x.length=0;C.traverseVisible(function(a){a instanceof THREE.Sprite&&x.push(a)});if(0!==x.length){u.useProgram(K);\nu.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,z);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,y);u.uniformMatrix4fv(k,!1,I.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);O=P=0;var J=C.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1),\nO=P=1):J instanceof THREE.FogExp2&&(u.uniform1f(n,J.density),u.uniform1i(l,2),O=P=2)):(u.uniform1i(l,0),O=P=0);for(var J=0,E=x.length;J<E;J++){var Q=x[J],L=Q.material;Q._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}x.sort(w);I=[];J=0;for(E=x.length;J<E;J++)Q=x[J],L=Q.material,u.uniform1f(s,L.alphaTest),u.uniformMatrix4fv(h,!1,Q._modelViewMatrix.elements),I[0]=Q.scale.x,I[1]=Q.scale.y,Q=0,C.fog&&L.fog&&(Q=O),P!==Q&&(u.uniform1i(l,Q),P=Q),\nnull!==L.map?(u.uniform2f(a,L.map.offset.x,L.map.offset.y),u.uniform2f(b,L.map.repeat.x,L.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,L.opacity),u.uniform3f(e,L.color.r,L.color.g,L.color.b),u.uniform1f(c,L.rotation),u.uniform2fv(d,I),D.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),D.setDepthTest(L.depthTest),D.setDepthWrite(L.depthWrite),L.map&&L.map.image&&L.map.image.width?D.setTexture(L.map,0):D.setTexture(A,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,\n0);u.enable(u.CULL_FACE)}}};\nTHREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var e=b.__webglObjects[c.id];if(e&&(!1===c.frustumCulled||!0===h.intersectsObject(c)))for(var f=0,g=e.length;f<g;f++){var k=e[f];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);l.push(k)}f=0;for(g=c.children.length;f<g;f++)a(b,c.children[f],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,f,g,h=new THREE.Frustum,k=new THREE.Matrix4,l=[];this.init=function(a){b=a.context;c=a;a=THREE.ShaderLib.depthRGBA;var h=\nTHREE.UniformsUtils.clone(a.uniforms);d=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h});e=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0});f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,skinning:!0});g=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});d._shadowPass=\n!0;e._shadowPass=!0;f._shadowPass=!0;g._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(n,q){var r,t,s,p,v;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===n.autoUpdate&&n.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);k.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse);h.setFromMatrix(k);c.setRenderTarget(this.renderTarget);c.clear();l.length=0;a(n,n,q);var w;r=0;for(t=l.length;r<t;r++)s=l[r],v=s.object,s=s.buffer,\nv instanceof THREE.PointCloud&&!v.customDepthMaterial||((w=v.material instanceof THREE.MeshFaceMaterial?v.material.materials[0]:v.material)&&c.setMaterialFaces(v.material),p=void 0!==v.geometry.morphTargets&&0<v.geometry.morphTargets.length&&w.morphTargets,w=v instanceof THREE.SkinnedMesh&&w.skinning,p=v.customDepthMaterial?v.customDepthMaterial:w?p?g:f:p?e:d,s instanceof THREE.BufferGeometry?c.renderBufferDirect(q,n.__lights,null,p,s,v):c.renderBuffer(q,n.__lights,null,p,s,v));p=n.__webglObjectsImmediate;\nr=0;for(t=p.length;r<t;r++)s=p[r],v=s.object,v.visible&&(v._modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,v.matrixWorld),c.renderImmediateObject(q,n.__lights,null,d,v));r=c.getClearColor();t=c.getClearAlpha();b.clearColor(r.r,r.g,r.b,t);b.enable(b.BLEND)}};\nTHREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:\"uniform lowp int renderType;\\nuniform vec3 screenPosition;\\nuniform vec2 scale;\\nuniform float rotation;\\nuniform sampler2D occlusionMap;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvarying float vVisibility;\\nvoid main() {\\nvUV = uv;\\nvec2 pos = position;\\nif( renderType == 2 ) {\\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\\nvVisibility = visibility.r / 9.0;\\nvVisibility *= 1.0 - visibility.g / 9.0;\\nvVisibility *= visibility.b / 9.0;\\nvVisibility *= 1.0 - visibility.a / 9.0;\\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\\n}\\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\\n}\",fragmentShader:\"uniform lowp int renderType;\\nuniform sampler2D map;\\nuniform float opacity;\\nuniform vec3 color;\\nvarying vec2 vUV;\\nvarying float vVisibility;\\nvoid main() {\\nif( renderType == 0 ) {\\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\\n} else if( renderType == 1 ) {\\ngl_FragColor = texture2D( map, vUV );\\n} else {\\nvec4 texture = texture2D( map, vUV );\\ntexture.a *= opacity * vVisibility;\\ngl_FragColor = texture;\\ngl_FragColor.rgb *= color;\\n}\\n}\"},\nlensFlare:{vertexShader:\"uniform lowp int renderType;\\nuniform vec3 screenPosition;\\nuniform vec2 scale;\\nuniform float rotation;\\nattribute vec2 position;\\nattribute vec2 uv;\\nvarying vec2 vUV;\\nvoid main() {\\nvUV = uv;\\nvec2 pos = position;\\nif( renderType == 2 ) {\\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\\n}\\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\\n}\",\nfragmentShader:\"precision mediump float;\\nuniform lowp int renderType;\\nuniform sampler2D map;\\nuniform sampler2D occlusionMap;\\nuniform float opacity;\\nuniform vec3 color;\\nvarying vec2 vUV;\\nvoid main() {\\nif( renderType == 0 ) {\\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\\n} else if( renderType == 1 ) {\\ngl_FragColor = texture2D( map, vUV );\\n} else {\\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\\nvisibility = ( 1.0 - visibility / 4.0 );\\nvec4 texture = texture2D( map, vUV );\\ntexture.a *= opacity * visibility;\\ngl_FragColor = texture;\\ngl_FragColor.rgb *= color;\\n}\\n}\"}};\n\nexports.THREE = THREE;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/config.css": {
"type": "text/css",
"title": "$:/plugins/rboue/Three.js/Lib/config.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": "/* Stats module */\n#stats {}\n#stats #fps {background: transparent !important}\n#stats #fps #fpsText {color: #aaa !important}\n#stats #fps #fpsGraph {}"
},
"$:/plugins/rboue/Three.js/Lib/stringview.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/stringview.js",
"module-type": "library",
"text": "(function(){\n\"use strict\";\n/*\nThe aims of this library are:\n\n to create a C-like interface for strings (i.e., an array of character codes — an\n ArrayBufferView in JavaScript) based upon the JavaScript ArrayBuffer interface\n to create a highly extensible library that anyone can extend by adding methods to\n the object StringView.prototype\n to create a collection of methods for such string-like objects (since now: stringViews)\n which work strictly on arrays of numbers rather than on creating new immutable\n JavaScript strings\n to work with Unicode encodings other than JavaScript's default UTF-16 DOMStrings\n*/\n\n/*\\\n|*|\n|*| :: Number.isInteger() polyfill ::\n|*|\n|*| https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\n|*|\n\\*/\n\nif (!Number.isInteger) {\n Number.isInteger = function isInteger (nVal) {\n return typeof nVal === \"number\" && isFinite(nVal) && nVal > -9007199254740992 && nVal < 9007199254740992 && Math.floor(nVal) === nVal;\n };\n}\n\n/*\\\n|*|\n|*| StringView - Mozilla Developer Network\n|*|\n|*| Revision #8, October 6, 2014\n|*|\n|*| https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays/StringView\n|*| https://developer.mozilla.org/en-US/docs/User:fusionchess\n|*|\n|*| This framework is released under the GNU Lesser General Public License, version 3 or later.\n|*| http://www.gnu.org/licenses/lgpl-3.0.html\n|*|\n\\*/\n\nfunction StringView (vInput, sEncoding /* optional (default: UTF-8) */, nOffset /* optional */, nLength /* optional */) {\n\n var fTAView, aWhole, aRaw, fPutOutptCode, fGetOutptChrSize, nInptLen, nStartIdx = isFinite(nOffset) ? nOffset : 0, nTranscrType = 15;\n\n if (sEncoding) { this.encoding = sEncoding.toString(); }\n\n encSwitch: switch (this.encoding) {\n case \"UTF-8\":\n fPutOutptCode = StringView.putUTF8CharCode;\n fGetOutptChrSize = StringView.getUTF8CharLength;\n fTAView = Uint8Array;\n break encSwitch;\n case \"UTF-16\":\n fPutOutptCode = StringView.putUTF16CharCode;\n fGetOutptChrSize = StringView.getUTF16CharLength;\n fTAView = Uint16Array;\n break encSwitch;\n case \"UTF-32\":\n fTAView = Uint32Array;\n nTranscrType &= 14;\n break encSwitch;\n default:\n /* case \"ASCII\", or case \"BinaryString\" or unknown cases */\n fTAView = Uint8Array;\n nTranscrType &= 14;\n }\n\n typeSwitch: switch (typeof vInput) {\n case \"string\":\n /* the input argument is a primitive string: a new buffer will be created. */\n nTranscrType &= 7;\n break typeSwitch;\n case \"object\":\n classSwitch: switch (vInput.constructor) {\n case StringView:\n /* the input argument is a stringView: a new buffer will be created. */\n nTranscrType &= 3;\n break typeSwitch;\n case String:\n /* the input argument is an objectified string: a new buffer will be created. */\n nTranscrType &= 7;\n break typeSwitch;\n case ArrayBuffer:\n /* the input argument is an arrayBuffer: the buffer will be shared. */\n aWhole = new fTAView(vInput);\n nInptLen = this.encoding === \"UTF-32\" ?\n vInput.byteLength >>> 2\n : this.encoding === \"UTF-16\" ?\n vInput.byteLength >>> 1\n :\n vInput.byteLength;\n aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n aWhole\n : new fTAView(vInput, nStartIdx, !isFinite(nLength) ? nInptLen - nStartIdx : nLength);\n\n break typeSwitch;\n case Uint32Array:\n case Uint16Array:\n case Uint8Array:\n /* the input argument is a typedArray: the buffer, and possibly the array itself, will be shared. */\n fTAView = vInput.constructor;\n nInptLen = vInput.length;\n aWhole = vInput.byteOffset === 0 && vInput.length === (\n fTAView === Uint32Array ?\n vInput.buffer.byteLength >>> 2\n : fTAView === Uint16Array ?\n vInput.buffer.byteLength >>> 1\n :\n vInput.buffer.byteLength\n ) ? vInput : new fTAView(vInput.buffer);\n aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n vInput\n : vInput.subarray(nStartIdx, isFinite(nLength) ? nStartIdx + nLength : nInptLen);\n\n break typeSwitch;\n default:\n /* the input argument is an array or another serializable object: a new typedArray will be created. */\n aWhole = new fTAView(vInput);\n nInptLen = aWhole.length;\n aRaw = nStartIdx === 0 && (!isFinite(nLength) || nLength === nInptLen) ?\n aWhole\n : aWhole.subarray(nStartIdx, isFinite(nLength) ? nStartIdx + nLength : nInptLen);\n }\n break typeSwitch;\n default:\n /* the input argument is a number, a boolean or a function: a new typedArray will be created. */\n aWhole = aRaw = new fTAView(Number(vInput) || 0);\n\n }\n\n if (nTranscrType < 8) {\n\n var vSource, nOutptLen, nCharStart, nCharEnd, nEndIdx, fGetInptChrSize, fGetInptChrCode;\n\n if (nTranscrType & 4) { /* input is string */\n\n vSource = vInput;\n nOutptLen = nInptLen = vSource.length;\n nTranscrType ^= this.encoding === \"UTF-32\" ? 0 : 2;\n /* ...or...: nTranscrType ^= Number(this.encoding !== \"UTF-32\") << 1; */\n nStartIdx = nCharStart = nOffset ? Math.max((nOutptLen + nOffset) % nOutptLen, 0) : 0;\n nEndIdx = nCharEnd = (Number.isInteger(nLength) ? Math.min(Math.max(nLength, 0) + nStartIdx, nOutptLen) : nOutptLen) - 1;\n\n } else { /* input is stringView */\n\n vSource = vInput.rawData;\n nInptLen = vInput.makeIndex();\n nStartIdx = nCharStart = nOffset ? Math.max((nInptLen + nOffset) % nInptLen, 0) : 0;\n nOutptLen = Number.isInteger(nLength) ? Math.min(Math.max(nLength, 0), nInptLen - nCharStart) : nInptLen;\n nEndIdx = nCharEnd = nOutptLen + nCharStart;\n\n if (vInput.encoding === \"UTF-8\") {\n fGetInptChrSize = StringView.getUTF8CharLength;\n fGetInptChrCode = StringView.loadUTF8CharCode;\n } else if (vInput.encoding === \"UTF-16\") {\n fGetInptChrSize = StringView.getUTF16CharLength;\n fGetInptChrCode = StringView.loadUTF16CharCode;\n } else {\n nTranscrType &= 1;\n }\n\n }\n\n if (nOutptLen === 0 || nTranscrType < 4 && vSource.encoding === this.encoding && nCharStart === 0 && nOutptLen === nInptLen) {\n\n /* the encoding is the same, the length too and the offset is 0... or the input is empty! */\n\n nTranscrType = 7;\n\n }\n\n conversionSwitch: switch (nTranscrType) {\n\n case 0:\n\n /* both the source and the new StringView have a fixed-length encoding... */\n\n aWhole = new fTAView(nOutptLen);\n for (var nOutptIdx = 0; nOutptIdx < nOutptLen; aWhole[nOutptIdx] = vSource[nStartIdx + nOutptIdx++]);\n break conversionSwitch;\n\n case 1:\n\n /* the source has a fixed-length encoding but the new StringView has a variable-length encoding... */\n\n /* mapping... */\n\n nOutptLen = 0;\n\n for (var nInptIdx = nStartIdx; nInptIdx < nEndIdx; nInptIdx++) {\n nOutptLen += fGetOutptChrSize(vSource[nInptIdx]);\n }\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription of the source... */\n\n for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx++) {\n nOutptIdx = fPutOutptCode(aWhole, vSource[nInptIdx], nOutptIdx);\n }\n\n break conversionSwitch;\n\n case 2:\n\n /* the source has a variable-length encoding but the new StringView has a fixed-length encoding... */\n\n /* mapping... */\n\n nStartIdx = 0;\n\n var nChrCode;\n\n for (nChrIdx = 0; nChrIdx < nCharStart; nChrIdx++) {\n nChrCode = fGetInptChrCode(vSource, nStartIdx);\n nStartIdx += fGetInptChrSize(nChrCode);\n }\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription of the source... */\n\n for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx += fGetInptChrSize(nChrCode), nOutptIdx++) {\n nChrCode = fGetInptChrCode(vSource, nInptIdx);\n aWhole[nOutptIdx] = nChrCode;\n }\n\n break conversionSwitch;\n\n case 3:\n\n /* both the source and the new StringView have a variable-length encoding... */\n\n /* mapping... */\n\n nOutptLen = 0;\n\n var nChrCode;\n\n for (var nChrIdx = 0, nInptIdx = 0; nChrIdx < nCharEnd; nInptIdx += fGetInptChrSize(nChrCode)) {\n nChrCode = fGetInptChrCode(vSource, nInptIdx);\n if (nChrIdx === nCharStart) { nStartIdx = nInptIdx; }\n if (++nChrIdx > nCharStart) { nOutptLen += fGetOutptChrSize(nChrCode); }\n }\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription... */\n\n for (var nInptIdx = nStartIdx, nOutptIdx = 0; nOutptIdx < nOutptLen; nInptIdx += fGetInptChrSize(nChrCode)) {\n nChrCode = fGetInptChrCode(vSource, nInptIdx);\n nOutptIdx = fPutOutptCode(aWhole, nChrCode, nOutptIdx);\n }\n\n break conversionSwitch;\n\n case 4:\n\n /* DOMString to ASCII or BinaryString or other unknown encodings */\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription... */\n\n for (var nIdx = 0; nIdx < nOutptLen; nIdx++) {\n aWhole[nIdx] = vSource.charCodeAt(nIdx) & 0xff;\n }\n\n break conversionSwitch;\n\n case 5:\n\n /* DOMString to UTF-8 or to UTF-16 */\n\n /* mapping... */\n\n nOutptLen = 0;\n\n for (var nMapIdx = 0; nMapIdx < nInptLen; nMapIdx++) {\n if (nMapIdx === nCharStart) { nStartIdx = nOutptLen; }\n nOutptLen += fGetOutptChrSize(vSource.charCodeAt(nMapIdx));\n if (nMapIdx === nCharEnd) { nEndIdx = nOutptLen; }\n }\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription... */\n\n for (var nOutptIdx = 0, nChrIdx = 0; nOutptIdx < nOutptLen; nChrIdx++) {\n nOutptIdx = fPutOutptCode(aWhole, vSource.charCodeAt(nChrIdx), nOutptIdx);\n }\n\n break conversionSwitch;\n\n case 6:\n\n /* DOMString to UTF-32 */\n\n aWhole = new fTAView(nOutptLen);\n\n /* transcription... */\n\n for (var nIdx = 0; nIdx < nOutptLen; nIdx++) {\n aWhole[nIdx] = vSource.charCodeAt(nIdx);\n }\n\n break conversionSwitch;\n\n case 7:\n\n aWhole = new fTAView(nOutptLen ? vSource : 0);\n break conversionSwitch;\n\n }\n\n aRaw = nTranscrType > 3 && (nStartIdx > 0 || nEndIdx < aWhole.length - 1) ? aWhole.subarray(nStartIdx, nEndIdx) : aWhole;\n\n }\n\n this.buffer = aWhole.buffer;\n this.bufferView = aWhole;\n this.rawData = aRaw;\n\n Object.freeze(this);\n\n}\n\n/* CONSTRUCTOR'S METHODS */\n\nStringView.loadUTF8CharCode = function (aChars, nIdx) {\n\n var nLen = aChars.length, nPart = aChars[nIdx];\n\n return nPart > 251 && nPart < 254 && nIdx + 5 < nLen ?\n /* (nPart - 252 << 30) may be not safe in ECMAScript! So...: */\n /* six bytes */ (nPart - 252) * 1073741824 + (aChars[nIdx + 1] - 128 << 24) + (aChars[nIdx + 2] - 128 << 18) + (aChars[nIdx + 3] - 128 << 12) + (aChars[nIdx + 4] - 128 << 6) + aChars[nIdx + 5] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ?\n /* five bytes */ (nPart - 248 << 24) + (aChars[nIdx + 1] - 128 << 18) + (aChars[nIdx + 2] - 128 << 12) + (aChars[nIdx + 3] - 128 << 6) + aChars[nIdx + 4] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ?\n /* four bytes */(nPart - 240 << 18) + (aChars[nIdx + 1] - 128 << 12) + (aChars[nIdx + 2] - 128 << 6) + aChars[nIdx + 3] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ?\n /* three bytes */ (nPart - 224 << 12) + (aChars[nIdx + 1] - 128 << 6) + aChars[nIdx + 2] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ?\n /* two bytes */ (nPart - 192 << 6) + aChars[nIdx + 1] - 128\n :\n /* one byte */ nPart;\n\n};\n\nStringView.putUTF8CharCode = function (aTarget, nChar, nPutAt) {\n\n var nIdx = nPutAt;\n\n if (nChar < 0x80 /* 128 */) {\n /* one byte */\n aTarget[nIdx++] = nChar;\n } else if (nChar < 0x800 /* 2048 */) {\n /* two bytes */\n aTarget[nIdx++] = 0xc0 /* 192 */ + (nChar >>> 6);\n aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n } else if (nChar < 0x10000 /* 65536 */) {\n /* three bytes */\n aTarget[nIdx++] = 0xe0 /* 224 */ + (nChar >>> 12);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n } else if (nChar < 0x200000 /* 2097152 */) {\n /* four bytes */\n aTarget[nIdx++] = 0xf0 /* 240 */ + (nChar >>> 18);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n } else if (nChar < 0x4000000 /* 67108864 */) {\n /* five bytes */\n aTarget[nIdx++] = 0xf8 /* 248 */ + (nChar >>> 24);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 18) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n } else /* if (nChar <= 0x7fffffff) */ { /* 2147483647 */\n /* six bytes */\n aTarget[nIdx++] = 0xfc /* 252 */ + /* (nChar >>> 30) may be not safe in ECMAScript! So...: */ (nChar / 1073741824);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 24) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 18) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 12) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + ((nChar >>> 6) & 0x3f /* 63 */);\n aTarget[nIdx++] = 0x80 /* 128 */ + (nChar & 0x3f /* 63 */);\n }\n\n return nIdx;\n\n};\n\nStringView.getUTF8CharLength = function (nChar) {\n return nChar < 0x80 ? 1 : nChar < 0x800 ? 2 : nChar < 0x10000 ? 3 : nChar < 0x200000 ? 4 : nChar < 0x4000000 ? 5 : 6;\n};\n\nStringView.loadUTF16CharCode = function (aChars, nIdx) {\n\n /* UTF-16 to DOMString decoding algorithm */\n var nFrstChr = aChars[nIdx];\n\n return nFrstChr > 0xD7BF /* 55231 */ && nIdx + 1 < aChars.length ?\n (nFrstChr - 0xD800 /* 55296 */ << 10) + aChars[nIdx + 1] + 0x2400 /* 9216 */\n : nFrstChr;\n\n};\n\nStringView.putUTF16CharCode = function (aTarget, nChar, nPutAt) {\n\n var nIdx = nPutAt;\n\n if (nChar < 0x10000 /* 65536 */) {\n /* one element */\n aTarget[nIdx++] = nChar;\n } else {\n /* two elements */\n aTarget[nIdx++] = 0xD7C0 /* 55232 */ + (nChar >>> 10);\n aTarget[nIdx++] = 0xDC00 /* 56320 */ + (nChar & 0x3FF /* 1023 */);\n }\n\n return nIdx;\n\n};\n\nStringView.getUTF16CharLength = function (nChar) {\n return nChar < 0x10000 ? 1 : 2;\n};\n\n/* Array of bytes to base64 string decoding */\n\nStringView.b64ToUint6 = function (nChr) {\n\n return nChr > 64 && nChr < 91 ?\n nChr - 65\n : nChr > 96 && nChr < 123 ?\n nChr - 71\n : nChr > 47 && nChr < 58 ?\n nChr + 4\n : nChr === 43 ?\n 62\n : nChr === 47 ?\n 63\n :\n 0;\n\n};\n\nStringView.uint6ToB64 = function (nUint6) {\n\n return nUint6 < 26 ?\n nUint6 + 65\n : nUint6 < 52 ?\n nUint6 + 71\n : nUint6 < 62 ?\n nUint6 - 4\n : nUint6 === 62 ?\n 43\n : nUint6 === 63 ?\n 47\n :\n 65;\n\n};\n\n/* Base64 string to array encoding */\n\nStringView.bytesToBase64 = function (aBytes) {\n\n var sB64Enc = \"\";\n\n for (var nMod3, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {\n nMod3 = nIdx % 3;\n if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += \"\\r\\n\"; }\n nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);\n if (nMod3 === 2 || aBytes.length - nIdx === 1) {\n sB64Enc += String.fromCharCode(StringView.uint6ToB64(nUint24 >>> 18 & 63), StringView.uint6ToB64(nUint24 >>> 12 & 63), StringView.uint6ToB64(nUint24 >>> 6 & 63), StringView.uint6ToB64(nUint24 & 63));\n nUint24 = 0;\n }\n }\n\n return sB64Enc.replace(/A(?=A$|$)/g, \"=\");\n\n};\n\n\nStringView.base64ToBytes = function (sBase64, nBlockBytes) {\n\n var\n sB64Enc = sBase64.replace(/[^A-Za-z0-9\\+\\/]/g, \"\"), nInLen = sB64Enc.length,\n nOutLen = nBlockBytes ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockBytes) * nBlockBytes : nInLen * 3 + 1 >>> 2, aBytes = new Uint8Array(nOutLen);\n\n for (var nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {\n nMod4 = nInIdx & 3;\n nUint24 |= StringView.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;\n if (nMod4 === 3 || nInLen - nInIdx === 1) {\n for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {\n aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;\n }\n nUint24 = 0;\n }\n }\n\n return aBytes;\n\n};\n\nStringView.makeFromBase64 = function (sB64Inpt, sEncoding, nByteOffset, nLength) {\n\n return new StringView(sEncoding === \"UTF-16\" || sEncoding === \"UTF-32\" ? StringView.base64ToBytes(sB64Inpt, sEncoding === \"UTF-16\" ? 2 : 4).buffer : StringView.base64ToBytes(sB64Inpt), sEncoding, nByteOffset, nLength);\n\n};\n\n/* DEFAULT VALUES */\n\nStringView.prototype.encoding = \"UTF-8\"; /* Default encoding... */\n\n/* INSTANCES' METHODS */\n\nStringView.prototype.makeIndex = function (nChrLength, nStartFrom) {\n\n var\n\n aTarget = this.rawData, nChrEnd, nRawLength = aTarget.length,\n nStartIdx = nStartFrom || 0, nIdxEnd = nStartIdx, nStopAtChr = isNaN(nChrLength) ? Infinity : nChrLength;\n\n if (nChrLength + 1 > aTarget.length) { throw new RangeError(\"StringView.prototype.makeIndex - The offset can\\'t be major than the length of the array - 1.\"); }\n\n switch (this.encoding) {\n\n case \"UTF-8\":\n\n var nPart;\n\n for (nChrEnd = 0; nIdxEnd < nRawLength && nChrEnd < nStopAtChr; nChrEnd++) {\n nPart = aTarget[nIdxEnd];\n nIdxEnd += nPart > 251 && nPart < 254 && nIdxEnd + 5 < nRawLength ? 6\n : nPart > 247 && nPart < 252 && nIdxEnd + 4 < nRawLength ? 5\n : nPart > 239 && nPart < 248 && nIdxEnd + 3 < nRawLength ? 4\n : nPart > 223 && nPart < 240 && nIdxEnd + 2 < nRawLength ? 3\n : nPart > 191 && nPart < 224 && nIdxEnd + 1 < nRawLength ? 2\n : 1;\n }\n\n break;\n\n case \"UTF-16\":\n\n for (nChrEnd = nStartIdx; nIdxEnd < nRawLength && nChrEnd < nStopAtChr; nChrEnd++) {\n nIdxEnd += aTarget[nIdxEnd] > 0xD7BF /* 55231 */ && nIdxEnd + 1 < aTarget.length ? 2 : 1;\n }\n\n break;\n\n default:\n\n nIdxEnd = nChrEnd = isFinite(nChrLength) ? nChrLength : nRawLength - 1;\n\n }\n\n if (nChrLength) { return nIdxEnd; }\n\n return nChrEnd;\n\n};\n\nStringView.prototype.toBase64 = function (bWholeBuffer) {\n\n return StringView.bytesToBase64(\n bWholeBuffer ?\n (\n this.bufferView.constructor === Uint8Array ?\n this.bufferView\n :\n new Uint8Array(this.buffer)\n )\n : this.rawData.constructor === Uint8Array ?\n this.rawData\n :\n new Uint8Array(this.buffer, this.rawData.byteOffset, this.rawData.length << (this.rawData.constructor === Uint16Array ? 1 : 2))\n );\n\n};\n\nStringView.prototype.subview = function (nCharOffset /* optional */, nCharLength /* optional */) {\n\n var\n\n nChrLen, nCharStart, nStrLen, bVariableLen = this.encoding === \"UTF-8\" || this.encoding === \"UTF-16\",\n nStartOffset = nCharOffset, nStringLength, nRawLen = this.rawData.length;\n\n if (nRawLen === 0) {\n return new StringView(this.buffer, this.encoding);\n }\n\n nStringLength = bVariableLen ? this.makeIndex() : nRawLen;\n nCharStart = nCharOffset ? Math.max((nStringLength + nCharOffset) % nStringLength, 0) : 0;\n nStrLen = Number.isInteger(nCharLength) ? Math.max(nCharLength, 0) + nCharStart > nStringLength ? nStringLength - nCharStart : nCharLength : nStringLength;\n\n if (nCharStart === 0 && nStrLen === nStringLength) { return this; }\n\n if (bVariableLen) {\n nStartOffset = this.makeIndex(nCharStart);\n nChrLen = this.makeIndex(nStrLen, nStartOffset) - nStartOffset;\n } else {\n nStartOffset = nCharStart;\n nChrLen = nStrLen - nCharStart;\n }\n\n if (this.encoding === \"UTF-16\") {\n nStartOffset <<= 1;\n } else if (this.encoding === \"UTF-32\") {\n nStartOffset <<= 2;\n }\n\n return new StringView(this.buffer, this.encoding, nStartOffset, nChrLen);\n\n};\n\nStringView.prototype.forEachChar = function (fCallback, oThat, nChrOffset, nChrLen) {\n\n var aSource = this.rawData, nRawEnd, nRawIdx;\n\n if (this.encoding === \"UTF-8\" || this.encoding === \"UTF-16\") {\n\n var fGetInptChrSize, fGetInptChrCode;\n\n if (this.encoding === \"UTF-8\") {\n fGetInptChrSize = StringView.getUTF8CharLength;\n fGetInptChrCode = StringView.loadUTF8CharCode;\n } else if (this.encoding === \"UTF-16\") {\n fGetInptChrSize = StringView.getUTF16CharLength;\n fGetInptChrCode = StringView.loadUTF16CharCode;\n }\n\n nRawIdx = isFinite(nChrOffset) ? this.makeIndex(nChrOffset) : 0;\n nRawEnd = isFinite(nChrLen) ? this.makeIndex(nChrLen, nRawIdx) : aSource.length;\n\n for (var nChrCode, nChrIdx = 0; nRawIdx < nRawEnd; nChrIdx++) {\n nChrCode = fGetInptChrCode(aSource, nRawIdx);\n fCallback.call(oThat || null, nChrCode, nChrIdx, nRawIdx, aSource);\n nRawIdx += fGetInptChrSize(nChrCode);\n }\n\n } else {\n\n nRawIdx = isFinite(nChrOffset) ? nChrOffset : 0;\n nRawEnd = isFinite(nChrLen) ? nChrLen + nRawIdx : aSource.length;\n\n for (nRawIdx; nRawIdx < nRawEnd; nRawIdx++) {\n fCallback.call(oThat || null, aSource[nRawIdx], nRawIdx, nRawIdx, aSource);\n }\n\n }\n\n};\n\nStringView.prototype.valueOf = StringView.prototype.toString = function () {\n\n if (this.encoding !== \"UTF-8\" && this.encoding !== \"UTF-16\") {\n /* ASCII, UTF-32 or BinaryString to DOMString */\n return String.fromCharCode.apply(null, this.rawData);\n }\n\n var fGetCode, fGetIncr, sView = \"\";\n\n if (this.encoding === \"UTF-8\") {\n fGetIncr = StringView.getUTF8CharLength;\n fGetCode = StringView.loadUTF8CharCode;\n } else if (this.encoding === \"UTF-16\") {\n fGetIncr = StringView.getUTF16CharLength;\n fGetCode = StringView.loadUTF16CharCode;\n }\n\n for (var nChr, nLen = this.rawData.length, nIdx = 0; nIdx < nLen; nIdx += fGetIncr(nChr)) {\n nChr = fGetCode(this.rawData, nIdx);\n sView += String.fromCharCode(nChr);\n }\n\n return sView;\n\n};\nexports.StringView = StringView;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/tools.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/tools.js",
"module-type": "library",
"text": "// Tools for playing more easily with Three.js library.\n//\n\n(function() {\n\n var Tools = {};\n\n Tools.Stats = require(\"$:/plugins/rboue/Three.js/Lib/stats-min.js\").Stats;\n Tools.dat = require(\"$:/plugins/rboue/Three.js/Lib/dat-gui-min.js\").dat;\n\n // Resolve PATH\n Tools.resolvePath = function(path) {\n if (!tiddlyWiki) return null;\n return(tiddlyWiki.resolvePath(path));\n };\n\n // Debug tools\n //\n Tools.log = function() {\n this.flagActive = true;\n };\n Tools.log.prototype = {\n start: function() {this.flagActive = true;},\n stop: function() {this.flagActive = false;},\n log: function(mess, flagNoLog, fonc) {\n if (!this.flagActive || flagNoLog) return;\n console.log((fonc ? fonc+\": \" : \"\")+mess);\n },\n logPoint: function(x,y) {return \"(\"+x+\",\"+y+\")\";}\n };\n\n // Animation object\n //\n Tools.Animation = function(node, renderFunc, flagStartStopOnClick, flagLog) {\n var func = \"Tools.Animation\";\n this.flagNoLog = !flagLog;\n this.node = node; // Container DOM node\n this.renderFunc = renderFunc; // rendering\n this.idAnimation = null; // Internal id used by cancelAnimationFrame() to stop animation\n this.flagAnimation = true;\n\n this.nodeId = this.node.getAttribute(\"id\");\n if (!this.nodeId)\n alert(\"Tools.Animation error: DOM node has no \\\"id\\\" attribute. Can't stop animation !\");\n\n // Start/Stop on click\n if (flagStartStopOnClick) {\n var self = this;\n this.node.addEventListener(\"mousedown\", function(event) {\n func = \"Tools.Animation.onMouseDown\";\n self.startStop();\n }, false);\n }\n };\n Tools.Animation.prototype = {\n start: function() {\n var func = \"Tools.Animation.start\";\n hack.log(\"\", this.flagNoLog, func);\n this.flagAnimation = true;\n var self = this;\n var animate = function() {\n var func = \"Tools.Animation.start.animate\";\n // Cancel animation when tiddler has been closed (i.e. widget's DOM node disappears, cf.\n // Jeremy Ruston 14/12/07 in TiddlyWikiDev group).\n if (!document.getElementById(self.nodeId)) {\n hack.log(\"animation canceled: tiddler closes\", self.flagNoLog, func);\n self.stop();\n return;\n }\n self.idAnimation = window.requestAnimationFrame(animate);\n self.renderFunc();\n };\n animate();\n },\n isClosed: function() {\n var func = \"Tools.Animation.isClosed\";\n // Cancel animation when tiddler has been closed (i.e. widget's DOM node disappears, cf.\n // Jeremy Ruston 14/12/07 in TiddlyWikiDev group).\n if (this.nodeId && ! document.getElementById(this.nodeId)) {\n hack.log(\"animation canceled: tiddler closes\", this.flagNoLog, func);\n this.stop();\n return true;\n }\n return false;\n },\n stop: function() {\n var func = \"Tools.Animation.stop\";\n hack.log(\"\", this.flagNoLog, func);\n window.cancelAnimationFrame(this.idAnimation);\n this.flagAnimation = false;\n },\n startStop: function() {\n if (this.flagAnimation)\n this.stop();\n else\n this.start();\n }\n };\n\n // Toolbar container for stats and menu\n //\n Tools.toolbarId = \"toolbar\"; // id of toolbar \n Tools.toolbarGet = function(node) {\n var nodeId = node.getAttribute(\"id\");\n if (!nodeId) return null;\n var toolbarId = nodeId + \"-\" + Tools.toolbarId;\n var toolbar = document.getElementById(toolbarId);\n if (!toolbar) {\n var toolbar = document.createElement(\"div\");\n toolbar.setAttribute(\"id\", toolbarId);\n toolbar.style.position = \"relative\";\n toolbar.style.top = \"\" + (-node.offsetHeight - 5) + \"px\";\n toolbar.style.zIndex = 10;\n node.appendChild(toolbar);\n }\n return toolbar;\n };\n\n // Statistic viewer at upper left corner of widget DOM <node>\n //\n Tools.addStats = function(node) {\n var stats = new Tools.Stats();\n stats.domElement.style.position = \"relative\";\n stats.domElement.style.display = \"inline-block\";\n stats.domElement.style.verticalAlign = \"top\";\n\n // Install stats in toolbar\n var toolbar = Tools.toolbarGet(node);\n if (toolbar.firstChild)\n toolbar.insertBefore(stats.domElement, toolbar.firstChild);\n else\n toolbar.appendChild(stats.domElement);\n return stats;\n };\n\n // GUI menu at upper right corner of widget DOM <node> \n //\n Tools.Gui = function(node, flagOpen) {\n this.node = node;\n this.gui = new Tools.dat.GUI({autoPlace: false});\n this.gui.domElement.style.position = \"relative\";\n this.gui.domElement.style.display = \"inline-block\";\n this.gui.domElement.style.verticalAlign = \"top\";\n this.gui.domElement.style.zIndex = 20;\n //this.onTiddlerRefresh();\n if (flagOpen)\n this.gui.open();\n else\n this.gui.close();\n\n // Install menu in toolbar\n this.toolbar = Tools.toolbarGet(this.node);\n this.toolbar.appendChild(this.gui.domElement);\n };\n Tools.Gui.prototype = {\n get: function() {\n return this.gui;\n },\n onTiddlerRefresh: function() {\n var offset = this.toolbar.childNodes.length >= 2 ? this.toolbar.firstChild.offsetWidth : 0;\n var left = this.toolbar.offsetWidth - offset < 245 ? 0 : this.toolbar.offsetWidth - offset - 245;\n this.gui.domElement.style.left = \"\" + left + \"px\";\n }\n };\n\n // Export renderer's view to tiddler\n // Parameters :\n // <renderer> : renderer.\n // <tiddlerTitle> : title of the target tiddler with respect to the filesystem mode configuration.\n // <type> : type of tiddler : \"image/png\" (default), \"image/jpeg\" or \"image/svg+xml\".\n // <flagOverwrite> : if true, overwrite existing tiddler without asking.\n // Saves renderer's wiew as a tiddler with required type.\n //\n Tools.exportView = function(renderer, tiddlerTitle, type, flagOverwrite) {\n var func = \"Tools.exportView\";\n if (!renderer.domElement) return;\n var tag = renderer.domElement.tagName.toUpperCase();\n if ((((type == \"image/png\") || (type == \"image/jpeg\")) && (tag != \"CANVAS\")) ||\n ((type == \"image/svg+xml\") && (tag != \"SVG\"))) {\n console.error(func+\": bad tiddler type : \"+type)\n return;\n }\n TiddlyWiki.exportToTiddler(renderer.domElement, \"tw:\"+tiddlerTitle, type, flagOverwrite);\n };\n\n // Execute code when a condition is fulfilled\n // Parameters :\n // <funcTest> : returns true when the condition is fulfilled, false otherwise.\n // <funcExec> : code to execute.\n // <periodicity> : periodicity of the active waiting mechanism (250 ms by default).\n //\n Tools.wait = function(funcTest, funcExec, periodicity) {\n var func = \"Tools.wait\", flagNoLog = true;\n var period = 250; // periodicity in ms\n if (periodicity) period = periodicity;\n var timerId = null;\n var doWait = function() {\n var func = \"Tools.wait/doWait\";\n if (!funcTest()) return;\n\n // Test OK\n hack.log(\"test OK !\", flagNoLog, func);\n clearInterval(timerId);\n funcExec();\n };\n timerId = setInterval(doWait, period);\n };\n\n exports.Tools = Tools;\n})();"
},
"$:/plugins/rboue/Three.js/Lib/stats-min.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/stats-min.js",
"module-type": "library",
"text": "(function(){\n// stats.js - http://github.com/mrdoob/stats.js\nvar Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement(\"div\");f.id=\"stats\";f.addEventListener(\"mousedown\",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText=\"width:80px;opacity:0.9;cursor:pointer\";var a=document.createElement(\"div\");a.id=\"fps\";a.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#002\";f.appendChild(a);var i=document.createElement(\"div\");i.id=\"fpsText\";i.style.cssText=\"color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";\ni.innerHTML=\"FPS\";a.appendChild(i);var c=document.createElement(\"div\");c.id=\"fpsGraph\";c.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0ff\";for(a.appendChild(c);74>c.children.length;){var j=document.createElement(\"span\");j.style.cssText=\"width:1px;height:30px;float:left;background-color:#113\";c.appendChild(j)}var d=document.createElement(\"div\");d.id=\"ms\";d.style.cssText=\"padding:0 0 3px 3px;text-align:left;background-color:#020;display:none\";f.appendChild(d);var k=document.createElement(\"div\");\nk.id=\"msText\";k.style.cssText=\"color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px\";k.innerHTML=\"MS\";d.appendChild(k);var e=document.createElement(\"div\");e.id=\"msGraph\";e.style.cssText=\"position:relative;width:74px;height:30px;background-color:#0f0\";for(d.appendChild(e);74>e.children.length;)j=document.createElement(\"span\"),j.style.cssText=\"width:1px;height:30px;float:left;background-color:#131\",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display=\n\"block\";d.style.display=\"none\";break;case 1:a.style.display=\"none\",d.style.display=\"block\"}};return{REVISION:11,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+\" MS (\"+n+\"-\"+o+\")\";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+\"px\";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+\" FPS (\"+p+\"-\"+q+\")\",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height=\na+\"px\",m=b,r=0);return b},update:function(){l=this.end()}}};\n\nexports.Stats = Stats;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/dat-gui-min.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/dat-gui-min.js",
"module-type": "library",
"text": "(function(){\n/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\nvar dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement(\"link\");c.type=\"text/css\";c.rel=\"stylesheet\";c.href=e;a.getElementsByTagName(\"head\")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement(\"style\");c.type=\"text/css\";c.innerHTML=e;a.getElementsByTagName(\"head\")[0].appendChild(c)}}}();\ndat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}},\neach:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b<n;b++){if(b in a&&d.call(f,a[b],b)===this.BREAK)break}else for(b in a)if(d.call(f,a[b],b)===this.BREAK)break},defer:function(a){setTimeout(a,0)},toArray:function(c){return c.toArray?c.toArray():a.call(c)},isUndefined:function(a){return a===void 0},isNull:function(a){return a===null},isNaN:function(a){return a!==a},isArray:Array.isArray||function(a){return a.constructor===Array},isObject:function(a){return a===\nObject(a)},isNumber:function(a){return a===a+0},isString:function(a){return a===a+\"\"},isBoolean:function(a){return a===false||a===true},isFunction:function(a){return Object.prototype.toString.call(a)===\"[object Function]\"}}}();\ndat.controllers.Controller=function(e){var a=function(a,d){this.initialValue=a[d];this.domElement=document.createElement(\"div\");this.object=a;this.property=d;this.__onFinishChange=this.__onChange=void 0};e.extend(a.prototype,{onChange:function(a){this.__onChange=a;return this},onFinishChange:function(a){this.__onFinishChange=a;return this},setValue:function(a){this.object[this.property]=a;this.__onChange&&this.__onChange.call(this,a);this.updateDisplay();return this},getValue:function(){return this.object[this.property]},\nupdateDisplay:function(){return this},isModified:function(){return this.initialValue!==this.getValue()}});return a}(dat.utils.common);\ndat.dom.dom=function(e){function a(b){if(b===\"0\"||e.isUndefined(b))return 0;b=b.match(d);return!e.isNull(b)?parseFloat(b[1]):0}var c={};e.each({HTMLEvents:[\"change\"],MouseEvents:[\"click\",\"mousemove\",\"mousedown\",\"mouseup\",\"mouseover\"],KeyboardEvents:[\"keydown\"]},function(b,a){e.each(b,function(b){c[b]=a})});var d=/(\\d+(\\.\\d+)?)px/,f={makeSelectable:function(b,a){if(!(b===void 0||b.style===void 0))b.onselectstart=a?function(){return false}:function(){},b.style.MozUserSelect=a?\"auto\":\"none\",b.style.KhtmlUserSelect=\na?\"auto\":\"none\",b.unselectable=a?\"on\":\"off\"},makeFullscreen:function(b,a,d){e.isUndefined(a)&&(a=true);e.isUndefined(d)&&(d=true);b.style.position=\"absolute\";if(a)b.style.left=0,b.style.right=0;if(d)b.style.top=0,b.style.bottom=0},fakeEvent:function(b,a,d,f){var d=d||{},m=c[a];if(!m)throw Error(\"Event type \"+a+\" not supported.\");var l=document.createEvent(m);switch(m){case \"MouseEvents\":l.initMouseEvent(a,d.bubbles||false,d.cancelable||true,window,d.clickCount||1,0,0,d.x||d.clientX||0,d.y||d.clientY||\n0,false,false,false,false,0,null);break;case \"KeyboardEvents\":m=l.initKeyboardEvent||l.initKeyEvent;e.defaults(d,{cancelable:true,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:void 0,charCode:void 0});m(a,d.bubbles||false,d.cancelable,window,d.ctrlKey,d.altKey,d.shiftKey,d.metaKey,d.keyCode,d.charCode);break;default:l.initEvent(a,d.bubbles||false,d.cancelable||true)}e.defaults(l,f);b.dispatchEvent(l)},bind:function(b,a,d,c){b.addEventListener?b.addEventListener(a,d,c||false):b.attachEvent&&\nb.attachEvent(\"on\"+a,d);return f},unbind:function(b,a,d,c){b.removeEventListener?b.removeEventListener(a,d,c||false):b.detachEvent&&b.detachEvent(\"on\"+a,d);return f},addClass:function(b,a){if(b.className===void 0)b.className=a;else if(b.className!==a){var d=b.className.split(/ +/);if(d.indexOf(a)==-1)d.push(a),b.className=d.join(\" \").replace(/^\\s+/,\"\").replace(/\\s+$/,\"\")}return f},removeClass:function(b,a){if(a){if(b.className!==void 0)if(b.className===a)b.removeAttribute(\"class\");else{var d=b.className.split(/ +/),\nc=d.indexOf(a);if(c!=-1)d.splice(c,1),b.className=d.join(\" \")}}else b.className=void 0;return f},hasClass:function(a,d){return RegExp(\"(?:^|\\\\s+)\"+d+\"(?:\\\\s+|$)\").test(a.className)||false},getWidth:function(b){b=getComputedStyle(b);return a(b[\"border-left-width\"])+a(b[\"border-right-width\"])+a(b[\"padding-left\"])+a(b[\"padding-right\"])+a(b.width)},getHeight:function(b){b=getComputedStyle(b);return a(b[\"border-top-width\"])+a(b[\"border-bottom-width\"])+a(b[\"padding-top\"])+a(b[\"padding-bottom\"])+a(b.height)},\ngetOffset:function(a){var d={left:0,top:0};if(a.offsetParent){do d.left+=a.offsetLeft,d.top+=a.offsetTop;while(a=a.offsetParent)}return d},isActive:function(a){return a===document.activeElement&&(a.type||a.href)}};return f}(dat.utils.common);\ndat.controllers.OptionController=function(e,a,c){var d=function(f,b,e){d.superclass.call(this,f,b);var h=this;this.__select=document.createElement(\"select\");if(c.isArray(e)){var j={};c.each(e,function(a){j[a]=a});e=j}c.each(e,function(a,b){var d=document.createElement(\"option\");d.innerHTML=b;d.setAttribute(\"value\",a);h.__select.appendChild(d)});this.updateDisplay();a.bind(this.__select,\"change\",function(){h.setValue(this.options[this.selectedIndex].value)});this.domElement.appendChild(this.__select)};\nd.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue());return a},updateDisplay:function(){this.__select.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.controllers.NumberController=function(e,a){var c=function(d,f,b){c.superclass.call(this,d,f);b=b||{};this.__min=b.min;this.__max=b.max;this.__step=b.step;d=this.__impliedStep=a.isUndefined(this.__step)?this.initialValue==0?1:Math.pow(10,Math.floor(Math.log(this.initialValue)/Math.LN10))/10:this.__step;d=d.toString();this.__precision=d.indexOf(\".\")>-1?d.length-d.indexOf(\".\")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&a<this.__min)a=this.__min;\nelse if(this.__max!==void 0&&a>this.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common);\ndat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,\"mousemove\",j);a.unbind(window,\"mouseup\",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement(\"input\");this.__input.setAttribute(\"type\",\"text\");a.bind(this.__input,\"change\",h);\na.bind(this.__input,\"blur\",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,\"mousedown\",function(b){a.bind(window,\"mousemove\",j);a.bind(window,\"mouseup\",m);o=b.clientY});a.bind(this.__input,\"keydown\",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input,\nb;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common);\ndat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,\"mousemove\",o);a.unbind(window,\"mouseup\",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement(\"div\");\nthis.__foreground=document.createElement(\"div\");a.bind(this.__background,\"mousedown\",function(b){a.bind(window,\"mousemove\",o);a.bind(window,\"mouseup\",y);o(b)});a.addClass(this.__background,\"slider\");a.addClass(this.__foreground,\"slider-fg\");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width=\n(this.getValue()-this.__min)/(this.__max-this.__min)*100+\"%\";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,\".slider {\\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\\n height: 1em;\\n border-radius: 1em;\\n background-color: #eee;\\n padding: 0 0.5em;\\n overflow: hidden;\\n}\\n\\n.slider-fg {\\n padding: 1px 0 2px 0;\\n background-color: #aaa;\\n height: 1em;\\n margin-left: -0.5em;\\n padding-right: 0.5em;\\n border-radius: 1em 0 0 1em;\\n}\\n\\n.slider-fg:after {\\n display: inline-block;\\n border-radius: 1em;\\n background-color: #fff;\\n border: 1px solid #aaa;\\n content: '';\\n float: right;\\n margin-right: -1em;\\n margin-top: -1px;\\n height: 0.9em;\\n width: 0.9em;\\n}\");\ndat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement(\"div\");this.__button.innerHTML=e===void 0?\"Fire\":e;a.bind(this.__button,\"click\",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,\"button\");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this,\nthis.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement(\"input\");this.__checkbox.setAttribute(\"type\",\"checkbox\");a.bind(this.__checkbox,\"change\",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&&\nthis.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute(\"checked\",\"checked\"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common);\ndat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a=\"0\"+a;return\"#\"+a}else return\"rgba(\"+Math.round(a.r)+\",\"+Math.round(a.g)+\",\"+Math.round(a.b)+\",\"+a.a+\")\"}}(dat.utils.common);\ndat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:\"HEX\",hex:parseInt(\"0x\"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:\"HEX\",hex:parseInt(\"0x\"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\nreturn a===null?false:{space:\"RGB\",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\,\\s*(.+)\\s*\\)/);return a===null?false:{space:\"RGB\",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:\"HEX\",hex:a,conversionName:\"HEX\"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!=\n3?false:{space:\"RGB\",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:\"RGB\",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:\"RGB\",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&&\na.isNumber(b.g)&&a.isNumber(b.b)?{space:\"RGB\",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:\"HSV\",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:\"HSV\",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d=\nfalse;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common);\ndat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error(\"Object \"+b+' has no property \"'+r+'\"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,\"c\");r=document.createElement(\"span\");g.addClass(r,\"property-name\");r.innerHTML=b.property;var e=document.createElement(\"div\");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW);\ng.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement(\"li\");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property,\n{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each([\"updateDisplay\",\"onChange\",\"onFinishChange\"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}});\ng.addClass(d,\"has-slider\");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,\"click\",function(){g.fakeEvent(c.__checkbox,\"click\")}),g.bind(c.__checkbox,\"click\",function(a){a.stopPropagation()});\nelse if(c instanceof n)g.bind(d,\"click\",function(){g.fakeEvent(c.__button,\"click\")}),g.bind(d,\"mouseover\",function(){g.addClass(c.__button,\"hover\")}),g.bind(d,\"mouseout\",function(){g.removeClass(c.__button,\"hover\")});else if(c instanceof l)g.addClass(d,\"color\"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)}\nfunction t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement(\"li\");g.addClass(a.domElement,\n\"has-save\");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,\"save-row\");var c=document.createElement(\"span\");c.innerHTML=\" \";g.addClass(c,\"button gears\");var d=document.createElement(\"span\");d.innerHTML=\"Save\";g.addClass(d,\"button\");g.addClass(d,\"save\");var e=document.createElement(\"span\");e.innerHTML=\"New\";g.addClass(e,\"button\");g.addClass(e,\"save-as\");var f=document.createElement(\"span\");f.innerHTML=\"Revert\";g.addClass(f,\"button\");g.addClass(f,\"revert\");var m=a.__preset_select=document.createElement(\"select\");\na.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,\"change\",function(){for(var b=0;b<a.__preset_select.length;b++)a.__preset_select[b].innerHTML=a.__preset_select[b].value;a.preset=this.value});b.appendChild(m);b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);if(u){var b=document.getElementById(\"dg-save-locally\"),l=document.getElementById(\"dg-local-explain\");b.style.display=\"block\";b=document.getElementById(\"dg-local-storage\");\nlocalStorage.getItem(document.location.href+\".isLocal\")===\"true\"&&b.setAttribute(\"checked\",\"checked\");var o=function(){l.style.display=a.useLocalStorage?\"block\":\"none\"};o();g.bind(b,\"change\",function(){a.useLocalStorage=!a.useLocalStorage;o()})}var h=document.getElementById(\"dg-new-constructor\");g.bind(h,\"keydown\",function(a){a.metaKey&&(a.which===67||a.keyCode==67)&&x.hide()});g.bind(c,\"click\",function(){h.innerHTML=JSON.stringify(a.getSaveObject(),void 0,2);x.show();h.focus();h.select()});g.bind(d,\n\"click\",function(){a.save()});g.bind(e,\"click\",function(){var b=prompt(\"Enter a new preset name.\");b&&a.saveAs(b)});g.bind(f,\"click\",function(){a.revert()})}function J(a){function b(f){f.preventDefault();e=f.clientX;g.addClass(a.__closeButton,k.CLASS_DRAG);g.bind(window,\"mousemove\",c);g.bind(window,\"mouseup\",d);return false}function c(b){b.preventDefault();a.width+=e-b.clientX;a.onResize();e=b.clientX;return false}function d(){g.removeClass(a.__closeButton,k.CLASS_DRAG);g.unbind(window,\"mousemove\",\nc);g.unbind(window,\"mouseup\",d)}a.__resize_handle=document.createElement(\"div\");i.extend(a.__resize_handle.style,{width:\"6px\",marginLeft:\"-3px\",height:\"200px\",cursor:\"ew-resize\",position:\"absolute\"});var e;g.bind(a.__resize_handle,\"mousedown\",b);g.bind(a.__closeButton,\"mousedown\",b);a.domElement.insertBefore(a.__resize_handle,a.domElement.firstElementChild)}function D(a,b){a.domElement.style.width=b+\"px\";if(a.__save_row&&a.autoPlace)a.__save_row.style.width=b+\"px\";if(a.__closeButton)a.__closeButton.style.width=\nb+\"px\"}function z(a,b){var c={};i.each(a.__rememberedObjects,function(d,e){var f={};i.each(a.__rememberedObjectIndecesToControllers[e],function(a,c){f[c]=b?a.initialValue:a.getValue()});c[e]=f});return c}function C(a,b,c){var d=document.createElement(\"option\");d.innerHTML=b;d.value=b;a.__preset_select.appendChild(d);if(c)a.__preset_select.selectedIndex=a.__preset_select.length-1}function B(a,b){var c=a.__preset_select[a.__preset_select.selectedIndex];c.innerHTML=b?c.value+\"*\":c.value}function E(a){a.length!=\n0&&o(function(){E(a)});i.each(a,function(a){a.updateDisplay()})}e.inject(c);var w=\"Default\",u;try{u=\"localStorage\"in window&&window.localStorage!==null}catch(K){u=false}var x,F=true,v,A=false,G=[],k=function(a){function b(){localStorage.setItem(document.location.href+\".gui\",JSON.stringify(d.getSaveObject()))}function c(){var a=d.getRoot();a.width+=1;i.defer(function(){a.width-=1})}var d=this;this.domElement=document.createElement(\"div\");this.__ul=document.createElement(\"ul\");this.domElement.appendChild(this.__ul);\ng.addClass(this.domElement,\"dg\");this.__folders={};this.__controllers=[];this.__rememberedObjects=[];this.__rememberedObjectIndecesToControllers=[];this.__listening=[];a=a||{};a=i.defaults(a,{autoPlace:true,width:k.DEFAULT_WIDTH});a=i.defaults(a,{resizable:a.autoPlace,hideable:a.autoPlace});if(i.isUndefined(a.load))a.load={preset:w};else if(a.preset)a.load.preset=a.preset;i.isUndefined(a.parent)&&a.hideable&&G.push(this);a.resizable=i.isUndefined(a.parent)&&a.resizable;if(a.autoPlace&&i.isUndefined(a.scrollable))a.scrollable=\ntrue;var e=u&&localStorage.getItem(document.location.href+\".isLocal\")===\"true\";Object.defineProperties(this,{parent:{get:function(){return a.parent}},scrollable:{get:function(){return a.scrollable}},autoPlace:{get:function(){return a.autoPlace}},preset:{get:function(){return d.parent?d.getRoot().preset:a.load.preset},set:function(b){d.parent?d.getRoot().preset=b:a.load.preset=b;for(b=0;b<this.__preset_select.length;b++)if(this.__preset_select[b].value==this.preset)this.__preset_select.selectedIndex=\nb;d.revert()}},width:{get:function(){return a.width},set:function(b){a.width=b;D(d,b)}},name:{get:function(){return a.name},set:function(b){a.name=b;if(m)m.innerHTML=a.name}},closed:{get:function(){return a.closed},set:function(b){a.closed=b;a.closed?g.addClass(d.__ul,k.CLASS_CLOSED):g.removeClass(d.__ul,k.CLASS_CLOSED);this.onResize();if(d.__closeButton)d.__closeButton.innerHTML=b?k.TEXT_OPEN:k.TEXT_CLOSED}},load:{get:function(){return a.load}},useLocalStorage:{get:function(){return e},set:function(a){u&&\n((e=a)?g.bind(window,\"unload\",b):g.unbind(window,\"unload\",b),localStorage.setItem(document.location.href+\".isLocal\",a))}}});if(i.isUndefined(a.parent)){a.closed=false;g.addClass(this.domElement,k.CLASS_MAIN);g.makeSelectable(this.domElement,false);if(u&&e){d.useLocalStorage=true;var f=localStorage.getItem(document.location.href+\".gui\");if(f)a.load=JSON.parse(f)}this.__closeButton=document.createElement(\"div\");this.__closeButton.innerHTML=k.TEXT_CLOSED;g.addClass(this.__closeButton,k.CLASS_CLOSE_BUTTON);\nthis.domElement.appendChild(this.__closeButton);g.bind(this.__closeButton,\"click\",function(){d.closed=!d.closed})}else{if(a.closed===void 0)a.closed=true;var m=document.createTextNode(a.name);g.addClass(m,\"controller-name\");f=s(d,m);g.addClass(this.__ul,k.CLASS_CLOSED);g.addClass(f,\"title\");g.bind(f,\"click\",function(a){a.preventDefault();d.closed=!d.closed;return false});if(!a.closed)this.closed=false}a.autoPlace&&(i.isUndefined(a.parent)&&(F&&(v=document.createElement(\"div\"),g.addClass(v,\"dg\"),g.addClass(v,\nk.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(v),F=false),v.appendChild(this.domElement),g.addClass(this.domElement,k.CLASS_AUTO_PLACE)),this.parent||D(d,a.width));g.bind(window,\"resize\",function(){d.onResize()});g.bind(this.__ul,\"webkitTransitionEnd\",function(){d.onResize()});g.bind(this.__ul,\"transitionend\",function(){d.onResize()});g.bind(this.__ul,\"oTransitionEnd\",function(){d.onResize()});this.onResize();a.resizable&&J(this);d.getRoot();a.parent||c()};k.toggleHide=function(){A=!A;i.each(G,\nfunction(a){a.domElement.style.zIndex=A?-999:999;a.domElement.style.opacity=A?0:1})};k.CLASS_AUTO_PLACE=\"a\";k.CLASS_AUTO_PLACE_CONTAINER=\"ac\";k.CLASS_MAIN=\"main\";k.CLASS_CONTROLLER_ROW=\"cr\";k.CLASS_TOO_TALL=\"taller-than-window\";k.CLASS_CLOSED=\"closed\";k.CLASS_CLOSE_BUTTON=\"close-button\";k.CLASS_DRAG=\"drag\";k.DEFAULT_WIDTH=245;k.TEXT_CLOSED=\"Close Controls\";k.TEXT_OPEN=\"Open Controls\";g.bind(window,\"keydown\",function(a){document.activeElement.type!==\"text\"&&(a.which===72||a.keyCode==72)&&k.toggleHide()},\nfalse);i.extend(k.prototype,{add:function(a,b){return q(this,a,b,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(a,b){return q(this,a,b,{color:true})},remove:function(a){this.__ul.removeChild(a.__li);this.__controllers.slice(this.__controllers.indexOf(a),1);var b=this;i.defer(function(){b.onResize()})},destroy:function(){this.autoPlace&&v.removeChild(this.domElement)},addFolder:function(a){if(this.__folders[a]!==void 0)throw Error('You already have a folder in this GUI by the name \"'+\na+'\"');var b={name:a,parent:this};b.autoPlace=this.autoPlace;if(this.load&&this.load.folders&&this.load.folders[a])b.closed=this.load.folders[a].closed,b.load=this.load.folders[a];b=new k(b);this.__folders[a]=b;a=s(this,b.domElement);g.addClass(a,\"folder\");return b},open:function(){this.closed=false},close:function(){this.closed=true},onResize:function(){var a=this.getRoot();if(a.scrollable){var b=g.getOffset(a.__ul).top,c=0;i.each(a.__ul.childNodes,function(b){a.autoPlace&&b===a.__save_row||(c+=\ng.getHeight(b))});window.innerHeight-b-20<c?(g.addClass(a.domElement,k.CLASS_TOO_TALL),a.__ul.style.height=window.innerHeight-b-20+\"px\"):(g.removeClass(a.domElement,k.CLASS_TOO_TALL),a.__ul.style.height=\"auto\")}a.__resize_handle&&i.defer(function(){a.__resize_handle.style.height=a.__ul.offsetHeight+\"px\"});if(a.__closeButton)a.__closeButton.style.width=a.width+\"px\"},remember:function(){if(i.isUndefined(x))x=new y,x.domElement.innerHTML=a;if(this.parent)throw Error(\"You can only call remember on a top level GUI.\");\nvar b=this;i.each(Array.prototype.slice.call(arguments),function(a){b.__rememberedObjects.length==0&&I(b);b.__rememberedObjects.indexOf(a)==-1&&b.__rememberedObjects.push(a)});this.autoPlace&&D(this,this.width)},getRoot:function(){for(var a=this;a.parent;)a=a.parent;return a},getSaveObject:function(){var a=this.load;a.closed=this.closed;if(this.__rememberedObjects.length>0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b,\nc){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders,\nfunction(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'<div id=\"dg-save\" class=\"dg dialogue\">\\n\\n Here\\'s the new load parameter for your <code>GUI</code>\\'s constructor:\\n\\n <textarea id=\"dg-new-constructor\"></textarea>\\n\\n <div id=\"dg-save-locally\">\\n\\n <input id=\"dg-local-storage\" type=\"checkbox\"/> Automatically save\\n values to <code>localStorage</code> on exit.\\n\\n <div id=\"dg-local-explain\">The values saved to <code>localStorage</code> will\\n override those passed to <code>dat.GUI</code>\\'s constructor. This makes it\\n easier to work incrementally, but <code>localStorage</code> is fragile,\\n and your friends may not see the same values you do.\\n \\n </div>\\n \\n </div>\\n\\n</div>',\n\".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n\",\ndat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,\"\");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d=\nfunction(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement(\"input\");this.__input.setAttribute(\"type\",\"text\");a.bind(this.__input,\"keyup\",e);a.bind(this.__input,\"change\",e);a.bind(this.__input,\"blur\",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,\"keydown\",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,\ne.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController,\ndat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background=\"\";f.each(j,function(e){a.style.cssText+=\"background: \"+e+\"linear-gradient(\"+b+\", \"+c+\" 0%, \"+d+\" 100%); \"})}function n(a){a.style.background=\"\";a.style.cssText+=\"background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);\";a.style.cssText+=\"background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";\na.style.cssText+=\"background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";a.style.cssText+=\"background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\";a.style.cssText+=\"background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);\"}var h=function(e,l){function o(b){q(b);a.bind(window,\"mousemove\",q);a.bind(window,\n\"mouseup\",j)}function j(){a.unbind(window,\"mousemove\",q);a.unbind(window,\"mouseup\",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,\"mousemove\",s);a.unbind(window,\"mouseup\",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=\n1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement(\"div\");a.makeSelectable(this.domElement,\nfalse);this.__selector=document.createElement(\"div\");this.__selector.className=\"selector\";this.__saturation_field=document.createElement(\"div\");this.__saturation_field.className=\"saturation-field\";this.__field_knob=document.createElement(\"div\");this.__field_knob.className=\"field-knob\";this.__field_knob_border=\"2px solid \";this.__hue_knob=document.createElement(\"div\");this.__hue_knob.className=\"hue-knob\";this.__hue_field=document.createElement(\"div\");this.__hue_field.className=\"hue-field\";this.__input=\ndocument.createElement(\"input\");this.__input.type=\"text\";this.__input_textShadow=\"0 1px 1px \";a.bind(this.__input,\"keydown\",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,\"blur\",g);a.bind(this.__selector,\"mousedown\",function(){a.addClass(this,\"drag\").bind(window,\"mouseup\",function(){a.removeClass(p.__selector,\"drag\")})});var t=document.createElement(\"div\");f.extend(this.__selector.style,{width:\"122px\",height:\"102px\",padding:\"3px\",backgroundColor:\"#222\",boxShadow:\"0px 1px 3px rgba(0,0,0,0.3)\"});\nf.extend(this.__field_knob.style,{position:\"absolute\",width:\"12px\",height:\"12px\",border:this.__field_knob_border+(this.__color.v<0.5?\"#fff\":\"#000\"),boxShadow:\"0px 1px 3px rgba(0,0,0,0.5)\",borderRadius:\"12px\",zIndex:1});f.extend(this.__hue_knob.style,{position:\"absolute\",width:\"15px\",height:\"2px\",borderRight:\"4px solid #fff\",zIndex:1});f.extend(this.__saturation_field.style,{width:\"100px\",height:\"100px\",border:\"1px solid #555\",marginRight:\"3px\",display:\"inline-block\",cursor:\"pointer\"});f.extend(t.style,\n{width:\"100%\",height:\"100%\",background:\"none\"});b(t,\"top\",\"rgba(0,0,0,0)\",\"#000\");f.extend(this.__hue_field.style,{width:\"15px\",height:\"100px\",display:\"inline-block\",border:\"1px solid #555\",cursor:\"ns-resize\"});n(this.__hue_field);f.extend(this.__input.style,{outline:\"none\",textAlign:\"center\",color:\"#fff\",border:0,fontWeight:\"bold\",textShadow:this.__input_textShadow+\"rgba(0,0,0,0.7)\"});a.bind(this.__saturation_field,\"mousedown\",o);a.bind(this.__field_knob,\"mousedown\",o);a.bind(this.__hue_field,\"mousedown\",\nfunction(b){s(b);a.bind(window,\"mousemove\",s);a.bind(window,\"mouseup\",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue());\nif(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+\"px\",marginTop:100*(1-this.__color.v)-7+\"px\",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+\n\"rgb(\"+h+\",\"+h+\",\"+h+\")\"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+\"px\";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,\"left\",\"#fff\",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:\"rgb(\"+h+\",\"+h+\",\"+h+\")\",textShadow:this.__input_textShadow+\"rgba(\"+j+\",\"+j+\",\"+j+\",.7)\"})}});var j=[\"-moz-\",\"-o-\",\"-webkit-\",\"-ms-\",\"\"];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a,\nb,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space===\"RGB\")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!==\"RGB\")n(this,b,c),this.__state.space=\"RGB\";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space===\"HSV\")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!==\"HSV\")h(this),this.__state.space=\"HSV\";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space===\n\"HEX\")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space===\"HSV\")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw\"Corrupted color state\";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw\"Failed to interpret color arguments\";this.__state.a=this.__state.a||\n1};j.COMPONENTS=\"r,g,b,h,s,v,hex,a\".split(\",\");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,\"r\",2);f(j.prototype,\"g\",1);f(j.prototype,\"b\",0);b(j.prototype,\"h\");b(j.prototype,\"s\");b(j.prototype,\"v\");Object.defineProperty(j.prototype,\"a\",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,\"hex\",{get:function(){if(!this.__state.space!==\"HEX\")this.__state.hex=\na.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space=\"HEX\";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0};\na=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255<<e)}}}(),dat.color.toString,dat.utils.common),dat.color.interpret,dat.utils.common),dat.utils.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||\nwindow.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1E3/60)}}(),dat.dom.CenteredDiv=function(e,a){var c=function(){this.backgroundElement=document.createElement(\"div\");a.extend(this.backgroundElement.style,{backgroundColor:\"rgba(0,0,0,0.8)\",top:0,left:0,display:\"none\",zIndex:\"1000\",opacity:0,WebkitTransition:\"opacity 0.2s linear\"});e.makeFullscreen(this.backgroundElement);this.backgroundElement.style.position=\"fixed\";this.domElement=\ndocument.createElement(\"div\");a.extend(this.domElement.style,{position:\"fixed\",display:\"none\",zIndex:\"1001\",opacity:0,WebkitTransition:\"-webkit-transform 0.2s ease-out, opacity 0.2s linear\"});document.body.appendChild(this.backgroundElement);document.body.appendChild(this.domElement);var c=this;e.bind(this.backgroundElement,\"click\",function(){c.hide()})};c.prototype.show=function(){var c=this;this.backgroundElement.style.display=\"block\";this.domElement.style.display=\"block\";this.domElement.style.opacity=\n0;this.domElement.style.webkitTransform=\"scale(1.1)\";this.layout();a.defer(function(){c.backgroundElement.style.opacity=1;c.domElement.style.opacity=1;c.domElement.style.webkitTransform=\"scale(1)\"})};c.prototype.hide=function(){var a=this,c=function(){a.domElement.style.display=\"none\";a.backgroundElement.style.display=\"none\";e.unbind(a.domElement,\"webkitTransitionEnd\",c);e.unbind(a.domElement,\"transitionend\",c);e.unbind(a.domElement,\"oTransitionEnd\",c)};e.bind(this.domElement,\"webkitTransitionEnd\",\nc);e.bind(this.domElement,\"transitionend\",c);e.bind(this.domElement,\"oTransitionEnd\",c);this.backgroundElement.style.opacity=0;this.domElement.style.opacity=0;this.domElement.style.webkitTransform=\"scale(1.1)\"};c.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-e.getWidth(this.domElement)/2+\"px\";this.domElement.style.top=window.innerHeight/2-e.getHeight(this.domElement)/2+\"px\"};return c}(dat.dom.dom,dat.utils.common),dat.dom.dom,dat.utils.common);\nexports.dat = dat;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/AssimpJSONLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/AssimpJSONLoader.js",
"module-type": "library",
"text": "/**\n * @author Alexander Gessler / http://www.greentoken.de/\n * https://github.com/acgessler\n *\n * Loader for models imported with Open Asset Import Library (http://assimp.sf.net)\n * through assimp2json (https://github.com/acgessler/assimp2json).\n *\n * Supports any input format that assimp supports, including 3ds, obj, dae, blend,\n * fbx, x, ms3d, lwo (and many more).\n *\n * See webgl_loader_assimp2json example.\n */\n\nTHREE.AssimpJSONLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n};\n\nTHREE.AssimpJSONLoader.prototype = {\n\n\tconstructor: THREE.AssimpJSONLoader,\n\n\ttexturePath : '',\n\n\tload: function ( url, onLoad, onProgress, onError, texturePath ) {\n var fonc = \"THREE.AssimpJSONLoader.load\";\n hack.log(\"url: \"+url+\": crossOrigin = \"+this.crossOrigin, hack.loader, fonc);\n\n\t\tvar scope = this;\n\n\t\tthis.texturePath = texturePath && ( typeof texturePath === \"string\" ) ? texturePath : this.extractUrlBase( url );\n\n\t\tvar loader = new THREE.XHRLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\t\t\tvar scene = scope.parse( JSON.parse( text ) );\n\t\t\tonLoad( scene );\n\t\t} );\n\t},\n\n\tsetCrossOrigin: function ( value ) {\n\t\tthis.crossOrigin = value;\n\t},\n\n\textractUrlBase: function ( url ) { // from three/src/loaders/Loader.js\n\t\tvar parts = url.split( '/' );\n\t\tparts.pop();\n\t\treturn ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/';\n\t},\n\n\tparse: function ( json ) {\n\t\tvar meshes = this.parseList ( json.meshes, this.parseMesh );\n\t\tvar materials = this.parseList ( json.materials, this.parseMaterial );\n\t\treturn this.parseObject( json, json.rootnode, meshes, materials );\n\t},\n\n\tparseList : function(json, handler) {\n\t\tvar meshes = new Array(json.length);\n\t\tfor(var i = 0; i < json.length; ++i) {\n\t\t\tmeshes[i] = handler.call(this, json[i]);\n\t\t}\n\t\treturn meshes;\n\t},\n\n\tparseMesh : function(json) {\n\t\tvar vertex, geometry, i, e, in_data, src;\n\n\n\t\tgeometry = new THREE.Geometry();\n\n\t\t// read vertex positions\n\t\tfor(in_data = json.vertices, i = 0, e = in_data.length; i < e; ) {\n\t\t\tgeometry.vertices.push( new THREE.Vector3( in_data[ i++ ], in_data[ i++ ], in_data[ i++ ] ) );\n\t\t}\n\n\t\t// read faces\n\t\tvar cnt = 0;\n\t\tfor(in_data = json.faces, i = 0, e = in_data.length; i < e; ++i) {\n\t\t\tface = new THREE.Face3();\n\t\t\tsrc = in_data[i];\n\t\t\tface.a = src[0];\n\t\t\tface.b = src[1];\n\t\t\tface.c = src[2];\n\n\t\t\tface.materialIndex = 0; //json.materialindex;\n\t\t\tgeometry.faces.push(face);\n\t\t}\n\n\t\t// read texture coordinates - three.js attaches them to its faces\n\t\tjson.texturecoords = json.texturecoords || [];\n\t\tfor(i = 0, e = json.texturecoords.length; i < e; ++i) {\n\n\t\t\tfunction convertTextureCoords(in_uv, out_faces, out_vertex_uvs) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 2;\n\t\t\t\t\tb = face.b * 2;\n\t\t\t\t\tc = face.c * 2;\n\t\t\t\t\tout_vertex_uvs.push([\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ a ], in_uv[ a + 1 ] ),\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ b ], in_uv[ b + 1 ] ),\n\t\t\t\t\t\tnew THREE.Vector2( in_uv[ c ], in_uv[ c + 1 ] )\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertTextureCoords(json.texturecoords[i], geometry.faces, geometry.faceVertexUvs[i]);\n\t\t}\n\n\t\t// read normals - three.js also attaches them to its faces\n\t\tif(json.normals) {\n\n\t\t\tfunction convertNormals(in_nor, out_faces) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 3;\n\t\t\t\t\tb = face.b * 3;\n\t\t\t\t\tc = face.c * 3;\n\t\t\t\t\tface.vertexNormals = [\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ a ], in_nor[ a + 1 ], in_nor[ a + 2 ] ),\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ b ], in_nor[ b + 1 ], in_nor[ b + 2 ] ),\n\t\t\t\t\t\tnew THREE.Vector3( in_nor[ c ], in_nor[ c + 1 ], in_nor[ c + 2 ] )\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertNormals(json.normals, geometry.faces);\n\t\t}\n\n\t\t// read vertex colors - three.js also attaches them to its faces\n\t\tif(json.colors && json.colors[0]) {\n\n\t\t\tfunction convertColors(in_color, out_faces) {\n\t\t\t\tvar i, e, face, a, b, c;\n\n\t\t\t\tfunction makeColor(start) {\n\t\t\t\t\tvar col = new THREE.Color( );\n\t\t\t\t\tcol.setRGB( arr[0], arr[1], arr[2] );\n\t\t\t\t\t// TODO: what about alpha?\n\t\t\t\t\treturn col;\n\t\t\t\t}\n\n\t\t\t\tfor(i = 0, e = out_faces.length; i < e; ++i) {\n\t\t\t\t\tface = out_faces[i];\n\t\t\t\t\ta = face.a * 4;\n\t\t\t\t\tb = face.b * 4;\n\t\t\t\t\tc = face.c * 4;\n\t\t\t\t\tface.vertexColors = [\n\t\t\t\t\t\tmakeColor( a ),\n\t\t\t\t\t\tmakeColor( b ),\n\t\t\t\t\t\tmakeColor( c )\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconvertColors(json.colors[0], geometry.faces);\n\t\t}\n\n\n\t\t//geometry.computeFaceNormals();\n\t\t//geometry.computeVertexNormals();\n\t\t//geometry.computeTangents();\n\t\tgeometry.computeBoundingSphere();\n\n\t\t// TODO: tangents\n\t\treturn geometry;\n\t},\n\n\tparseMaterial : function(json) {\n var func = \"THREE.AssimpJSONLoader.parseMaterial\";\n // *tiddlywiki*\n // It seems that this algorithm has bugs !\n // Due to the fact that images are asynchronously loaded, it made the assumption\n // that textures are loaded after all json is parsed. With TiddlyWiki, it's not the\n // case because image Tiddler's file are immediately and synchronously loaded.\n // The result is that <mat> variable is null and clashes when the onLoad() callback of the\n // image loader tries to make something of the texture with <mat>.\n //\n // The fix : cancel the texture loading and wait till all json is parsed\n // and <mat> is initialized with a coherent THREE.MeshPhongMaterial instance. After\n // that, a second pass resumes the normal loading of the textures.\n\n\t\tvar mat = null, \n\t\tscope = this, i, prop, has_textures = [],\n\n\t\tinit_props = {\n\t\t\tshading : THREE.SmoothShading\n\t\t};\n\n\t\tfunction toColor(value_arr) {\n\t\t\tvar col = new THREE.Color();\n\t\t\tcol.setRGB(value_arr[0],value_arr[1],value_arr[2]);\n\t\t\treturn col;\n\t\t}\n\n\t\tfunction defaultTexture() {\n\t\t\tvar im = new Image();\n\t\t\tim.width = 1;\n\t\t\tim.height = 1;\n\t\t\treturn new THREE.Texture(im);\n\t\t}\n\n // *tiddlywiki*\n var flagTiddler = false;\n\n\t\tfor (var i in json.properties) {\n\t\t\tprop = json.properties[i];\n\n\t\t\tif(prop.key === '$tex.file') {\n\t\t\t\t// prop.semantic gives the type of the texture\n\t\t\t\t// 1: diffuse\n\t\t\t\t// 2: specular mao\n\t\t\t\t// 5: height map (bumps)\n\t\t\t\t// 6: normal map\n\t\t\t\t// more values (i.e. emissive, environment) are known by assimp and may be relevant\n\t\t\t\tif(prop.semantic === 1 || prop.semantic === 5 || prop.semantic === 6 || prop.semantic === 2) {\n\t\t\t\t\t(function(semantic) {\n\t\t\t\t\t\tvar loader = new THREE.TextureLoader(scope.manager),\n\t\t\t\t\t\tkeyname;\n\n\t\t\t\t\t\tif(semantic === 1) {\n\t\t\t\t\t\t\tkeyname = 'map';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 5) {\n\t\t\t\t\t\t\tkeyname = 'bumpMap';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 6) {\n\t\t\t\t\t\t\tkeyname = 'normalMap';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(semantic === 2) {\n\t\t\t\t\t\t\tkeyname = 'specularMap';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thas_textures.push(keyname);\n\n\t\t\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\t\t\t\tvar material_url = scope.texturePath + '/' + prop.value\n\t\t\t\t\t\tmaterial_url = material_url.replace(/\\\\/g, '/');\n\n if (TiddlyWiki && material_url.match(/^tw:/)) {\n flagTiddler = true;\n hack.log(\"PASS 1: ignoring textures in tiddler's file\", hack.loader, func);\n return;\n }\n\t\t\t\t\t\tloader.load(material_url, function(tex) {\n\t\t\t\t\t\t\tif(tex) {\n\t\t\t\t\t\t\t\t// TODO: read texture settings from assimp.\n\t\t\t\t\t\t\t\t// Wrapping is the default, though.\n\t\t\t\t\t\t\t\ttex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n\n if (TiddlyWiki) {\n if (mat) {\n\t\t\t\t\t\t\t mat[keyname] = tex;\n\t\t\t\t\t\t\t mat.needsUpdate = true;\n }\n } else {\n\t\t\t\t\t\t\t\tmat[keyname] = tex;\n\t\t\t\t\t\t\t\tmat.needsUpdate = true;\n }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})(prop.semantic);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(prop.key === '?mat.name') {\n\t\t\t\tinit_props.name = prop.value;\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.diffuse') {\n\t\t\t\tinit_props.color = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.specular') {\n\t\t\t\tinit_props.specular = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.ambient') {\n\t\t\t\tinit_props.ambient = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$clr.emissive') {\n\t\t\t\tinit_props.emissive = toColor(prop.value);\n\t\t\t}\n\t\t\telse if(prop.key === '$mat.shadingm') {\n\t\t\t\t// aiShadingMode_Flat\n\t\t\t\tif (prop.value === 1) {\n\t\t\t\t\tinit_props.shading = THREE.FlatShading;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (prop.key === '$mat.shininess') {\n\t\t\t\tinit_props.shininess = prop.value;\n\t\t\t}\n\t\t}\n\n\t\tif(!init_props.ambient) {\n\t\t\tinit_props.ambient = init_props.color;\n\t\t}\n\n\t\t// note: three.js does not like it when a texture is added after the geometry\n\t\t// has been rendered once, see http://stackoverflow.com/questions/16531759/.\n\t\t// for this reason we fill all slots upfront with default textures\n\t\tif(has_textures.length) {\n\t\t\tfor(i = has_textures.length-1; i >= 0; --i) {\n\t\t\t\tinit_props[has_textures[i]] = defaultTexture();\n\t\t\t}\n\t\t}\n\n mat = new THREE.MeshPhongMaterial( init_props );\n\n if (TiddlyWiki && flagTiddler) {\n // New pass to handle tiddler files\n hack.log(\"PASS 2: loading textures in tiddler's file\", hack.loader, func);\n\n\t has_textures = [];\n\n\t for (var i in json.properties) {\n\t prop = json.properties[i];\n\t if(prop.key === '$tex.file') {\n\t\t// prop.semantic gives the type of the texture\n\t\t// 1: diffuse\n\t\t// 2: specular mao\n\t\t// 5: height map (bumps)\n\t\t// 6: normal map\n\t\t// more values (i.e. emissive, environment) are known by assimp and may be relevant\n\t\tif(prop.semantic === 1 || prop.semantic === 5 || prop.semantic === 6 || prop.semantic === 2) {\n\t\t (function(semantic) {\n\t\t var loader = new THREE.TextureLoader(scope.manager), keyname;\n\t\t if(semantic === 1) keyname = 'map';\n\t\t else if(semantic === 5) keyname = 'bumpMap';\n\t\t else if(semantic === 6) keyname = 'normalMap';\n\t\t else if(semantic === 2) keyname = 'specularMap';\n\t\t has_textures.push(keyname);\n\t\t loader.setCrossOrigin(this.crossOrigin);\n\t\t var material_url = scope.texturePath + '/' + prop.value\n\t\t material_url = material_url.replace(/\\\\/g, '/');\n\t\t loader.load(material_url, function(tex) {\n\t\t if(tex) {\n\t\t\t// TODO: read texture settings from assimp.\n\t\t\t// Wrapping is the default, though.\n\t\t\ttex.wrapS = tex.wrapT = THREE.RepeatWrapping;\n if (mat) {\n\t\t\t mat[keyname] = tex;\n\t\t\t mat.needsUpdate = true;\n }\n\t\t }\n\t\t });\n\t\t })(prop.semantic);\n\t\t}\n\t }\n }\n }\n \n\t return mat;\n\t},\n\n\tparseObject : function(json, node, meshes, materials) {\n\t\tvar obj = new THREE.Object3D()\n\t\t,\ti\n\t\t,\tidx\n\t\t;\n\n\t\tobj.name = node.name || \"\";\n\t\tobj.matrix = new THREE.Matrix4().fromArray(node.transformation).transpose();\n\t\tobj.matrix.decompose( obj.position, obj.quaternion, obj.scale );\n\n\t\tfor(i = 0; node.meshes && i < node.meshes.length; ++i) {\n\t\t\tidx = node.meshes[i];\n\t\t\tobj.add(new THREE.Mesh( meshes[idx], materials[json.meshes[idx].materialindex] ));\n\t\t}\n\n\t\tfor(i = 0; node.children && i < node.children.length; ++i) {\n\t\t\tobj.add(this.parseObject(json, node.children[i], meshes, materials));\n\t\t}\n\n\t\treturn obj;\n\t},\n};\n\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/AWDLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/AWDLoader.js",
"module-type": "library",
"text": "/**\n * Author: Pierre Lepers\n * Date: 09/12/2013 17:21\n */\n\nTHREE.AWDLoader = (function (){\n\n\n\n var UNCOMPRESSED = 0,\n DEFLATE = 1,\n LZMA = 2,\n\n AWD_FIELD_INT8 = 1,\n AWD_FIELD_INT16 = 2,\n AWD_FIELD_INT32 = 3,\n AWD_FIELD_UINT8 = 4,\n AWD_FIELD_UINT16 = 5,\n AWD_FIELD_UINT32 = 6,\n AWD_FIELD_FLOAT32 = 7,\n AWD_FIELD_FLOAT64 = 8,\n AWD_FIELD_BOOL = 21,\n AWD_FIELD_COLOR = 22,\n AWD_FIELD_BADDR = 23,\n AWD_FIELD_STRING = 31,\n AWD_FIELD_BYTEARRAY = 32,\n AWD_FIELD_VECTOR2x1 = 41,\n AWD_FIELD_VECTOR3x1 = 42,\n AWD_FIELD_VECTOR4x1 = 43,\n AWD_FIELD_MTX3x2 = 44,\n AWD_FIELD_MTX3x3 = 45,\n AWD_FIELD_MTX4x3 = 46,\n AWD_FIELD_MTX4x4 = 47,\n\n BOOL = 21,\n COLOR = 22,\n BADDR = 23,\n\n INT8 = 1,\n INT16 = 2,\n INT32 = 3,\n UINT8 = 4,\n UINT16 = 5,\n UINT32 = 6,\n FLOAT32 = 7,\n FLOAT64 = 8;\n\n\n var littleEndian = true;\n\n // ResourcesLoader\n // =============\n // handle loading for external resources\n function ResourcesLoader( awdUrl ){\n var func = \"THREE.AWDLoader.ResourcesLoader\";\n\n this._baseDir = awdUrl.substr( 0, awdUrl.lastIndexOf( '/' )+1 );\n\n this._loadingManager = new THREE.LoadingManager();\n\n }\n\n ResourcesLoader.prototype = {\n\n loadTexture : function( path ){\n var tex = new THREE.Texture();\n\n var loader = new THREE.ImageLoader( this._loadingManager );\n\n loader.load( this._baseDir+path, function( image ) {\n tex.image = image;\n tex.needsUpdate = true;\n });\n\n return tex;\n\n }\n }\n\n\n\n function Block(){\n this.id = 0;\n this.data = null;\n }\n\n\n\n function AWDLoader( showStatus ) {\n\n THREE.Loader.call( this, showStatus );\n\n this.trunk = new THREE.Object3D();\n\n this.materialFactory = undefined;\n\n this._resourceLoader = null;\n this._url = null;\n\n this._data;\n this._ptr = 0;\n\n this._version = [];\n this._streaming = false;\n this._optimized_for_accuracy = false;\n this._compression = 0;\n this._bodylen = 0xFFFFFFFF;\n\n\n this._blocks = [ new Block() ];\n\n this._accuracyMatrix = false;\n this._accuracyGeo = false;\n this._accuracyProps = false;\n\n\n };\n\n\n AWDLoader.prototype = new THREE.Loader();\n\n AWDLoader.prototype.constructor = AWDLoader;\n\n AWDLoader.prototype.load = function ( url, callback ) {\n var func = \"THREE.AWDLoader.load\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n this._url = url;\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.byteLength = \"+res.byteLength, hack.loader, func);\n this.parse(res);\n callback(this.trunk);\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n var that = this;\n this._url = url;\n var xhr = new XMLHttpRequest();\n xhr.open( \"GET\", url, true );\n xhr.responseType = 'arraybuffer';\n\n xhr.onreadystatechange = function () {\n\n if ( xhr.readyState == 4 ) {\n\n if ( xhr.status == 200 || xhr.status == 0 ) {\n that.parse( xhr.response );\n callback( that.trunk );\n\n } else {\n\n console.error( 'AWDLoader: Couldn\\'t load ' + url + ' (' + xhr.status + ')' );\n\n }\n\n }\n\n };\n\n xhr.send( null );\n\n };\n\n AWDLoader.prototype.parse = function ( data ) {\n var func = \"THREE.AWDLoader.parse\";\n\n var blen = data.byteLength;\n\n this._ptr = 0;\n this._data = new DataView( data );\n\n this._parseHeader( );\n\n if( this._compression != 0 ) {\n console.error( 'compressed AWD not supported' );\n }\n\n if (!this._streaming && this._bodylen != data.byteLength - this._ptr ) {\n console.error('AWDLoader: body len does not match file length', this._bodylen , blen - this._ptr);\n }\n\n while ( this._ptr < blen ) {\n this.parseNextBlock();\n }\n\n }\n\n\n\n AWDLoader.prototype.parseNextBlock = function ( ) {\n\n var assetData,\n ns, type, len, block,\n blockId = this.readU32(),\n ns = this.readU8(),\n type = this.readU8(),\n flags = this.readU8(),\n len = this.readU32();\n\n\n switch (type) {\n case 1:\n assetData = this.parseMeshData(len);\n break;\n case 22:\n assetData = this.parseContainer(len);\n break;\n case 23:\n assetData = this.parseMeshInstance(len);\n break;\n case 81:\n assetData = this.parseMaterial(len);\n break;\n case 82:\n assetData = this.parseTexture(len);\n break;\n case 101:\n assetData = this.parseSkeleton(len);\n break;\n\n// case 111:\n// assetData = this.parseMeshPoseAnimation(len, true);\n// break;\n case 112:\n assetData = this.parseMeshPoseAnimation(len, false);\n break;\n case 113:\n assetData = this.parseVertexAnimationSet(len);\n break;\n case 102:\n \tassetData = this.parseSkeletonPose(len);\n \tbreak;\n case 103:\n \tassetData = this.parseSkeletonAnimation(len);\n \tbreak;\n case 122:\n assetData = this.parseAnimatorSet(len);\n break;\n // case 121:\n // \tassetData = parseUVAnimation(len);\n // \tbreak;\n default:\n //debug('Ignoring block!',type, len);\n this._ptr += len;\n break;\n }\n\n\n // Store block reference for later use\n this._blocks[blockId] = block = new Block();\n block.data = assetData;\n block.id = blockId;\n\n }\n\n\n AWDLoader.prototype._parseHeader = function () {\n\n var version = this._version,\n awdmagic =\n ( this.readU8()<<16)\n | ( this.readU8()<<8 )\n | this.readU8();\n\n if( awdmagic != 4282180 )\n throw new Error( \"AWDLoader - bad magic\" );\n\n version[0] = this.readU8();\n version[1] = this.readU8();\n\n var flags = this.readU16();\n\n this._streaming = (flags & 0x1) == 0x1;\n\n if ((version[0] === 2) && (version[1] === 1)) {\n this._accuracyMatrix = (flags & 0x2) === 0x2;\n this._accuracyGeo = (flags & 0x4) === 0x4;\n this._accuracyProps = (flags & 0x8) === 0x8;\n }\n\n this._geoNrType = this._accuracyGeo ? FLOAT64 : FLOAT32;\n this._matrixNrType = this._accuracyMatrix ? FLOAT64 : FLOAT32;\n this._propsNrType = this._accuracyProps ? FLOAT64 : FLOAT32;\n\n this._optimized_for_accuracy \t= (flags & 0x2) === 0x2;\n\n this._compression = this.readU8();\n this._bodylen = this.readU32();\n\n\n }\n\n\n AWDLoader.prototype.parseContainer = function ( len ) {\n var parent,\n ctr = new THREE.Object3D(),\n par_id = this.readU32(),\n mtx = this.parseMatrix4();\n\n ctr.name = this.readUTF();\n ctr.applyMatrix( mtx );\n\n parent = this._blocks[par_id].data || this.trunk;\n parent.add(ctr);\n\n this.parseProperties({\n 1:this._matrixNrType,\n 2:this._matrixNrType,\n 3:this._matrixNrType,\n 4:UINT8\n });\n\n ctr.extra = this.parseUserAttributes();\n\n return ctr;\n }\n\n\n\n AWDLoader.prototype.parseMeshInstance = function ( len ) {\n var name,\n mesh, geometries, meshLen, meshes,\n par_id, data_id,\n mtx,\n materials, mat, mat_id,\n num_materials,\n materials_parsed,\n parent,\n i;\n\n par_id = this.readU32();\n mtx = this.parseMatrix4();\n name = this.readUTF();\n data_id = this.readU32();\n num_materials = this.readU16();\n\n geometries = this.getBlock( data_id );\n\n materials = [];\n materials_parsed = 0;\n\n for ( i = 0; i < num_materials; i++) {\n mat_id = this.readU32();\n mat = this.getBlock( mat_id );\n materials.push( mat );\n }\n\n\n\n meshLen = geometries.length\n meshes = [];\n\n // TODO : BufferGeometry don't support \"geometryGroups\" for now.\n // so we create sub meshes for each groups\n if( meshLen > 1 ) {\n mesh = new THREE.Object3D()\n for ( i = 0; i < meshLen; i++) {\n var sm = new THREE.Mesh( geometries[i] );\n meshes.push( sm );\n mesh.add( sm );\n }\n }\n else {\n mesh = new THREE.Mesh( geometries[0] );\n meshes.push( mesh );\n }\n\n mesh.applyMatrix( mtx );\n mesh.name = name;\n\n\n parent = this.getBlock( par_id ) || this.trunk;\n parent.add( mesh );\n\n\n var matLen = materials.length;\n var maxLen = Math.max( meshLen, matLen);\n for( i = 0; i< maxLen; i++ )\n meshes[ i%meshLen ].material = materials[ i % matLen ];\n\n\n // Ignore for now\n this.parseProperties( null );\n mesh.extra = this.parseUserAttributes();\n\n return mesh;\n }\n\n\n\n AWDLoader.prototype.parseMaterial = function ( len ) {\n var name,\n type,\n props,\n mat,\n attributes,\n finalize,\n num_methods,\n methods_parsed;\n\n name = this.readUTF();\n type = this.readU8();\n num_methods = this.readU8();\n\n //log( \"AWDLoader parseMaterial \",name )\n\n // Read material numerical properties\n // (1=color, 2=bitmap url, 11=alpha_blending, 12=alpha_threshold, 13=repeat)\n props = this.parseProperties({\n 1: AWD_FIELD_INT32,\n 2: AWD_FIELD_BADDR,\n 11: AWD_FIELD_BOOL,\n 12: AWD_FIELD_FLOAT32,\n 13: AWD_FIELD_BOOL\n });\n\n methods_parsed = 0;\n\n while( methods_parsed < num_methods ) {\n var method_type = this.readU16();\n this.parseProperties( null );\n this.parseUserAttributes();\n }\n\n attributes = this.parseUserAttributes();\n\n if( this.materialFactory !== undefined ) {\n mat = this.materialFactory( name );\n if( mat ) return mat;\n }\n\n mat = new THREE.MeshPhongMaterial();\n\n if (type === 1) { // Color material\n mat.color.setHex( props.get(1, 0xcccccc) );\n }\n else if (type === 2) { // Bitmap material\n var tex_addr = props.get(2, 0);\n mat.map = this.getBlock( tex_addr );\n }\n\n mat.extra = attributes;\n mat.alphaThreshold = props.get(12, 0.0);\n mat.repeat = props.get(13, false);\n\n\n return mat;\n }\n\n\n\n\n AWDLoader.prototype.parseTexture = function( len ) {\n\n\n var name = this.readUTF(),\n type = this.readU8(),\n asset,\n data_len;\n\n // External\n if (type === 0) {\n data_len = this.readU32();\n var url = this.readUTFBytes(data_len);\n console.log( url );\n\n asset = this.loadTexture( url );\n } else {\n // embed texture not supported\n }\n // Ignore for now\n this.parseProperties( null );\n\n this.parseUserAttributes();\n return asset;\n }\n\n AWDLoader.prototype.loadTexture = function( url ) {\n var func = \"AWDLoader.loadTexture\";\n\n if( null === this._resourceLoader )\n this._resourceLoader = new ResourcesLoader( this._url );\n\n return this._resourceLoader.loadTexture( url );\n }\n\n // broken : skeleton pose format is different than threejs one\n AWDLoader.prototype.parseSkeleton = function(len) // Array<Bone>\n {\n var name = this.readUTF(),\n num_joints = this.readU16(),\n skeleton = [],\n joints_parsed = 0;\n\n this.parseProperties( null );\n\n while (joints_parsed < num_joints) {\n var joint, ibp;\n\n // Ignore joint id\n this.readU16();\n\n joint = new THREE.Bone();\n joint.parent = this.readU16() - 1; // 0=null in AWD\n joint.name = this.readUTF();\n\n ibp = this.parseMatrix4();\n joint.skinMatrix = ibp;\n\n // Ignore joint props/attributes for now\n this.parseProperties(null);\n this.parseUserAttributes();\n\n skeleton.push(joint);\n joints_parsed++;\n }\n\n // Discard attributes for now\n this.parseUserAttributes();\n\n\n return skeleton;\n }\n\n\n\n AWDLoader.prototype.parseSkeletonPose = function(blockID)\n {\n var name = this.readUTF();\n\n\n var num_joints = this.readU16();\n this.parseProperties(null);\n\n // debug( 'parse Skeleton Pose. joints : ' + num_joints);\n\n var pose = [];\n\n var joints_parsed = 0;\n\n while (joints_parsed < num_joints) {\n\n var joint_pose;\n\n var has_transform; //:uint;\n var mtx_data;\n\n has_transform = this.readU8();\n\n if (has_transform === 1) {\n mtx_data = this.parseMatrix4();\n } else\n {\n mtx_data = new THREE.Matrix4();\n }\n pose[joints_parsed] = mtx_data;\n joints_parsed++;\n }\n // Skip attributes for now\n this.parseUserAttributes();\n\n return pose\n }\n\n AWDLoader.prototype.parseSkeletonAnimation = function(blockID)\n {\n var frame_dur;\n var pose_addr;\n var pose;\n\n var name = this.readUTF();\n\n var clip = [];\n\n var num_frames = this.readU16();\n this.parseProperties(null);\n\n var frames_parsed = 0;\n var returnedArray;\n\n\n // debug( 'parse Skeleton Animation. frames : ' + num_frames);\n\n while (frames_parsed < num_frames) {\n pose_addr = this.readU32();\n frame_dur = this.readU16();\n\n pose = this._blocks[pose_addr].data\n // debug( 'pose address ',pose[2].elements[12],pose[2].elements[13],pose[2].elements[14] );\n clip.push( {\n pose : pose,\n duration : frame_dur\n } );\n\n frames_parsed++;\n }\n if (clip.length == 0) {\n // debug(\"Could not this SkeletonClipNode, because no Frames where set.\");\n return;\n }\n // Ignore attributes for now\n this.parseUserAttributes();\n return clip;\n }\n\n\n\n AWDLoader.prototype.parseVertexAnimationSet = function(len)\n {\n var poseBlockAdress,\n name = this.readUTF(),\n num_frames = this.readU16(),\n props = this.parseProperties({1:UINT16}),\n frames_parsed = 0,\n skeletonFrames = [];\n\n while (frames_parsed < num_frames) {\n poseBlockAdress = this.readU32();\n skeletonFrames.push(this._blocks[poseBlockAdress].data);\n frames_parsed++;\n }\n\n this.parseUserAttributes();\n\n\n return skeletonFrames;\n }\n\n\n AWDLoader.prototype.parseAnimatorSet = function(len)\n {\n var targetMesh;\n\n var animSetBlockAdress; //:int\n\n var targetAnimationSet; //:AnimationSetBase;\n var outputString = \"\"; //:String = \"\";\n var name = this.readUTF();\n var type = this.readU16();\n\n var props = this.parseProperties({1:BADDR});\n\n animSetBlockAdress = this.readU32();\n var targetMeshLength = this.readU16();\n\n var meshAdresses = []; //:Vector.<uint> = new Vector.<uint>;\n\n for (var i = 0; i < targetMeshLength; i++)\n meshAdresses.push( this.readU32() );\n\n var activeState = this.readU16();\n var autoplay = Boolean(this.readU8());\n this.parseUserAttributes();\n this.parseUserAttributes();\n\n var returnedArray;\n var targetMeshes = []; //:Vector.<Mesh> = new Vector.<Mesh>;\n\n for (i = 0; i < meshAdresses.length; i++) {\n// returnedArray = getAssetByID(meshAdresses[i], [AssetType.MESH]);\n// if (returnedArray[0])\n targetMeshes.push(this._blocks[meshAdresses[i]].data);\n }\n\n targetAnimationSet = this._blocks[animSetBlockAdress].data\n var thisAnimator;\n\n if (type == 1) {\n\n\n thisAnimator = {\n animationSet : targetAnimationSet,\n skeleton : this._blocks[props.get(1, 0)].data\n };\n\n } else if (type == 2) {\n // debug( \"vertex Anim???\");\n }\n\n\n for (i = 0; i < targetMeshes.length; i++) {\n targetMeshes[i].animator = thisAnimator;\n }\n // debug(\"Parsed a Animator: Name = \" + name);\n\n return thisAnimator;\n }\n\n\n\n\n\n\n\n AWDLoader.prototype.parseMeshData = function ( len ) {\n\n var name = this.readUTF(),\n num_subs = this.readU16(),\n geom,\n subs_parsed = 0,\n props,\n buffer,\n skinW, skinI,\n geometries = [];\n\n\n\n\n props = this.parseProperties({\n 1: this._geoNrType,\n 2: this._geoNrType\n });\n\n\n\n // Loop through sub meshes\n while (subs_parsed < num_subs) {\n\n var sm_len, sm_end, attrib;\n\n geom = new THREE.BufferGeometry();\n geom.name = name;\n geometries.push( geom );\n\n\n sm_len = this.readU32();\n sm_end = this._ptr + sm_len;\n\n\n // Ignore for now\n this.parseProperties({1:this._geoNrType, 2:this._geoNrType});\n\n // Loop through data streams\n while ( this._ptr < sm_end ) {\n\n\n var idx = 0,\n str_type = this.readU8(),\n str_ftype = this.readU8(),\n str_len = this.readU32(),\n str_end = str_len + this._ptr;\n\n\n\n\n\n // VERTICES\n // ------------------\n if ( str_type === 1 ) {\n\n buffer = new Float32Array( ( str_len / 12 ) * 3 );\n attrib = new THREE.BufferAttribute( buffer, 3 );\n\n geom.addAttribute( 'position', attrib );\n idx = 0;\n\n while (this._ptr < str_end) {\n buffer[idx] = -this.readF32();\n buffer[idx+1] = this.readF32();\n buffer[idx+2] = this.readF32();\n idx+=3;\n }\n }\n\n\n // INDICES\n // -----------------\n else if (str_type === 2) {\n\n buffer = new Uint16Array( str_len / 2 );\n attrib = new THREE.BufferAttribute( buffer, 1 );\n geom.addAttribute( 'index', attrib );\n\n geom.offsets.push({\n start: 0,\n index: 0,\n count: str_len/2\n });\n\n idx = 0;\n\n while (this._ptr < str_end) {\n buffer[idx+1] = this.readU16();\n buffer[idx] = this.readU16();\n buffer[idx+2] = this.readU16();\n idx+=3;\n }\n }\n\n // UVS\n // -------------------\n else if (str_type === 3) {\n\n buffer = new Float32Array( ( str_len / 8 ) * 2 );\n attrib = new THREE.BufferAttribute( buffer, 2 );\n\n geom.addAttribute( 'uv', attrib );\n idx = 0;\n\n while (this._ptr < str_end) {\n buffer[idx] = this.readF32();\n buffer[idx+1] = 1.0-this.readF32();\n idx+=2;\n }\n }\n\n // NORMALS\n else if (str_type === 4) {\n\n buffer = new Float32Array( ( str_len / 12 ) * 3 );\n attrib = new THREE.BufferAttribute( buffer, 3 );\n geom.addAttribute( 'normal', attrib );\n idx = 0;\n\n while (this._ptr < str_end) {\n buffer[idx] = -this.readF32();\n buffer[idx+1] = this.readF32();\n buffer[idx+2] = this.readF32();\n idx+=3;\n }\n\n }\n\n // else if (str_type == 6) {\n // skinI = new Float32Array( str_len>>1 );\n // idx = 0\n\n // while (this._ptr < str_end) {\n // skinI[idx] = this.readU16();\n // idx++;\n // }\n\n // }\n // else if (str_type == 7) {\n // skinW = new Float32Array( str_len>>2 );\n // idx = 0;\n\n // while (this._ptr < str_end) {\n // skinW[idx] = this.readF32();\n // idx++;\n // }\n // }\n else {\n this._ptr = str_end;\n }\n\n\n\n }\n\n this.parseUserAttributes();\n\n\n geom.computeBoundingSphere();\n subs_parsed++;\n }\n\n\n //geom.computeFaceNormals();\n\n\n this.parseUserAttributes();\n //finalizeAsset(geom, name);\n\n return geometries;\n }\n\n AWDLoader.prototype.parseMeshPoseAnimation = function(len, poseOnly)\n {\n var num_frames = 1,\n num_submeshes,\n frames_parsed,\n subMeshParsed,\n frame_dur,\n x, y, z,\n\n str_len,\n str_end,\n geom,\n subGeom,\n idx = 0,\n clip = {},\n indices,\n verts,\n num_Streams,\n streamsParsed,\n streamtypes = [],\n\n props,\n thisGeo,\n name = this.readUTF(),\n geoAdress = this.readU32();\n\n\n var mesh = this.getBlock( geoAdress );\n\n if (mesh == null) {\n console.log( \"parseMeshPoseAnimation target mesh not found at:\", geoAdress );\n return;\n }\n\n geom = mesh.geometry;\n geom.morphTargets = [];\n\n if (!poseOnly)\n num_frames = this.readU16();\n\n num_submeshes = this.readU16();\n num_Streams = this.readU16();\n\n // debug(\"VA num_frames : \", num_frames );\n // debug(\"VA num_submeshes : \", num_submeshes );\n // debug(\"VA numstreams : \", num_Streams );\n\n streamsParsed = 0;\n while (streamsParsed < num_Streams) {\n streamtypes.push(this.readU16());\n streamsParsed++;\n }\n props = this.parseProperties({1:BOOL, 2:BOOL});\n\n clip.looping = props.get(1, true);\n clip.stitchFinalFrame = props.get(2, false);\n\n frames_parsed = 0;\n\n while (frames_parsed < num_frames) {\n\n frame_dur = this.readU16();\n subMeshParsed = 0;\n\n while (subMeshParsed < num_submeshes) {\n\n streamsParsed = 0;\n str_len = this.readU32();\n str_end = this._ptr + str_len;\n\n while (streamsParsed < num_Streams) {\n\n if (streamtypes[streamsParsed] == 1) {\n\n //geom.addAttribute( 'morphTarget'+frames_parsed, Float32Array, str_len/12, 3 );\n var buffer = new Float32Array(str_len/4);\n geom.morphTargets.push( {\n array : buffer\n });\n\n //buffer = geom.attributes['morphTarget'+frames_parsed].array\n idx = 0;\n\n while ( this._ptr < str_end ) {\n buffer[idx] = this.readF32();\n buffer[idx+1] = this.readF32();\n buffer[idx+2] = this.readF32();\n idx += 3;\n }\n\n\n subMeshParsed++;\n } else\n this._ptr = str_end;\n streamsParsed++;\n }\n }\n\n\n frames_parsed++;\n }\n this.parseUserAttributes();\n\n return null;\n }\n\n\n\n\n\n\n\n\n\n AWDLoader.prototype.getBlock = function ( id ) {\n return this._blocks[id].data;\n },\n\n\n AWDLoader.prototype.parseMatrix4 = function ( ) {\n var mtx = new THREE.Matrix4();\n var e = mtx.elements;\n\n e[0] = this.readF32();\n e[1] = this.readF32();\n e[2] = this.readF32();\n e[3] = 0.0;\n //e[3] = 0.0;\n\n e[4] = this.readF32();\n e[5] = this.readF32();\n e[6] = this.readF32();\n //e[7] = this.readF32();\n e[7] = 0.0;\n\n e[8] = this.readF32();\n e[9] = this.readF32();\n e[10] = this.readF32();\n //e[11] = this.readF32();\n e[11] = 0.0;\n\n e[12] = -this.readF32();\n e[13] = this.readF32();\n e[14] = this.readF32();\n //e[15] = this.readF32();\n e[15] = 1.0;\n return mtx;\n }\n\n\n AWDLoader.prototype.parseProperties = function ( expected ) {\n var list_len = this.readU32();\n var list_end = this._ptr + list_len;\n\n var props = new AWDProperties();\n\n if( expected ) {\n\n while( this._ptr < list_end ) {\n\n var key = this.readU16();\n var len = this.readU32();\n var type;\n\n if( expected.hasOwnProperty( key ) ) {\n type = expected[ key ];\n props.set( key, this.parseAttrValue( type, len ) );\n } else {\n this._ptr += len;\n }\n }\n\n }\n\n return props;\n\n };\n\n\n AWDLoader.prototype.parseUserAttributes = function ( ) {\n // skip for now\n this._ptr = this.readU32() + this._ptr;\n return null;\n };\n\n\n AWDLoader.prototype.parseAttrValue = function ( type, len ) {\n\n var elem_len;\n var read_func;\n\n switch (type) {\n case AWD_FIELD_INT8:\n elem_len = 1;\n read_func = this.readI8;\n break;\n case AWD_FIELD_INT16:\n elem_len = 2;\n read_func = this.readI16;\n break;\n case AWD_FIELD_INT32:\n elem_len = 4;\n read_func = this.readI32;\n break;\n case AWD_FIELD_BOOL:\n case AWD_FIELD_UINT8:\n elem_len = 1;\n read_func = this.readU8;\n break;\n case AWD_FIELD_UINT16:\n elem_len = 2;\n read_func = this.readU16;\n break;\n case AWD_FIELD_UINT32:\n case AWD_FIELD_BADDR:\n elem_len = 4;\n read_func = this.readU32;\n break;\n case AWD_FIELD_FLOAT32:\n elem_len = 4;\n read_func = this.readF32;\n break;\n case AWD_FIELD_FLOAT64:\n elem_len = 8;\n read_func = this.readF64;\n break;\n case AWD_FIELD_VECTOR2x1:\n case AWD_FIELD_VECTOR3x1:\n case AWD_FIELD_VECTOR4x1:\n case AWD_FIELD_MTX3x2:\n case AWD_FIELD_MTX3x3:\n case AWD_FIELD_MTX4x3:\n case AWD_FIELD_MTX4x4:\n elem_len = 8;\n read_func = this.readF64;\n break;\n }\n\n if (elem_len < len) {\n var list;\n var num_read;\n var num_elems;\n\n list = [];\n num_read = 0;\n num_elems = len / elem_len;\n\n while (num_read < num_elems) {\n list.push(read_func.call( this ) );\n num_read++;\n }\n\n return list;\n }\n else {\n return read_func.call( this );\n }\n\n }\n\n\n AWDLoader.prototype.readU8 = function () {\n return this._data.getUint8( this._ptr++ );\n }\n AWDLoader.prototype.readI8 = function () {\n return this._data.getInt8( this._ptr++ );\n }\n\n AWDLoader.prototype.readU16 = function () {\n var a = this._data.getUint16( this._ptr, littleEndian );\n this._ptr += 2;\n return a;\n }\n AWDLoader.prototype.readI16 = function () {\n var a = this._data.getInt16( this._ptr, littleEndian );\n this._ptr += 2;\n return a;\n }\n\n AWDLoader.prototype.readU32 = function () {\n var a = this._data.getUint32( this._ptr, littleEndian );\n this._ptr += 4;\n return a;\n }\n AWDLoader.prototype.readI32 = function () {\n var a = this._data.getInt32( this._ptr, littleEndian );\n this._ptr += 4;\n return a;\n }\n AWDLoader.prototype.readF32 = function () {\n var a = this._data.getFloat32( this._ptr, littleEndian );\n this._ptr += 4;\n return a;\n }\n AWDLoader.prototype.readF64 = function () {\n var a = this._data.getFloat64( this._ptr, littleEndian );\n this._ptr += 8;\n return a;\n }\n\n\n /**\n * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.\n * @param {Array.<number>} bytes UTF-8 byte array.\n * @return {string} 16-bit Unicode string.\n */\n AWDLoader.prototype.readUTF = function () {\n var len = this.readU16();\n\n return this.readUTFBytes( len );\n };\n\n /**\n * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.\n * @param {Array.<number>} bytes UTF-8 byte array.\n * @return {string} 16-bit Unicode string.\n */\n AWDLoader.prototype.readUTFBytes = function ( len ) {\n\n\n // TODO(user): Use native implementations if/when available\n\n var out = [], c = 0;\n\n while ( out.length < len ) {\n var c1 = this._data.getUint8( this._ptr++, littleEndian );\n if (c1 < 128) {\n out[c++] = String.fromCharCode(c1);\n } else if (c1 > 191 && c1 < 224) {\n var c2 = this._data.getUint8( this._ptr++, littleEndian );\n out[c++] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);\n } else {\n var c2 = this._data.getUint8( this._ptr++, littleEndian );\n var c3 = this._data.getUint8( this._ptr++, littleEndian );\n out[c++] = String.fromCharCode(\n (c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63\n );\n }\n }\n return out.join('');\n };\n\n\n\n\n\n\n\n\n\n AWDProperties = function(){}\n\n AWDProperties.prototype = {\n\n\n set : function(key, value)\n {\n this[key] = value;\n },\n\n get : function(key, fallback)\n {\n if ( this.hasOwnProperty(key) )\n return this[key];\n else return fallback;\n }\n }\n\n return AWDLoader;\n\n})();\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/BinaryLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/BinaryLoader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BinaryLoader = function ( showStatus ) {\n\n\tTHREE.Loader.call( this, showStatus );\n\n};\n\nTHREE.BinaryLoader.prototype = Object.create( THREE.Loader.prototype );\n\n// Load models generated by slim OBJ converter with BINARY option (converter_obj_three_slim.py -t binary)\n// - binary models consist of two files: JS and BIN\n// - parameters\n//\t\t- url (required)\n//\t\t- callback (required)\n//\t\t- texturePath (optional: if not specified, textures will be assumed to be in the same folder as JS model file)\n//\t\t- binaryPath (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)\n\nTHREE.BinaryLoader.prototype.load = function ( url, callback, texturePath, binaryPath ) {\n\n\t// todo: unify load API to for easier SceneLoader use\n\n\ttexturePath = texturePath || this.extractUrlBase( url );\n\tbinaryPath = binaryPath || this.extractUrlBase( url );\n\n\tvar callbackProgress = this.showProgress ? THREE.Loader.prototype.updateProgress : undefined;\n\n\tthis.onLoadStart();\n\n\t// #1 load JS part via web worker\n\n\tthis.loadAjaxJSON( this, url, callback, texturePath, binaryPath, callbackProgress );\n\n};\n\nTHREE.BinaryLoader.prototype.loadAjaxJSON = function ( context, url, callback, texturePath, binaryPath, callbackProgress ) {\n var func = \"THREE.BinaryLoader.loadAjaxJSON\";\n\n\ttexturePath = texturePath && ( typeof texturePath === \"string\" ) ? texturePath : this.extractUrlBase( url );\n\tbinaryPath = binaryPath && ( typeof binaryPath === \"string\" ) ? binaryPath : this.extractUrlBase( url );\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n var json = JSON.parse(res);\n context.loadAjaxBuffers(json, callback, binaryPath, texturePath, callbackProgress);\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\tvar xhr = new XMLHttpRequest();\n\n\txhr.onreadystatechange = function () {\n\n\t\tif ( xhr.readyState == 4 ) {\n\n\t\t\tif ( xhr.status == 200 || xhr.status == 0 ) {\n\n\t\t\t\tvar json = JSON.parse( xhr.responseText );\n\t\t\t\tcontext.loadAjaxBuffers( json, callback, binaryPath, texturePath, callbackProgress );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( \"THREE.BinaryLoader: Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\txhr.open( \"GET\", url, true );\n\txhr.send( null );\n\n};\n\nTHREE.BinaryLoader.prototype.loadAjaxBuffers = function ( json, callback, binaryPath, texturePath, callbackProgress ) {\n var func = \"THREE.BinaryLoader.loadAjaxBuffers\";\n\n var url = binaryPath + json.buffers;\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n this.createBinModel(res, callback, texturePath, json.materials);\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\tvar scope = this;\n\n\tvar xhr = new XMLHttpRequest(),\n\t\turl = binaryPath + json.buffers;\n\n\txhr.addEventListener( 'load', function ( event ) {\n\n\t\tvar buffer = xhr.response;\n\n\t\tif ( buffer === undefined ) {\n\n\t\t\t// IEWEBGL needs this\n\t\t\tbuffer = ( new Uint8Array( xhr.responseBody ) ).buffer;\n\n\t\t}\n\n\t\tif ( buffer.byteLength == 0 ) { // iOS and other XMLHttpRequest level 1\n\n\t\t\tvar buffer = new ArrayBuffer( xhr.responseText.length );\n\n\t\t\tvar bufView = new Uint8Array( buffer );\n\n\t\t\tfor ( var i = 0, l = xhr.responseText.length; i < l; i ++ ) {\n\n\t\t\t\tbufView[ i ] = xhr.responseText.charCodeAt( i ) & 0xff;\n\n\t\t\t}\n\n\t\t}\n\n\t\tscope.createBinModel( buffer, callback, texturePath, json.materials );\n\n\t}, false );\n\n\tif ( callbackProgress !== undefined ) {\n\n\t\txhr.addEventListener( 'progress', function ( event ) {\n\n\t\t\tif ( event.lengthComputable ) {\n\n\t\t\t\tcallbackProgress( event );\n\n\t\t\t}\n\n\t\t}, false );\n\n\t}\n\n\txhr.addEventListener( 'error', function ( event ) {\n\n\t\tconsole.error( \"THREE.BinaryLoader: Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t}, false );\n\n\n\txhr.open( \"GET\", url, true );\n\txhr.responseType = \"arraybuffer\";\n\tif ( xhr.overrideMimeType ) xhr.overrideMimeType( \"text/plain; charset=x-user-defined\" );\n\txhr.send( null );\n\n};\n\n// Binary AJAX parser\n\nTHREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texturePath, jsonMaterials ) {\n\n\tvar Model = function ( texturePath ) {\n\n\t\tvar scope = this,\n\t\t\tcurrentOffset = 0,\n\t\t\tmd,\n\t\t\tnormals = [],\n\t\t\tuvs = [],\n\t\t\tstart_tri_flat, start_tri_smooth, start_tri_flat_uv, start_tri_smooth_uv,\n\t\t\tstart_quad_flat, start_quad_smooth, start_quad_flat_uv, start_quad_smooth_uv,\n\t\t\ttri_size, quad_size,\n\t\t\tlen_tri_flat, len_tri_smooth, len_tri_flat_uv, len_tri_smooth_uv,\n\t\t\tlen_quad_flat, len_quad_smooth, len_quad_flat_uv, len_quad_smooth_uv;\n\n\n\t\tTHREE.Geometry.call( this );\n\n\t\tmd = parseMetaData( data, currentOffset );\n\n\t\tcurrentOffset += md.header_bytes;\n/*\n\t\tmd.vertex_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n\t\tmd.material_index_bytes = Uint16Array.BYTES_PER_ELEMENT;\n\t\tmd.normal_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n\t\tmd.uv_index_bytes = Uint32Array.BYTES_PER_ELEMENT;\n*/\n\t\t// buffers sizes\n\n\t\ttri_size = md.vertex_index_bytes * 3 + md.material_index_bytes;\n\t\tquad_size = md.vertex_index_bytes * 4 + md.material_index_bytes;\n\n\t\tlen_tri_flat = md.ntri_flat * ( tri_size );\n\t\tlen_tri_smooth = md.ntri_smooth * ( tri_size + md.normal_index_bytes * 3 );\n\t\tlen_tri_flat_uv = md.ntri_flat_uv * ( tri_size + md.uv_index_bytes * 3 );\n\t\tlen_tri_smooth_uv = md.ntri_smooth_uv * ( tri_size + md.normal_index_bytes * 3 + md.uv_index_bytes * 3 );\n\n\t\tlen_quad_flat = md.nquad_flat * ( quad_size );\n\t\tlen_quad_smooth = md.nquad_smooth * ( quad_size + md.normal_index_bytes * 4 );\n\t\tlen_quad_flat_uv = md.nquad_flat_uv * ( quad_size + md.uv_index_bytes * 4 );\n\t\tlen_quad_smooth_uv = md.nquad_smooth_uv * ( quad_size + md.normal_index_bytes * 4 + md.uv_index_bytes * 4 );\n\n\t\t// read buffers\n\n\t\tcurrentOffset += init_vertices( currentOffset );\n\n\t\tcurrentOffset += init_normals( currentOffset );\n\t\tcurrentOffset += handlePadding( md.nnormals * 3 );\n\n\t\tcurrentOffset += init_uvs( currentOffset );\n\n\t\tstart_tri_flat \t\t= currentOffset;\n\t\tstart_tri_smooth = start_tri_flat + len_tri_flat + handlePadding( md.ntri_flat * 2 );\n\t\tstart_tri_flat_uv = start_tri_smooth + len_tri_smooth + handlePadding( md.ntri_smooth * 2 );\n\t\tstart_tri_smooth_uv = start_tri_flat_uv + len_tri_flat_uv + handlePadding( md.ntri_flat_uv * 2 );\n\n\t\tstart_quad_flat = start_tri_smooth_uv + len_tri_smooth_uv + handlePadding( md.ntri_smooth_uv * 2 );\n\t\tstart_quad_smooth = start_quad_flat + len_quad_flat\t + handlePadding( md.nquad_flat * 2 );\n\t\tstart_quad_flat_uv = start_quad_smooth + len_quad_smooth + handlePadding( md.nquad_smooth * 2 );\n\t\tstart_quad_smooth_uv= start_quad_flat_uv + len_quad_flat_uv + handlePadding( md.nquad_flat_uv * 2 );\n\n\t\t// have to first process faces with uvs\n\t\t// so that face and uv indices match\n\n\t\tinit_triangles_flat_uv( start_tri_flat_uv );\n\t\tinit_triangles_smooth_uv( start_tri_smooth_uv );\n\n\t\tinit_quads_flat_uv( start_quad_flat_uv );\n\t\tinit_quads_smooth_uv( start_quad_smooth_uv );\n\n\t\t// now we can process untextured faces\n\n\t\tinit_triangles_flat( start_tri_flat );\n\t\tinit_triangles_smooth( start_tri_smooth );\n\n\t\tinit_quads_flat( start_quad_flat );\n\t\tinit_quads_smooth( start_quad_smooth );\n\n\t\tthis.computeFaceNormals();\n\n\t\tfunction handlePadding( n ) {\n\n\t\t\treturn ( n % 4 ) ? ( 4 - n % 4 ) : 0;\n\n\t\t};\n\n\t\tfunction parseMetaData( data, offset ) {\n\n\t\t\tvar metaData = {\n\n\t\t\t\t'signature' :parseString( data, offset, 12 ),\n\t\t\t\t'header_bytes' :parseUChar8( data, offset + 12 ),\n\n\t\t\t\t'vertex_coordinate_bytes' :parseUChar8( data, offset + 13 ),\n\t\t\t\t'normal_coordinate_bytes' :parseUChar8( data, offset + 14 ),\n\t\t\t\t'uv_coordinate_bytes' :parseUChar8( data, offset + 15 ),\n\n\t\t\t\t'vertex_index_bytes' :parseUChar8( data, offset + 16 ),\n\t\t\t\t'normal_index_bytes' :parseUChar8( data, offset + 17 ),\n\t\t\t\t'uv_index_bytes' :parseUChar8( data, offset + 18 ),\n\t\t\t\t'material_index_bytes' :parseUChar8( data, offset + 19 ),\n\n\t\t\t\t'nvertices' :parseUInt32( data, offset + 20 ),\n\t\t\t\t'nnormals' :parseUInt32( data, offset + 20 + 4*1 ),\n\t\t\t\t'nuvs' :parseUInt32( data, offset + 20 + 4*2 ),\n\n\t\t\t\t'ntri_flat' :parseUInt32( data, offset + 20 + 4*3 ),\n\t\t\t\t'ntri_smooth' :parseUInt32( data, offset + 20 + 4*4 ),\n\t\t\t\t'ntri_flat_uv' :parseUInt32( data, offset + 20 + 4*5 ),\n\t\t\t\t'ntri_smooth_uv' :parseUInt32( data, offset + 20 + 4*6 ),\n\n\t\t\t\t'nquad_flat' :parseUInt32( data, offset + 20 + 4*7 ),\n\t\t\t\t'nquad_smooth' :parseUInt32( data, offset + 20 + 4*8 ),\n\t\t\t\t'nquad_flat_uv' :parseUInt32( data, offset + 20 + 4*9 ),\n\t\t\t\t'nquad_smooth_uv' :parseUInt32( data, offset + 20 + 4*10 )\n\n\t\t\t};\n/*\n\t\t\tconsole.log( \"signature: \" + metaData.signature );\n\n\t\t\tconsole.log( \"header_bytes: \" + metaData.header_bytes );\n\t\t\tconsole.log( \"vertex_coordinate_bytes: \" + metaData.vertex_coordinate_bytes );\n\t\t\tconsole.log( \"normal_coordinate_bytes: \" + metaData.normal_coordinate_bytes );\n\t\t\tconsole.log( \"uv_coordinate_bytes: \" + metaData.uv_coordinate_bytes );\n\n\t\t\tconsole.log( \"vertex_index_bytes: \" + metaData.vertex_index_bytes );\n\t\t\tconsole.log( \"normal_index_bytes: \" + metaData.normal_index_bytes );\n\t\t\tconsole.log( \"uv_index_bytes: \" + metaData.uv_index_bytes );\n\t\t\tconsole.log( \"material_index_bytes: \" + metaData.material_index_bytes );\n\n\t\t\tconsole.log( \"nvertices: \" + metaData.nvertices );\n\t\t\tconsole.log( \"nnormals: \" + metaData.nnormals );\n\t\t\tconsole.log( \"nuvs: \" + metaData.nuvs );\n\n\t\t\tconsole.log( \"ntri_flat: \" + metaData.ntri_flat );\n\t\t\tconsole.log( \"ntri_smooth: \" + metaData.ntri_smooth );\n\t\t\tconsole.log( \"ntri_flat_uv: \" + metaData.ntri_flat_uv );\n\t\t\tconsole.log( \"ntri_smooth_uv: \" + metaData.ntri_smooth_uv );\n\n\t\t\tconsole.log( \"nquad_flat: \" + metaData.nquad_flat );\n\t\t\tconsole.log( \"nquad_smooth: \" + metaData.nquad_smooth );\n\t\t\tconsole.log( \"nquad_flat_uv: \" + metaData.nquad_flat_uv );\n\t\t\tconsole.log( \"nquad_smooth_uv: \" + metaData.nquad_smooth_uv );\n\n\t\t\tvar total = metaData.header_bytes\n\t\t\t\t\t + metaData.nvertices * metaData.vertex_coordinate_bytes * 3\n\t\t\t\t\t + metaData.nnormals * metaData.normal_coordinate_bytes * 3\n\t\t\t\t\t + metaData.nuvs * metaData.uv_coordinate_bytes * 2\n\t\t\t\t\t + metaData.ntri_flat * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes )\n\t\t\t\t\t + metaData.ntri_smooth * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 )\n\t\t\t\t\t + metaData.ntri_flat_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.uv_index_bytes*3 )\n\t\t\t\t\t + metaData.ntri_smooth_uv * ( metaData.vertex_index_bytes*3 + metaData.material_index_bytes + metaData.normal_index_bytes*3 + metaData.uv_index_bytes*3 )\n\t\t\t\t\t + metaData.nquad_flat * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes )\n\t\t\t\t\t + metaData.nquad_smooth * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 )\n\t\t\t\t\t + metaData.nquad_flat_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.uv_index_bytes*4 )\n\t\t\t\t\t + metaData.nquad_smooth_uv * ( metaData.vertex_index_bytes*4 + metaData.material_index_bytes + metaData.normal_index_bytes*4 + metaData.uv_index_bytes*4 );\n\t\t\tconsole.log( \"total bytes: \" + total );\n*/\n\n\t\t\treturn metaData;\n\n\t\t};\n\n\t\tfunction parseString( data, offset, length ) {\n\n\t\t\tvar charArray = new Uint8Array( data, offset, length );\n\n\t\t\tvar text = \"\";\n\n\t\t\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\t\t\ttext += String.fromCharCode( charArray[ offset + i ] );\n\n\t\t\t}\n\n\t\t\treturn text;\n\n\t\t};\n\n\t\tfunction parseUChar8( data, offset ) {\n\n\t\t\tvar charArray = new Uint8Array( data, offset, 1 );\n\n\t\t\treturn charArray[ 0 ];\n\n\t\t};\n\n\t\tfunction parseUInt32( data, offset ) {\n\n\t\t\tvar intArray = new Uint32Array( data, offset, 1 );\n\n\t\t\treturn intArray[ 0 ];\n\n\t\t};\n\n\t\tfunction init_vertices( start ) {\n\n\t\t\tvar nElements = md.nvertices;\n\n\t\t\tvar coordArray = new Float32Array( data, start, nElements * 3 );\n\n\t\t\tvar i, x, y, z;\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tx = coordArray[ i * 3 ];\n\t\t\t\ty = coordArray[ i * 3 + 1 ];\n\t\t\t\tz = coordArray[ i * 3 + 2 ];\n\n\t\t\t\tscope.vertices.push( new THREE.Vector3( x, y, z ) );\n\n\t\t\t}\n\n\t\t\treturn nElements * 3 * Float32Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_normals( start ) {\n\n\t\t\tvar nElements = md.nnormals;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar normalArray = new Int8Array( data, start, nElements * 3 );\n\n\t\t\t\tvar i, x, y, z;\n\n\t\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\t\tx = normalArray[ i * 3 ];\n\t\t\t\t\ty = normalArray[ i * 3 + 1 ];\n\t\t\t\t\tz = normalArray[ i * 3 + 2 ];\n\n\t\t\t\t\tnormals.push( x/127, y/127, z/127 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn nElements * 3 * Int8Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_uvs( start ) {\n\n\t\t\tvar nElements = md.nuvs;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar uvArray = new Float32Array( data, start, nElements * 2 );\n\n\t\t\t\tvar i, u, v;\n\n\t\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\t\tu = uvArray[ i * 2 ];\n\t\t\t\t\tv = uvArray[ i * 2 + 1 ];\n\n\t\t\t\t\tuvs.push( u, v );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn nElements * 2 * Float32Array.BYTES_PER_ELEMENT;\n\n\t\t};\n\n\t\tfunction init_uvs3( nElements, offset ) {\n\n\t\t\tvar i, uva, uvb, uvc, u1, u2, u3, v1, v2, v3;\n\n\t\t\tvar uvIndexBuffer = new Uint32Array( data, offset, 3 * nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tuva = uvIndexBuffer[ i * 3 ];\n\t\t\t\tuvb = uvIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tuvc = uvIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tu1 = uvs[ uva*2 ];\n\t\t\t\tv1 = uvs[ uva*2 + 1 ];\n\n\t\t\t\tu2 = uvs[ uvb*2 ];\n\t\t\t\tv2 = uvs[ uvb*2 + 1 ];\n\n\t\t\t\tu3 = uvs[ uvc*2 ];\n\t\t\t\tv3 = uvs[ uvc*2 + 1 ];\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u1, v1 ),\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u3, v3 )\n\t\t\t\t] );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_uvs4( nElements, offset ) {\n\n\t\t\tvar i, uva, uvb, uvc, uvd, u1, u2, u3, u4, v1, v2, v3, v4;\n\n\t\t\tvar uvIndexBuffer = new Uint32Array( data, offset, 4 * nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\tuva = uvIndexBuffer[ i * 4 ];\n\t\t\t\tuvb = uvIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tuvc = uvIndexBuffer[ i * 4 + 2 ];\n\t\t\t\tuvd = uvIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tu1 = uvs[ uva*2 ];\n\t\t\t\tv1 = uvs[ uva*2 + 1 ];\n\n\t\t\t\tu2 = uvs[ uvb*2 ];\n\t\t\t\tv2 = uvs[ uvb*2 + 1 ];\n\n\t\t\t\tu3 = uvs[ uvc*2 ];\n\t\t\t\tv3 = uvs[ uvc*2 + 1 ];\n\n\t\t\t\tu4 = uvs[ uvd*2 ];\n\t\t\t\tv4 = uvs[ uvd*2 + 1 ];\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u1, v1 ),\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u4, v4 )\n\t\t\t\t] );\n\n\t\t\t\tscope.faceVertexUvs[ 0 ].push( [\n\t\t\t\t\tnew THREE.Vector2( u2, v2 ),\n\t\t\t\t\tnew THREE.Vector2( u3, v3 ),\n\t\t\t\t\tnew THREE.Vector2( u4, v4 )\n\t\t\t\t] );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces3_flat( nElements, offsetVertices, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, m;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 3 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, c, null, null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces4_flat( nElements, offsetVertices, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, d, m;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 4 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 4 + 2 ];\n\t\t\t\td = vertexIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, d, null, null, m ) );\n\t\t\t\tscope.faces.push( new THREE.Face3( b, c, d, null, null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces3_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, m;\n\t\t\tvar na, nb, nc;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 3 * nElements );\n\t\t\tvar normalIndexBuffer = new Uint32Array( data, offsetNormals, 3 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 3 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tna = normalIndexBuffer[ i * 3 ];\n\t\t\t\tnb = normalIndexBuffer[ i * 3 + 1 ];\n\t\t\t\tnc = normalIndexBuffer[ i * 3 + 2 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tvar nax = normals[ na*3 ],\n\t\t\t\t\tnay = normals[ na*3 + 1 ],\n\t\t\t\t\tnaz = normals[ na*3 + 2 ],\n\n\t\t\t\t\tnbx = normals[ nb*3 ],\n\t\t\t\t\tnby = normals[ nb*3 + 1 ],\n\t\t\t\t\tnbz = normals[ nb*3 + 2 ],\n\n\t\t\t\t\tncx = normals[ nc*3 ],\n\t\t\t\t\tncy = normals[ nc*3 + 1 ],\n\t\t\t\t\tncz = normals[ nc*3 + 2 ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, c, [\n\t\t\t\t\tnew THREE.Vector3( nax, nay, naz ),\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ncx, ncy, ncz )\n\t\t\t\t], null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_faces4_smooth( nElements, offsetVertices, offsetNormals, offsetMaterials ) {\n\n\t\t\tvar i, a, b, c, d, m;\n\t\t\tvar na, nb, nc, nd;\n\n\t\t\tvar vertexIndexBuffer = new Uint32Array( data, offsetVertices, 4 * nElements );\n\t\t\tvar normalIndexBuffer = new Uint32Array( data, offsetNormals, 4 * nElements );\n\t\t\tvar materialIndexBuffer = new Uint16Array( data, offsetMaterials, nElements );\n\n\t\t\tfor( i = 0; i < nElements; i ++ ) {\n\n\t\t\t\ta = vertexIndexBuffer[ i * 4 ];\n\t\t\t\tb = vertexIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tc = vertexIndexBuffer[ i * 4 + 2 ];\n\t\t\t\td = vertexIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tna = normalIndexBuffer[ i * 4 ];\n\t\t\t\tnb = normalIndexBuffer[ i * 4 + 1 ];\n\t\t\t\tnc = normalIndexBuffer[ i * 4 + 2 ];\n\t\t\t\tnd = normalIndexBuffer[ i * 4 + 3 ];\n\n\t\t\t\tm = materialIndexBuffer[ i ];\n\n\t\t\t\tvar nax = normals[ na*3 ],\n\t\t\t\t\tnay = normals[ na*3 + 1 ],\n\t\t\t\t\tnaz = normals[ na*3 + 2 ],\n\n\t\t\t\t\tnbx = normals[ nb*3 ],\n\t\t\t\t\tnby = normals[ nb*3 + 1 ],\n\t\t\t\t\tnbz = normals[ nb*3 + 2 ],\n\n\t\t\t\t\tncx = normals[ nc*3 ],\n\t\t\t\t\tncy = normals[ nc*3 + 1 ],\n\t\t\t\t\tncz = normals[ nc*3 + 2 ],\n\n\t\t\t\t\tndx = normals[ nd*3 ],\n\t\t\t\t\tndy = normals[ nd*3 + 1 ],\n\t\t\t\t\tndz = normals[ nd*3 + 2 ];\n\n\t\t\t\tscope.faces.push( new THREE.Face3( a, b, d, [\n\t\t\t\t\tnew THREE.Vector3( nax, nay, naz ),\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ndx, ndy, ndz )\n\t\t\t\t], null, m ) );\n\n\t\t\t\tscope.faces.push( new THREE.Face3( b, c, d, [\n\t\t\t\t\tnew THREE.Vector3( nbx, nby, nbz ),\n\t\t\t\t\tnew THREE.Vector3( ncx, ncy, ncz ),\n\t\t\t\t\tnew THREE.Vector3( ndx, ndy, ndz )\n\t\t\t\t], null, m ) );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_flat( start ) {\n\n\t\t\tvar nElements = md.ntri_flat;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tinit_faces3_flat( nElements, start, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_flat_uv( start ) {\n\n\t\t\tvar nElements = md.ntri_flat_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_flat( nElements, start, offsetMaterials );\n\t\t\t\tinit_uvs3( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_smooth( start ) {\n\n\t\t\tvar nElements = md.ntri_smooth;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_triangles_smooth_uv( start ) {\n\n\t\t\tvar nElements = md.ntri_smooth_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 3;\n\n\t\t\t\tinit_faces3_smooth( nElements, start, offsetNormals, offsetMaterials );\n\t\t\t\tinit_uvs3( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_flat( start ) {\n\n\t\t\tvar nElements = md.nquad_flat;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetMaterials = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tinit_faces4_flat( nElements, start, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_flat_uv( start ) {\n\n\t\t\tvar nElements = md.nquad_flat_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetUvs = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_flat( nElements, start, offsetMaterials );\n\t\t\t\tinit_uvs4( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_smooth( start ) {\n\n\t\t\tvar nElements = md.nquad_smooth;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction init_quads_smooth_uv( start ) {\n\n\t\t\tvar nElements = md.nquad_smooth_uv;\n\n\t\t\tif ( nElements ) {\n\n\t\t\t\tvar offsetNormals = start + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetUvs = offsetNormals + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\t\t\t\tvar offsetMaterials = offsetUvs + nElements * Uint32Array.BYTES_PER_ELEMENT * 4;\n\n\t\t\t\tinit_faces4_smooth( nElements, start, offsetNormals, offsetMaterials );\n\t\t\t\tinit_uvs4( nElements, offsetUvs );\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tModel.prototype = Object.create( THREE.Geometry.prototype );\n\n\tvar geometry = new Model( texturePath );\n\tvar materials = this.initMaterials( jsonMaterials, texturePath );\n\n\tif ( this.needsTangents( materials ) ) geometry.computeTangents();\n\n\tcallback( geometry, materials );\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/ColladaLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/ColladaLoader.js",
"module-type": "library",
"text": "/**\n* @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com\n* @author Tony Parisi / http://www.tonyparisi.com/\n*/\n\nTHREE.ColladaLoader = function () {\n\n\tvar COLLADA = null;\n\tvar scene = null;\n\tvar daeScene;\n\n\tvar readyCallbackFunc = null;\n\n\tvar sources = {};\n\tvar images = {};\n\tvar animations = {};\n\tvar controllers = {};\n\tvar geometries = {};\n\tvar materials = {};\n\tvar effects = {};\n\tvar cameras = {};\n\tvar lights = {};\n\n\tvar animData;\n\tvar visualScenes;\n\tvar baseUrl;\n\tvar morphs;\n\tvar skins;\n\n\tvar flip_uv = true;\n\tvar preferredShading = THREE.SmoothShading;\n\n\tvar options = {\n\t\t// Force Geometry to always be centered at the local origin of the\n\t\t// containing Mesh.\n\t\tcenterGeometry: false,\n\n\t\t// Axis conversion is done for geometries, animations, and controllers.\n\t\t// If we ever pull cameras or lights out of the COLLADA file, they'll\n\t\t// need extra work.\n\t\tconvertUpAxis: false,\n\n\t\tsubdivideFaces: true,\n\n\t\tupAxis: 'Y',\n\n\t\t// For reflective or refractive materials we'll use this cubemap\n\t\tdefaultEnvMap: null\n\n\t};\n\n\tvar colladaUnit = 1.0;\n\tvar colladaUp = 'Y';\n\tvar upConversion = null;\n\n\tfunction load ( url, readyCallback, progressCallback ) {\n var func = \"THREE.ColladaLoader.load\";\n\n\t\tvar length = 0;\n\n\t\tif ( document.implementation && document.implementation.createDocument ) {\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n this._url = url;\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.byteLength = \"+res.byteLength, hack.loader, func);\n //hack.log(\"res = \"+res, hack.loader, func);\n\t\t readyCallbackFunc = readyCallback;\n\t\t var xmlParser = new DOMParser();\n\t\t var responseXML = xmlParser.parseFromString(res, \"application/xml\" );\n\t\t parse(responseXML, undefined, url);\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\t\t\tvar request = new XMLHttpRequest();\n\n\t\t\trequest.onreadystatechange = function() {\n\n\t\t\t\tif( request.readyState == 4 ) {\n\n\t\t\t\t\tif( request.status == 0 || request.status == 200 ) {\n\n\n\t\t\t\t\t\tif ( request.responseXML ) {\n\n\t\t\t\t\t\t\treadyCallbackFunc = readyCallback;\n\t\t\t\t\t\t\tparse( request.responseXML, undefined, url );\n\n\t\t\t\t\t\t} else if ( request.responseText ) {\n\n\t\t\t\t\t\t\treadyCallbackFunc = readyCallback;\n\t\t\t\t\t\t\tvar xmlParser = new DOMParser();\n\t\t\t\t\t\t\tvar responseXML = xmlParser.parseFromString( request.responseText, \"application/xml\" );\n\t\t\t\t\t\t\tparse( responseXML, undefined, url );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.error( \"ColladaLoader: Empty or non-existing file (\" + url + \")\" );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( request.readyState == 3 ) {\n\n\t\t\t\t\tif ( progressCallback ) {\n\n\t\t\t\t\t\tif ( length == 0 ) {\n\n\t\t\t\t\t\t\tlength = request.getResponseHeader( \"Content-Length\" );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprogressCallback( { total: length, loaded: request.responseText.length } );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\trequest.open( \"GET\", url, true );\n\t\t\trequest.send( null );\n\n\t\t} else {\n\n\t\t\talert( \"Don't know how to parse XML!\" );\n\n\t\t}\n\n\t}\n\n\tfunction parse( doc, callBack, url ) {\n\n\t\tCOLLADA = doc;\n\t\tcallBack = callBack || readyCallbackFunc;\n\n\t\tif ( url !== undefined ) {\n\n\t\t\tvar parts = url.split( '/' );\n\t\t\tparts.pop();\n\t\t\tbaseUrl = ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/';\n\n\t\t}\n\n\t\tparseAsset();\n\t\tsetUpConversion();\n\t\timages = parseLib( \"library_images image\", _Image, \"image\" );\n\t\tmaterials = parseLib( \"library_materials material\", Material, \"material\" );\n\t\teffects = parseLib( \"library_effects effect\", Effect, \"effect\" );\n\t\tgeometries = parseLib( \"library_geometries geometry\", Geometry, \"geometry\" );\n\t\tcameras = parseLib( \"library_cameras camera\", Camera, \"camera\" );\n\t\tlights = parseLib( \"library_lights light\", Light, \"light\" );\n\t\tcontrollers = parseLib( \"library_controllers controller\", Controller, \"controller\" );\n\t\tanimations = parseLib( \"library_animations animation\", Animation, \"animation\" );\n\t\tvisualScenes = parseLib( \"library_visual_scenes visual_scene\", VisualScene, \"visual_scene\" );\n\n\t\tmorphs = [];\n\t\tskins = [];\n\n\t\tdaeScene = parseScene();\n\t\tscene = new THREE.Object3D();\n\n\t\tfor ( var i = 0; i < daeScene.nodes.length; i ++ ) {\n\n\t\t\tscene.add( createSceneGraph( daeScene.nodes[ i ] ) );\n\n\t\t}\n\n\t\t// unit conversion\n\t\tscene.scale.multiplyScalar( colladaUnit );\n\n\t\tcreateAnimations();\n\n\t\tvar result = {\n\n\t\t\tscene: scene,\n\t\t\tmorphs: morphs,\n\t\t\tskins: skins,\n\t\t\tanimations: animData,\n\t\t\tdae: {\n\t\t\t\timages: images,\n\t\t\t\tmaterials: materials,\n\t\t\t\tcameras: cameras,\n\t\t\t\tlights: lights,\n\t\t\t\teffects: effects,\n\t\t\t\tgeometries: geometries,\n\t\t\t\tcontrollers: controllers,\n\t\t\t\tanimations: animations,\n\t\t\t\tvisualScenes: visualScenes,\n\t\t\t\tscene: daeScene\n\t\t\t}\n\n\t\t};\n\n\t\tif ( callBack ) {\n\n\t\t\tcallBack( result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction setPreferredShading ( shading ) {\n\n\t\tpreferredShading = shading;\n\n\t}\n\n\tfunction parseAsset () {\n\n\t\tvar elements = COLLADA.querySelectorAll('asset');\n\n\t\tvar element = elements[0];\n\n\t\tif ( element && element.childNodes ) {\n\n\t\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\t\tcase 'unit':\n\n\t\t\t\t\t\tvar meter = child.getAttribute( 'meter' );\n\n\t\t\t\t\t\tif ( meter ) {\n\n\t\t\t\t\t\t\tcolladaUnit = parseFloat( meter );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'up_axis':\n\n\t\t\t\t\t\tcolladaUp = child.textContent.charAt(0);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction parseLib ( q, classSpec, prefix ) {\n\n\t\tvar elements = COLLADA.querySelectorAll(q);\n\n\t\tvar lib = {};\n\n\t\tvar i = 0;\n\n\t\tvar elementsLength = elements.length;\n\n\t\tfor ( var j = 0; j < elementsLength; j ++ ) {\n\n\t\t\tvar element = elements[j];\n\t\t\tvar daeElement = ( new classSpec() ).parse( element );\n\n\t\t\tif ( !daeElement.id || daeElement.id.length == 0 ) daeElement.id = prefix + ( i ++ );\n\t\t\tlib[ daeElement.id ] = daeElement;\n\n\t\t}\n\n\t\treturn lib;\n\n\t}\n\n\tfunction parseScene() {\n\n\t\tvar sceneElement = COLLADA.querySelectorAll('scene instance_visual_scene')[0];\n\t\tif ( sceneElement ) {\n\n\t\t\tvar url = sceneElement.getAttribute( 'url' ).replace( /^#/, '' );\n\t\t\treturn visualScenes[ url.length > 0 ? url : 'visual_scene0' ];\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}\n\n\tfunction createAnimations() {\n\n\t\tanimData = [];\n\n\t\t// fill in the keys\n\t\trecurseHierarchy( scene );\n\n\t}\n\n\tfunction recurseHierarchy( node ) {\n\n\t\tvar n = daeScene.getChildById( node.id, true ),\n\t\t\tnewData = null;\n\n\t\tif ( n && n.keys ) {\n\n\t\t\tnewData = {\n\t\t\t\tfps: 60,\n\t\t\t\thierarchy: [ {\n\t\t\t\t\tnode: n,\n\t\t\t\t\tkeys: n.keys,\n\t\t\t\t\tsids: n.sids\n\t\t\t\t} ],\n\t\t\t\tnode: node,\n\t\t\t\tname: 'animation_' + node.name,\n\t\t\t\tlength: 0\n\t\t\t};\n\n\t\t\tanimData.push(newData);\n\n\t\t\tfor ( var i = 0, il = n.keys.length; i < il; i++ ) {\n\n\t\t\t\tnewData.length = Math.max( newData.length, n.keys[i].time );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tnewData = {\n\t\t\t\thierarchy: [ {\n\t\t\t\t\tkeys: [],\n\t\t\t\t\tsids: []\n\t\t\t\t} ]\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, il = node.children.length; i < il; i++ ) {\n\n\t\t\tvar d = recurseHierarchy( node.children[i] );\n\n\t\t\tfor ( var j = 0, jl = d.hierarchy.length; j < jl; j ++ ) {\n\n\t\t\t\tnewData.hierarchy.push( {\n\t\t\t\t\tkeys: [],\n\t\t\t\t\tsids: []\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn newData;\n\n\t}\n\n\tfunction calcAnimationBounds () {\n\n\t\tvar start = 1000000;\n\t\tvar end = -start;\n\t\tvar frames = 0;\n\t\tvar ID;\n\t\tfor ( var id in animations ) {\n\n\t\t\tvar animation = animations[ id ];\n\t\t\tID = ID || animation.id;\n\t\t\tfor ( var i = 0; i < animation.sampler.length; i ++ ) {\n\n\t\t\t\tvar sampler = animation.sampler[ i ];\n\n\t\t\t\tsampler.create();\n\n\t\t\t\tstart = Math.min( start, sampler.startTime );\n\t\t\t\tend = Math.max( end, sampler.endTime );\n\t\t\t\tframes = Math.max( frames, sampler.input.length );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { start:start, end:end, frames:frames,ID:ID };\n\n\t}\n\n\tfunction createMorph ( geometry, ctrl ) {\n\n\t\tvar morphCtrl = ctrl instanceof InstanceController ? controllers[ ctrl.url ] : ctrl;\n\n\t\tif ( !morphCtrl || !morphCtrl.morph ) {\n\n\t\t\tconsole.log(\"could not find morph controller!\");\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar morph = morphCtrl.morph;\n\n\t\tfor ( var i = 0; i < morph.targets.length; i ++ ) {\n\n\t\t\tvar target_id = morph.targets[ i ];\n\t\t\tvar daeGeometry = geometries[ target_id ];\n\n\t\t\tif ( !daeGeometry.mesh ||\n\t\t\t\t !daeGeometry.mesh.primitives ||\n\t\t\t\t !daeGeometry.mesh.primitives.length ) {\n\t\t\t\t continue;\n\t\t\t}\n\n\t\t\tvar target = daeGeometry.mesh.primitives[ 0 ].geometry;\n\n\t\t\tif ( target.vertices.length === geometry.vertices.length ) {\n\n\t\t\t\tgeometry.morphTargets.push( { name: \"target_1\", vertices: target.vertices } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.morphTargets.push( { name: \"target_Z\", vertices: geometry.vertices } );\n\n\t};\n\n\tfunction createSkin ( geometry, ctrl, applyBindShape ) {\n\n\t\tvar skinCtrl = controllers[ ctrl.url ];\n\n\t\tif ( !skinCtrl || !skinCtrl.skin ) {\n\n\t\t\tconsole.log( \"could not find skin controller!\" );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( !ctrl.skeleton || !ctrl.skeleton.length ) {\n\n\t\t\tconsole.log( \"could not find the skeleton for the skin!\" );\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar skin = skinCtrl.skin;\n\t\tvar skeleton = daeScene.getChildById( ctrl.skeleton[ 0 ] );\n\t\tvar hierarchy = [];\n\n\t\tapplyBindShape = applyBindShape !== undefined ? applyBindShape : true;\n\n\t\tvar bones = [];\n\t\tgeometry.skinWeights = [];\n\t\tgeometry.skinIndices = [];\n\n\t\t//createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 );\n\t\t//createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights );\n\n\t\t/*\n\t\tgeometry.animation = {\n\t\t\tname: 'take_001',\n\t\t\tfps: 30,\n\t\t\tlength: 2,\n\t\t\tJIT: true,\n\t\t\thierarchy: hierarchy\n\t\t};\n\t\t*/\n\n\t\tif ( applyBindShape ) {\n\n\t\t\tfor ( var i = 0; i < geometry.vertices.length; i ++ ) {\n\n\t\t\t\tgeometry.vertices[ i ].applyMatrix4( skin.bindShapeMatrix );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction setupSkeleton ( node, bones, frame, parent ) {\n\n\t\tnode.world = node.world || new THREE.Matrix4();\n\t\tnode.localworld = node.localworld || new THREE.Matrix4();\n\t\tnode.world.copy( node.matrix );\n\t\tnode.localworld.copy( node.matrix );\n\n\t\tif ( node.channels && node.channels.length ) {\n\n\t\t\tvar channel = node.channels[ 0 ];\n\t\t\tvar m = channel.sampler.output[ frame ];\n\n\t\t\tif ( m instanceof THREE.Matrix4 ) {\n\n\t\t\t\tnode.world.copy( m );\n\t\t\t\tnode.localworld.copy(m);\n\t\t\t\tif(frame == 0)\n\t\t\t\t\tnode.matrix.copy(m);\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parent ) {\n\n\t\t\tnode.world.multiplyMatrices( parent, node.world );\n\n\t\t}\n\n\t\tbones.push( node );\n\n\t\tfor ( var i = 0; i < node.nodes.length; i ++ ) {\n\n\t\t\tsetupSkeleton( node.nodes[ i ], bones, frame, node.world );\n\n\t\t}\n\n\t}\n\n\tfunction setupSkinningMatrices ( bones, skin ) {\n\n\t\t// FIXME: this is dumb...\n\n\t\tfor ( var i = 0; i < bones.length; i ++ ) {\n\n\t\t\tvar bone = bones[ i ];\n\t\t\tvar found = -1;\n\n\t\t\tif ( bone.type != 'JOINT' ) continue;\n\n\t\t\tfor ( var j = 0; j < skin.joints.length; j ++ ) {\n\n\t\t\t\tif ( bone.sid == skin.joints[ j ] ) {\n\n\t\t\t\t\tfound = j;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( found >= 0 ) {\n\n\t\t\t\tvar inv = skin.invBindMatrices[ found ];\n\n\t\t\t\tbone.invBindMatrix = inv;\n\t\t\t\tbone.skinningMatrix = new THREE.Matrix4();\n\t\t\t\tbone.skinningMatrix.multiplyMatrices(bone.world, inv); // (IBMi * JMi)\n\t\t\t\tbone.animatrix = new THREE.Matrix4();\n\n\t\t\t\tbone.animatrix.copy(bone.localworld);\n\t\t\t\tbone.weights = [];\n\n\t\t\t\tfor ( var j = 0; j < skin.weights.length; j ++ ) {\n\n\t\t\t\t\tfor (var k = 0; k < skin.weights[ j ].length; k ++ ) {\n\n\t\t\t\t\t\tvar w = skin.weights[ j ][ k ];\n\n\t\t\t\t\t\tif ( w.joint == found ) {\n\n\t\t\t\t\t\t\tbone.weights.push( w );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( \"ColladaLoader: Could not find joint '\" + bone.sid + \"'.\" );\n\n\t\t\t\tbone.skinningMatrix = new THREE.Matrix4();\n\t\t\t\tbone.weights = [];\n\n\t\t\t}\n\t\t}\n\n\t}\n\n\t//Walk the Collada tree and flatten the bones into a list, extract the position, quat and scale from the matrix\n\tfunction flattenSkeleton(skeleton) {\n\n\t\tvar list = [];\n\t\tvar walk = function(parentid, node, list) {\n\n\t\t\tvar bone = {};\n\t\t\tbone.name = node.sid;\n\t\t\tbone.parent = parentid;\n\t\t\tbone.matrix = node.matrix;\n\t\t\tvar data = [new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3()];\n\t\t\tbone.matrix.decompose(data[0],data[1],data[2]);\n\n\t\t\tbone.pos = [data[0].x,data[0].y,data[0].z];\n\n\t\t\tbone.scl = [data[2].x,data[2].y,data[2].z];\n\t\t\tbone.rotq = [data[1].x,data[1].y,data[1].z,data[1].w];\n\t\t\tlist.push(bone);\n\n\t\t\tfor(var i in node.nodes) {\n\n\t\t\t\twalk(node.sid,node.nodes[i],list);\n\n\t\t\t}\n\n\t\t};\n\n\t\twalk(-1,skeleton,list);\n\t\treturn list;\n\n\t}\n\n\t//Move the vertices into the pose that is proper for the start of the animation\n\tfunction skinToBindPose(geometry,skeleton,skinController) {\n\n\t\tvar bones = [];\n\t\tsetupSkeleton( skeleton, bones, -1 );\n\t\tsetupSkinningMatrices( bones, skinController.skin );\n\t\tv = new THREE.Vector3();\n\t\tvar skinned = [];\n\n\t\tfor(var i =0; i < geometry.vertices.length; i++) {\n\n\t\t\tskinned.push(new THREE.Vector3());\n\n\t\t}\n\n\t\tfor ( i = 0; i < bones.length; i ++ ) {\n\n\t\t\tif ( bones[ i ].type != 'JOINT' ) continue;\n\n\t\t\tfor ( j = 0; j < bones[ i ].weights.length; j ++ ) {\n\n\t\t\t\tw = bones[ i ].weights[ j ];\n\t\t\t\tvidx = w.index;\n\t\t\t\tweight = w.weight;\n\n\t\t\t\to = geometry.vertices[vidx];\n\t\t\t\ts = skinned[vidx];\n\n\t\t\t\tv.x = o.x;\n\t\t\t\tv.y = o.y;\n\t\t\t\tv.z = o.z;\n\n\t\t\t\tv.applyMatrix4( bones[i].skinningMatrix );\n\n\t\t\t\ts.x += (v.x * weight);\n\t\t\t\ts.y += (v.y * weight);\n\t\t\t\ts.z += (v.z * weight);\n\t\t\t}\n\n\t\t}\n\n\t\tfor(var i =0; i < geometry.vertices.length; i++) {\n\n\t\t\tgeometry.vertices[i] = skinned[i];\n\n\t\t}\n\n\t}\n\n\tfunction applySkin ( geometry, instanceCtrl, frame ) {\n\n\t\tvar skinController = controllers[ instanceCtrl.url ];\n\n\t\tframe = frame !== undefined ? frame : 40;\n\n\t\tif ( !skinController || !skinController.skin ) {\n\n\t\t\tconsole.log( 'ColladaLoader: Could not find skin controller.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( !instanceCtrl.skeleton || !instanceCtrl.skeleton.length ) {\n\n\t\t\tconsole.log( 'ColladaLoader: Could not find the skeleton for the skin. ' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tvar animationBounds = calcAnimationBounds();\n\t\tvar skeleton = daeScene.getChildById( instanceCtrl.skeleton[0], true ) ||\n\t\t\t\t\t daeScene.getChildBySid( instanceCtrl.skeleton[0], true );\n\n\t\t//flatten the skeleton into a list of bones\n\t\tvar bonelist = flattenSkeleton(skeleton);\n\t\tvar joints = skinController.skin.joints;\n\n\t\t//sort that list so that the order reflects the order in the joint list\n\t\tvar sortedbones = [];\n\t\tfor(var i = 0; i < joints.length; i++) {\n\n\t\t\tfor(var j =0; j < bonelist.length; j++) {\n\n\t\t\t\tif(bonelist[j].name == joints[i]) {\n\n\t\t\t\t\tsortedbones[i] = bonelist[j];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//hook up the parents by index instead of name\n\t\tfor(var i = 0; i < sortedbones.length; i++) {\n\n\t\t\tfor(var j =0; j < sortedbones.length; j++) {\n\n\t\t\t\tif(sortedbones[i].parent == sortedbones[j].name) {\n\n\t\t\t\t\tsortedbones[i].parent = j;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tvar i, j, w, vidx, weight;\n\t\tvar v = new THREE.Vector3(), o, s;\n\n\t\t// move vertices to bind shape\n\t\tfor ( i = 0; i < geometry.vertices.length; i ++ ) {\n\t\t\t\t\tgeometry.vertices[i].applyMatrix4( skinController.skin.bindShapeMatrix );\n\t\t}\n\n\t\tvar skinIndices = [];\n\t\tvar skinWeights = [];\n\t\tvar weights = skinController.skin.weights;\n\n\t\t//hook up the skin weights\n\t\t// TODO - this might be a good place to choose greatest 4 weights\n\t\tfor(var i =0; i < weights.length; i++) {\n\n\t\t\tvar indicies = new THREE.Vector4(weights[i][0]?weights[i][0].joint:0,weights[i][1]?weights[i][1].joint:0,weights[i][2]?weights[i][2].joint:0,weights[i][3]?weights[i][3].joint:0);\n\t\t\tvar weight = new THREE.Vector4(weights[i][0]?weights[i][0].weight:0,weights[i][1]?weights[i][1].weight:0,weights[i][2]?weights[i][2].weight:0,weights[i][3]?weights[i][3].weight:0);\n\n\t\t\tskinIndices.push(indicies);\n\t\t\tskinWeights.push(weight);\n\n\t\t}\n\n\t\tgeometry.skinIndices = skinIndices;\n\t\tgeometry.skinWeights = skinWeights;\n\t\tgeometry.bones = sortedbones;\n\t\t// process animation, or simply pose the rig if no animation\n\n\t\t//create an animation for the animated bones\n\t\t//NOTE: this has no effect when using morphtargets\n\t\tvar animationdata = {\"name\":animationBounds.ID,\"fps\":30,\"length\":animationBounds.frames/30,\"hierarchy\":[]};\n\n\t\tfor(var j =0; j < sortedbones.length; j++) {\n\n\t\t\tanimationdata.hierarchy.push({parent:sortedbones[j].parent, name:sortedbones[j].name, keys:[]});\n\n\t\t}\n\n\t\tconsole.log( 'ColladaLoader:', animationBounds.ID + ' has ' + sortedbones.length + ' bones.' );\n\n\n\n\t\tskinToBindPose(geometry,skeleton,skinController);\n\n\n\t\tfor ( frame = 0; frame < animationBounds.frames; frame ++ ) {\n\n\t\t\tvar bones = [];\n\t\t\tvar skinned = [];\n\t\t\t// process the frame and setup the rig with a fresh\n\t\t\t// transform, possibly from the bone's animation channel(s)\n\n\t\t\tsetupSkeleton( skeleton, bones, frame );\n\t\t\tsetupSkinningMatrices( bones, skinController.skin );\n\n\t\t\tfor(var i = 0; i < bones.length; i ++) {\n\n\t\t\t\tfor(var j = 0; j < animationdata.hierarchy.length; j ++) {\n\n\t\t\t\t\tif(animationdata.hierarchy[j].name == bones[i].sid) {\n\n\t\t\t\t\t\tvar key = {};\n\t\t\t\t\t\tkey.time = (frame/30);\n\t\t\t\t\t\tkey.matrix = bones[i].animatrix;\n\n\t\t\t\t\t\tif(frame == 0)\n\t\t\t\t\t\t\tbones[i].matrix = key.matrix;\n\n\t\t\t\t\t\tvar data = [new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3()];\n\t\t\t\t\t\tkey.matrix.decompose(data[0],data[1],data[2]);\n\n\t\t\t\t\t\tkey.pos = [data[0].x,data[0].y,data[0].z];\n\n\t\t\t\t\t\tkey.scl = [data[2].x,data[2].y,data[2].z];\n\t\t\t\t\t\tkey.rot = data[1];\n\n\t\t\t\t\t\tanimationdata.hierarchy[j].keys.push(key);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tgeometry.animation = animationdata;\n\n\t\t}\n\n\t};\n\n\tfunction createSceneGraph ( node, parent ) {\n\n\t\tvar obj = new THREE.Object3D();\n\t\tvar skinned = false;\n\t\tvar skinController;\n\t\tvar morphController;\n\t\tvar i, j;\n\n\t\t// FIXME: controllers\n\n\t\tfor ( i = 0; i < node.controllers.length; i ++ ) {\n\n\t\t\tvar controller = controllers[ node.controllers[ i ].url ];\n\n\t\t\tswitch ( controller.type ) {\n\n\t\t\t\tcase 'skin':\n\n\t\t\t\t\tif ( geometries[ controller.skin.source ] ) {\n\n\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\tinst_geom.url = controller.skin.source;\n\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\t\t\t\t\t\tskinned = true;\n\t\t\t\t\t\tskinController = node.controllers[ i ];\n\n\t\t\t\t\t} else if ( controllers[ controller.skin.source ] ) {\n\n\t\t\t\t\t\t// urgh: controller can be chained\n\t\t\t\t\t\t// handle the most basic case...\n\n\t\t\t\t\t\tvar second = controllers[ controller.skin.source ];\n\t\t\t\t\t\tmorphController = second;\n\t\t\t\t\t//\tskinController = node.controllers[i];\n\n\t\t\t\t\t\tif ( second.morph && geometries[ second.morph.source ] ) {\n\n\t\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\t\tinst_geom.url = second.morph.source;\n\t\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'morph':\n\n\t\t\t\t\tif ( geometries[ controller.morph.source ] ) {\n\n\t\t\t\t\t\tvar inst_geom = new InstanceGeometry();\n\n\t\t\t\t\t\tinst_geom.url = controller.morph.source;\n\t\t\t\t\t\tinst_geom.instance_material = node.controllers[ i ].instance_material;\n\n\t\t\t\t\t\tnode.geometries.push( inst_geom );\n\t\t\t\t\t\tmorphController = node.controllers[ i ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.log( 'ColladaLoader: Morph-controller partially supported.' );\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// geometries\n\n\t\tvar double_sided_materials = {};\n\n\t\tfor ( i = 0; i < node.geometries.length; i ++ ) {\n\n\t\t\tvar instance_geometry = node.geometries[i];\n\t\t\tvar instance_materials = instance_geometry.instance_material;\n\t\t\tvar geometry = geometries[ instance_geometry.url ];\n\t\t\tvar used_materials = {};\n\t\t\tvar used_materials_array = [];\n\t\t\tvar num_materials = 0;\n\t\t\tvar first_material;\n\n\t\t\tif ( geometry ) {\n\n\t\t\t\tif ( !geometry.mesh || !geometry.mesh.primitives )\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif ( obj.name.length == 0 ) {\n\n\t\t\t\t\tobj.name = geometry.id;\n\n\t\t\t\t}\n\n\t\t\t\t// collect used fx for this geometry-instance\n\n\t\t\t\tif ( instance_materials ) {\n\n\t\t\t\t\tfor ( j = 0; j < instance_materials.length; j ++ ) {\n\n\t\t\t\t\t\tvar instance_material = instance_materials[ j ];\n\t\t\t\t\t\tvar mat = materials[ instance_material.target ];\n\t\t\t\t\t\tvar effect_id = mat.instance_effect.url;\n\t\t\t\t\t\tvar shader = effects[ effect_id ].shader;\n\t\t\t\t\t\tvar material3js = shader.material;\n\n\t\t\t\t\t\tif ( geometry.doubleSided ) {\n\n\t\t\t\t\t\t\tif ( !( instance_material.symbol in double_sided_materials ) ) {\n\n\t\t\t\t\t\t\t\tvar _copied_material = material3js.clone();\n\t\t\t\t\t\t\t\t_copied_material.side = THREE.DoubleSide;\n\t\t\t\t\t\t\t\tdouble_sided_materials[ instance_material.symbol ] = _copied_material;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial3js = double_sided_materials[ instance_material.symbol ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterial3js.opacity = !material3js.opacity ? 1 : material3js.opacity;\n\t\t\t\t\t\tused_materials[ instance_material.symbol ] = num_materials;\n\t\t\t\t\t\tused_materials_array.push( material3js );\n\t\t\t\t\t\tfirst_material = material3js;\n\t\t\t\t\t\tfirst_material.name = mat.name == null || mat.name === '' ? mat.id : mat.name;\n\t\t\t\t\t\tnum_materials ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar mesh;\n\t\t\t\tvar material = first_material || new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.FlatShading, side: geometry.doubleSided ? THREE.DoubleSide : THREE.FrontSide } );\n\t\t\t\tvar geom = geometry.mesh.geometry3js;\n\n\t\t\t\tif ( num_materials > 1 ) {\n\n\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( used_materials_array );\n\n\t\t\t\t\tfor ( j = 0; j < geom.faces.length; j ++ ) {\n\n\t\t\t\t\t\tvar face = geom.faces[ j ];\n\t\t\t\t\t\tface.materialIndex = used_materials[ face.daeMaterial ]\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( skinController !== undefined ) {\n\n\n\t\t\t\t\tapplySkin( geom, skinController );\n\n\t\t\t\t\tif(geom.morphTargets.length > 0) {\n\n\t\t\t\t\t\tmaterial.morphTargets = true;\n\t\t\t\t\t\tmaterial.skinning = false;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmaterial.morphTargets = false;\n\t\t\t\t\t\tmaterial.skinning = true;\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tmesh = new THREE.SkinnedMesh( geom, material, false );\n\n\n\t\t\t\t\t//mesh.skeleton = skinController.skeleton;\n\t\t\t\t\t//mesh.skinController = controllers[ skinController.url ];\n\t\t\t\t\t//mesh.skinInstanceController = skinController;\n\t\t\t\t\tmesh.name = 'skin_' + skins.length;\n\n\n\n\t\t\t\t\t//mesh.animationHandle.setKey(0);\n\t\t\t\t\tskins.push( mesh );\n\n\t\t\t\t} else if ( morphController !== undefined ) {\n\n\t\t\t\t\tcreateMorph( geom, morphController );\n\n\t\t\t\t\tmaterial.morphTargets = true;\n\n\t\t\t\t\tmesh = new THREE.Mesh( geom, material );\n\t\t\t\t\tmesh.name = 'morph_' + morphs.length;\n\n\t\t\t\t\tmorphs.push( mesh );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmesh = new THREE.Mesh( geom, material );\n\t\t\t\t\t// mesh.geom.name = geometry.id;\n\n\t\t\t\t}\n\n\t\t\t\t// N.B.: TP says this is not a great default behavior. It's a nice\n\t\t\t\t// optimization to flatten the hierarchy but this should be done\n\t\t\t\t// only if requested by the user via a flag. For now I undid it\n\t\t\t\t// and fixed the character animation example that uses it\n\t\t\t\t// node.geometries.length > 1 ? obj.add( mesh ) : obj = mesh;\n\t\t\t\tobj.add(mesh);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( i = 0; i < node.cameras.length; i ++ ) {\n\n\t\t\tvar instance_camera = node.cameras[i];\n\t\t\tvar cparams = cameras[instance_camera.url];\n\n\t\t\tvar cam = new THREE.PerspectiveCamera(cparams.yfov, parseFloat(cparams.aspect_ratio),\n\t\t\t\t\tparseFloat(cparams.znear), parseFloat(cparams.zfar));\n\n\t\t\tobj.add(cam);\n\t\t}\n\n\t\tfor ( i = 0; i < node.lights.length; i ++ ) {\n\n\t\t\tvar light = null;\n\t\t\tvar instance_light = node.lights[i];\n\t\t\tvar lparams = lights[instance_light.url];\n\n\t\t\tif ( lparams && lparams.technique ) {\n\n\t\t\t\tvar color = lparams.color.getHex();\n\t\t\t\tvar intensity = lparams.intensity;\n\t\t\t\tvar distance = lparams.distance;\n\t\t\t\tvar angle = lparams.falloff_angle;\n\t\t\t\tvar exponent; // Intentionally undefined, don't know what this is yet\n\n\t\t\t\tswitch ( lparams.technique ) {\n\n\t\t\t\t\tcase 'directional':\n\n\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity, distance );\n\t\t\t\t\t\tlight.position.set(0, 0, 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'point':\n\n\t\t\t\t\t\tlight = new THREE.PointLight( color, intensity, distance );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'spot':\n\n\t\t\t\t\t\tlight = new THREE.SpotLight( color, intensity, distance, angle, exponent );\n\t\t\t\t\t\tlight.position.set(0, 0, 1);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ambient':\n\n\t\t\t\t\t\tlight = new THREE.AmbientLight( color );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (light) {\n\t\t\t\tobj.add(light);\n\t\t\t}\n\t\t}\n\n\t\tobj.name = node.name || node.id || \"\";\n\t\tobj.id = node.id || \"\";\n\t\tobj.layer = node.layer || \"\";\n\t\tobj.matrix = node.matrix;\n\t\tobj.matrix.decompose( obj.position, obj.quaternion, obj.scale );\n\n\t\tif ( options.centerGeometry && obj.geometry ) {\n\n\t\t\tvar delta = obj.geometry.center();\n\t\t\tdelta.multiply( obj.scale );\n\t\t\tdelta.applyQuaternion( obj.quaternion );\n\n\t\t\tobj.position.sub( delta );\n\n\t\t}\n\n\t\tfor ( i = 0; i < node.nodes.length; i ++ ) {\n\n\t\t\tobj.add( createSceneGraph( node.nodes[i], node ) );\n\n\t\t}\n\n\t\treturn obj;\n\n\t};\n\n\tfunction getJointId( skin, id ) {\n\n\t\tfor ( var i = 0; i < skin.joints.length; i ++ ) {\n\n\t\t\tif ( skin.joints[ i ] == id ) {\n\n\t\t\t\treturn i;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction getLibraryNode( id ) {\n\n var nodes = COLLADA.querySelectorAll('library_nodes node');\n\n for ( var i = 0; i < nodes.length; i++ ) {\n\n var attObj = nodes[i].attributes.getNamedItem('id');\n if ( attObj && attObj.value === id ) {\n return nodes[i];\n }\n }\n\n return undefined;\n\n\t};\n\n\tfunction getChannelsForNode (node ) {\n\n\t\tvar channels = [];\n\t\tvar startTime = 1000000;\n\t\tvar endTime = -1000000;\n\n\t\tfor ( var id in animations ) {\n\n\t\t\tvar animation = animations[id];\n\n\t\t\tfor ( var i = 0; i < animation.channel.length; i ++ ) {\n\n\t\t\t\tvar channel = animation.channel[i];\n\t\t\t\tvar sampler = animation.sampler[i];\n\t\t\t\tvar id = channel.target.split('/')[0];\n\n\t\t\t\tif ( id == node.id ) {\n\n\t\t\t\t\tsampler.create();\n\t\t\t\t\tchannel.sampler = sampler;\n\t\t\t\t\tstartTime = Math.min(startTime, sampler.startTime);\n\t\t\t\t\tendTime = Math.max(endTime, sampler.endTime);\n\t\t\t\t\tchannels.push(channel);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( channels.length ) {\n\n\t\t\tnode.startTime = startTime;\n\t\t\tnode.endTime = endTime;\n\n\t\t}\n\n\t\treturn channels;\n\n\t};\n\n\tfunction calcFrameDuration( node ) {\n\n\t\tvar minT = 10000000;\n\n\t\tfor ( var i = 0; i < node.channels.length; i ++ ) {\n\n\t\t\tvar sampler = node.channels[i].sampler;\n\n\t\t\tfor ( var j = 0; j < sampler.input.length - 1; j ++ ) {\n\n\t\t\t\tvar t0 = sampler.input[ j ];\n\t\t\t\tvar t1 = sampler.input[ j + 1 ];\n\t\t\t\tminT = Math.min( minT, t1 - t0 );\n\n\t\t\t}\n\t\t}\n\n\t\treturn minT;\n\n\t};\n\n\tfunction calcMatrixAt( node, t ) {\n\n\t\tvar animated = {};\n\n\t\tvar i, j;\n\n\t\tfor ( i = 0; i < node.channels.length; i ++ ) {\n\n\t\t\tvar channel = node.channels[ i ];\n\t\t\tanimated[ channel.sid ] = channel;\n\n\t\t}\n\n\t\tvar matrix = new THREE.Matrix4();\n\n\t\tfor ( i = 0; i < node.transforms.length; i ++ ) {\n\n\t\t\tvar transform = node.transforms[ i ];\n\t\t\tvar channel = animated[ transform.sid ];\n\n\t\t\tif ( channel !== undefined ) {\n\n\t\t\t\tvar sampler = channel.sampler;\n\t\t\t\tvar value;\n\n\t\t\t\tfor ( j = 0; j < sampler.input.length - 1; j ++ ) {\n\n\t\t\t\t\tif ( sampler.input[ j + 1 ] > t ) {\n\n\t\t\t\t\t\tvalue = sampler.output[ j ];\n\t\t\t\t\t\t//console.log(value.flatten)\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\tif ( value instanceof THREE.Matrix4 ) {\n\n\t\t\t\t\t\tmatrix.multiplyMatrices( matrix, value );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// FIXME: handle other types\n\n\t\t\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tmatrix.multiplyMatrices( matrix, transform.matrix );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn matrix;\n\n\t};\n\n\tfunction bakeAnimations ( node ) {\n\n\t\tif ( node.channels && node.channels.length ) {\n\n\t\t\tvar keys = [],\n\t\t\t\tsids = [];\n\n\t\t\tfor ( var i = 0, il = node.channels.length; i < il; i++ ) {\n\n\t\t\t\tvar channel = node.channels[i],\n\t\t\t\t\tfullSid = channel.fullSid,\n\t\t\t\t\tsampler = channel.sampler,\n\t\t\t\t\tinput = sampler.input,\n\t\t\t\t\ttransform = node.getTransformBySid( channel.sid ),\n\t\t\t\t\tmember;\n\n\t\t\t\tif ( channel.arrIndices ) {\n\n\t\t\t\t\tmember = [];\n\n\t\t\t\t\tfor ( var j = 0, jl = channel.arrIndices.length; j < jl; j++ ) {\n\n\t\t\t\t\t\tmember[ j ] = getConvertedIndex( channel.arrIndices[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmember = getConvertedMember( channel.member );\n\n\t\t\t\t}\n\n\t\t\t\tif ( transform ) {\n\n\t\t\t\t\tif ( sids.indexOf( fullSid ) === -1 ) {\n\n\t\t\t\t\t\tsids.push( fullSid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var j = 0, jl = input.length; j < jl; j++ ) {\n\n\t\t\t\t\t\tvar time = input[j],\n\t\t\t\t\t\t\tdata = sampler.getData( transform.type, j, member ),\n\t\t\t\t\t\t\tkey = findKey( keys, time );\n\n\t\t\t\t\t\tif ( !key ) {\n\n\t\t\t\t\t\t\tkey = new Key( time );\n\t\t\t\t\t\t\tvar timeNdx = findTimeNdx( keys, time );\n\t\t\t\t\t\t\tkeys.splice( timeNdx == -1 ? keys.length : timeNdx, 0, key );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tkey.addTarget( fullSid, transform, member, data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log( 'Could not find transform \"' + channel.sid + '\" in node ' + node.id );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// post process\n\t\t\tfor ( var i = 0; i < sids.length; i++ ) {\n\n\t\t\t\tvar sid = sids[ i ];\n\n\t\t\t\tfor ( var j = 0; j < keys.length; j++ ) {\n\n\t\t\t\t\tvar key = keys[ j ];\n\n\t\t\t\t\tif ( !key.hasTarget( sid ) ) {\n\n\t\t\t\t\t\tinterpolateKeys( keys, key, j, sid );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tnode.keys = keys;\n\t\t\tnode.sids = sids;\n\n\t\t}\n\n\t};\n\n\tfunction findKey ( keys, time) {\n\n\t\tvar retVal = null;\n\n\t\tfor ( var i = 0, il = keys.length; i < il && retVal == null; i++ ) {\n\n\t\t\tvar key = keys[i];\n\n\t\t\tif ( key.time === time ) {\n\n\t\t\t\tretVal = key;\n\n\t\t\t} else if ( key.time > time ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn retVal;\n\n\t};\n\n\tfunction findTimeNdx ( keys, time) {\n\n\t\tvar ndx = -1;\n\n\t\tfor ( var i = 0, il = keys.length; i < il && ndx == -1; i++ ) {\n\n\t\t\tvar key = keys[i];\n\n\t\t\tif ( key.time >= time ) {\n\n\t\t\t\tndx = i;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn ndx;\n\n\t};\n\n\tfunction interpolateKeys ( keys, key, ndx, fullSid ) {\n\n\t\tvar prevKey = getPrevKeyWith( keys, fullSid, ndx ? ndx-1 : 0 ),\n\t\t\tnextKey = getNextKeyWith( keys, fullSid, ndx+1 );\n\n\t\tif ( prevKey && nextKey ) {\n\n\t\t\tvar scale = (key.time - prevKey.time) / (nextKey.time - prevKey.time),\n\t\t\t\tprevTarget = prevKey.getTarget( fullSid ),\n\t\t\t\tnextData = nextKey.getTarget( fullSid ).data,\n\t\t\t\tprevData = prevTarget.data,\n\t\t\t\tdata;\n\n\t\t\tif ( prevTarget.type === 'matrix' ) {\n\n\t\t\t\tdata = prevData;\n\n\t\t\t} else if ( prevData.length ) {\n\n\t\t\t\tdata = [];\n\n\t\t\t\tfor ( var i = 0; i < prevData.length; ++i ) {\n\n\t\t\t\t\tdata[ i ] = prevData[ i ] + ( nextData[ i ] - prevData[ i ] ) * scale;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdata = prevData + ( nextData - prevData ) * scale;\n\n\t\t\t}\n\n\t\t\tkey.addTarget( fullSid, prevTarget.transform, prevTarget.member, data );\n\n\t\t}\n\n\t};\n\n\t// Get next key with given sid\n\n\tfunction getNextKeyWith( keys, fullSid, ndx ) {\n\n\t\tfor ( ; ndx < keys.length; ndx++ ) {\n\n\t\t\tvar key = keys[ ndx ];\n\n\t\t\tif ( key.hasTarget( fullSid ) ) {\n\n\t\t\t\treturn key;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\t// Get previous key with given sid\n\n\tfunction getPrevKeyWith( keys, fullSid, ndx ) {\n\n\t\tndx = ndx >= 0 ? ndx : ndx + keys.length;\n\n\t\tfor ( ; ndx >= 0; ndx-- ) {\n\n\t\t\tvar key = keys[ ndx ];\n\n\t\t\tif ( key.hasTarget( fullSid ) ) {\n\n\t\t\t\treturn key;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tfunction _Image() {\n\n\t\tthis.id = \"\";\n\t\tthis.init_from = \"\";\n\n\t};\n\n\t_Image.prototype.parse = function(element) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeName == 'init_from' ) {\n\n\t\t\t\tthis.init_from = child.textContent;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Controller() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.type = \"\";\n\t\tthis.skin = null;\n\t\tthis.morph = null;\n\n\t};\n\n\tController.prototype.parse = function( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\t\tthis.name = element.getAttribute('name');\n\t\tthis.type = \"none\";\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'skin':\n\n\t\t\t\t\tthis.skin = (new Skin()).parse(child);\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'morph':\n\n\t\t\t\t\tthis.morph = (new Morph()).parse(child);\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Morph() {\n\n\t\tthis.method = null;\n\t\tthis.source = null;\n\t\tthis.targets = null;\n\t\tthis.weights = null;\n\n\t};\n\n\tMorph.prototype.parse = function( element ) {\n\n\t\tvar sources = {};\n\t\tvar inputs = [];\n\t\tvar i;\n\n\t\tthis.method = element.getAttribute( 'method' );\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\n\t\tfor ( i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar source = ( new Source() ).parse( child );\n\t\t\t\t\tsources[ source.id ] = source;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'targets':\n\n\t\t\t\t\tinputs = this.parseInputs( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( i = 0; i < inputs.length; i ++ ) {\n\n\t\t\tvar input = inputs[ i ];\n\t\t\tvar source = sources[ input.source ];\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'MORPH_TARGET':\n\n\t\t\t\t\tthis.targets = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'MORPH_WEIGHT':\n\n\t\t\t\t\tthis.weights = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tMorph.prototype.parseInputs = function(element) {\n\n\t\tvar inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tinputs.push( (new Input()).parse(child) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn inputs;\n\n\t};\n\n\tfunction Skin() {\n\n\t\tthis.source = \"\";\n\t\tthis.bindShapeMatrix = null;\n\t\tthis.invBindMatrices = [];\n\t\tthis.joints = [];\n\t\tthis.weights = [];\n\n\t};\n\n\tSkin.prototype.parse = function( element ) {\n\n\t\tvar sources = {};\n\t\tvar joints, weights;\n\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\t\tthis.invBindMatrices = [];\n\t\tthis.joints = [];\n\t\tthis.weights = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bind_shape_matrix':\n\n\t\t\t\t\tvar f = _floats(child.textContent);\n\t\t\t\t\tthis.bindShapeMatrix = getConvertedMat4( f );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar src = new Source().parse(child);\n\t\t\t\t\tsources[ src.id ] = src;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'joints':\n\n\t\t\t\t\tjoints = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vertex_weights':\n\n\t\t\t\t\tweights = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\tthis.parseJoints( joints, sources );\n\t\tthis.parseWeights( weights, sources );\n\n\t\treturn this;\n\n\t};\n\n\tSkin.prototype.parseJoints = function ( element, sources ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tvar input = ( new Input() ).parse( child );\n\t\t\t\t\tvar source = sources[ input.source ];\n\n\t\t\t\t\tif ( input.semantic == 'JOINT' ) {\n\n\t\t\t\t\t\tthis.joints = source.read();\n\n\t\t\t\t\t} else if ( input.semantic == 'INV_BIND_MATRIX' ) {\n\n\t\t\t\t\t\tthis.invBindMatrices = source.read();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tSkin.prototype.parseWeights = function ( element, sources ) {\n\n\t\tvar v, vcount, inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tinputs.push( ( new Input() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'v':\n\n\t\t\t\t\tv = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vcount':\n\n\t\t\t\t\tvcount = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar index = 0;\n\n\t\tfor ( var i = 0; i < vcount.length; i ++ ) {\n\n\t\t\tvar numBones = vcount[i];\n\t\t\tvar vertex_weights = [];\n\n\t\t\tfor ( var j = 0; j < numBones; j++ ) {\n\n\t\t\t\tvar influence = {};\n\n\t\t\t\tfor ( var k = 0; k < inputs.length; k ++ ) {\n\n\t\t\t\t\tvar input = inputs[ k ];\n\t\t\t\t\tvar value = v[ index + input.offset ];\n\n\t\t\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\t\t\tcase 'JOINT':\n\n\t\t\t\t\t\t\tinfluence.joint = value;//this.joints[value];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'WEIGHT':\n\n\t\t\t\t\t\t\tinfluence.weight = sources[ input.source ].data[ value ];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvertex_weights.push( influence );\n\t\t\t\tindex += inputs.length;\n\t\t\t}\n\n\t\t\tfor ( var j = 0; j < vertex_weights.length; j ++ ) {\n\n\t\t\t\tvertex_weights[ j ].index = i;\n\n\t\t\t}\n\n\t\t\tthis.weights.push( vertex_weights );\n\n\t\t}\n\n\t};\n\n\tfunction VisualScene () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.nodes = [];\n\t\tthis.scene = new THREE.Object3D();\n\n\t};\n\n\tVisualScene.prototype.getChildById = function( id, recursive ) {\n\n\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\tvar node = this.nodes[ i ].getChildById( id, recursive );\n\n\t\t\tif ( node ) {\n\n\t\t\t\treturn node;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tVisualScene.prototype.getChildBySid = function( sid, recursive ) {\n\n\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\tvar node = this.nodes[ i ].getChildBySid( sid, recursive );\n\n\t\t\tif ( node ) {\n\n\t\t\t\treturn node;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tVisualScene.prototype.parse = function( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\t\tthis.nodes = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'node':\n\n\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Node() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.sid = \"\";\n\t\tthis.nodes = [];\n\t\tthis.controllers = [];\n\t\tthis.transforms = [];\n\t\tthis.geometries = [];\n\t\tthis.channels = [];\n\t\tthis.matrix = new THREE.Matrix4();\n\n\t};\n\n\tNode.prototype.getChannelForTransform = function( transformSid ) {\n\n\t\tfor ( var i = 0; i < this.channels.length; i ++ ) {\n\n\t\t\tvar channel = this.channels[i];\n\t\t\tvar parts = channel.target.split('/');\n\t\t\tvar id = parts.shift();\n\t\t\tvar sid = parts.shift();\n\t\t\tvar dotSyntax = (sid.indexOf(\".\") >= 0);\n\t\t\tvar arrSyntax = (sid.indexOf(\"(\") >= 0);\n\t\t\tvar arrIndices;\n\t\t\tvar member;\n\n\t\t\tif ( dotSyntax ) {\n\n\t\t\t\tparts = sid.split(\".\");\n\t\t\t\tsid = parts.shift();\n\t\t\t\tmember = parts.shift();\n\n\t\t\t} else if ( arrSyntax ) {\n\n\t\t\t\tarrIndices = sid.split(\"(\");\n\t\t\t\tsid = arrIndices.shift();\n\n\t\t\t\tfor ( var j = 0; j < arrIndices.length; j ++ ) {\n\n\t\t\t\t\tarrIndices[ j ] = parseInt( arrIndices[ j ].replace( /\\)/, '' ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( sid == transformSid ) {\n\n\t\t\t\tchannel.info = { sid: sid, dotSyntax: dotSyntax, arrSyntax: arrSyntax, arrIndices: arrIndices };\n\t\t\t\treturn channel;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getChildById = function ( id, recursive ) {\n\n\t\tif ( this.id == id ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( recursive ) {\n\n\t\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\t\tvar n = this.nodes[ i ].getChildById( id, recursive );\n\n\t\t\t\tif ( n ) {\n\n\t\t\t\t\treturn n;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getChildBySid = function ( sid, recursive ) {\n\n\t\tif ( this.sid == sid ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( recursive ) {\n\n\t\t\tfor ( var i = 0; i < this.nodes.length; i ++ ) {\n\n\t\t\t\tvar n = this.nodes[ i ].getChildBySid( sid, recursive );\n\n\t\t\t\tif ( n ) {\n\n\t\t\t\t\treturn n;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.getTransformBySid = function ( sid ) {\n\n\t\tfor ( var i = 0; i < this.transforms.length; i ++ ) {\n\n\t\t\tif ( this.transforms[ i ].sid == sid ) return this.transforms[ i ];\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tNode.prototype.parse = function( element ) {\n\n\t\tvar url;\n\n\t\tthis.id = element.getAttribute('id');\n\t\tthis.sid = element.getAttribute('sid');\n\t\tthis.name = element.getAttribute('name');\n\t\tthis.type = element.getAttribute('type');\n\t\tthis.layer = element.getAttribute('layer');\n\n\t\tthis.type = this.type == 'JOINT' ? this.type : 'NODE';\n\n\t\tthis.nodes = [];\n\t\tthis.transforms = [];\n\t\tthis.geometries = [];\n\t\tthis.cameras = [];\n\t\tthis.lights = [];\n\t\tthis.controllers = [];\n\t\tthis.matrix = new THREE.Matrix4();\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'node':\n\n\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_camera':\n\n\t\t\t\t\tthis.cameras.push( ( new InstanceCamera() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_controller':\n\n\t\t\t\t\tthis.controllers.push( ( new InstanceController() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_geometry':\n\n\t\t\t\t\tthis.geometries.push( ( new InstanceGeometry() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_light':\n\n\t\t\t\t\tthis.lights.push( ( new InstanceLight() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'instance_node':\n\n\t\t\t\t\turl = child.getAttribute( 'url' ).replace( /^#/, '' );\n\t\t\t\t\tvar iNode = getLibraryNode( url );\n\n\t\t\t\t\tif ( iNode ) {\n\n\t\t\t\t\t\tthis.nodes.push( ( new Node() ).parse( iNode )) ;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'rotate':\n\t\t\t\tcase 'translate':\n\t\t\t\tcase 'scale':\n\t\t\t\tcase 'matrix':\n\t\t\t\tcase 'lookat':\n\t\t\t\tcase 'skew':\n\n\t\t\t\t\tthis.transforms.push( ( new Transform() ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.channels = getChannelsForNode( this );\n\t\tbakeAnimations( this );\n\n\t\tthis.updateMatrix();\n\n\t\treturn this;\n\n\t};\n\n\tNode.prototype.updateMatrix = function () {\n\n\t\tthis.matrix.identity();\n\n\t\tfor ( var i = 0; i < this.transforms.length; i ++ ) {\n\n\t\t\tthis.transforms[ i ].apply( this.matrix );\n\n\t\t}\n\n\t};\n\n\tfunction Transform () {\n\n\t\tthis.sid = \"\";\n\t\tthis.type = \"\";\n\t\tthis.data = [];\n\t\tthis.obj = null;\n\n\t};\n\n\tTransform.prototype.parse = function ( element ) {\n\n\t\tthis.sid = element.getAttribute( 'sid' );\n\t\tthis.type = element.nodeName;\n\t\tthis.data = _floats( element.textContent );\n\t\tthis.convert();\n\n\t\treturn this;\n\n\t};\n\n\tTransform.prototype.convert = function () {\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'matrix':\n\n\t\t\t\tthis.obj = getConvertedMat4( this.data );\n\t\t\t\tbreak;\n\n\t\t\tcase 'rotate':\n\n\t\t\t\tthis.angle = THREE.Math.degToRad( this.data[3] );\n\n\t\t\tcase 'translate':\n\n\t\t\t\tfixCoords( this.data, -1 );\n\t\t\t\tthis.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'scale':\n\n\t\t\t\tfixCoords( this.data, 1 );\n\t\t\t\tthis.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.log( 'Can not convert Transform of type ' + this.type );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tTransform.prototype.apply = function () {\n\n\t\tvar m1 = new THREE.Matrix4();\n\n\t\treturn function ( matrix ) {\n\n\t\t\tswitch ( this.type ) {\n\n\t\t\t\tcase 'matrix':\n\n\t\t\t\t\tmatrix.multiply( this.obj );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'translate':\n\n\t\t\t\t\tmatrix.multiply( m1.makeTranslation( this.obj.x, this.obj.y, this.obj.z ) );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'rotate':\n\n\t\t\t\t\tmatrix.multiply( m1.makeRotationAxis( this.obj, this.angle ) );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'scale':\n\n\t\t\t\t\tmatrix.scale( this.obj );\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t};\n\n\t}();\n\n\tTransform.prototype.update = function ( data, member ) {\n\n\t\tvar members = [ 'X', 'Y', 'Z', 'ANGLE' ];\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'matrix':\n\n\t\t\t\tif ( ! member ) {\n\n\t\t\t\t\tthis.obj.copy( data );\n\n\t\t\t\t} else if ( member.length === 1 ) {\n\n\t\t\t\t\tswitch ( member[ 0 ] ) {\n\n\t\t\t\t\t\tcase 0:\n\n\t\t\t\t\t\t\tthis.obj.n11 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n21 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n31 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n41 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\n\t\t\t\t\t\t\tthis.obj.n12 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n22 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n32 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n42 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\n\t\t\t\t\t\t\tthis.obj.n13 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n23 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n33 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n43 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\n\t\t\t\t\t\t\tthis.obj.n14 = data[ 0 ];\n\t\t\t\t\t\t\tthis.obj.n24 = data[ 1 ];\n\t\t\t\t\t\t\tthis.obj.n34 = data[ 2 ];\n\t\t\t\t\t\t\tthis.obj.n44 = data[ 3 ];\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( member.length === 2 ) {\n\n\t\t\t\t\tvar propName = 'n' + ( member[ 0 ] + 1 ) + ( member[ 1 ] + 1 );\n\t\t\t\t\tthis.obj[ propName ] = data;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log('Incorrect addressing of matrix in transform.');\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'translate':\n\t\t\tcase 'scale':\n\n\t\t\t\tif ( Object.prototype.toString.call( member ) === '[object Array]' ) {\n\n\t\t\t\t\tmember = members[ member[ 0 ] ];\n\n\t\t\t\t}\n\n\t\t\t\tswitch ( member ) {\n\n\t\t\t\t\tcase 'X':\n\n\t\t\t\t\t\tthis.obj.x = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Y':\n\n\t\t\t\t\t\tthis.obj.y = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Z':\n\n\t\t\t\t\t\tthis.obj.z = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tthis.obj.x = data[ 0 ];\n\t\t\t\t\t\tthis.obj.y = data[ 1 ];\n\t\t\t\t\t\tthis.obj.z = data[ 2 ];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'rotate':\n\n\t\t\t\tif ( Object.prototype.toString.call( member ) === '[object Array]' ) {\n\n\t\t\t\t\tmember = members[ member[ 0 ] ];\n\n\t\t\t\t}\n\n\t\t\t\tswitch ( member ) {\n\n\t\t\t\t\tcase 'X':\n\n\t\t\t\t\t\tthis.obj.x = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Y':\n\n\t\t\t\t\t\tthis.obj.y = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Z':\n\n\t\t\t\t\t\tthis.obj.z = data;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ANGLE':\n\n\t\t\t\t\t\tthis.angle = THREE.Math.degToRad( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tthis.obj.x = data[ 0 ];\n\t\t\t\t\t\tthis.obj.y = data[ 1 ];\n\t\t\t\t\t\tthis.obj.z = data[ 2 ];\n\t\t\t\t\t\tthis.angle = THREE.Math.degToRad( data[ 3 ] );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tfunction InstanceController() {\n\n\t\tthis.url = \"\";\n\t\tthis.skeleton = [];\n\t\tthis.instance_material = [];\n\n\t};\n\n\tInstanceController.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\t\tthis.skeleton = [];\n\t\tthis.instance_material = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType !== 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'skeleton':\n\n\t\t\t\t\tthis.skeleton.push( child.textContent.replace(/^#/, '') );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bind_material':\n\n\t\t\t\t\tvar instances = child.querySelectorAll('instance_material');\n\n\t\t\t\t\tfor ( var j = 0; j < instances.length; j ++ ){\n\n\t\t\t\t\t\tvar instance = instances[j];\n\t\t\t\t\t\tthis.instance_material.push( (new InstanceMaterial()).parse(instance) );\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceMaterial () {\n\n\t\tthis.symbol = \"\";\n\t\tthis.target = \"\";\n\n\t};\n\n\tInstanceMaterial.prototype.parse = function ( element ) {\n\n\t\tthis.symbol = element.getAttribute('symbol');\n\t\tthis.target = element.getAttribute('target').replace(/^#/, '');\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceGeometry() {\n\n\t\tthis.url = \"\";\n\t\tthis.instance_material = [];\n\n\t};\n\n\tInstanceGeometry.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\t\tthis.instance_material = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tif ( child.nodeName == 'bind_material' ) {\n\n\t\t\t\tvar instances = child.querySelectorAll('instance_material');\n\n\t\t\t\tfor ( var j = 0; j < instances.length; j ++ ) {\n\n\t\t\t\t\tvar instance = instances[j];\n\t\t\t\t\tthis.instance_material.push( (new InstanceMaterial()).parse(instance) );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Geometry() {\n\n\t\tthis.id = \"\";\n\t\tthis.mesh = null;\n\n\t};\n\n\tGeometry.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\textractDoubleSided( this, element );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'mesh':\n\n\t\t\t\t\tthis.mesh = (new Mesh(this)).parse(child);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\n\t\t\t\t\t// console.log( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Mesh( geometry ) {\n\n\t\tthis.geometry = geometry.id;\n\t\tthis.primitives = [];\n\t\tthis.vertices = null;\n\t\tthis.geometry3js = null;\n\n\t};\n\n\tMesh.prototype.parse = function( element ) {\n\n\t\tthis.primitives = [];\n\n\t\tvar i, j;\n\n\t\tfor ( i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\t_source( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vertices':\n\n\t\t\t\t\tthis.vertices = ( new Vertices() ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'triangles':\n\n\t\t\t\t\tthis.primitives.push( ( new Triangles().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'polygons':\n\n\t\t\t\t\tthis.primitives.push( ( new Polygons().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'polylist':\n\n\t\t\t\t\tthis.primitives.push( ( new Polylist().parse( child ) ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.geometry3js = new THREE.Geometry();\n\n\t\tvar vertexData = sources[ this.vertices.input['POSITION'].source ].data;\n\n\t\tfor ( i = 0; i < vertexData.length; i += 3 ) {\n\n\t\t\tthis.geometry3js.vertices.push( getConvertedVec3( vertexData, i ).clone() );\n\n\t\t}\n\n\t\tfor ( i = 0; i < this.primitives.length; i ++ ) {\n\n\t\t\tvar primitive = this.primitives[ i ];\n\t\t\tprimitive.setVertices( this.vertices );\n\t\t\tthis.handlePrimitive( primitive, this.geometry3js );\n\n\t\t}\n\n\t\tthis.geometry3js.computeFaceNormals();\n\n\t\tif ( this.geometry3js.calcNormals ) {\n\n\t\t\tthis.geometry3js.computeVertexNormals();\n\t\t\tdelete this.geometry3js.calcNormals;\n\n\t\t}\n\n\t\t// this.geometry3js.computeBoundingBox();\n\n\t\treturn this;\n\n\t};\n\n\tMesh.prototype.handlePrimitive = function( primitive, geom ) {\n\n\t\tvar j, k, pList = primitive.p, inputs = primitive.inputs;\n\t\tvar input, index, idx32;\n\t\tvar source, numParams;\n\t\tvar vcIndex = 0, vcount = 3, maxOffset = 0;\n\t\tvar texture_sets = [];\n\n\t\tfor ( j = 0; j < inputs.length; j ++ ) {\n\n\t\t\tinput = inputs[ j ];\n\n\t\t\tvar offset = input.offset + 1;\n\t\t\tmaxOffset = (maxOffset < offset)? offset : maxOffset;\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'TEXCOORD':\n\t\t\t\t\ttexture_sets.push( input.set );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var pCount = 0; pCount < pList.length; ++pCount ) {\n\n\t\t\tvar p = pList[ pCount ], i = 0;\n\n\t\t\twhile ( i < p.length ) {\n\n\t\t\t\tvar vs = [];\n\t\t\t\tvar ns = [];\n\t\t\t\tvar ts = null;\n\t\t\t\tvar cs = [];\n\n\t\t\t\tif ( primitive.vcount ) {\n\n\t\t\t\t\tvcount = primitive.vcount.length ? primitive.vcount[ vcIndex ++ ] : primitive.vcount;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvcount = p.length / maxOffset;\n\n\t\t\t\t}\n\n\n\t\t\t\tfor ( j = 0; j < vcount; j ++ ) {\n\n\t\t\t\t\tfor ( k = 0; k < inputs.length; k ++ ) {\n\n\t\t\t\t\t\tinput = inputs[ k ];\n\t\t\t\t\t\tsource = sources[ input.source ];\n\n\t\t\t\t\t\tindex = p[ i + ( j * maxOffset ) + input.offset ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\t\t\t\t\t\tidx32 = index * numParams;\n\n\t\t\t\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\t\t\t\tcase 'VERTEX':\n\n\t\t\t\t\t\t\t\tvs.push( index );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'NORMAL':\n\n\t\t\t\t\t\t\t\tns.push( getConvertedVec3( source.data, idx32 ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'TEXCOORD':\n\n\t\t\t\t\t\t\t\tts = ts || { };\n\t\t\t\t\t\t\t\tif ( ts[ input.set ] === undefined ) ts[ input.set ] = [];\n\t\t\t\t\t\t\t\t// invert the V\n\t\t\t\t\t\t\t\tts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], source.data[ idx32 + 1 ] ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'COLOR':\n\n\t\t\t\t\t\t\t\tcs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ns.length == 0 ) {\n\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.NORMAL;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tns.push( getConvertedVec3( source.data, vs[ ndx ] * numParams ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgeom.calcNormals = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( !ts ) {\n\n\t\t\t\t\tts = { };\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.TEXCOORD;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\ttexture_sets.push( input.set );\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tidx32 = vs[ ndx ] * numParams;\n\t\t\t\t\t\t\tif ( ts[ input.set ] === undefined ) ts[ input.set ] = [ ];\n\t\t\t\t\t\t\t// invert the V\n\t\t\t\t\t\t\tts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], 1.0 - source.data[ idx32 + 1 ] ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( cs.length == 0 ) {\n\n\t\t\t\t\t// check the vertices inputs\n\t\t\t\t\tinput = this.vertices.input.COLOR;\n\n\t\t\t\t\tif ( input ) {\n\n\t\t\t\t\t\tsource = sources[ input.source ];\n\t\t\t\t\t\tnumParams = source.accessor.params.length;\n\n\t\t\t\t\t\tfor ( var ndx = 0, len = vs.length; ndx < len; ndx++ ) {\n\n\t\t\t\t\t\t\tidx32 = vs[ ndx ] * numParams;\n\t\t\t\t\t\t\tcs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar face = null, faces = [], uv, uvArr;\n\n\t\t\t\tif ( vcount === 3 ) {\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[1], vs[2], ns, cs.length ? cs : new THREE.Color() ) );\n\n\t\t\t\t} else if ( vcount === 4 ) {\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[1], vs[3], [ns[0], ns[1], ns[3]], cs.length ? [cs[0], cs[1], cs[3]] : new THREE.Color() ) );\n\n\t\t\t\t\tfaces.push( new THREE.Face3( vs[1], vs[2], vs[3], [ns[1], ns[2], ns[3]], cs.length ? [cs[1], cs[2], cs[3]] : new THREE.Color() ) );\n\n\t\t\t\t} else if ( vcount > 4 && options.subdivideFaces ) {\n\n\t\t\t\t\tvar clr = cs.length ? cs : new THREE.Color(),\n\t\t\t\t\t\tvec1, vec2, vec3, v1, v2, norm;\n\n\t\t\t\t\t// subdivide into multiple Face3s\n\n\t\t\t\t\tfor ( k = 1; k < vcount - 1; ) {\n\n\t\t\t\t\t\t// FIXME: normals don't seem to be quite right\n\n\t\t\t\t\t\tfaces.push( new THREE.Face3( vs[0], vs[k], vs[k+1], [ ns[0], ns[k++], ns[k] ], clr ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( faces.length ) {\n\n\t\t\t\t\tfor ( var ndx = 0, len = faces.length; ndx < len; ndx ++ ) {\n\n\t\t\t\t\t\tface = faces[ndx];\n\t\t\t\t\t\tface.daeMaterial = primitive.material;\n\t\t\t\t\t\tgeom.faces.push( face );\n\n\t\t\t\t\t\tfor ( k = 0; k < texture_sets.length; k++ ) {\n\n\t\t\t\t\t\t\tuv = ts[ texture_sets[k] ];\n\n\t\t\t\t\t\t\tif ( vcount > 4 ) {\n\n\t\t\t\t\t\t\t\t// Grab the right UVs for the vertices in this face\n\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[ndx+1], uv[ndx+2] ];\n\n\t\t\t\t\t\t\t} else if ( vcount === 4 ) {\n\n\t\t\t\t\t\t\t\tif ( ndx === 0 ) {\n\n\t\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[1], uv[3] ];\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tuvArr = [ uv[1].clone(), uv[2], uv[3].clone() ];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tuvArr = [ uv[0], uv[1], uv[2] ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( geom.faceVertexUvs[k] === undefined ) {\n\n\t\t\t\t\t\t\t\tgeom.faceVertexUvs[k] = [];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgeom.faceVertexUvs[k].push( uvArr );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.log( 'dropped face with vcount ' + vcount + ' for geometry with id: ' + geom.id );\n\n\t\t\t\t}\n\n\t\t\t\ti += maxOffset * vcount;\n\n\t\t\t}\n\t\t}\n\n\t};\n\n\tfunction Polygons () {\n\n\t\tthis.material = \"\";\n\t\tthis.count = 0;\n\t\tthis.inputs = [];\n\t\tthis.vcount = null;\n\t\tthis.p = [];\n\t\tthis.geometry = new THREE.Geometry();\n\n\t};\n\n\tPolygons.prototype.setVertices = function ( vertices ) {\n\n\t\tfor ( var i = 0; i < this.inputs.length; i ++ ) {\n\n\t\t\tif ( this.inputs[ i ].source == vertices.id ) {\n\n\t\t\t\tthis.inputs[ i ].source = vertices.input[ 'POSITION' ].source;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tPolygons.prototype.parse = function ( element ) {\n\n\t\tthis.material = element.getAttribute( 'material' );\n\t\tthis.count = _attr_as_int( element, 'count', 0 );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tthis.inputs.push( ( new Input() ).parse( element.childNodes[ i ] ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'vcount':\n\n\t\t\t\t\tthis.vcount = _ints( child.textContent );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'p':\n\n\t\t\t\t\tthis.p.push( _ints( child.textContent ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ph':\n\n\t\t\t\t\tconsole.warn( 'polygon holes not yet supported!' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Polylist () {\n\n\t\tPolygons.call( this );\n\n\t\tthis.vcount = [];\n\n\t};\n\n\tPolylist.prototype = Object.create( Polygons.prototype );\n\n\tfunction Triangles () {\n\n\t\tPolygons.call( this );\n\n\t\tthis.vcount = 3;\n\n\t};\n\n\tTriangles.prototype = Object.create( Polygons.prototype );\n\n\tfunction Accessor() {\n\n\t\tthis.source = \"\";\n\t\tthis.count = 0;\n\t\tthis.stride = 0;\n\t\tthis.params = [];\n\n\t};\n\n\tAccessor.prototype.parse = function ( element ) {\n\n\t\tthis.params = [];\n\t\tthis.source = element.getAttribute( 'source' );\n\t\tthis.count = _attr_as_int( element, 'count', 0 );\n\t\tthis.stride = _attr_as_int( element, 'stride', 0 );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeName == 'param' ) {\n\n\t\t\t\tvar param = {};\n\t\t\t\tparam[ 'name' ] = child.getAttribute( 'name' );\n\t\t\t\tparam[ 'type' ] = child.getAttribute( 'type' );\n\t\t\t\tthis.params.push( param );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Vertices() {\n\n\t\tthis.input = {};\n\n\t};\n\n\tVertices.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute('id');\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[i].nodeName == 'input' ) {\n\n\t\t\t\tvar input = ( new Input() ).parse( element.childNodes[ i ] );\n\t\t\t\tthis.input[ input.semantic ] = input;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Input () {\n\n\t\tthis.semantic = \"\";\n\t\tthis.offset = 0;\n\t\tthis.source = \"\";\n\t\tthis.set = 0;\n\n\t};\n\n\tInput.prototype.parse = function ( element ) {\n\n\t\tthis.semantic = element.getAttribute('semantic');\n\t\tthis.source = element.getAttribute('source').replace(/^#/, '');\n\t\tthis.set = _attr_as_int(element, 'set', -1);\n\t\tthis.offset = _attr_as_int(element, 'offset', 0);\n\n\t\tif ( this.semantic == 'TEXCOORD' && this.set < 0 ) {\n\n\t\t\tthis.set = 0;\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Source ( id ) {\n\n\t\tthis.id = id;\n\t\tthis.type = null;\n\n\t};\n\n\tSource.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bool_array':\n\n\t\t\t\t\tthis.data = _bools( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'float_array':\n\n\t\t\t\t\tthis.data = _floats( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'int_array':\n\n\t\t\t\t\tthis.data = _ints( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'IDREF_array':\n\t\t\t\tcase 'Name_array':\n\n\t\t\t\t\tthis.data = _strings( child.textContent );\n\t\t\t\t\tthis.type = child.nodeName;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique_common':\n\n\t\t\t\t\tfor ( var j = 0; j < child.childNodes.length; j ++ ) {\n\n\t\t\t\t\t\tif ( child.childNodes[ j ].nodeName == 'accessor' ) {\n\n\t\t\t\t\t\t\tthis.accessor = ( new Accessor() ).parse( child.childNodes[ j ] );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// console.log(child.nodeName);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tSource.prototype.read = function () {\n\n\t\tvar result = [];\n\n\t\t//for (var i = 0; i < this.accessor.params.length; i++) {\n\n\t\t\tvar param = this.accessor.params[ 0 ];\n\n\t\t\t//console.log(param.name + \" \" + param.type);\n\n\t\t\tswitch ( param.type ) {\n\n\t\t\t\tcase 'IDREF':\n\t\t\t\tcase 'Name': case 'name':\n\t\t\t\tcase 'float':\n\n\t\t\t\t\treturn this.data;\n\n\t\t\t\tcase 'float4x4':\n\n\t\t\t\t\tfor ( var j = 0; j < this.data.length; j += 16 ) {\n\n\t\t\t\t\t\tvar s = this.data.slice( j, j + 16 );\n\t\t\t\t\t\tvar m = getConvertedMat4( s );\n\t\t\t\t\t\tresult.push( m );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( 'ColladaLoader: Source: Read dont know how to read ' + param.type + '.' );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t//}\n\n\t\treturn result;\n\n\t};\n\n\tfunction Material () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.instance_effect = null;\n\n\t};\n\n\tMaterial.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[ i ].nodeName == 'instance_effect' ) {\n\n\t\t\t\tthis.instance_effect = ( new InstanceEffect() ).parse( element.childNodes[ i ] );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction ColorOrTexture () {\n\n\t\tthis.color = new THREE.Color();\n\t\tthis.color.setRGB( Math.random(), Math.random(), Math.random() );\n\t\tthis.color.a = 1.0;\n\n\t\tthis.texture = null;\n\t\tthis.texcoord = null;\n\t\tthis.texOpts = null;\n\n\t};\n\n\tColorOrTexture.prototype.isColor = function () {\n\n\t\treturn ( this.texture == null );\n\n\t};\n\n\tColorOrTexture.prototype.isTexture = function () {\n\n\t\treturn ( this.texture != null );\n\n\t};\n\n\tColorOrTexture.prototype.parse = function ( element ) {\n\n\t\tif (element.nodeName == 'transparent') {\n\n\t\t\tthis.opaque = element.getAttribute('opaque');\n\n\t\t}\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'color':\n\n\t\t\t\t\tvar rgba = _floats( child.textContent );\n\t\t\t\t\tthis.color = new THREE.Color();\n\t\t\t\t\tthis.color.setRGB( rgba[0], rgba[1], rgba[2] );\n\t\t\t\t\tthis.color.a = rgba[3];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'texture':\n\n\t\t\t\t\tthis.texture = child.getAttribute('texture');\n\t\t\t\t\tthis.texcoord = child.getAttribute('texcoord');\n\t\t\t\t\t// Defaults from:\n\t\t\t\t\t// https://collada.org/mediawiki/index.php/Maya_texture_placement_MAYA_extension\n\t\t\t\t\tthis.texOpts = {\n\t\t\t\t\t\toffsetU: 0,\n\t\t\t\t\t\toffsetV: 0,\n\t\t\t\t\t\trepeatU: 1,\n\t\t\t\t\t\trepeatV: 1,\n\t\t\t\t\t\twrapU: 1,\n\t\t\t\t\t\twrapV: 1\n\t\t\t\t\t};\n\t\t\t\t\tthis.parseTexture( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tColorOrTexture.prototype.parseTexture = function ( element ) {\n\n\t\tif ( ! element.childNodes ) return this;\n\n\t\t// This should be supported by Maya, 3dsMax, and MotionBuilder\n\n\t\tif ( element.childNodes[1] && element.childNodes[1].nodeName === 'extra' ) {\n\n\t\t\telement = element.childNodes[1];\n\n\t\t\tif ( element.childNodes[1] && element.childNodes[1].nodeName === 'technique' ) {\n\n\t\t\t\telement = element.childNodes[1];\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'offsetU':\n\t\t\t\tcase 'offsetV':\n\t\t\t\tcase 'repeatU':\n\t\t\t\tcase 'repeatV':\n\n\t\t\t\t\tthis.texOpts[ child.nodeName ] = parseFloat( child.textContent );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrapU':\n\t\t\t\tcase 'wrapV':\n\n\t\t\t\t\t// some dae have a value of true which becomes NaN via parseInt\n\n\t\t\t\t\tif ( child.textContent.toUpperCase() === 'TRUE' ) {\n\n\t\t\t\t\t\tthis.texOpts[ child.nodeName ] = 1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.texOpts[ child.nodeName ] = parseInt( child.textContent );\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.texOpts[ child.nodeName ] = child.textContent;\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Shader ( type, effect ) {\n\n\t\tthis.type = type;\n\t\tthis.effect = effect;\n\t\tthis.material = null;\n\n\t};\n\n\tShader.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'ambient':\n\t\t\t\tcase 'emission':\n\t\t\t\tcase 'diffuse':\n\t\t\t\tcase 'specular':\n\t\t\t\tcase 'transparent':\n\n\t\t\t\t\tthis[ child.nodeName ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bump':\n\n\t\t\t\t\t// If 'bumptype' is 'heightfield', create a 'bump' property\n\t\t\t\t\t// Else if 'bumptype' is 'normalmap', create a 'normal' property\n\t\t\t\t\t// (Default to 'bump')\n\t\t\t\t\tvar bumpType = child.getAttribute( 'bumptype' );\n\t\t\t\t\tif ( bumpType ) {\n\t\t\t\t\t\tif ( bumpType.toLowerCase() === \"heightfield\" ) {\n\t\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t} else if ( bumpType.toLowerCase() === \"normalmap\" ) {\n\t\t\t\t\t\t\tthis[ 'normal' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.error( \"Shader.prototype.parse: Invalid value for attribute 'bumptype' (\" + bumpType +\n\t\t\t\t\t\t\t\t \") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'\" );\n\t\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn( \"Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'\" );\n\t\t\t\t\t\tthis[ 'bump' ] = ( new ColorOrTexture() ).parse( child );\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'shininess':\n\t\t\t\tcase 'reflectivity':\n\t\t\t\tcase 'index_of_refraction':\n\t\t\t\tcase 'transparency':\n\n\t\t\t\t\tvar f = child.querySelectorAll('float');\n\n\t\t\t\t\tif ( f.length > 0 )\n\t\t\t\t\t\tthis[ child.nodeName ] = parseFloat( f[ 0 ].textContent );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.create();\n\t\treturn this;\n\n\t};\n\n\tShader.prototype.create = function() {\n\n\t\tvar props = {};\n\n\t\tvar transparent = false;\n\n\t\tif (this['transparency'] !== undefined && this['transparent'] !== undefined) {\n\t\t\t// convert transparent color RBG to average value\n\t\t\tvar transparentColor = this['transparent'];\n\t\t\tvar transparencyLevel = (this.transparent.color.r + this.transparent.color.g + this.transparent.color.b) / 3 * this.transparency;\n\n\t\t\tif (transparencyLevel > 0) {\n\t\t\t\ttransparent = true;\n\t\t\t\tprops[ 'transparent' ] = true;\n\t\t\t\tprops[ 'opacity' ] = 1 - transparencyLevel;\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar keys = {\n\t\t\t'diffuse':'map',\n\t\t\t'ambient':'lightMap' ,\n\t\t\t'specular':'specularMap',\n\t\t\t'emission':'emissionMap',\n\t\t\t'bump':'bumpMap',\n\t\t\t'normal':'normalMap'\n\t\t\t};\n\n\t\tfor ( var prop in this ) {\n\n\t\t\tswitch ( prop ) {\n\n\t\t\t\tcase 'ambient':\n\t\t\t\tcase 'emission':\n\t\t\t\tcase 'diffuse':\n\t\t\t\tcase 'specular':\n\t\t\t\tcase 'bump':\n\t\t\t\tcase 'normal':\n\n\t\t\t\t\tvar cot = this[ prop ];\n\n\t\t\t\t\tif ( cot instanceof ColorOrTexture ) {\n\n\t\t\t\t\t\tif ( cot.isTexture() ) {\n\n\t\t\t\t\t\t\tvar samplerId = cot.texture;\n\t\t\t\t\t\t\tvar surfaceId = this.effect.sampler[samplerId];\n\n\t\t\t\t\t\t\tif ( surfaceId !== undefined && surfaceId.source !== undefined ) {\n\n\t\t\t\t\t\t\t\tvar surface = this.effect.surface[surfaceId.source];\n\t\t\t\t\t\t\t\tvar image = images[surface.init_from];\n\n\t\t\t\t\t\t\t\tif (image) {\n\n\t\t\t\t\t\t\t\t\tvar url = baseUrl + image.init_from;\n\n\t\t\t\t\t\t\t\t\tvar texture;\n\t\t\t\t\t\t\t\t\tvar loader = THREE.Loader.Handlers.get( url );\n\n\t\t\t\t\t\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\t\t\t\t\t\ttexture = loader.load( url );\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\ttexture = new THREE.Texture();\n\t\t\t\t\t\t\t\t\t\tloader = new THREE.ImageLoader();\n\t\t\t\t\t\t\t\t\t\tloader.load( url, function ( image ) {\n\n\t\t\t\t\t\t\t\t\t\t\ttexture.image = image;\n\t\t\t\t\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttexture.wrapS = cot.texOpts.wrapU ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;\n\t\t\t\t\t\t\t\t\ttexture.wrapT = cot.texOpts.wrapV ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;\n\t\t\t\t\t\t\t\t\ttexture.offset.x = cot.texOpts.offsetU;\n\t\t\t\t\t\t\t\t\ttexture.offset.y = cot.texOpts.offsetV;\n\t\t\t\t\t\t\t\t\ttexture.repeat.x = cot.texOpts.repeatU;\n\t\t\t\t\t\t\t\t\ttexture.repeat.y = cot.texOpts.repeatV;\n\t\t\t\t\t\t\t\t\tprops[keys[prop]] = texture;\n\n\t\t\t\t\t\t\t\t\t// Texture with baked lighting?\n\t\t\t\t\t\t\t\t\tif (prop === 'emission') props['emissive'] = 0xffffff;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( prop === 'diffuse' || !transparent ) {\n\n\t\t\t\t\t\t\tif ( prop === 'emission' ) {\n\n\t\t\t\t\t\t\t\tprops[ 'emissive' ] = cot.color.getHex();\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tprops[ prop ] = cot.color.getHex();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'shininess':\n\n\t\t\t\t\tprops[ prop ] = this[ prop ];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'reflectivity':\n\n\t\t\t\t\tprops[ prop ] = this[ prop ];\n\t\t\t\t\tif( props[ prop ] > 0.0 ) props['envMap'] = options.defaultEnvMap;\n\t\t\t\t\tprops['combine'] = THREE.MixOperation;\t//mix regular shading with reflective component\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'index_of_refraction':\n\n\t\t\t\t\tprops[ 'refractionRatio' ] = this[ prop ]; //TODO: \"index_of_refraction\" becomes \"refractionRatio\" in shader, but I'm not sure if the two are actually comparable\n\t\t\t\t\tif ( this[ prop ] !== 1.0 ) props['envMap'] = options.defaultEnvMap;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'transparency':\n\t\t\t\t\t// gets figured out up top\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tprops[ 'shading' ] = preferredShading;\n\t\tprops[ 'side' ] = this.effect.doubleSided ? THREE.DoubleSide : THREE.FrontSide;\n\n\t\tswitch ( this.type ) {\n\n\t\t\tcase 'constant':\n\n\t\t\t\tif (props.emissive != undefined) props.color = props.emissive;\n\t\t\t\tthis.material = new THREE.MeshBasicMaterial( props );\n\t\t\t\tbreak;\n\n\t\t\tcase 'phong':\n\t\t\tcase 'blinn':\n\n\t\t\t\tif (props.diffuse != undefined) props.color = props.diffuse;\n\t\t\t\tthis.material = new THREE.MeshPhongMaterial( props );\n\t\t\t\tbreak;\n\n\t\t\tcase 'lambert':\n\t\t\tdefault:\n\n\t\t\t\tif (props.diffuse != undefined) props.color = props.diffuse;\n\t\t\t\tthis.material = new THREE.MeshLambertMaterial( props );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn this.material;\n\n\t};\n\n\tfunction Surface ( effect ) {\n\n\t\tthis.effect = effect;\n\t\tthis.init_from = null;\n\t\tthis.format = null;\n\n\t};\n\n\tSurface.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'init_from':\n\n\t\t\t\t\tthis.init_from = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'format':\n\n\t\t\t\t\tthis.format = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( \"unhandled Surface prop: \" + child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Sampler2D ( effect ) {\n\n\t\tthis.effect = effect;\n\t\tthis.source = null;\n\t\tthis.wrap_s = null;\n\t\tthis.wrap_t = null;\n\t\tthis.minfilter = null;\n\t\tthis.magfilter = null;\n\t\tthis.mipfilter = null;\n\n\t};\n\n\tSampler2D.prototype.parse = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tthis.source = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'minfilter':\n\n\t\t\t\t\tthis.minfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'magfilter':\n\n\t\t\t\t\tthis.magfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mipfilter':\n\n\t\t\t\t\tthis.mipfilter = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrap_s':\n\n\t\t\t\t\tthis.wrap_s = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'wrap_t':\n\n\t\t\t\t\tthis.wrap_t = child.textContent;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( \"unhandled Sampler2D prop: \" + child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Effect () {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.shader = null;\n\t\tthis.surface = {};\n\t\tthis.sampler = {};\n\n\t};\n\n\tEffect.prototype.create = function () {\n\n\t\tif ( this.shader == null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\textractDoubleSided( this, element );\n\n\t\tthis.shader = null;\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'profile_COMMON':\n\n\t\t\t\t\tthis.parseTechnique( this.parseProfileCOMMON( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tEffect.prototype.parseNewparam = function ( element ) {\n\n\t\tvar sid = element.getAttribute( 'sid' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'surface':\n\n\t\t\t\t\tthis.surface[sid] = ( new Surface( this ) ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sampler2D':\n\n\t\t\t\t\tthis.sampler[sid] = ( new Sampler2D( this ) ).parse( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseProfileCOMMON = function ( element ) {\n\n\t\tvar technique;\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'profile_COMMON':\n\n\t\t\t\t\tthis.parseProfileCOMMON( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique':\n\n\t\t\t\t\ttechnique = child;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'newparam':\n\n\t\t\t\t\tthis.parseNewparam( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'image':\n\n\t\t\t\t\tvar _image = ( new _Image() ).parse( child );\n\t\t\t\t\timages[ _image.id ] = _image;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'extra':\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log( child.nodeName );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn technique;\n\n\t};\n\n\tEffect.prototype.parseTechnique= function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'constant':\n\t\t\t\tcase 'lambert':\n\t\t\t\tcase 'blinn':\n\t\t\t\tcase 'phong':\n\n\t\t\t\t\tthis.shader = ( new Shader( child.nodeName, this ) ).parse( child );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'extra':\n\t\t\t\t\tthis.parseExtra(child);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseExtra = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'technique':\n\t\t\t\t\tthis.parseExtraTechnique( child );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tEffect.prototype.parseExtraTechnique= function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[i];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'bump':\n\t\t\t\t\tthis.shader.parse( element );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction InstanceEffect () {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceEffect.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute( 'url' ).replace( /^#/, '' );\n\t\treturn this;\n\n\t};\n\n\tfunction Animation() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.source = {};\n\t\tthis.sampler = [];\n\t\tthis.channel = [];\n\n\t};\n\n\tAnimation.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\t\tthis.source = {};\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'animation':\n\n\t\t\t\t\tvar anim = ( new Animation() ).parse( child );\n\n\t\t\t\t\tfor ( var src in anim.source ) {\n\n\t\t\t\t\t\tthis.source[ src ] = anim.source[ src ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( var j = 0; j < anim.channel.length; j ++ ) {\n\n\t\t\t\t\t\tthis.channel.push( anim.channel[ j ] );\n\t\t\t\t\t\tthis.sampler.push( anim.sampler[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'source':\n\n\t\t\t\t\tvar src = ( new Source() ).parse( child );\n\t\t\t\t\tthis.source[ src.id ] = src;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'sampler':\n\n\t\t\t\t\tthis.sampler.push( ( new Sampler( this ) ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'channel':\n\n\t\t\t\t\tthis.channel.push( ( new Channel( this ) ).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction Channel( animation ) {\n\n\t\tthis.animation = animation;\n\t\tthis.source = \"\";\n\t\tthis.target = \"\";\n\t\tthis.fullSid = null;\n\t\tthis.sid = null;\n\t\tthis.dotSyntax = null;\n\t\tthis.arrSyntax = null;\n\t\tthis.arrIndices = null;\n\t\tthis.member = null;\n\n\t};\n\n\tChannel.prototype.parse = function ( element ) {\n\n\t\tthis.source = element.getAttribute( 'source' ).replace( /^#/, '' );\n\t\tthis.target = element.getAttribute( 'target' );\n\n\t\tvar parts = this.target.split( '/' );\n\n\t\tvar id = parts.shift();\n\t\tvar sid = parts.shift();\n\n\t\tvar dotSyntax = ( sid.indexOf(\".\") >= 0 );\n\t\tvar arrSyntax = ( sid.indexOf(\"(\") >= 0 );\n\n\t\tif ( dotSyntax ) {\n\n\t\t\tparts = sid.split(\".\");\n\t\t\tthis.sid = parts.shift();\n\t\t\tthis.member = parts.shift();\n\n\t\t} else if ( arrSyntax ) {\n\n\t\t\tvar arrIndices = sid.split(\"(\");\n\t\t\tthis.sid = arrIndices.shift();\n\n\t\t\tfor (var j = 0; j < arrIndices.length; j ++ ) {\n\n\t\t\t\tarrIndices[j] = parseInt( arrIndices[j].replace(/\\)/, '') );\n\n\t\t\t}\n\n\t\t\tthis.arrIndices = arrIndices;\n\n\t\t} else {\n\n\t\t\tthis.sid = sid;\n\n\t\t}\n\n\t\tthis.fullSid = sid;\n\t\tthis.dotSyntax = dotSyntax;\n\t\tthis.arrSyntax = arrSyntax;\n\n\t\treturn this;\n\n\t};\n\n\tfunction Sampler ( animation ) {\n\n\t\tthis.id = \"\";\n\t\tthis.animation = animation;\n\t\tthis.inputs = [];\n\t\tthis.input = null;\n\t\tthis.output = null;\n\t\tthis.strideOut = null;\n\t\tthis.interpolation = null;\n\t\tthis.startTime = null;\n\t\tthis.endTime = null;\n\t\tthis.duration = 0;\n\n\t};\n\n\tSampler.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.inputs = [];\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'input':\n\n\t\t\t\t\tthis.inputs.push( (new Input()).parse( child ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tSampler.prototype.create = function () {\n\n\t\tfor ( var i = 0; i < this.inputs.length; i ++ ) {\n\n\t\t\tvar input = this.inputs[ i ];\n\t\t\tvar source = this.animation.source[ input.source ];\n\n\t\t\tswitch ( input.semantic ) {\n\n\t\t\t\tcase 'INPUT':\n\n\t\t\t\t\tthis.input = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OUTPUT':\n\n\t\t\t\t\tthis.output = source.read();\n\t\t\t\t\tthis.strideOut = source.accessor.stride;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'INTERPOLATION':\n\n\t\t\t\t\tthis.interpolation = source.read();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'IN_TANGENT':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OUT_TANGENT':\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.log(input.semantic);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.startTime = 0;\n\t\tthis.endTime = 0;\n\t\tthis.duration = 0;\n\n\t\tif ( this.input.length ) {\n\n\t\t\tthis.startTime = 100000000;\n\t\t\tthis.endTime = -100000000;\n\n\t\t\tfor ( var i = 0; i < this.input.length; i ++ ) {\n\n\t\t\t\tthis.startTime = Math.min( this.startTime, this.input[ i ] );\n\t\t\t\tthis.endTime = Math.max( this.endTime, this.input[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.duration = this.endTime - this.startTime;\n\n\t\t}\n\n\t};\n\n\tSampler.prototype.getData = function ( type, ndx, member ) {\n\n\t\tvar data;\n\n\t\tif ( type === 'matrix' && this.strideOut === 16 ) {\n\n\t\t\tdata = this.output[ ndx ];\n\n\t\t} else if ( this.strideOut > 1 ) {\n\n\t\t\tdata = [];\n\t\t\tndx *= this.strideOut;\n\n\t\t\tfor ( var i = 0; i < this.strideOut; ++i ) {\n\n\t\t\t\tdata[ i ] = this.output[ ndx + i ];\n\n\t\t\t}\n\n\t\t\tif ( this.strideOut === 3 ) {\n\n\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\tcase 'rotate':\n\t\t\t\t\tcase 'translate':\n\n\t\t\t\t\t\tfixCoords( data, -1 );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'scale':\n\n\t\t\t\t\t\tfixCoords( data, 1 );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t} else if ( this.strideOut === 4 && type === 'matrix' ) {\n\n\t\t\t\tfixCoords( data, -1 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdata = this.output[ ndx ];\n\n\t\t\tif ( member && type == 'translate' ) {\n\t\t\t\tdata = getConvertedTranslation( member, data );\n\t\t\t}\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction Key ( time ) {\n\n\t\tthis.targets = [];\n\t\tthis.time = time;\n\n\t};\n\n\tKey.prototype.addTarget = function ( fullSid, transform, member, data ) {\n\n\t\tthis.targets.push( {\n\t\t\tsid: fullSid,\n\t\t\tmember: member,\n\t\t\ttransform: transform,\n\t\t\tdata: data\n\t\t} );\n\n\t};\n\n\tKey.prototype.apply = function ( opt_sid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tvar target = this.targets[ i ];\n\n\t\t\tif ( !opt_sid || target.sid === opt_sid ) {\n\n\t\t\t\ttarget.transform.update( target.data, target.member );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tKey.prototype.getTarget = function ( fullSid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tif ( this.targets[ i ].sid === fullSid ) {\n\n\t\t\t\treturn this.targets[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tKey.prototype.hasTarget = function ( fullSid ) {\n\n\t\tfor ( var i = 0; i < this.targets.length; ++i ) {\n\n\t\t\tif ( this.targets[ i ].sid === fullSid ) {\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t};\n\n\t// TODO: Currently only doing linear interpolation. Should support full COLLADA spec.\n\tKey.prototype.interpolate = function ( nextKey, time ) {\n\n\t\tfor ( var i = 0, l = this.targets.length; i < l; i ++ ) {\n\n\t\t\tvar target = this.targets[ i ],\n\t\t\t\tnextTarget = nextKey.getTarget( target.sid ),\n\t\t\t\tdata;\n\n\t\t\tif ( target.transform.type !== 'matrix' && nextTarget ) {\n\n\t\t\t\tvar scale = ( time - this.time ) / ( nextKey.time - this.time ),\n\t\t\t\t\tnextData = nextTarget.data,\n\t\t\t\t\tprevData = target.data;\n\n\t\t\t\tif ( scale < 0 ) scale = 0;\n\t\t\t\tif ( scale > 1 ) scale = 1;\n\n\t\t\t\tif ( prevData.length ) {\n\n\t\t\t\t\tdata = [];\n\n\t\t\t\t\tfor ( var j = 0; j < prevData.length; ++j ) {\n\n\t\t\t\t\t\tdata[ j ] = prevData[ j ] + ( nextData[ j ] - prevData[ j ] ) * scale;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdata = prevData + ( nextData - prevData ) * scale;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tdata = target.data;\n\n\t\t\t}\n\n\t\t\ttarget.transform.update( data, target.member );\n\n\t\t}\n\n\t};\n\n\t// Camera\n\tfunction Camera() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.technique = \"\";\n\n\t};\n\n\tCamera.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'optics':\n\n\t\t\t\t\tthis.parseOptics( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tCamera.prototype.parseOptics = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tif ( element.childNodes[ i ].nodeName == 'technique_common' ) {\n\n\t\t\t\tvar technique = element.childNodes[ i ];\n\n\t\t\t\tfor ( var j = 0; j < technique.childNodes.length; j ++ ) {\n\n\t\t\t\t\tthis.technique = technique.childNodes[ j ].nodeName;\n\n\t\t\t\t\tif ( this.technique == 'perspective' ) {\n\n\t\t\t\t\t\tvar perspective = technique.childNodes[ j ];\n\n\t\t\t\t\t\tfor ( var k = 0; k < perspective.childNodes.length; k ++ ) {\n\n\t\t\t\t\t\t\tvar param = perspective.childNodes[ k ];\n\n\t\t\t\t\t\t\tswitch ( param.nodeName ) {\n\n\t\t\t\t\t\t\t\tcase 'yfov':\n\t\t\t\t\t\t\t\t\tthis.yfov = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'xfov':\n\t\t\t\t\t\t\t\t\tthis.xfov = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'znear':\n\t\t\t\t\t\t\t\t\tthis.znear = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'zfar':\n\t\t\t\t\t\t\t\t\tthis.zfar = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'aspect_ratio':\n\t\t\t\t\t\t\t\t\tthis.aspect_ratio = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( this.technique == 'orthographic' ) {\n\n\t\t\t\t\t\tvar orthographic = technique.childNodes[ j ];\n\n\t\t\t\t\t\tfor ( var k = 0; k < orthographic.childNodes.length; k ++ ) {\n\n\t\t\t\t\t\t\tvar param = orthographic.childNodes[ k ];\n\n\t\t\t\t\t\t\tswitch ( param.nodeName ) {\n\n\t\t\t\t\t\t\t\tcase 'xmag':\n\t\t\t\t\t\t\t\t\tthis.xmag = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'ymag':\n\t\t\t\t\t\t\t\t\tthis.ymag = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'znear':\n\t\t\t\t\t\t\t\t\tthis.znear = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'zfar':\n\t\t\t\t\t\t\t\t\tthis.zfar = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'aspect_ratio':\n\t\t\t\t\t\t\t\t\tthis.aspect_ratio = param.textContent;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceCamera() {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceCamera.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\n\t\treturn this;\n\n\t};\n\n\t// Light\n\n\tfunction Light() {\n\n\t\tthis.id = \"\";\n\t\tthis.name = \"\";\n\t\tthis.technique = \"\";\n\n\t};\n\n\tLight.prototype.parse = function ( element ) {\n\n\t\tthis.id = element.getAttribute( 'id' );\n\t\tthis.name = element.getAttribute( 'name' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\t\t\tif ( child.nodeType != 1 ) continue;\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'technique_common':\n\n\t\t\t\t\tthis.parseCommon( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'technique':\n\n\t\t\t\t\tthis.parseTechnique( child );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tLight.prototype.parseCommon = function ( element ) {\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tswitch ( element.childNodes[ i ].nodeName ) {\n\n\t\t\t\tcase 'directional':\n\t\t\t\tcase 'point':\n\t\t\t\tcase 'spot':\n\t\t\t\tcase 'ambient':\n\n\t\t\t\t\tthis.technique = element.childNodes[ i ].nodeName;\n\n\t\t\t\t\tvar light = element.childNodes[ i ];\n\n\t\t\t\t\tfor ( var j = 0; j < light.childNodes.length; j ++ ) {\n\n\t\t\t\t\t\tvar child = light.childNodes[j];\n\n\t\t\t\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\t\t\t\tcase 'color':\n\n\t\t\t\t\t\t\t\tvar rgba = _floats( child.textContent );\n\t\t\t\t\t\t\t\tthis.color = new THREE.Color(0);\n\t\t\t\t\t\t\t\tthis.color.setRGB( rgba[0], rgba[1], rgba[2] );\n\t\t\t\t\t\t\t\tthis.color.a = rgba[3];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'falloff_angle':\n\n\t\t\t\t\t\t\t\tthis.falloff_angle = parseFloat( child.textContent );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'quadratic_attenuation':\n\t\t\t\t\t\t\t\tvar f = parseFloat( child.textContent );\n\t\t\t\t\t\t\t\tthis.distance = f ? Math.sqrt( 1/f ) : 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tLight.prototype.parseTechnique = function ( element ) {\n\n\t\tthis.profile = element.getAttribute( 'profile' );\n\n\t\tfor ( var i = 0; i < element.childNodes.length; i ++ ) {\n\n\t\t\tvar child = element.childNodes[ i ];\n\n\t\t\tswitch ( child.nodeName ) {\n\n\t\t\t\tcase 'intensity':\n\n\t\t\t\t\tthis.intensity = parseFloat(child.textContent);\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t};\n\n\tfunction InstanceLight() {\n\n\t\tthis.url = \"\";\n\n\t};\n\n\tInstanceLight.prototype.parse = function ( element ) {\n\n\t\tthis.url = element.getAttribute('url').replace(/^#/, '');\n\n\t\treturn this;\n\n\t};\n\n\tfunction _source( element ) {\n\n\t\tvar id = element.getAttribute( 'id' );\n\n\t\tif ( sources[ id ] != undefined ) {\n\n\t\t\treturn sources[ id ];\n\n\t\t}\n\n\t\tsources[ id ] = ( new Source(id )).parse( element );\n\t\treturn sources[ id ];\n\n\t};\n\n\tfunction _nsResolver( nsPrefix ) {\n\n\t\tif ( nsPrefix == \"dae\" ) {\n\n\t\t\treturn \"http://www.collada.org/2005/11/COLLADASchema\";\n\n\t\t}\n\n\t\treturn null;\n\n\t};\n\n\tfunction _bools( str ) {\n\n\t\tvar raw = _strings( str );\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( (raw[i] == 'true' || raw[i] == '1') ? true : false );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _floats( str ) {\n\n\t\tvar raw = _strings(str);\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( parseFloat( raw[ i ] ) );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _ints( str ) {\n\n\t\tvar raw = _strings( str );\n\t\tvar data = [];\n\n\t\tfor ( var i = 0, l = raw.length; i < l; i ++ ) {\n\n\t\t\tdata.push( parseInt( raw[ i ], 10 ) );\n\n\t\t}\n\n\t\treturn data;\n\n\t};\n\n\tfunction _strings( str ) {\n\n\t\treturn ( str.length > 0 ) ? _trimString( str ).split( /\\s+/ ) : [];\n\n\t};\n\n\tfunction _trimString( str ) {\n\n\t\treturn str.replace( /^\\s+/, \"\" ).replace( /\\s+$/, \"\" );\n\n\t};\n\n\tfunction _attr_as_float( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn parseFloat( element.getAttribute( name ) );\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _attr_as_int( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn parseInt( element.getAttribute( name ), 10) ;\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _attr_as_string( element, name, defaultValue ) {\n\n\t\tif ( element.hasAttribute( name ) ) {\n\n\t\t\treturn element.getAttribute( name );\n\n\t\t} else {\n\n\t\t\treturn defaultValue;\n\n\t\t}\n\n\t};\n\n\tfunction _format_float( f, num ) {\n\n\t\tif ( f === undefined ) {\n\n\t\t\tvar s = '0.';\n\n\t\t\twhile ( s.length < num + 2 ) {\n\n\t\t\t\ts += '0';\n\n\t\t\t}\n\n\t\t\treturn s;\n\n\t\t}\n\n\t\tnum = num || 2;\n\n\t\tvar parts = f.toString().split( '.' );\n\t\tparts[ 1 ] = parts.length > 1 ? parts[ 1 ].substr( 0, num ) : \"0\";\n\n\t\twhile( parts[ 1 ].length < num ) {\n\n\t\t\tparts[ 1 ] += '0';\n\n\t\t}\n\n\t\treturn parts.join( '.' );\n\n\t};\n\n\tfunction extractDoubleSided( obj, element ) {\n\n\t\tobj.doubleSided = false;\n\n\t\tvar node = element.querySelectorAll('extra double_sided')[0];\n\n\t\tif ( node ) {\n\n\t\t\tif ( node && parseInt( node.textContent, 10 ) === 1 ) {\n\n\t\t\t\tobj.doubleSided = true;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Up axis conversion\n\n\tfunction setUpConversion() {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\tupConversion = null;\n\n\t\t} else {\n\n\t\t\tswitch ( colladaUp ) {\n\n\t\t\t\tcase 'X':\n\n\t\t\t\t\tupConversion = options.upAxis === 'Y' ? 'XtoY' : 'XtoZ';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Y':\n\n\t\t\t\t\tupConversion = options.upAxis === 'X' ? 'YtoX' : 'YtoZ';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Z':\n\n\t\t\t\t\tupConversion = options.upAxis === 'X' ? 'ZtoX' : 'ZtoY';\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction fixCoords( data, sign ) {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tswitch ( upConversion ) {\n\n\t\t\tcase 'XtoY':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = sign * data[ 1 ];\n\t\t\t\tdata[ 1 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XtoZ':\n\n\t\t\t\tvar tmp = data[ 2 ];\n\t\t\t\tdata[ 2 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 0 ];\n\t\t\t\tdata[ 0 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YtoX':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = sign * tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YtoZ':\n\n\t\t\t\tvar tmp = data[ 1 ];\n\t\t\t\tdata[ 1 ] = sign * data[ 2 ];\n\t\t\t\tdata[ 2 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZtoX':\n\n\t\t\t\tvar tmp = data[ 0 ];\n\t\t\t\tdata[ 0 ] = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 2 ];\n\t\t\t\tdata[ 2 ] = tmp;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZtoY':\n\n\t\t\t\tvar tmp = data[ 1 ];\n\t\t\t\tdata[ 1 ] = data[ 2 ];\n\t\t\t\tdata[ 2 ] = sign * tmp;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tfunction getConvertedTranslation( axis, data ) {\n\n\t\tif ( options.convertUpAxis !== true || colladaUp === options.upAxis ) {\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\tswitch ( axis ) {\n\t\t\tcase 'X':\n\t\t\t\tdata = upConversion == 'XtoY' ? data * -1 : data;\n\t\t\t\tbreak;\n\t\t\tcase 'Y':\n\t\t\t\tdata = upConversion == 'YtoZ' || upConversion == 'YtoX' ? data * -1 : data;\n\t\t\t\tbreak;\n\t\t\tcase 'Z':\n\t\t\t\tdata = upConversion == 'ZtoY' ? data * -1 : data ;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn data;\n\t};\n\n\tfunction getConvertedVec3( data, offset ) {\n\n\t\tvar arr = [ data[ offset ], data[ offset + 1 ], data[ offset + 2 ] ];\n\t\tfixCoords( arr, -1 );\n\t\treturn new THREE.Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] );\n\n\t};\n\n\tfunction getConvertedMat4( data ) {\n\n\t\tif ( options.convertUpAxis ) {\n\n\t\t\t// First fix rotation and scale\n\n\t\t\t// Columns first\n\t\t\tvar arr = [ data[ 0 ], data[ 4 ], data[ 8 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 0 ] = arr[ 0 ];\n\t\t\tdata[ 4 ] = arr[ 1 ];\n\t\t\tdata[ 8 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 1 ], data[ 5 ], data[ 9 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 1 ] = arr[ 0 ];\n\t\t\tdata[ 5 ] = arr[ 1 ];\n\t\t\tdata[ 9 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 2 ], data[ 6 ], data[ 10 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 2 ] = arr[ 0 ];\n\t\t\tdata[ 6 ] = arr[ 1 ];\n\t\t\tdata[ 10 ] = arr[ 2 ];\n\t\t\t// Rows second\n\t\t\tarr = [ data[ 0 ], data[ 1 ], data[ 2 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 0 ] = arr[ 0 ];\n\t\t\tdata[ 1 ] = arr[ 1 ];\n\t\t\tdata[ 2 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 4 ], data[ 5 ], data[ 6 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 4 ] = arr[ 0 ];\n\t\t\tdata[ 5 ] = arr[ 1 ];\n\t\t\tdata[ 6 ] = arr[ 2 ];\n\t\t\tarr = [ data[ 8 ], data[ 9 ], data[ 10 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 8 ] = arr[ 0 ];\n\t\t\tdata[ 9 ] = arr[ 1 ];\n\t\t\tdata[ 10 ] = arr[ 2 ];\n\n\t\t\t// Now fix translation\n\t\t\tarr = [ data[ 3 ], data[ 7 ], data[ 11 ] ];\n\t\t\tfixCoords( arr, -1 );\n\t\t\tdata[ 3 ] = arr[ 0 ];\n\t\t\tdata[ 7 ] = arr[ 1 ];\n\t\t\tdata[ 11 ] = arr[ 2 ];\n\n\t\t}\n\n\t\treturn new THREE.Matrix4(\n\t\t\tdata[0], data[1], data[2], data[3],\n\t\t\tdata[4], data[5], data[6], data[7],\n\t\t\tdata[8], data[9], data[10], data[11],\n\t\t\tdata[12], data[13], data[14], data[15]\n\t\t\t);\n\n\t};\n\n\tfunction getConvertedIndex( index ) {\n\n\t\tif ( index > -1 && index < 3 ) {\n\n\t\t\tvar members = ['X', 'Y', 'Z'],\n\t\t\t\tindices = { X: 0, Y: 1, Z: 2 };\n\n\t\t\tindex = getConvertedMember( members[ index ] );\n\t\t\tindex = indices[ index ];\n\n\t\t}\n\n\t\treturn index;\n\n\t};\n\n\tfunction getConvertedMember( member ) {\n\n\t\tif ( options.convertUpAxis ) {\n\n\t\t\tswitch ( member ) {\n\n\t\t\t\tcase 'X':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoY':\n\t\t\t\t\t\tcase 'XtoZ':\n\t\t\t\t\t\tcase 'YtoX':\n\n\t\t\t\t\t\t\tmember = 'Y';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'ZtoX':\n\n\t\t\t\t\t\t\tmember = 'Z';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Y':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoY':\n\t\t\t\t\t\tcase 'YtoX':\n\t\t\t\t\t\tcase 'ZtoX':\n\n\t\t\t\t\t\t\tmember = 'X';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'XtoZ':\n\t\t\t\t\t\tcase 'YtoZ':\n\t\t\t\t\t\tcase 'ZtoY':\n\n\t\t\t\t\t\t\tmember = 'Z';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Z':\n\n\t\t\t\t\tswitch ( upConversion ) {\n\n\t\t\t\t\t\tcase 'XtoZ':\n\n\t\t\t\t\t\t\tmember = 'X';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'YtoZ':\n\t\t\t\t\t\tcase 'ZtoX':\n\t\t\t\t\t\tcase 'ZtoY':\n\n\t\t\t\t\t\t\tmember = 'Y';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn member;\n\n\t};\n\n\treturn {\n\n\t\tload: load,\n\t\tparse: parse,\n\t\tsetPreferredShading: setPreferredShading,\n\t\tapplySkin: applySkin,\n\t\tgeometries : geometries,\n\t\toptions: options\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/DDSLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/DDSLoader.js",
"module-type": "library",
"text": "/*\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.DDSLoader = function () {};\n\nTHREE.DDSLoader.prototype = {\n\n\tconstructor: THREE.DDSLoader,\n\n\tload: function ( url, onLoad, onError ) {\n var func = \"THREE.DDSLoader.load\";\n hack.log(\"url: \"+url, hack.loader, func);\n\n\t\tvar scope = this;\n\n\t\tvar images = [];\n\n\t\tvar texture = new THREE.CompressedTexture();\n\t\ttexture.image = images;\n\n\t\t// no flipping for cube textures\n\t\t// (also flipping doesn't work for compressed textures )\n\n\t\ttexture.flipY = false;\n\n\t\t// can't generate mipmaps for compressed textures\n\t\t// mips must be embedded in DDS files\n\n\t\ttexture.generateMipmaps = false;\n\n\t\tif ( url instanceof Array ) {\n\n\t\t\tvar loaded = 0;\n\n\t\t\tvar loader = new THREE.XHRLoader();\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\n\t\t\tvar loadTexture = function ( i ) {\n\t\t\n\t\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\t\tvar dds = scope.parse( buffer, true );\n\n\t\t\t\t\timages[ i ] = {\n\t\t\t\t\t\twidth: dds.width,\n\t\t\t\t\t\theight: dds.height,\n\t\t\t\t\t\tformat: dds.format,\n\t\t\t\t\t\tmipmaps: dds.mipmaps\n\t\t\t\t\t}\n\n\t\t\t\t\tloaded += 1;\n\n\t\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\t\ttexture.format = dds.format;\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tvar loader = new THREE.XHRLoader();\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tvar dds = scope.parse( buffer, true );\n\n\t\t\t\tif ( dds.isCubemap ) {\n\n\t\t\t\t\tvar faces = dds.mipmaps.length / dds.mipmapCount;\n\n\t\t\t\t\tfor ( var f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps : [] };\n\n\t\t\t\t\t\tfor ( var i = 0; i < dds.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( dds.mipmaps[ f * dds.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = dds.format;\n\t\t\t\t\t\t\timages[ f ].width = dds.width;\n\t\t\t\t\t\t\timages[ f ].height = dds.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = dds.width;\n\t\t\t\t\ttexture.image.height = dds.height;\n\t\t\t\t\ttexture.mipmaps = dds.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = dds.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t} );\n\n\t\t}\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n\n\t\treturn texture;\n\n\t},\n\n\tparse: function ( buffer, loadMipmaps ) {\n\n\t\tvar dds = { mipmaps: [], width: 0, height: 0, format: null, mipmapCount: 1 };\n\n\t\t// Adapted from @toji's DDS utils\n\t\t//\thttps://github.com/toji/webgl-texture-utils/blob/master/texture-util/dds.js\n\n\t\t// All values and structures referenced from:\n\t\t// http://msdn.microsoft.com/en-us/library/bb943991.aspx/\n\n\t\tvar DDS_MAGIC = 0x20534444;\n\n\t\tvar DDSD_CAPS = 0x1,\n\t\t\tDDSD_HEIGHT = 0x2,\n\t\t\tDDSD_WIDTH = 0x4,\n\t\t\tDDSD_PITCH = 0x8,\n\t\t\tDDSD_PIXELFORMAT = 0x1000,\n\t\t\tDDSD_MIPMAPCOUNT = 0x20000,\n\t\t\tDDSD_LINEARSIZE = 0x80000,\n\t\t\tDDSD_DEPTH = 0x800000;\n\n\t\tvar DDSCAPS_COMPLEX = 0x8,\n\t\t\tDDSCAPS_MIPMAP = 0x400000,\n\t\t\tDDSCAPS_TEXTURE = 0x1000;\n\n\t\tvar DDSCAPS2_CUBEMAP = 0x200,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEX = 0x400,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEX = 0x800,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEY = 0x1000,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000,\n\t\t\tDDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000,\n\t\t\tDDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000,\n\t\t\tDDSCAPS2_VOLUME = 0x200000;\n\n\t\tvar DDPF_ALPHAPIXELS = 0x1,\n\t\t\tDDPF_ALPHA = 0x2,\n\t\t\tDDPF_FOURCC = 0x4,\n\t\t\tDDPF_RGB = 0x40,\n\t\t\tDDPF_YUV = 0x200,\n\t\t\tDDPF_LUMINANCE = 0x20000;\n\n\t\tfunction fourCCToInt32( value ) {\n\n\t\t\treturn value.charCodeAt(0) +\n\t\t\t\t(value.charCodeAt(1) << 8) +\n\t\t\t\t(value.charCodeAt(2) << 16) +\n\t\t\t\t(value.charCodeAt(3) << 24);\n\n\t\t}\n\n\t\tfunction int32ToFourCC( value ) {\n\n\t\t\treturn String.fromCharCode(\n\t\t\t\tvalue & 0xff,\n\t\t\t\t(value >> 8) & 0xff,\n\t\t\t\t(value >> 16) & 0xff,\n\t\t\t\t(value >> 24) & 0xff\n\t\t\t);\n\t\t}\n\n\t\tfunction loadARGBMip( buffer, dataOffset, width, height ) {\n\t\t\tvar dataLength = width*height*4;\n\t\t\tvar srcBuffer = new Uint8Array( buffer, dataOffset, dataLength );\n\t\t\tvar byteArray = new Uint8Array( dataLength );\n\t\t\tvar dst = 0;\n\t\t\tvar src = 0;\n\t\t\tfor ( var y = 0; y < height; y++ ) {\n\t\t\t\tfor ( var x = 0; x < width; x++ ) {\n\t\t\t\t\tvar b = srcBuffer[src]; src++;\n\t\t\t\t\tvar g = srcBuffer[src]; src++;\n\t\t\t\t\tvar r = srcBuffer[src]; src++;\n\t\t\t\t\tvar a = srcBuffer[src]; src++;\n\t\t\t\t\tbyteArray[dst] = r; dst++;\t//r\n\t\t\t\t\tbyteArray[dst] = g; dst++;\t//g\n\t\t\t\t\tbyteArray[dst] = b; dst++;\t//b\n\t\t\t\t\tbyteArray[dst] = a; dst++;\t//a\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn byteArray;\n\t\t}\n\n\t\tvar FOURCC_DXT1 = fourCCToInt32(\"DXT1\");\n\t\tvar FOURCC_DXT3 = fourCCToInt32(\"DXT3\");\n\t\tvar FOURCC_DXT5 = fourCCToInt32(\"DXT5\");\n\n\t\tvar headerLengthInt = 31; // The header length in 32 bit ints\n\n\t\t// Offsets into the header array\n\n\t\tvar off_magic = 0;\n\n\t\tvar off_size = 1;\n\t\tvar off_flags = 2;\n\t\tvar off_height = 3;\n\t\tvar off_width = 4;\n\n\t\tvar off_mipmapCount = 7;\n\n\t\tvar off_pfFlags = 20;\n\t\tvar off_pfFourCC = 21;\n\t\tvar off_RGBBitCount = 22;\n\t\tvar off_RBitMask = 23;\n\t\tvar off_GBitMask = 24;\n\t\tvar off_BBitMask = 25;\n\t\tvar off_ABitMask = 26;\n\n\t\tvar off_caps = 27;\n\t\tvar off_caps2 = 28;\n\t\tvar off_caps3 = 29;\n\t\tvar off_caps4 = 30;\n\n\t\t// Parse header\n\n\t\tvar header = new Int32Array( buffer, 0, headerLengthInt );\n\n\t\tif ( header[ off_magic ] !== DDS_MAGIC ) {\n\n\t\t\tconsole.error( 'THREE.DDSLoader.parse: Invalid magic number in DDS header.' );\n\t\t\treturn dds;\n\n\t\t}\n\n\t\tif ( ! header[ off_pfFlags ] & DDPF_FOURCC ) {\n\n\t\t\tconsole.error( 'THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code.' );\n\t\t\treturn dds;\n\n\t\t}\n\n\t\tvar blockBytes;\n\n\t\tvar fourCC = header[ off_pfFourCC ];\n\n\t\tvar isRGBAUncompressed = false;\n\n\t\tswitch ( fourCC ) {\n\n\t\t\tcase FOURCC_DXT1:\n\n\t\t\t\tblockBytes = 8;\n\t\t\t\tdds.format = THREE.RGB_S3TC_DXT1_Format;\n\t\t\t\tbreak;\n\n\t\t\tcase FOURCC_DXT3:\n\n\t\t\t\tblockBytes = 16;\n\t\t\t\tdds.format = THREE.RGBA_S3TC_DXT3_Format;\n\t\t\t\tbreak;\n\n\t\t\tcase FOURCC_DXT5:\n\n\t\t\t\tblockBytes = 16;\n\t\t\t\tdds.format = THREE.RGBA_S3TC_DXT5_Format;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tif( header[off_RGBBitCount] ==32 \n\t\t\t\t\t&& header[off_RBitMask]&0xff0000\n\t\t\t\t\t&& header[off_GBitMask]&0xff00 \n\t\t\t\t\t&& header[off_BBitMask]&0xff\n\t\t\t\t\t&& header[off_ABitMask]&0xff000000 ) {\n\t\t\t\t\tisRGBAUncompressed = true;\n\t\t\t\t\tblockBytes = 64;\n\t\t\t\t\tdds.format = THREE.RGBAFormat;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error( 'THREE.DDSLoader.parse: Unsupported FourCC code ', int32ToFourCC( fourCC ) );\n\t\t\t\t\treturn dds;\n\t\t\t\t}\n\t\t}\n\n\t\tdds.mipmapCount = 1;\n\n\t\tif ( header[ off_flags ] & DDSD_MIPMAPCOUNT && loadMipmaps !== false ) {\n\n\t\t\tdds.mipmapCount = Math.max( 1, header[ off_mipmapCount ] );\n\n\t\t}\n\n\t\t//TODO: Verify that all faces of the cubemap are present with DDSCAPS2_CUBEMAP_POSITIVEX, etc.\n\n\t\tdds.isCubemap = header[ off_caps2 ] & DDSCAPS2_CUBEMAP ? true : false;\n\n\t\tdds.width = header[ off_width ];\n\t\tdds.height = header[ off_height ];\n\n\t\tvar dataOffset = header[ off_size ] + 4;\n\n\t\t// Extract mipmaps buffers\n\n\t\tvar width = dds.width;\n\t\tvar height = dds.height;\n\n\t\tvar faces = dds.isCubemap ? 6 : 1;\n\n\t\tfor ( var face = 0; face < faces; face ++ ) {\n\n\t\t\tfor ( var i = 0; i < dds.mipmapCount; i ++ ) {\n\n\t\t\t\tif( isRGBAUncompressed ) {\n\t\t\t\t\tvar byteArray = loadARGBMip( buffer, dataOffset, width, height );\n\t\t\t\t\tvar dataLength = byteArray.length;\n\t\t\t\t} else {\n\t\t\t\t\tvar dataLength = Math.max( 4, width ) / 4 * Math.max( 4, height ) / 4 * blockBytes;\n\t\t\t\t\tvar byteArray = new Uint8Array( buffer, dataOffset, dataLength );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar mipmap = { \"data\": byteArray, \"width\": width, \"height\": height };\n\t\t\t\tdds.mipmaps.push( mipmap );\n\n\t\t\t\tdataOffset += dataLength;\n\n\t\t\t\twidth = Math.max( width * 0.5, 1 );\n\t\t\t\theight = Math.max( height * 0.5, 1 );\n\n\t\t\t}\n\n\t\t\twidth = dds.width;\n\t\t\theight = dds.height;\n\n\t\t}\n\n\t\treturn dds;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/MTLLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/MTLLoader.js",
"module-type": "library",
"text": "/**\n * Loads a Wavefront .mtl file specifying materials\n *\n * @author angelxuanchang\n */\n\nTHREE.MTLLoader = function( baseUrl, options, crossOrigin ) {\n\n\tthis.baseUrl = baseUrl;\n\tthis.options = options;\n\tthis.crossOrigin = crossOrigin;\n\n};\n\nTHREE.MTLLoader.prototype = {\n\n\tconstructor: THREE.MTLLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader();\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tonLoad( scope.parse( text ) );\n\n\t\t} );\n\n\t},\n\n\t/**\n\t * Parses loaded MTL file\n\t * @param text - Content of MTL file\n\t * @return {THREE.MTLLoader.MaterialCreator}\n\t */\n\tparse: function ( text ) {\n\n\t\tvar lines = text.split( \"\\n\" );\n\t\tvar info = {};\n\t\tvar delimiter_pattern = /\\s+/;\n\t\tvar materialsInfo = {};\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim();\n\n\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\t// Blank line or comment ignore\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tvar pos = line.indexOf( ' ' );\n\n\t\t\tvar key = ( pos >= 0 ) ? line.substring( 0, pos ) : line;\n\t\t\tkey = key.toLowerCase();\n\n\t\t\tvar value = ( pos >= 0 ) ? line.substring( pos + 1 ) : \"\";\n\t\t\tvalue = value.trim();\n\n\t\t\tif ( key === \"newmtl\" ) {\n\n\t\t\t\t// New material\n\n\t\t\t\tinfo = { name: value };\n\t\t\t\tmaterialsInfo[ value ] = info;\n\n\t\t\t} else if ( info ) {\n\n\t\t\t\tif ( key === \"ka\" || key === \"kd\" || key === \"ks\" ) {\n\n\t\t\t\t\tvar ss = value.split( delimiter_pattern, 3 );\n\t\t\t\t\tinfo[ key ] = [ parseFloat( ss[0] ), parseFloat( ss[1] ), parseFloat( ss[2] ) ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tinfo[ key ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar materialCreator = new THREE.MTLLoader.MaterialCreator( this.baseUrl, this.options );\n\t\tmaterialCreator.setMaterials( materialsInfo );\n\t\treturn materialCreator;\n\n\t}\n\n};\n\n/**\n * Create a new THREE-MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n * side: Which side to apply the material\n * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n * wrap: What type of wrapping to apply for textures\n * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n * Default: false, assumed to be already normalized\n * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n * Default: false\n * invertTransparency: If transparency need to be inverted (inversion is needed if d = 0 is fully opaque)\n * Default: false (d = 1 is fully opaque)\n * @constructor\n */\n\nTHREE.MTLLoader.MaterialCreator = function( baseUrl, options ) {\n\n\tthis.baseUrl = baseUrl;\n\tthis.options = options;\n\tthis.materialsInfo = {};\n\tthis.materials = {};\n\tthis.materialsArray = [];\n\tthis.nameLookup = {};\n\n\tthis.side = ( this.options && this.options.side )? this.options.side: THREE.FrontSide;\n\tthis.wrap = ( this.options && this.options.wrap )? this.options.wrap: THREE.RepeatWrapping;\n\n};\n\nTHREE.MTLLoader.MaterialCreator.prototype = {\n\n\tconstructor: THREE.MTLLoader.MaterialCreator,\n\n\tsetMaterials: function( materialsInfo ) {\n\n\t\tthis.materialsInfo = this.convert( materialsInfo );\n\t\tthis.materials = {};\n\t\tthis.materialsArray = [];\n\t\tthis.nameLookup = {};\n\n\t},\n\n\tconvert: function( materialsInfo ) {\n\n\t\tif ( !this.options ) return materialsInfo;\n\n\t\tvar converted = {};\n\n\t\tfor ( var mn in materialsInfo ) {\n\n\t\t\t// Convert materials info into normalized form based on options\n\n\t\t\tvar mat = materialsInfo[ mn ];\n\n\t\t\tvar covmat = {};\n\n\t\t\tconverted[ mn ] = covmat;\n\n\t\t\tfor ( var prop in mat ) {\n\n\t\t\t\tvar save = true;\n\t\t\t\tvar value = mat[ prop ];\n\t\t\t\tvar lprop = prop.toLowerCase();\n\n\t\t\t\tswitch ( lprop ) {\n\n\t\t\t\t\tcase 'kd':\n\t\t\t\t\tcase 'ka':\n\t\t\t\t\tcase 'ks':\n\n\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\t\tif ( this.options && this.options.normalizeRGB ) {\n\n\t\t\t\t\t\t\tvalue = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( this.options && this.options.ignoreZeroRGBs ) {\n\n\t\t\t\t\t\t\tif ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 1 ] === 0 ) {\n\n\t\t\t\t\t\t\t\t// ignore\n\n\t\t\t\t\t\t\t\tsave = false;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'd':\n\n\t\t\t\t\t\t// According to MTL format (http://paulbourke.net/dataformats/mtl/):\n\t\t\t\t\t\t// d is dissolve for current material\n\t\t\t\t\t\t// factor of 1.0 is fully opaque, a factor of 0 is fully dissolved (completely transparent)\n\n\t\t\t\t\t\tif ( this.options && this.options.invertTransparency ) {\n\n\t\t\t\t\t\t\tvalue = 1 - value;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( save ) {\n\n\t\t\t\t\tcovmat[ lprop ] = value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn converted;\n\n\t},\n\n\tpreload: function () {\n\n\t\tfor ( var mn in this.materialsInfo ) {\n\n\t\t\tthis.create( mn );\n\n\t\t}\n\n\t},\n\n\tgetIndex: function( materialName ) {\n\n\t\treturn this.nameLookup[ materialName ];\n\n\t},\n\n\tgetAsArray: function() {\n\n\t\tvar index = 0;\n\n\t\tfor ( var mn in this.materialsInfo ) {\n\n\t\t\tthis.materialsArray[ index ] = this.create( mn );\n\t\t\tthis.nameLookup[ mn ] = index;\n\t\t\tindex ++;\n\n\t\t}\n\n\t\treturn this.materialsArray;\n\n\t},\n\n\tcreate: function ( materialName ) {\n\n\t\tif ( this.materials[ materialName ] === undefined ) {\n\n\t\t\tthis.createMaterial_( materialName );\n\n\t\t}\n\n\t\treturn this.materials[ materialName ];\n\n\t},\n\n\tcreateMaterial_: function ( materialName ) {\n\n\t\t// Create material\n\n\t\tvar mat = this.materialsInfo[ materialName ];\n\t\tvar params = {\n\n\t\t\tname: materialName,\n\t\t\tside: this.side\n\n\t\t};\n\n\t\tfor ( var prop in mat ) {\n\n\t\t\tvar value = mat[ prop ];\n\n\t\t\tswitch ( prop.toLowerCase() ) {\n\n\t\t\t\t// Ns is material specular exponent\n\n\t\t\t\tcase 'kd':\n\n\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\n\t\t\t\t\tparams[ 'diffuse' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ka':\n\n\t\t\t\t\t// Ambient color (color under shadow) using RGB values\n\n\t\t\t\t\tparams[ 'ambient' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ks':\n\n\t\t\t\t\t// Specular color (color when light is reflected from shiny surface) using RGB values\n\t\t\t\t\tparams[ 'specular' ] = new THREE.Color().fromArray( value );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map_kd':\n\n\t\t\t\t\t// Diffuse texture map\n\n\t\t\t\t\tparams[ 'map' ] = this.loadTexture( this.baseUrl + value );\n\t\t\t\t\tparams[ 'map' ].wrapS = this.wrap;\n\t\t\t\t\tparams[ 'map' ].wrapT = this.wrap;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ns':\n\n\t\t\t\t\t// The specular exponent (defines the focus of the specular highlight)\n\t\t\t\t\t// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n\n\t\t\t\t\tparams['shininess'] = value;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'd':\n\n\t\t\t\t\t// According to MTL format (http://paulbourke.net/dataformats/mtl/):\n\t\t\t\t\t// d is dissolve for current material\n\t\t\t\t\t// factor of 1.0 is fully opaque, a factor of 0 is fully dissolved (completely transparent)\n\n\t\t\t\t\tif ( value < 1 ) {\n\n\t\t\t\t\t\tparams['transparent'] = true;\n\t\t\t\t\t\tparams['opacity'] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( params[ 'diffuse' ] ) {\n\n\t\t\tif ( !params[ 'ambient' ]) params[ 'ambient' ] = params[ 'diffuse' ];\n\t\t\tparams[ 'color' ] = params[ 'diffuse' ];\n\n\t\t}\n\n\t\tthis.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n\t\treturn this.materials[ materialName ];\n\n\t},\n\n\n\tloadTexture: function ( url, mapping, onLoad, onError ) {\n\n\t\tvar texture;\n\t\tvar loader = THREE.Loader.Handlers.get( url );\n\n\t\tif ( loader !== null ) {\n\n\t\t\ttexture = loader.load( url, onLoad );\n\n\t\t} else {\n\n\t\t\ttexture = new THREE.Texture();\n\n\t\t\tloader = new THREE.ImageLoader();\n\t\t\tloader.crossOrigin = this.crossOrigin;\n\t\t\tloader.load( url, function ( image ) {\n\n\t\t\t\ttexture.image = THREE.MTLLoader.ensurePowerOfTwo_( image );\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t} );\n\n\t\t}\n\n\t\ttexture.mapping = mapping;\n\n\t\treturn texture;\n\n\t}\n\n};\n\nTHREE.MTLLoader.ensurePowerOfTwo_ = function ( image ) {\n\n\tif ( ! THREE.Math.isPowerOfTwo( image.width ) || ! THREE.Math.isPowerOfTwo( image.height ) ) {\n\n\t\tvar canvas = document.createElement( \"canvas\" );\n\t\tcanvas.width = THREE.MTLLoader.nextHighestPowerOfTwo_( image.width );\n\t\tcanvas.height = THREE.MTLLoader.nextHighestPowerOfTwo_( image.height );\n\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tctx.drawImage( image, 0, 0, image.width, image.height, 0, 0, canvas.width, canvas.height );\n\t\treturn canvas;\n\n\t}\n\n\treturn image;\n\n};\n\nTHREE.MTLLoader.nextHighestPowerOfTwo_ = function( x ) {\n\n\t--x;\n\n\tfor ( var i = 1; i < 32; i <<= 1 ) {\n\n\t\tx = x | x >> i;\n\n\t}\n\n\treturn x + 1;\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.MTLLoader.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/OBJLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/OBJLoader.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.OBJLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nTHREE.OBJLoader.prototype = {\n\n\tconstructor: THREE.OBJLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tonLoad( scope.parse( text ) );\n\n\t\t} );\n\n\t},\n\n\tparse: function ( text ) {\n var func = \"THREE.OBJLoader.parse\";\n\n\t\tfunction vector( x, y, z ) {\n\n\t\t\treturn new THREE.Vector3( parseFloat( x ), parseFloat( y ), parseFloat( z ) );\n\n\t\t}\n\n\t\tfunction uv( u, v ) {\n\n\t\t\treturn new THREE.Vector2( parseFloat( u ), parseFloat( v ) );\n\n\t\t}\n\n\t\tfunction face3( a, b, c, normals ) {\n\n\t\t\treturn new THREE.Face3( a, b, c, normals );\n\n\t\t}\n\t\t\n\t\tvar object = new THREE.Object3D();\n\t\tvar geometry, material, mesh;\n\n\t\tfunction parseVertexIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + vertices.length;\n\n\t\t}\n\n\t\tfunction parseNormalIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + normals.length;\n\n\t\t}\n\n\t\tfunction parseUVIndex( index ) {\n\n\t\t\tindex = parseInt( index );\n\n\t\t\treturn index >= 0 ? index - 1 : index + uvs.length;\n\n\t\t}\n\t\t\n\t\tfunction add_face( a, b, c, normals_inds ) {\n\n\t\t\tif ( normals_inds === undefined ) {\n\n\t\t\t\tgeometry.faces.push( face3(\n\t\t\t\t\tvertices[ parseVertexIndex( a ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( b ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( c ) ] - 1\n\t\t\t\t) );\n\n\t\t\t} else {\n\n\t\t\t\tgeometry.faces.push( face3(\n\t\t\t\t\tvertices[ parseVertexIndex( a ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( b ) ] - 1,\n\t\t\t\t\tvertices[ parseVertexIndex( c ) ] - 1,\n\t\t\t\t\t[\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 0 ] ) ].clone(),\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 1 ] ) ].clone(),\n\t\t\t\t\t\tnormals[ parseNormalIndex( normals_inds[ 2 ] ) ].clone()\n\t\t\t\t\t]\n\t\t\t\t) );\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tfunction add_uvs( a, b, c ) {\n\t \n\t\t\tgeometry.faceVertexUvs[ 0 ].push( [\n\t\t\t\tuvs[ parseUVIndex( a ) ].clone(),\n\t\t\t\tuvs[ parseUVIndex( b ) ].clone(),\n\t\t\t\tuvs[ parseUVIndex( c ) ].clone()\n\t\t\t] );\n\n\t\t}\n\t\t\n\t\tfunction handle_face_line(faces, uvs, normals_inds) {\n\n\t\t\tif ( faces[ 3 ] === undefined ) {\n\t\t\t\t\n\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 2 ], normals_inds );\n\t\t\t\t\n\t\t\t\tif ( uvs !== undefined && uvs.length > 0 ) {\n\n\t\t\t\t\tadd_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 2 ] );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif ( normals_inds !== undefined && normals_inds.length > 0 ) {\n\n\t\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 3 ], [ normals_inds[ 0 ], normals_inds[ 1 ], normals_inds[ 3 ] ] );\n\t\t\t\t\tadd_face( faces[ 1 ], faces[ 2 ], faces[ 3 ], [ normals_inds[ 1 ], normals_inds[ 2 ], normals_inds[ 3 ] ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tadd_face( faces[ 0 ], faces[ 1 ], faces[ 3 ] );\n\t\t\t\t\tadd_face( faces[ 1 ], faces[ 2 ], faces[ 3 ] );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( uvs !== undefined && uvs.length > 0 ) {\n\n\t\t\t\t\tadd_uvs( uvs[ 0 ], uvs[ 1 ], uvs[ 3 ] );\n\t\t\t\t\tadd_uvs( uvs[ 1 ], uvs[ 2 ], uvs[ 3 ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// create mesh if no objects in text\n\n\t\tif ( /^o /gm.test( text ) === false ) {\n\n\t\t\tgeometry = new THREE.Geometry();\n\t\t\tmaterial = new THREE.MeshLambertMaterial();\n\t\t\tmesh = new THREE.Mesh( geometry, material );\n\t\t\tobject.add( mesh );\n\n\t\t}\n\n\t\tvar vertices = [];\n\t\tvar normals = [];\n\t\tvar uvs = [];\n\n\t\t// v float float float\n\n\t\tvar vertex_pattern = /v( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// vn float float float\n\n\t\tvar normal_pattern = /vn( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// vt float float\n\n\t\tvar uv_pattern = /vt( +[\\d|\\.|\\+|\\-|e]+)( +[\\d|\\.|\\+|\\-|e]+)/;\n\n\t\t// f vertex vertex vertex ...\n\n\t\tvar face_pattern1 = /f( +-?\\d+)( +-?\\d+)( +-?\\d+)( +-?\\d+)?/;\n\n\t\t// f vertex/uv vertex/uv vertex/uv ...\n\n\t\tvar face_pattern2 = /f( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+))?/;\n\n\t\t// f vertex/uv/normal vertex/uv/normal vertex/uv/normal ...\n\n\t\tvar face_pattern3 = /f( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))( +(-?\\d+)\\/(-?\\d+)\\/(-?\\d+))?/;\n\n\t\t// f vertex//normal vertex//normal vertex//normal ... \n\n\t\tvar face_pattern4 = /f( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))( +(-?\\d+)\\/\\/(-?\\d+))?/\n\n\t\t// fixes\n\n\t\ttext = text.replace( /\\\\\\r\\n/g, '' ); // handles line continuations \\\n\n\t\tvar lines = text.split( '\\n' );\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim();\n\n\t\t\tvar result;\n\n\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t} else if ( ( result = vertex_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"v 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\t\tvertices.push( \n\t\t\t\t\tgeometry.vertices.push(\n\t\t\t\t\t\tvector(\n\t\t\t\t\t\t\tresult[ 1 ], result[ 2 ], result[ 3 ]\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = normal_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"vn 1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\t\tnormals.push(\n\t\t\t\t\tvector(\n\t\t\t\t\t\tresult[ 1 ], result[ 2 ], result[ 3 ]\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = uv_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"vt 0.1 0.2\", \"0.1\", \"0.2\"]\n\n\t\t\t\tuvs.push(\n\t\t\t\t\tuv(\n\t\t\t\t\t\tresult[ 1 ], result[ 2 ]\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern1.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1 2 3\", \"1\", \"2\", \"3\", undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ] ]\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern2.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1/1 2/2 3/3\", \" 1/1\", \"1\", \"1\", \" 2/2\", \"2\", \"2\", \" 3/3\", \"3\", \"3\", undefined, undefined, undefined]\n\t\t\t\t\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t\t\t\t\t[ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //uv\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern3.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1/1/1 2/2/2 3/3/3\", \" 1/1/1\", \"1\", \"1\", \"1\", \" 2/2/2\", \"2\", \"2\", \"2\", \" 3/3/3\", \"3\", \"3\", \"3\", undefined, undefined, undefined, undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 6 ], result[ 10 ], result[ 14 ] ], //faces\n\t\t\t\t\t[ result[ 3 ], result[ 7 ], result[ 11 ], result[ 15 ] ], //uv\n\t\t\t\t\t[ result[ 4 ], result[ 8 ], result[ 12 ], result[ 16 ] ] //normal\n\t\t\t\t);\n\n\t\t\t} else if ( ( result = face_pattern4.exec( line ) ) !== null ) {\n\n\t\t\t\t// [\"f 1//1 2//2 3//3\", \" 1//1\", \"1\", \"1\", \" 2//2\", \"2\", \"2\", \" 3//3\", \"3\", \"3\", undefined, undefined, undefined]\n\n\t\t\t\thandle_face_line(\n\t\t\t\t\t[ result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ] ], //faces\n\t\t\t\t\t[ ], //uv\n\t\t\t\t\t[ result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ] ] //normal\n\t\t\t\t);\n\n\t\t\t} else if ( /^o /.test( line ) ) {\n\n\t\t\t\tgeometry = new THREE.Geometry();\n\t\t\t\tmaterial = new THREE.MeshLambertMaterial();\n\n\t\t\t\tmesh = new THREE.Mesh( geometry, material );\n\t\t\t\tmesh.name = line.substring( 2 ).trim();\n\t\t\t\tobject.add( mesh );\n\n\t\t\t} else if ( /^g /.test( line ) ) {\n\n\t\t\t\t// group\n\n\t\t\t} else if ( /^usemtl /.test( line ) ) {\n\n\t\t\t\t// material\n\n\t\t\t\tmaterial.name = line.substring( 7 ).trim();\n\n\t\t\t} else if ( /^mtllib /.test( line ) ) {\n\n\t\t\t\t// mtl file\n\n\t\t\t} else if ( /^s /.test( line ) ) {\n\n\t\t\t\t// smooth shading\n\n\t\t\t} else {\n\n\t\t\t\t// console.log( \"THREE.OBJLoader: Unhandled line \" + line );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar children = object.children;\n\n\t\tfor ( var i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tvar geometry = children[ i ].geometry;\n\n\t\t\tgeometry.computeFaceNormals();\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\t\t\n\t\treturn object;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/PDBLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/PDBLoader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.PDBLoader = function ( manager ) {\n\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\n\n};\n\nTHREE.PDBLoader.prototype = {\n\n\tconstructor: THREE.PDBLoader,\n\n\tload: function ( url, onLoad ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tvar json = scope.parsePDB( text );\n\t\t\tscope.createModel( json, onLoad );\n\n\t\t} );\n\n\t},\n\n\t// Based on CanvasMol PDB parser\n\n\tparsePDB: function ( text ) {\n\n\t\tfunction trim( text ) {\n\n\t\t\treturn text.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\n\t\t}\n\n\t\tfunction capitalize( text ) {\n\n\t\t\treturn text.charAt(0).toUpperCase() + text.substr(1).toLowerCase();\n\n\t\t}\n\n\t\tfunction hash( s, e ) {\n\n\t\t\treturn \"s\" + Math.min( s, e ) + \"e\" + Math.max( s, e );\n\n\t\t}\n\n\t\tfunction parseBond( start, length ) {\n\n\t\t\tvar eatom = parseInt( lines[ i ].substr( start, length ) );\n\n\t\t\tif( eatom ) {\n\n\t\t\t\tvar h = hash( satom, eatom );\n\n\t\t\t\tif ( bhash[ h ] == undefined ) {\n\n\t\t\t\t\tbonds.push( [ satom - 1, eatom - 1, 1 ] );\n\t\t\t\t\tbhash[ h ] = bonds.length - 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// doesn't really work as almost all PDBs\n\t\t\t\t\t// have just normal bonds appearing multiple\n\t\t\t\t\t// times instead of being double/triple bonds\n\t\t\t\t\t// bonds[bhash[h]][2] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar CPK = {\"h\":[255,255,255],\"he\":[217,255,255],\"li\":[204,128,255],\"be\":[194,255,0],\"b\":[255,181,181],\"c\":[144,144,144],\"n\":[48,80,248],\"o\":[255,13,13],\"f\":[144,224,80],\"ne\":[179,227,245],\"na\":[171,92,242],\"mg\":[138,255,0],\"al\":[191,166,166],\"si\":[240,200,160],\"p\":[255,128,0],\"s\":[255,255,48],\"cl\":[31,240,31],\"ar\":[128,209,227],\"k\":[143,64,212],\"ca\":[61,255,0],\"sc\":[230,230,230],\"ti\":[191,194,199],\"v\":[166,166,171],\"cr\":[138,153,199],\"mn\":[156,122,199],\"fe\":[224,102,51],\"co\":[240,144,160],\"ni\":[80,208,80],\"cu\":[200,128,51],\"zn\":[125,128,176],\"ga\":[194,143,143],\"ge\":[102,143,143],\"as\":[189,128,227],\"se\":[255,161,0],\"br\":[166,41,41],\"kr\":[92,184,209],\"rb\":[112,46,176],\"sr\":[0,255,0],\"y\":[148,255,255],\"zr\":[148,224,224],\"nb\":[115,194,201],\"mo\":[84,181,181],\"tc\":[59,158,158],\"ru\":[36,143,143],\"rh\":[10,125,140],\"pd\":[0,105,133],\"ag\":[192,192,192],\"cd\":[255,217,143],\"in\":[166,117,115],\"sn\":[102,128,128],\"sb\":[158,99,181],\"te\":[212,122,0],\"i\":[148,0,148],\"xe\":[66,158,176],\"cs\":[87,23,143],\"ba\":[0,201,0],\"la\":[112,212,255],\"ce\":[255,255,199],\"pr\":[217,255,199],\"nd\":[199,255,199],\"pm\":[163,255,199],\"sm\":[143,255,199],\"eu\":[97,255,199],\"gd\":[69,255,199],\"tb\":[48,255,199],\"dy\":[31,255,199],\"ho\":[0,255,156],\"er\":[0,230,117],\"tm\":[0,212,82],\"yb\":[0,191,56],\"lu\":[0,171,36],\"hf\":[77,194,255],\"ta\":[77,166,255],\"w\":[33,148,214],\"re\":[38,125,171],\"os\":[38,102,150],\"ir\":[23,84,135],\"pt\":[208,208,224],\"au\":[255,209,35],\"hg\":[184,184,208],\"tl\":[166,84,77],\"pb\":[87,89,97],\"bi\":[158,79,181],\"po\":[171,92,0],\"at\":[117,79,69],\"rn\":[66,130,150],\"fr\":[66,0,102],\"ra\":[0,125,0],\"ac\":[112,171,250],\"th\":[0,186,255],\"pa\":[0,161,255],\"u\":[0,143,255],\"np\":[0,128,255],\"pu\":[0,107,255],\"am\":[84,92,242],\"cm\":[120,92,227],\"bk\":[138,79,227],\"cf\":[161,54,212],\"es\":[179,31,212],\"fm\":[179,31,186],\"md\":[179,13,166],\"no\":[189,13,135],\"lr\":[199,0,102],\"rf\":[204,0,89],\"db\":[209,0,79],\"sg\":[217,0,69],\"bh\":[224,0,56],\"hs\":[230,0,46],\"mt\":[235,0,38],\n\t\t\t \"ds\":[235,0,38],\"rg\":[235,0,38],\"cn\":[235,0,38],\"uut\":[235,0,38],\"uuq\":[235,0,38],\"uup\":[235,0,38],\"uuh\":[235,0,38],\"uus\":[235,0,38],\"uuo\":[235,0,38]};\n\n\n\t\tvar atoms = [];\n\t\tvar bonds = [];\n\t\tvar histogram = {};\n\n\t\tvar bhash = {};\n\n\t\tvar lines = text.split( \"\\n\" );\n\n\t\tvar x, y, z, e;\n\n\t\tfor( var i = 0, il = lines.length; i < il; ++ i ) {\n\n\t\t\tif( lines[i].substr(0,4)==\"ATOM\" || lines[i].substr(0,6)==\"HETATM\" ) {\n\n\t\t\t\tx = parseFloat( lines[i].substr(30,7) );\n\t\t\t\ty = parseFloat( lines[i].substr(38,7) );\n\t\t\t\tz = parseFloat( lines[i].substr(46,7) );\n\n\t\t\t\te = trim( lines[i].substr(76,2) ).toLowerCase();\n\n\t\t\t\tif ( e==\"\" ) e = trim(lines[i].substr(12,2)).toLowerCase();\n\t\t\t\tatoms.push( [ x,y,z, CPK[e], capitalize(e) ] );\n\n\t\t\t\tif (histogram[e]==undefined) histogram[e] = 1;\n\t\t\t\telse histogram[e] += 1;\n\n\t\t\t} else if(lines[i].substr(0,6)==\"CONECT\") {\n\n\t\t\t\tvar satom = parseInt( lines[i].substr(6,5) );\n\n\t\t\t\tparseBond(11,5);\n\t\t\t\tparseBond(16,5);\n\t\t\t\tparseBond(21,5);\n\t\t\t\tparseBond(26,5);\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { \"ok\": true, \"atoms\": atoms, \"bonds\": bonds, \"histogram\": histogram };\n\n\t},\n\n\tcreateModel: function ( json, callback ) {\n\n\t\tvar scope = this,\n\t\tgeometryAtoms = new THREE.Geometry(),\n\t\tgeometryBonds = new THREE.Geometry();\n\n\t\tgeometryAtoms.elements = [];\n\n\t\tvar atoms = json.atoms;\n\t\tvar bonds = json.bonds;\n\n\t\tfor ( var i = 0; i < atoms.length; i ++ ) {\n\n\t\t\tvar atom = atoms[ i ];\n\n\t\t\tvar x = atom[ 0 ];\n\t\t\tvar y = atom[ 1 ];\n\t\t\tvar z = atom[ 2 ];\n\n\t\t\tvar position = new THREE.Vector3( x, y, z );\n\t\t\tgeometryAtoms.vertices.push( position );\n\n\t\t\tvar r = atom[ 3 ][ 0 ] / 255;\n\t\t\tvar g = atom[ 3 ][ 1 ] / 255;\n\t\t\tvar b = atom[ 3 ][ 2 ] / 255;\n\n\t\t\tvar color = new THREE.Color();\n\t\t\tcolor.setRGB( r, g, b );\n\n\t\t\tgeometryAtoms.colors.push( color );\n\n\t\t\tgeometryAtoms.elements.push( atom[ 4 ] );\n\n\t\t}\n\n\t\tfor ( var i = 0; i < bonds.length; i ++ ) {\n\n\t\t\tvar bond = bonds[ i ];\n\n\t\t\tvar start = bond[ 0 ];\n\t\t\tvar end = bond[ 1 ];\n\n\t\t\tvar vertex1 = geometryAtoms.vertices[ start ];\n\t\t\tvar vertex2 = geometryAtoms.vertices[ end ];\n\n\t\t\tgeometryBonds.vertices.push( vertex1.clone() );\n\t\t\tgeometryBonds.vertices.push( vertex2.clone() );\n\n\t\t}\n\n\t\tcallback( geometryAtoms, geometryBonds, json );\n\n\t}\n\n}\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/PLYLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/PLYLoader.js",
"module-type": "library",
"text": "/**\n * @author Wei Meng / http://about.me/menway\n *\n * Description: A THREE loader for PLY ASCII files (known as the Polygon File Format or the Stanford Triangle Format).\n *\n * Currently only supports ASCII encoded files.\n *\n * Limitations: ASCII decoding assumes file is UTF-8.\n *\n * Usage:\n *\tvar loader = new THREE.PLYLoader();\n *\tloader.addEventListener( 'load', function ( event ) {\n *\n *\t\tvar geometry = event.content;\n *\t\tscene.add( new THREE.Mesh( geometry ) );\n *\n *\t} );\n *\tloader.load( './models/ply/ascii/dolphins.ply' );\n */\n\n\nTHREE.PLYLoader = function () {};\n\nTHREE.PLYLoader.prototype = {\n\n\tconstructor: THREE.PLYLoader,\n\n\tload: function ( url, callback ) {\n var func = \"THREE.PLYLoader.load\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\t var geometry = this.parse(res);\n\t this.dispatchEvent({type: 'load', content: geometry});\n\t if (callback) callback(geometry);\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n\t return;\n }\n\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar geometry = scope.parse( event.target.response );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.responseType = \"arraybuffer\";\n\t\trequest.send( null );\n\n\t},\n\n\tbin2str: function (buf) {\n\n\t\tvar array_buffer = new Uint8Array(buf);\n\t\tvar str = '';\n\t\tfor(var i = 0; i < buf.byteLength; i++) {\n\t\t\tstr += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n\t\t}\n\n\t\treturn str;\n\n\t},\n\n\tisASCII: function( data ){\n\n\t\tvar header = this.parseHeader( this.bin2str( data ) );\n\t\t\n\t\treturn header.format === \"ascii\";\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tif ( data instanceof ArrayBuffer ) {\n\n\t\t\treturn this.isASCII( data )\n\t\t\t\t? this.parseASCII( this.bin2str( data ) )\n\t\t\t\t: this.parseBinary( data );\n\n\t\t} else {\n\n\t\t\treturn this.parseASCII( data );\n\n\t\t}\n\n\t},\n\n\tparseHeader: function ( data ) {\n\t\t\n\t\tvar patternHeader = /ply([\\s\\S]*)end_header\\n/;\n\t\tvar headerText = \"\";\n\t\tif ( ( result = patternHeader.exec( data ) ) != null ) {\n\t\t\theaderText = result [ 1 ];\n\t\t}\n\t\t\n\t\tvar header = new Object();\n\t\theader.comments = [];\n\t\theader.elements = [];\n\t\theader.headerLength = result[0].length;\n\t\t\n\t\tvar lines = headerText.split( '\\n' );\n\t\tvar currentElement = undefined;\n\t\tvar lineType, lineValues;\n\n\t\tfunction make_ply_element_property(propertValues) {\n\t\t\t\n\t\t\tvar property = Object();\n\n\t\t\tproperty.type = propertValues[0]\n\t\t\t\n\t\t\tif ( property.type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tproperty.name = propertValues[3]\n\t\t\t\tproperty.countType = propertValues[1]\n\t\t\t\tproperty.itemType = propertValues[2]\n\n\t\t\t} else {\n\n\t\t\t\tproperty.name = propertValues[1]\n\n\t\t\t}\n\n\t\t\treturn property\n\t\t\t\n\t\t}\n\t\t\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim()\n\t\t\tif ( line === \"\" ) { continue; }\n\t\t\tlineValues = line.split( /\\s+/ );\n\t\t\tlineType = lineValues.shift()\n\t\t\tline = lineValues.join(\" \")\n\t\t\t\n\t\t\tswitch( lineType ) {\n\t\t\t\t\n\t\t\tcase \"format\":\n\n\t\t\t\theader.format = lineValues[0];\n\t\t\t\theader.version = lineValues[1];\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"comment\":\n\n\t\t\t\theader.comments.push(line);\n\n\t\t\t\tbreak;\n\n\t\t\tcase \"element\":\n\n\t\t\t\tif ( !(currentElement === undefined) ) {\n\n\t\t\t\t\theader.elements.push(currentElement);\n\n\t\t\t\t}\n\n\t\t\t\tcurrentElement = Object();\n\t\t\t\tcurrentElement.name = lineValues[0];\n\t\t\t\tcurrentElement.count = parseInt( lineValues[1] );\n\t\t\t\tcurrentElement.properties = [];\n\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"property\":\n\n\t\t\t\tcurrentElement.properties.push( make_ply_element_property( lineValues ) );\n\n\t\t\t\tbreak;\n\t\t\t\t\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.log(\"unhandled\", lineType, lineValues);\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif ( !(currentElement === undefined) ) {\n\n\t\t\theader.elements.push(currentElement);\n\n\t\t}\n\t\t\n\t\treturn header;\n\t\t\n\t},\n\n\tparseASCIINumber: function ( n, type ) {\n\t\t\n\t\tswitch( type ) {\n\t\t\t\n\t\tcase 'char': case 'uchar': case 'short': case 'ushort': case 'int': case 'uint':\n\t\tcase 'int8': case 'uint8': case 'int16': case 'uint16': case 'int32': case 'uint32':\n\n\t\t\treturn parseInt( n );\n\n\t\tcase 'float': case 'double': case 'float32': case 'float64':\n\n\t\t\treturn parseFloat( n );\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\tparseASCIIElement: function ( properties, line ) {\n\n\t\tvalues = line.split( /\\s+/ );\n\t\t\n\t\tvar element = Object();\n\t\t\n\t\tfor ( var i = 0; i < properties.length; i ++ ) {\n\t\t\t\n\t\t\tif ( properties[i].type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tvar list = [];\n\t\t\t\tvar n = this.parseASCIINumber( values.shift(), properties[i].countType );\n\n\t\t\t\tfor ( j = 0; j < n; j ++ ) {\n\t\t\t\t\t\n\t\t\t\t\tlist.push( this.parseASCIINumber( values.shift(), properties[i].itemType ) );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = list;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = this.parseASCIINumber( values.shift(), properties[i].type );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn element;\n\t\t\n\t},\n\n\tparseASCII: function ( data ) {\n\n\t\t// PLY ascii format specification, as per http://en.wikipedia.org/wiki/PLY_(file_format)\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar result;\n\n\t\tvar header = this.parseHeader( data );\n\n\t\tvar patternBody = /end_header\\n([\\s\\S]*)$/;\n\t\tvar body = \"\";\n\t\tif ( ( result = patternBody.exec( data ) ) != null ) {\n\t\t\tbody = result [ 1 ];\n\t\t}\n\t\t\n\t\tvar lines = body.split( '\\n' );\n\t\tvar currentElement = 0;\n\t\tvar currentElementCount = 0;\n\t\tgeometry.useColor = false;\n\t\t\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\tvar line = lines[ i ];\n\t\t\tline = line.trim()\n\t\t\tif ( line === \"\" ) { continue; }\n\t\t\t\n\t\t\tif ( currentElementCount >= header.elements[currentElement].count ) {\n\n\t\t\t\tcurrentElement++;\n\t\t\t\tcurrentElementCount = 0;\n\n\t\t\t}\n\t\t\t\n\t\t\tvar element = this.parseASCIIElement( header.elements[currentElement].properties, line );\n\t\t\t\n\t\t\tthis.handleElement( geometry, header.elements[currentElement].name, element );\n\t\t\t\n\t\t\tcurrentElementCount++;\n\t\t\t\n\t\t}\n\n\t\treturn this.postProcess( geometry );\n\n\t},\n\n\tpostProcess: function ( geometry ) {\n\t\t\n\t\tif ( geometry.useColor ) {\n\t\t\t\n\t\t\tfor ( var i = 0; i < geometry.faces.length; i ++ ) {\n\t\t\t\t\n\t\t\t\tgeometry.faces[i].vertexColors = [\n\t\t\t\t\tgeometry.colors[geometry.faces[i].a],\n\t\t\t\t\tgeometry.colors[geometry.faces[i].b],\n\t\t\t\t\tgeometry.colors[geometry.faces[i].c]\n\t\t\t\t];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tgeometry.elementsNeedUpdate = true;\n\t\t\t\n\t\t}\n\n\t\tgeometry.computeBoundingSphere();\n\n\t\treturn geometry;\n\t\t\n\t},\n\n\thandleElement: function ( geometry, elementName, element ) {\n\t\t\n\t\tif ( elementName === \"vertex\" ) {\n\n\t\t\tgeometry.vertices.push(\n\t\t\t\tnew THREE.Vector3( element.x, element.y, element.z )\n\t\t\t);\n\t\t\t\n\t\t\tif ( 'red' in element && 'green' in element && 'blue' in element ) {\n\t\t\t\t\n\t\t\t\tgeometry.useColor = true;\n\t\t\t\t\n\t\t\t\tcolor = new THREE.Color();\n\t\t\t\tcolor.setRGB( element.red / 255.0, element.green / 255.0, element.blue / 255.0 );\n\t\t\t\tgeometry.colors.push( color );\n\t\t\t\t\n\t\t\t}\n\n\t\t} else if ( elementName === \"face\" ) {\n\n\t\t\tgeometry.faces.push(\n\t\t\t\tnew THREE.Face3( element.vertex_indices[0], element.vertex_indices[1], element.vertex_indices[2] )\n\t\t\t);\n\n\t\t}\n\t\t\n\t},\n\n\tbinaryRead: function ( dataview, at, type, little_endian ) {\n\n\t\tswitch( type ) {\n\n\t\t\t// corespondences for non-specific length types here match rply:\n\t\tcase 'int8':\t\tcase 'char':\t return [ dataview.getInt8( at ), 1 ];\n\n\t\tcase 'uint8':\t\tcase 'uchar':\t return [ dataview.getUint8( at ), 1 ];\n\n\t\tcase 'int16':\t\tcase 'short':\t return [ dataview.getInt16( at, little_endian ), 2 ];\n\n\t\tcase 'uint16':\tcase 'ushort': return [ dataview.getUint16( at, little_endian ), 2 ];\n\n\t\tcase 'int32':\t\tcase 'int':\t\t return [ dataview.getInt32( at, little_endian ), 4 ];\n\n\t\tcase 'uint32':\tcase 'uint':\t return [ dataview.getUint32( at, little_endian ), 4 ];\n\n\t\tcase 'float32': case 'float':\t return [ dataview.getFloat32( at, little_endian ), 4 ];\n\n\t\tcase 'float64': case 'double': return [ dataview.getFloat64( at, little_endian ), 8 ];\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\tbinaryReadElement: function ( dataview, at, properties, little_endian ) {\n\t\t\n\t\tvar element = Object();\n\t\tvar result, read = 0;\n\t\t\n\t\tfor ( var i = 0; i < properties.length; i ++ ) {\n\t\t \n\t\t\tif ( properties[i].type === \"list\" ) {\n\t\t\t\t\n\t\t\t\tvar list = [];\n\n\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].countType, little_endian );\n\t\t\t\tvar n = result[0];\n\t\t\t\tread += result[1];\n\t\t\t\t\n\t\t\t\tfor ( j = 0; j < n; j ++ ) {\n\t\t\t\t\t\n\t\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].itemType, little_endian );\n\t\t\t\t\tlist.push( result[0] );\n\t\t\t\t\tread += result[1];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telement[ properties[i].name ] = list;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresult = this.binaryRead( dataview, at+read, properties[i].type, little_endian );\n\t\t\t\telement[ properties[i].name ] = result[0];\n\t\t\t\tread += result[1];\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn [ element, read ];\n\t\t\n\t},\n\n\tparseBinary: function ( data ) {\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar header = this.parseHeader( this.bin2str( data ) );\n\t\tvar little_endian = (header.format === \"binary_little_endian\");\n\t\tvar body = new DataView( data, header.headerLength );\n\t\tvar result, loc = 0;\n\n\t\tfor ( var currentElement = 0; currentElement < header.elements.length; currentElement ++ ) {\n\t\t\t\n\t\t\tfor ( var currentElementCount = 0; currentElementCount < header.elements[currentElement].count; currentElementCount ++ ) {\n\t\t\t\n\t\t\t\tresult = this.binaryReadElement( body, loc, header.elements[currentElement].properties, little_endian );\n\t\t\t\tloc += result[1];\n\t\t\t\tvar element = result[0];\n\t\t\t\n\t\t\t\tthis.handleElement( geometry, header.elements[currentElement].name, element );\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn this.postProcess( geometry );\n\t\t\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.PLYLoader.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/SceneLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/SceneLoader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SceneLoader = function () {\n\n\tthis.onLoadStart = function () {};\n\tthis.onLoadProgress = function() {};\n\tthis.onLoadComplete = function () {};\n\n\tthis.callbackSync = function () {};\n\tthis.callbackProgress = function () {};\n\n\tthis.geometryHandlers = {};\n\tthis.hierarchyHandlers = {};\n\n\tthis.addGeometryHandler( \"ascii\", THREE.JSONLoader );\n\n};\n\nTHREE.SceneLoader.prototype = {\n\n\tconstructor: THREE.SceneLoader,\n\n\tload: function ( url, onLoad, onProgress, onError ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.XHRLoader( scope.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tscope.parse( JSON.parse( text ), onLoad, url );\n\n\t\t} );\n\n\t},\n\n\tsetCrossOrigin: function ( value ) {\n\n\t\tthis.crossOrigin = value;\n\n\t},\n\n\taddGeometryHandler: function ( typeID, loaderClass ) {\n\n\t\tthis.geometryHandlers[ typeID ] = { \"loaderClass\": loaderClass };\n\n\t},\n\n\taddHierarchyHandler: function ( typeID, loaderClass ) {\n\n\t\tthis.hierarchyHandlers[ typeID ] = { \"loaderClass\": loaderClass };\n\n\t},\n\n\tparse: function ( json, callbackFinished, url ) {\n var func = \"THREE.SceneLoader.parse\";\n\n\t\tvar scope = this;\n\n\t\tvar urlBase = THREE.Loader.prototype.extractUrlBase( url );\n\n\t\tvar geometry, material, camera, fog,\n\t\t\ttexture, images, color,\n\t\t\tlight, hex, intensity,\n\t\t\tcounter_models, counter_textures,\n\t\t\ttotal_models, total_textures,\n\t\t\tresult;\n\n\t\tvar target_array = [];\n\n\t\tvar data = json;\n\n\t\t// async geometry loaders\n\n\t\tfor ( var typeID in this.geometryHandlers ) {\n\n\t\t\tvar loaderClass = this.geometryHandlers[ typeID ][ \"loaderClass\" ];\n\t\t\tthis.geometryHandlers[ typeID ][ \"loaderObject\" ] = new loaderClass();\n\n\t\t}\n\n\t\t// async hierachy loaders\n\n\t\tfor ( var typeID in this.hierarchyHandlers ) {\n\n\t\t\tvar loaderClass = this.hierarchyHandlers[ typeID ][ \"loaderClass\" ];\n\t\t\tthis.hierarchyHandlers[ typeID ][ \"loaderObject\" ] = new loaderClass();\n\n\t\t}\n\n\t\tcounter_models = 0;\n\t\tcounter_textures = 0;\n\n\t\tresult = {\n\n\t\t\tscene: new THREE.Scene(),\n\t\t\tgeometries: {},\n\t\t\tface_materials: {},\n\t\t\tmaterials: {},\n\t\t\ttextures: {},\n\t\t\tobjects: {},\n\t\t\tcameras: {},\n\t\t\tlights: {},\n\t\t\tfogs: {},\n\t\t\tempties: {},\n\t\t\tgroups: {}\n\n\t\t};\n\n\t\tif ( data.transform ) {\n\n\t\t\tvar position = data.transform.position,\n\t\t\t\trotation = data.transform.rotation,\n\t\t\t\tscale = data.transform.scale;\n\n\t\t\tif ( position ) {\n\n\t\t\t\tresult.scene.position.fromArray( position );\n\n\t\t\t}\n\n\t\t\tif ( rotation ) {\n\n\t\t\t\tresult.scene.rotation.fromArray( rotation );\n\n\t\t\t}\n\n\t\t\tif ( scale ) {\n\n\t\t\t\tresult.scene.scale.fromArray( scale );\n\n\t\t\t}\n\n\t\t\tif ( position || rotation || scale ) {\n\n\t\t\t\tresult.scene.updateMatrix();\n\t\t\t\tresult.scene.updateMatrixWorld();\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction get_url( source_url, url_type ) {\n\n\t\t\tif ( url_type == \"relativeToHTML\" ) {\n\n\t\t\t\treturn source_url;\n\n\t\t\t} else {\n\n\t\t\t\treturn urlBase + source_url;\n\n\t\t\t}\n\n\t\t};\n\n\t\t// toplevel loader function, delegates to handle_children\n\n\t\tfunction handle_objects() {\n var func = \"THREE.SceneLoader.parse.handle_objects\";\n\n\t\t\thandle_children( result.scene, data.objects );\n\n\t\t}\n\n\t\t// handle all the children from the loaded json and attach them to given parent\n\n\t\tfunction handle_children( parent, children ) {\n var func = \"THREE.SceneLoader.parse.handle_children\";\n hack.log(\"\", hack.sceneLoader, func);\n\n\t\t\tvar mat, dst, pos, rot, scl, quat;\n\n\t\t\tfor ( var objID in children ) {\n\n\t\t\t\t// check by id if child has already been handled,\n\t\t\t\t// if not, create new object\n\n\t\t\t\tvar object = result.objects[ objID ];\n\t\t\t\tvar objJSON = children[ objID ];\n\n hack.log(\"objID = <\"+objID+\">, object = \"+object, hack.sceneLoader, func);\n hack.log(\" geometry = \"+objJSON.geometry, hack.sceneLoader, func);\n hack.log(\" material = \"+objJSON.material, hack.sceneLoader, func);\n\n\t\t\t\tif ( object === undefined ) {\n\n\t\t\t\t\t// meshes\n\n\t\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n\t\t\t\t\t\tif ( objJSON.loading === undefined ) {\n\n\t\t\t\t\t\t\tvar reservedTypes = {\n\t\t\t\t\t\t\t\t\"type\": 1, \"url\": 1, \"material\": 1,\n\t\t\t\t\t\t\t\t\"position\": 1, \"rotation\": 1, \"scale\" : 1,\n\t\t\t\t\t\t\t\t\"visible\": 1, \"children\": 1, \"userData\": 1,\n\t\t\t\t\t\t\t\t\"skin\": 1, \"morph\": 1, \"mirroredLoop\": 1, \"duration\": 1\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tvar loaderParameters = {};\n\n\t\t\t\t\t\t\tfor ( var parType in objJSON ) {\n\n\t\t\t\t\t\t\t\tif ( ! ( parType in reservedTypes ) ) {\n\n\t\t\t\t\t\t\t\t\tloaderParameters[ parType ] = objJSON[ parType ];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\n\t\t\t\t\t\t\tobjJSON.loading = true;\n\n\t\t\t\t\t\t\tvar loader = scope.hierarchyHandlers[ objJSON.type ][ \"loaderObject\" ];\n\n\t\t\t\t\t\t\t// ColladaLoader\n\n\t\t\t\t\t\t\tif ( loader.options ) {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ) );\n\n\t\t\t\t\t\t\t// UTF8Loader\n\t\t\t\t\t\t\t// OBJLoader\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tloader.load( get_url( objJSON.url, data.urlBaseType ), create_callback_hierachy( objID, parent, material, objJSON ), loaderParameters );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( objJSON.geometry !== undefined ) {\n\n\t\t\t\t\t\tgeometry = result.geometries[ objJSON.geometry ];\n\n\t\t\t\t\t\t// geometry already loaded\n\n\t\t\t\t\t\tif ( geometry ) {\n\n\t\t\t\t\t\t\tvar needsTangents = false;\n\n\t\t\t\t\t\t\tmaterial = result.materials[ objJSON.material ];\n\t\t\t\t\t\t\tneedsTangents = material instanceof THREE.ShaderMaterial;\n\n\t\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\t\tmat = objJSON.matrix;\n\t\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is no material specified in the object\n\n\t\t\t\t\t\t\tif ( ! objJSON.material ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// use materials from the model file\n\t\t\t\t\t\t\t// if there is just empty face material\n\t\t\t\t\t\t\t// (must create new material as each model has its own face material)\n\n\t\t\t\t\t\t\tif ( ( material instanceof THREE.MeshFaceMaterial ) && material.materials.length === 0 ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshFaceMaterial( result.face_materials[ objJSON.geometry ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\t\t\t\t\t\tfor ( var i = 0; i < material.materials.length; i ++ ) {\n\n\t\t\t\t\t\t\t\t\tneedsTangents = needsTangents || ( material.materials[ i ] instanceof THREE.ShaderMaterial );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( needsTangents ) {\n\n\t\t\t\t\t\t\t\tgeometry.computeTangents();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( objJSON.skin ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.SkinnedMesh( geometry, material );\n\n\t\t\t\t\t\t\t} else if ( objJSON.morph ) {\n\n\t\t\t\t\t\t\t\tobject = new THREE.MorphAnimMesh( geometry, material );\n\n\t\t\t\t\t\t\t\tif ( objJSON.duration !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.duration = objJSON.duration;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.time !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.time = objJSON.time;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( objJSON.mirroredLoop !== undefined ) {\n\n\t\t\t\t\t\t\t\t\tobject.mirroredLoop = objJSON.mirroredLoop;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ( material.morphNormals ) {\n\n\t\t\t\t\t\t\t\t\tgeometry.computeMorphNormals();\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\t\tobject = new THREE.Mesh( geometry, material );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.name = objID;\n\n\t\t\t\t\t\t\tif ( mat ) {\n\n\t\t\t\t\t\t\t\tobject.matrixAutoUpdate = false;\n\t\t\t\t\t\t\t\tobject.matrix.set(\n\t\t\t\t\t\t\t\t\tmat[0], mat[1], mat[2], mat[3],\n\t\t\t\t\t\t\t\t\tmat[4], mat[5], mat[6], mat[7],\n\t\t\t\t\t\t\t\t\tmat[8], mat[9], mat[10], mat[11],\n\t\t\t\t\t\t\t\t\tmat[12], mat[13], mat[14], mat[15]\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tobject.scale.fromArray( scl );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tobject.visible = objJSON.visible;\n\t\t\t\t\t\t\tobject.castShadow = objJSON.castShadow;\n\t\t\t\t\t\t\tobject.receiveShadow = objJSON.receiveShadow;\n\n\t\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\t\tresult.objects[ objID ] = object;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// lights\n\n\t\t\t\t\t} else if ( objJSON.type === \"AmbientLight\" || objJSON.type === \"PointLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"DirectionalLight\" || objJSON.type === \"SpotLight\" ||\n\t\t\t\t\t\tobjJSON.type === \"HemisphereLight\" || objJSON.type === \"AreaLight\" ) {\n\n\t\t\t\t\t\tvar color = objJSON.color;\n\t\t\t\t\t\tvar intensity = objJSON.intensity;\n\t\t\t\t\t\tvar distance = objJSON.distance;\n\t\t\t\t\t\tvar position = objJSON.position;\n\t\t\t\t\t\tvar rotation = objJSON.rotation;\n\n\t\t\t\t\t\tswitch ( objJSON.type ) {\n\n\t\t\t\t\t\t\tcase 'AmbientLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AmbientLight( color );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\t\t\tlight = new THREE.PointLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity );\n\t\t\t\t\t\t\t\tlight.position.fromArray( objJSON.direction );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\t\t\tlight = new THREE.SpotLight( color, intensity, distance, 1 );\n\t\t\t\t\t\t\t\tlight.angle = objJSON.angle;\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\t\t\tlight = new THREE.DirectionalLight( color, intensity, distance );\n\t\t\t\t\t\t\t\tlight.target.set( position[ 0 ], position[ 1 ] - distance, position[ 2 ] );\n\t\t\t\t\t\t\t\tlight.target.applyEuler( new THREE.Euler( rotation[ 0 ], rotation[ 1 ], rotation[ 2 ], 'XYZ' ) );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'AreaLight':\n\t\t\t\t\t\t\t\tlight = new THREE.AreaLight(color, intensity);\n\t\t\t\t\t\t\t\tlight.position.fromArray( position );\n\t\t\t\t\t\t\t\tlight.width = objJSON.size;\n\t\t\t\t\t\t\t\tlight.height = objJSON.size_y;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( light );\n\n\t\t\t\t\t\tlight.name = objID;\n\t\t\t\t\t\tresult.lights[ objID ] = light;\n\t\t\t\t\t\tresult.objects[ objID ] = light;\n\n\t\t\t\t\t// cameras\n\n\t\t\t\t\t} else if ( objJSON.type === \"PerspectiveCamera\" || objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tif ( objJSON.type === \"PerspectiveCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.PerspectiveCamera( objJSON.fov, objJSON.aspect, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t} else if ( objJSON.type === \"OrthographicCamera\" ) {\n\n\t\t\t\t\t\t\tcamera = new THREE.OrthographicCamera( objJSON.left, objJSON.right, objJSON.top, objJSON.bottom, objJSON.near, objJSON.far );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcamera.name = objID;\n\t\t\t\t\t\tcamera.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else if ( rot !== undefined ) {\n\n\t\t\t\t\t\t\tcamera.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.add( camera );\n\n\t\t\t\t\t\tresult.cameras[ objID ] = camera;\n\t\t\t\t\t\tresult.objects[ objID ] = camera;\n\n\t\t\t\t\t// pure Object3D\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpos = objJSON.position;\n\t\t\t\t\t\trot = objJSON.rotation;\n\t\t\t\t\t\tscl = objJSON.scale;\n\t\t\t\t\t\tquat = objJSON.quaternion;\n\n\t\t\t\t\t\tobject = new THREE.Object3D();\n\t\t\t\t\t\tobject.name = objID;\n\t\t\t\t\t\tobject.position.fromArray( pos );\n\n\t\t\t\t\t\tif ( quat ) {\n\n\t\t\t\t\t\t\tobject.quaternion.fromArray( quat );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tobject.rotation.fromArray( rot );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tobject.scale.fromArray( scl );\n\t\t\t\t\t\tobject.visible = ( objJSON.visible !== undefined ) ? objJSON.visible : false;\n\n\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\tresult.objects[ objID ] = object;\n\t\t\t\t\t\tresult.empties[ objID ] = object;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( object ) {\n\n\t\t\t\t\t\tif ( objJSON.userData !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var key in objJSON.userData ) {\n\n\t\t\t\t\t\t\t\tvar value = objJSON.userData[ key ];\n\t\t\t\t\t\t\t\tobject.userData[ key ] = value;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( objJSON.groups !== undefined ) {\n\n\t\t\t\t\t\t\tfor ( var i = 0; i < objJSON.groups.length; i ++ ) {\n\n\t\t\t\t\t\t\t\tvar groupID = objJSON.groups[ i ];\n\n\t\t\t\t\t\t\t\tif ( result.groups[ groupID ] === undefined ) {\n\n\t\t\t\t\t\t\t\t\tresult.groups[ groupID ] = [];\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult.groups[ groupID ].push( objID );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( object !== undefined && objJSON.children !== undefined ) {\n\n\t\t\t\t\thandle_children( object, objJSON.children );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction handle_mesh( geo, mat, id ) {\n var func = \"THREE.SceneLoader.parse.handle_mesh\";\n hack.log(\"id = \"+id+\", mat = \"+mat, hack.sceneLoader, func);\n\n\t\t\tresult.geometries[ id ] = geo;\n\t\t result.face_materials[ id ] = mat;\n\t\t\thandle_objects();\n\n\t\t};\n\n\t\tfunction handle_hierarchy( node, id, parent, material, obj ) {\n\n\t\t\tvar p = obj.position;\n\t\t\tvar r = obj.rotation;\n\t\t\tvar q = obj.quaternion;\n\t\t\tvar s = obj.scale;\n\n\t\t\tnode.position.fromArray( p );\n\n\t\t\tif ( q ) {\n\n\t\t\t\tnode.quaternion.fromArray( q );\n\n\t\t\t} else {\n\n\t\t\t\tnode.rotation.fromArray( r );\n\n\t\t\t}\n\n\t\t\tnode.scale.fromArray( s );\n\n\t\t\t// override children materials\n\t\t\t// if object material was specified in JSON explicitly\n\n\t\t\tif ( material ) {\n\n\t\t\t\tnode.traverse( function ( child ) {\n\n\t\t\t\t\tchild.material = material;\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\t// override children visibility\n\t\t\t// with root node visibility as specified in JSON\n\n\t\t\tvar visible = ( obj.visible !== undefined ) ? obj.visible : true;\n\n\t\t\tnode.traverse( function ( child ) {\n\n\t\t\t\tchild.visible = visible;\n\n\t\t\t} );\n\n\t\t\tparent.add( node );\n\n\t\t\tnode.name = id;\n\n\t\t\tresult.objects[ id ] = node;\n\t\t\thandle_objects();\n\n\t\t};\n\n\t\tfunction create_callback_geometry( id ) {\n\n\t\t\treturn function ( geo, mat ) {\n var func = \"THREE.SceneLoader.parse.create_callback_geometry.function\";\n \n\t\t\t\tgeo.name = id;\n\n handle_mesh( geo, mat, id );\n\n\t\t\t\tcounter_models -= 1;\n\n\t\t\t\tscope.onLoadComplete();\n\n\t\t\t\tasync_callback_gate();\n\n\t\t\t}\n\n\t\t};\n\n if (TiddlyWiki) {\n\t function create_callback_geometry_for_tiddlywiki_url(id) {\n\t return function (geo, mat) {\n var func = \"THREE.SceneLoader.parse.create_callback_geometry_for_tiddlywiki_url.function\";\n hack.log(\"id = \"+id, hack.sceneLoader, func);\n\t\tgeo.name = id;\n\n // Simply register geometry but don't try to handle all objects because\n // it's too early in the load process.\n // It seems there is a bug in the load process algorithm. It\n // assumes that most of objecs are already loaded when the current geometry\n // ends it's loading, because this callback is always called by a\n // geometryHandler which loads a remote URL. It's not the case with\n // TiddlyWiki URL : loading is immediate !\n \t\tresult.geometries[ id ] = geo;\n\t\tresult.face_materials[ id ] = mat;\n\t\t\n counter_models -= 1;\n\t\tscope.onLoadComplete();\n\t\tasync_callback_gate();\n\t }\n\t };\n }\n\n\t\tfunction create_callback_hierachy( id, parent, material, obj ) {\n\n\t\t\treturn function ( event ) {\n\n\t\t\t\tvar result;\n\n\t\t\t\t// loaders which use EventDispatcher\n\n\t\t\t\tif ( event.content ) {\n\n\t\t\t\t\tresult = event.content;\n\n\t\t\t\t// ColladaLoader\n\n\t\t\t\t} else if ( event.dae ) {\n\n\t\t\t\t\tresult = event.scene;\n\n\n\t\t\t\t// UTF8Loader\n\n\t\t\t\t} else {\n\n\t\t\t\t\tresult = event;\n\n\t\t\t\t}\n\n\t\t\t\thandle_hierarchy( result, id, parent, material, obj );\n\n\t\t\t\tcounter_models -= 1;\n\n\t\t\t\tscope.onLoadComplete();\n\n\t\t\t\tasync_callback_gate();\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction create_callback_embed( id ) {\n\n\t\t\treturn function ( geo, mat ) {\n\n\t\t\t\tgeo.name = id;\n\n\t\t\t\tresult.geometries[ id ] = geo;\n\t\t\t\tresult.face_materials[ id ] = mat;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction async_callback_gate() {\n\n\t\t\tvar progress = {\n\n\t\t\t\ttotalModels : total_models,\n\t\t\t\ttotalTextures : total_textures,\n\t\t\t\tloadedModels : total_models - counter_models,\n\t\t\t\tloadedTextures : total_textures - counter_textures\n\n\t\t\t};\n\n\t\t\tscope.callbackProgress( progress, result );\n\n\t\t\tscope.onLoadProgress();\n\n\t\t\tif ( counter_models === 0 && counter_textures === 0 ) {\n\n\t\t\t\tfinalize();\n\t\t\t\tcallbackFinished( result );\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction finalize() {\n\n\t\t\t// take care of targets which could be asynchronously loaded objects\n\n\t\t\tfor ( var i = 0; i < target_array.length; i ++ ) {\n\n\t\t\t\tvar ta = target_array[ i ];\n\n\t\t\t\tvar target = result.objects[ ta.targetName ];\n\n\t\t\t\tif ( target ) {\n\n\t\t\t\t\tta.object.target = target;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// if there was error and target of specified name doesn't exist in the scene file\n\t\t\t\t\t// create instead dummy target\n\t\t\t\t\t// (target must be added to scene explicitly as parent is already added)\n\n\t\t\t\t\tta.object.target = new THREE.Object3D();\n\t\t\t\t\tresult.scene.add( ta.object.target );\n\n\t\t\t\t}\n\n\t\t\t\tta.object.target.userData.targetInverse = ta.object;\n\n\t\t\t}\n\n\t\t};\n\n\t\tvar callbackTexture = function ( count ) {\n\n\t\t\tcounter_textures -= count;\n\t\t\tasync_callback_gate();\n\n\t\t\tscope.onLoadComplete();\n\n\t\t};\n\n\t\t// must use this instead of just directly calling callbackTexture\n\t\t// because of closure in the calling context loop\n\n\t\tvar generateTextureCallback = function ( count ) {\n\n\t\t\treturn function () {\n\n\t\t\t\tcallbackTexture( count );\n\n\t\t\t};\n\n\t\t};\n\n\t\tfunction traverse_json_hierarchy( objJSON, callback ) {\n\n\t\t\tcallback( objJSON );\n\n\t\t\tif ( objJSON.children !== undefined ) {\n\n\t\t\t\tfor ( var objChildID in objJSON.children ) {\n\n\t\t\t\t\ttraverse_json_hierarchy( objJSON.children[ objChildID ], callback );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t// first go synchronous elements\n\n\t\t// fogs\n\n\t\tvar fogID, fogJSON;\n\n\t\tfor ( fogID in data.fogs ) {\n\n\t\t\tfogJSON = data.fogs[ fogID ];\n\n\t\t\tif ( fogJSON.type === \"linear\" ) {\n\n\t\t\t\tfog = new THREE.Fog( 0x000000, fogJSON.near, fogJSON.far );\n\n\t\t\t} else if ( fogJSON.type === \"exp2\" ) {\n\n\t\t\t\tfog = new THREE.FogExp2( 0x000000, fogJSON.density );\n\n\t\t\t}\n\n\t\t\tcolor = fogJSON.color;\n\t\t\tfog.color.setRGB( color[0], color[1], color[2] );\n\n\t\t\tresult.fogs[ fogID ] = fog;\n\n\t\t}\n\n\t\t// now come potentially asynchronous elements\n\n\t\t// geometries\n\n\t\t// count how many geometries will be loaded asynchronously\n\n\t\tvar geoID, geoJSON;\n\n\t\tfor ( geoID in data.geometries ) {\n\n\t\t\tgeoJSON = data.geometries[ geoID ];\n\n\t\t\tif ( geoJSON.type in this.geometryHandlers ) {\n\n\t\t\t\tcounter_models += 1;\n\n\t\t\t\tscope.onLoadStart();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// count how many hierarchies will be loaded asynchronously\n\n\t\tfor ( var objID in data.objects ) {\n\n\t\t\ttraverse_json_hierarchy( data.objects[ objID ], function ( objJSON ) {\n\n\t\t\t\tif ( objJSON.type && ( objJSON.type in scope.hierarchyHandlers ) ) {\n\n\t\t\t\t\tcounter_models += 1;\n\n\t\t\t\t\tscope.onLoadStart();\n\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t}\n\n\t\ttotal_models = counter_models;\n\n\t\tfor ( geoID in data.geometries ) {\n\n\t\t\tgeoJSON = data.geometries[ geoID ];\n\n\t\t\tif ( geoJSON.type === \"cube\" ) {\n\n\t\t\t\tgeometry = new THREE.BoxGeometry( geoJSON.width, geoJSON.height, geoJSON.depth, geoJSON.widthSegments, geoJSON.heightSegments, geoJSON.depthSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"plane\" ) {\n\n\t\t\t\tgeometry = new THREE.PlaneGeometry( geoJSON.width, geoJSON.height, geoJSON.widthSegments, geoJSON.heightSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"sphere\" ) {\n\n\t\t\t\tgeometry = new THREE.SphereGeometry( geoJSON.radius, geoJSON.widthSegments, geoJSON.heightSegments );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"cylinder\" ) {\n\n\t\t\t\tgeometry = new THREE.CylinderGeometry( geoJSON.topRad, geoJSON.botRad, geoJSON.height, geoJSON.radSegs, geoJSON.heightSegs );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"torus\" ) {\n\n\t\t\t\tgeometry = new THREE.TorusGeometry( geoJSON.radius, geoJSON.tube, geoJSON.segmentsR, geoJSON.segmentsT );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type === \"icosahedron\" ) {\n\n\t\t\t\tgeometry = new THREE.IcosahedronGeometry( geoJSON.radius, geoJSON.subdivisions );\n\t\t\t\tgeometry.name = geoID;\n\t\t\t\tresult.geometries[ geoID ] = geometry;\n\n\t\t\t} else if ( geoJSON.type in this.geometryHandlers ) {\n\n\t\t\t\tvar loaderParameters = {};\n\n\t\t\t\tfor ( var parType in geoJSON ) {\n\n\t\t\t\t\tif ( parType !== \"type\" && parType !== \"url\" ) {\n\n\t\t\t\t\t\tloaderParameters[ parType ] = geoJSON[ parType ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar loader = this.geometryHandlers[ geoJSON.type ][ \"loaderObject\" ];\n hack.log(\"geoJSON.type = \"+geoJSON.type+\", geoJSON.url = \"+geoJSON.url, hack.sceneLoader, func);\n if (TiddlyWiki && geoJSON.url.match(/^tw:/)) {\n\t\t\t loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry_for_tiddlywiki_url( geoID ), loaderParameters );\n } else\n\t\t\t loader.load( get_url( geoJSON.url, data.urlBaseType ), create_callback_geometry( geoID ), loaderParameters );\n\n\t\t\t} else if ( geoJSON.type === \"embedded\" ) {\n\n\t\t\t\tvar modelJson = data.embeds[ geoJSON.id ],\n\t\t\t\t\ttexture_path = \"\";\n\n\t\t\t\t// pass metadata along to jsonLoader so it knows the format version\n\n\t\t\t\tmodelJson.metadata = data.metadata;\n\n\t\t\t\tif ( modelJson ) {\n\n\t\t\t\t\tvar jsonLoader = this.geometryHandlers[ \"ascii\" ][ \"loaderObject\" ];\n\t\t\t\t\tvar model = jsonLoader.parse( modelJson, texture_path );\n\t\t\t\t\tcreate_callback_embed( geoID )( model.geometry, model.materials );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// textures\n\n\t\t// count how many textures will be loaded asynchronously\n\n\t\tvar textureID, textureJSON;\n\n\t\tfor ( textureID in data.textures ) {\n\n\t\t\ttextureJSON = data.textures[ textureID ];\n\n\t\t\tif ( textureJSON.url instanceof Array ) {\n\n\t\t\t\tcounter_textures += textureJSON.url.length;\n\n\t\t\t\tfor( var n = 0; n < textureJSON.url.length; n ++ ) {\n\n\t\t\t\t\tscope.onLoadStart();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tcounter_textures += 1;\n\n\t\t\t\tscope.onLoadStart();\n\n\t\t\t}\n\n\t\t}\n\n\t\ttotal_textures = counter_textures;\n\n\t\tfor ( textureID in data.textures ) {\n\n\t\t\ttextureJSON = data.textures[ textureID ];\n\n\t\t\tif ( textureJSON.mapping !== undefined && THREE[ textureJSON.mapping ] !== undefined ) {\n\n\t\t\t\ttextureJSON.mapping = new THREE[ textureJSON.mapping ]();\n\n\t\t\t}\n\n\t\t\tvar texture;\n\n\t\t\tif ( textureJSON.url instanceof Array ) {\n\n\t\t\t\tvar count = textureJSON.url.length;\n\t\t\t\tvar url_array = [];\n\n\t\t\t\tfor ( var i = 0; i < count; i ++ ) {\n\n\t\t\t\t\turl_array[ i ] = get_url( textureJSON.url[ i ], data.urlBaseType );\n\n\t\t\t\t}\n\n\t\t\t\tvar loader = THREE.Loader.Handlers.get( url_array[ 0 ] );\n\n\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\ttexture = loader.load( url_array, generateTextureCallback( count ) );\n\t\t\t\t\ttexture.mapping = textureJSON.mapping;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = THREE.ImageUtils.loadTextureCube( url_array, textureJSON.mapping, generateTextureCallback( count ) );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar fullUrl = get_url( textureJSON.url, data.urlBaseType );\n\t\t\t\tvar textureCallback = generateTextureCallback( 1 );\n\n\t\t\t\tvar loader = THREE.Loader.Handlers.get( fullUrl );\n\n\t\t\t\tif ( loader !== null ) {\n\n\t\t\t\t\ttexture = loader.load( fullUrl, textureCallback );\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = new THREE.Texture();\n\t\t\t\t\tloader = new THREE.ImageLoader();\n\t\t\t\t\t\n\t\t\t\t\t( function ( texture ) {\n\n\t\t\t\t\t\tloader.load( fullUrl, function ( image ) {\n\n\t\t\t\t\t\t\ttexture.image = image;\n\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\t\t\ttextureCallback();\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t} )( texture )\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\ttexture.mapping = textureJSON.mapping;\n\n\t\t\t\tif ( THREE[ textureJSON.minFilter ] !== undefined )\n\t\t\t\t\ttexture.minFilter = THREE[ textureJSON.minFilter ];\n\n\t\t\t\tif ( THREE[ textureJSON.magFilter ] !== undefined )\n\t\t\t\t\ttexture.magFilter = THREE[ textureJSON.magFilter ];\n\n\t\t\t\tif ( textureJSON.anisotropy ) texture.anisotropy = textureJSON.anisotropy;\n\n\t\t\t\tif ( textureJSON.repeat ) {\n\n\t\t\t\t\ttexture.repeat.set( textureJSON.repeat[ 0 ], textureJSON.repeat[ 1 ] );\n\n\t\t\t\t\tif ( textureJSON.repeat[ 0 ] !== 1 ) texture.wrapS = THREE.RepeatWrapping;\n\t\t\t\t\tif ( textureJSON.repeat[ 1 ] !== 1 ) texture.wrapT = THREE.RepeatWrapping;\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureJSON.offset ) {\n\n\t\t\t\t\ttexture.offset.set( textureJSON.offset[ 0 ], textureJSON.offset[ 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\t// handle wrap after repeat so that default repeat can be overriden\n\n\t\t\t\tif ( textureJSON.wrap ) {\n\n\t\t\t\t\tvar wrapMap = {\n\t\t\t\t\t\t\"repeat\": THREE.RepeatWrapping,\n\t\t\t\t\t\t\"mirror\": THREE.MirroredRepeatWrapping\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( wrapMap[ textureJSON.wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ textureJSON.wrap[ 0 ] ];\n\t\t\t\t\tif ( wrapMap[ textureJSON.wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ textureJSON.wrap[ 1 ] ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tresult.textures[ textureID ] = texture;\n\n\t\t}\n\n\t\t// materials\n\n\t\tvar matID, matJSON;\n\t\tvar parID;\n\n\t\tfor ( matID in data.materials ) {\n\n\t\t\tmatJSON = data.materials[ matID ];\n\n\t\t\tfor ( parID in matJSON.parameters ) {\n\n\t\t\t\tif ( parID === \"envMap\" || parID === \"map\" || parID === \"lightMap\" || parID === \"bumpMap\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = result.textures[ matJSON.parameters[ parID ] ];\n\n\t\t\t\t} else if ( parID === \"shading\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = ( matJSON.parameters[ parID ] === \"flat\" ) ? THREE.FlatShading : THREE.SmoothShading;\n\n\t\t\t\t} else if ( parID === \"side\" ) {\n\n\t\t\t\t\tif ( matJSON.parameters[ parID ] == \"double\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.DoubleSide;\n\n\t\t\t\t\t} else if ( matJSON.parameters[ parID ] == \"back\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.BackSide;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.FrontSide;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parID === \"blending\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = matJSON.parameters[ parID ] in THREE ? THREE[ matJSON.parameters[ parID ] ] : THREE.NormalBlending;\n\n\t\t\t\t} else if ( parID === \"combine\" ) {\n\n\t\t\t\t\tmatJSON.parameters[ parID ] = matJSON.parameters[ parID ] in THREE ? THREE[ matJSON.parameters[ parID ] ] : THREE.MultiplyOperation;\n\n\t\t\t\t} else if ( parID === \"vertexColors\" ) {\n\n\t\t\t\t\tif ( matJSON.parameters[ parID ] == \"face\" ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.FaceColors;\n\n\t\t\t\t\t// default to vertex colors if \"vertexColors\" is anything else face colors or 0 / null / false\n\n\t\t\t\t\t} else if ( matJSON.parameters[ parID ] ) {\n\n\t\t\t\t\t\tmatJSON.parameters[ parID ] = THREE.VertexColors;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parID === \"wrapRGB\" ) {\n\n\t\t\t\t\tvar v3 = matJSON.parameters[ parID ];\n\t\t\t\t\tmatJSON.parameters[ parID ] = new THREE.Vector3( v3[ 0 ], v3[ 1 ], v3[ 2 ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( matJSON.parameters.opacity !== undefined && matJSON.parameters.opacity < 1.0 ) {\n\n\t\t\t\tmatJSON.parameters.transparent = true;\n\n\t\t\t}\n\n\t\t\tif ( matJSON.parameters.normalMap ) {\n\n\t\t\t\tvar shader = THREE.ShaderLib[ \"normalmap\" ];\n\t\t\t\tvar uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\t\t\t\tvar diffuse = matJSON.parameters.color;\n\t\t\t\tvar specular = matJSON.parameters.specular;\n\t\t\t\tvar ambient = matJSON.parameters.ambient;\n\t\t\t\tvar shininess = matJSON.parameters.shininess;\n\n\t\t\t\tuniforms[ \"tNormal\" ].value = result.textures[ matJSON.parameters.normalMap ];\n\n\t\t\t\tif ( matJSON.parameters.normalScale ) {\n\n\t\t\t\t\tuniforms[ \"uNormalScale\" ].value.set( matJSON.parameters.normalScale[ 0 ], matJSON.parameters.normalScale[ 1 ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.map ) {\n\n\t\t\t\t\tuniforms[ \"tDiffuse\" ].value = matJSON.parameters.map;\n\t\t\t\t\tuniforms[ \"enableDiffuse\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.envMap ) {\n\n\t\t\t\t\tuniforms[ \"tCube\" ].value = matJSON.parameters.envMap;\n\t\t\t\t\tuniforms[ \"enableReflection\" ].value = true;\n\t\t\t\t\tuniforms[ \"reflectivity\" ].value = matJSON.parameters.reflectivity;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.lightMap ) {\n\n\t\t\t\t\tuniforms[ \"tAO\" ].value = matJSON.parameters.lightMap;\n\t\t\t\t\tuniforms[ \"enableAO\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.specularMap ) {\n\n\t\t\t\t\tuniforms[ \"tSpecular\" ].value = result.textures[ matJSON.parameters.specularMap ];\n\t\t\t\t\tuniforms[ \"enableSpecular\" ].value = true;\n\n\t\t\t\t}\n\n\t\t\t\tif ( matJSON.parameters.displacementMap ) {\n\n\t\t\t\t\tuniforms[ \"tDisplacement\" ].value = result.textures[ matJSON.parameters.displacementMap ];\n\t\t\t\t\tuniforms[ \"enableDisplacement\" ].value = true;\n\n\t\t\t\t\tuniforms[ \"uDisplacementBias\" ].value = matJSON.parameters.displacementBias;\n\t\t\t\t\tuniforms[ \"uDisplacementScale\" ].value = matJSON.parameters.displacementScale;\n\n\t\t\t\t}\n\n\t\t\t\tuniforms[ \"diffuse\" ].value.setHex( diffuse );\n\t\t\t\tuniforms[ \"specular\" ].value.setHex( specular );\n\t\t\t\tuniforms[ \"ambient\" ].value.setHex( ambient );\n\n\t\t\t\tuniforms[ \"shininess\" ].value = shininess;\n\n\t\t\t\tif ( matJSON.parameters.opacity ) {\n\n\t\t\t\t\tuniforms[ \"opacity\" ].value = matJSON.parameters.opacity;\n\n\t\t\t\t}\n\n\t\t\t\tvar parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms, lights: true, fog: true };\n\n\t\t\t\tmaterial = new THREE.ShaderMaterial( parameters );\n\n\t\t\t} else {\n\n\t\t\t\tmaterial = new THREE[ matJSON.type ]( matJSON.parameters );\n\n\t\t\t}\n\n\t\t\tmaterial.name = matID;\n\n\t\t\tresult.materials[ matID ] = material;\n\n\t\t}\n\n\t\t// second pass through all materials to initialize MeshFaceMaterials\n\t\t// that could be referring to other materials out of order\n\n\t\tfor ( matID in data.materials ) {\n\n\t\t\tmatJSON = data.materials[ matID ];\n\n\t\t\tif ( matJSON.parameters.materials ) {\n\n\t\t\t\tvar materialArray = [];\n\n\t\t\t\tfor ( var i = 0; i < matJSON.parameters.materials.length; i ++ ) {\n\n\t\t\t\t\tvar label = matJSON.parameters.materials[ i ];\n\t\t\t\t\tmaterialArray.push( result.materials[ label ] );\n\n\t\t\t\t}\n\n\t\t\t\tresult.materials[ matID ].materials = materialArray;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// objects ( synchronous init of procedural primitives )\n\n\t\thandle_objects();\n\n\t\t// defaults\n\n\t\tif ( result.cameras && data.defaults.camera ) {\n\n\t\t\tresult.currentCamera = result.cameras[ data.defaults.camera ];\n\n\t\t}\n\n\t\tif ( result.fogs && data.defaults.fog ) {\n\n\t\t\tresult.scene.fog = result.fogs[ data.defaults.fog ];\n\n\t\t}\n\n\t\t// synchronous callback\n\n\t\tscope.callbackSync( result );\n\n\t\t// just in case there are no async elements\n\n\t\tasync_callback_gate();\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/STLLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/STLLoader.js",
"module-type": "library",
"text": "/**\n * @author aleeper / http://adamleeper.com/\n * @author mrdoob / http://mrdoob.com/\n * @author gero3 / https://github.com/gero3\n *\n * Description: A THREE loader for STL ASCII files, as created by Solidworks and other CAD programs.\n *\n * Supports both binary and ASCII encoded files, with automatic detection of type.\n *\n * Limitations:\n * \tBinary decoding ignores header. There doesn't seem to be much of a use for it.\n * \tThere is perhaps some question as to how valid it is to always assume little-endian-ness.\n * \tASCII decoding assumes file is UTF-8. Seems to work for the examples...\n *\n * Usage:\n * \tvar loader = new THREE.STLLoader();\n * \tloader.addEventListener( 'load', function ( event ) {\n *\n * \t\tvar geometry = event.content;\n * \t\tscene.add( new THREE.Mesh( geometry ) );\n *\n * \t} );\n * \tloader.load( './models/stl/slotted_disk.stl' );\n */\n\n\nTHREE.STLLoader = function () {};\n\nTHREE.STLLoader.prototype = {\n\n\tconstructor: THREE.STLLoader\n\n};\n\nTHREE.STLLoader.prototype.load = function ( url, callback ) {\n var func = \"THREE.STLLoader.load\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n var geometry = this.parse(res);\n this.dispatchEvent({type: 'load', content: geometry});\n if (callback) callback(geometry);\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\tvar scope = this;\n\n\tvar xhr = new XMLHttpRequest();\n\n\tfunction onloaded( event ) {\n\n\t\tif ( event.target.status === 200 || event.target.status === 0 ) {\n\n\t\t\tvar geometry = scope.parse( event.target.response || event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t} else {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']', response: event.target.statusText } );\n\n\t\t}\n\n\t}\n\n\txhr.addEventListener( 'load', onloaded, false );\n\n\txhr.addEventListener( 'progress', function ( event ) {\n\n\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t}, false );\n\n\txhr.addEventListener( 'error', function () {\n\n\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t}, false );\n\n\tif ( xhr.overrideMimeType ) xhr.overrideMimeType( 'text/plain; charset=x-user-defined' );\n\txhr.open( 'GET', url, true );\n\txhr.responseType = 'arraybuffer';\n\txhr.send( null );\n\n};\n\nTHREE.STLLoader.prototype.parse = function ( data ) {\n var func = \"THREE.STLLoader.parse\";\n\n\tvar isBinary = function () {\n\n\t\tvar expect, face_size, n_faces, reader;\n\t\treader = new DataView( binData );\n\t\tface_size = (32 / 8 * 3) + ((32 / 8 * 3) * 3) + (16 / 8);\n\t\tn_faces = reader.getUint32(80,true);\n\t\texpect = 80 + (32 / 8) + (n_faces * face_size);\n\t\treturn expect === reader.byteLength;\n\n\t};\n\n\tvar binData = this.ensureBinary( data );\n\n\treturn isBinary()\n\t\t? this.parseBinary( binData )\n\t\t: this.parseASCII( this.ensureString( data ) );\n\n};\n\nTHREE.STLLoader.prototype.parseBinary = function ( data ) {\n\n\tvar reader = new DataView( data );\n\tvar faces = reader.getUint32( 80, true );\n\tvar dataOffset = 84;\n\tvar faceLength = 12 * 4 + 2;\n\n\tvar offset = 0;\n\n\tvar geometry = new THREE.BufferGeometry();\n\n\tvar vertices = new Float32Array( faces * 3 * 3 );\n\tvar normals = new Float32Array( faces * 3 * 3 );\n\n\tfor ( var face = 0; face < faces; face ++ ) {\n\n\t\tvar start = dataOffset + face * faceLength;\n\n\t\tfor ( var i = 1; i <= 3; i ++ ) {\n\n\t\t\tvar vertexstart = start + i * 12;\n\n\t\t\tvertices[ offset ] = reader.getFloat32( vertexstart, true );\n\t\t\tvertices[ offset + 1 ] = reader.getFloat32( vertexstart + 4, true );\n\t\t\tvertices[ offset + 2 ] = reader.getFloat32( vertexstart + 8, true );\n\n\t\t\tnormals[ offset ] = reader.getFloat32( start , true );\n\t\t\tnormals[ offset + 1 ] = reader.getFloat32( start + 4, true );\n\t\t\tnormals[ offset + 2 ] = reader.getFloat32( start + 8, true );\n\n\t\t\toffset += 3;\n\n\t\t}\n\n\t}\n\n\tgeometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );\n\tgeometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n\n\treturn geometry;\n\n};\n\nTHREE.STLLoader.prototype.parseASCII = function (data) {\n var func = \"THREE.STLLoader.parseASCII\";\n\n\tvar geometry, length, normal, patternFace, patternNormal, patternVertex, result, text;\n\tgeometry = new THREE.Geometry();\n\tpatternFace = /facet([\\s\\S]*?)endfacet/g;\n\n\twhile ( ( result = patternFace.exec( data ) ) !== null ) {\n\n\t\ttext = result[0];\n\t\tpatternNormal = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n\t\twhile ( ( result = patternNormal.exec( text ) ) !== null ) {\n\n\t\t\tnormal = new THREE.Vector3( parseFloat( result[ 1 ] ), parseFloat( result[ 3 ] ), parseFloat( result[ 5 ] ) );\n\n\t\t}\n\n\t\tpatternVertex = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g;\n\n\t\twhile ( ( result = patternVertex.exec( text ) ) !== null ) {\n\n\t\t\tgeometry.vertices.push( new THREE.Vector3( parseFloat( result[ 1 ] ), parseFloat( result[ 3 ] ), parseFloat( result[ 5 ] ) ) );\n\n\t\t}\n\n\t\tlength = geometry.vertices.length;\n\n\t\tgeometry.faces.push( new THREE.Face3( length - 3, length - 2, length - 1, normal ) );\n\n\t}\n\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n\n};\n\nTHREE.STLLoader.prototype.ensureString = function (buf) {\n var func = \"THREE.STLLoader.ensureString\";\n\n\tif (typeof buf !== \"string\"){\n\t\tvar array_buffer = new Uint8Array(buf);\n\t\tvar str = '';\n\t\tfor(var i = 0; i < buf.byteLength; i++) {\n\t\t\tstr += String.fromCharCode(array_buffer[i]); // implicitly assumes little-endian\n\t\t}\n\t\treturn str;\n\t} else {\n\t\treturn buf;\n\t}\n\n};\n\nTHREE.STLLoader.prototype.ensureBinary = function (buf) {\n\n\tif (typeof buf === \"string\"){\n\t\tvar array_buffer = new Uint8Array(buf.length);\n\t\tfor(var i = 0; i < buf.length; i++) {\n\t\t\tarray_buffer[i] = buf.charCodeAt(i) & 0xff; // implicitly assumes little-endian\n\t\t}\n\t\treturn array_buffer.buffer || array_buffer;\n\t} else {\n\t\treturn buf;\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.STLLoader.prototype );\n\nif ( typeof DataView === 'undefined'){\n\n\tDataView = function(buffer, byteOffset, byteLength){\n\n\t\tthis.buffer = buffer;\n\t\tthis.byteOffset = byteOffset || 0;\n\t\tthis.byteLength = byteLength || buffer.byteLength || buffer.length;\n\t\tthis._isString = typeof buffer === \"string\";\n\n\t}\n\n\tDataView.prototype = {\n\n\t\t_getCharCodes:function(buffer,start,length){\n\t\t\tstart = start || 0;\n\t\t\tlength = length || buffer.length;\n\t\t\tvar end = start + length;\n\t\t\tvar codes = [];\n\t\t\tfor (var i = start; i < end; i++) {\n\t\t\t\tcodes.push(buffer.charCodeAt(i) & 0xff);\n\t\t\t}\n\t\t\treturn codes;\n\t\t},\n\n\t\t_getBytes: function (length, byteOffset, littleEndian) {\n\n\t\t\tvar result;\n\n\t\t\t// Handle the lack of endianness\n\t\t\tif (littleEndian === undefined) {\n\n\t\t\t\tlittleEndian = this._littleEndian;\n\n\t\t\t}\n\n\t\t\t// Handle the lack of byteOffset\n\t\t\tif (byteOffset === undefined) {\n\n\t\t\t\tbyteOffset = this.byteOffset;\n\n\t\t\t} else {\n\n\t\t\t\tbyteOffset = this.byteOffset + byteOffset;\n\n\t\t\t}\n\n\t\t\tif (length === undefined) {\n\n\t\t\t\tlength = this.byteLength - byteOffset;\n\n\t\t\t}\n\n\t\t\t// Error Checking\n\t\t\tif (typeof byteOffset !== 'number') {\n\n\t\t\t\tthrow new TypeError('DataView byteOffset is not a number');\n\n\t\t\t}\n\n\t\t\tif (length < 0 || byteOffset + length > this.byteLength) {\n\n\t\t\t\tthrow new Error('DataView length or (byteOffset+length) value is out of bounds');\n\n\t\t\t}\n\n\t\t\tif (this.isString){\n\n\t\t\t\tresult = this._getCharCodes(this.buffer, byteOffset, byteOffset + length);\n\n\t\t\t} else {\n\n\t\t\t\tresult = this.buffer.slice(byteOffset, byteOffset + length);\n\n\t\t\t}\n\n\t\t\tif (!littleEndian && length > 1) {\n\n\t\t\t\tif (!(result instanceof Array)) {\n\n\t\t\t\t\tresult = Array.prototype.slice.call(result);\n\n\t\t\t\t}\n\n\t\t\t\tresult.reverse();\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t},\n\n\t\t// Compatibility functions on a String Buffer\n\n\t\tgetFloat64: function (byteOffset, littleEndian) {\n\n\t\t\tvar b = this._getBytes(8, byteOffset, littleEndian),\n\n\t\t\t\tsign = 1 - (2 * (b[7] >> 7)),\n\t\t\t\texponent = ((((b[7] << 1) & 0xff) << 3) | (b[6] >> 4)) - ((1 << 10) - 1),\n\n\t\t\t// Binary operators such as | and << operate on 32 bit values, using + and Math.pow(2) instead\n\t\t\t\tmantissa = ((b[6] & 0x0f) * Math.pow(2, 48)) + (b[5] * Math.pow(2, 40)) + (b[4] * Math.pow(2, 32)) +\n\t\t\t\t\t\t\t(b[3] * Math.pow(2, 24)) + (b[2] * Math.pow(2, 16)) + (b[1] * Math.pow(2, 8)) + b[0];\n\n\t\t\tif (exponent === 1024) {\n\t\t\t\tif (mantissa !== 0) {\n\t\t\t\t\treturn NaN;\n\t\t\t\t} else {\n\t\t\t\t\treturn sign * Infinity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (exponent === -1023) { // Denormalized\n\t\t\t\treturn sign * mantissa * Math.pow(2, -1022 - 52);\n\t\t\t}\n\n\t\t\treturn sign * (1 + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent);\n\n\t\t},\n\n\t\tgetFloat32: function (byteOffset, littleEndian) {\n\n\t\t\tvar b = this._getBytes(4, byteOffset, littleEndian),\n\n\t\t\t\tsign = 1 - (2 * (b[3] >> 7)),\n\t\t\t\texponent = (((b[3] << 1) & 0xff) | (b[2] >> 7)) - 127,\n\t\t\t\tmantissa = ((b[2] & 0x7f) << 16) | (b[1] << 8) | b[0];\n\n\t\t\tif (exponent === 128) {\n\t\t\t\tif (mantissa !== 0) {\n\t\t\t\t\treturn NaN;\n\t\t\t\t} else {\n\t\t\t\t\treturn sign * Infinity;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (exponent === -127) { // Denormalized\n\t\t\t\treturn sign * mantissa * Math.pow(2, -126 - 23);\n\t\t\t}\n\n\t\t\treturn sign * (1 + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent);\n\t\t},\n\n\t\tgetInt32: function (byteOffset, littleEndian) {\n\t\t\tvar b = this._getBytes(4, byteOffset, littleEndian);\n\t\t\treturn (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];\n\t\t},\n\n\t\tgetUint32: function (byteOffset, littleEndian) {\n\t\t\treturn this.getInt32(byteOffset, littleEndian) >>> 0;\n\t\t},\n\n\t\tgetInt16: function (byteOffset, littleEndian) {\n\t\t\treturn (this.getUint16(byteOffset, littleEndian) << 16) >> 16;\n\t\t},\n\n\t\tgetUint16: function (byteOffset, littleEndian) {\n\t\t\tvar b = this._getBytes(2, byteOffset, littleEndian);\n\t\t\treturn (b[1] << 8) | b[0];\n\t\t},\n\n\t\tgetInt8: function (byteOffset) {\n\t\t\treturn (this.getUint8(byteOffset) << 24) >> 24;\n\t\t},\n\n\t\tgetUint8: function (byteOffset) {\n\t\t\treturn this._getBytes(1, byteOffset)[0];\n\t\t}\n\n\t };\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/UTF8Loader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/UTF8Loader.js",
"module-type": "library",
"text": "/**\n * Loader for UTF8 version2 (after r51) encoded models generated by:\n *\thttp://code.google.com/p/webgl-loader/\n *\n * Code to load/decompress mesh is taken from r100 of this webgl-loader\n */\n\nTHREE.UTF8Loader = function () {};\n\n/**\n * Load UTF8 encoded model\n * @param jsonUrl - URL from which to load json containing information about model\n * @param callback - Callback(THREE.Object3D) on successful loading of model\n * @param options - options on how to load model (see THREE.MTLLoader.MaterialCreator for basic options)\n * Additional options include\n * geometryBase: Base url from which to load referenced geometries\n * materialBase: Base url from which to load referenced textures\n */\n\nTHREE.UTF8Loader.prototype.load = function ( jsonUrl, callback, options ) {\n var func = \"THREE.UTF8Loader.load\";\n hack.log(\"url: \"+jsonUrl, hack.loader, func);\n\n this.downloadModelJson( jsonUrl, options, callback );\n\n};\n\n// BufferGeometryCreator\n\nTHREE.UTF8Loader.BufferGeometryCreator = function () {\n};\n\nTHREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray, indices ) {\n\n\tvar ntris = indices.length / 3;\n\n\tvar geometry = new THREE.BufferGeometry();\n\n\tvar positions = new Float32Array( ntris * 3 * 3 );\n\tvar normals = new Float32Array( ntris * 3 * 3 );\n\tvar uvs = new Float32Array( ntris * 3 * 2 );\n\n\tvar i, j, offset;\n\tvar x, y, z;\n\tvar u, v;\n\n\tvar end = attribArray.length;\n\tvar stride = 8;\n\n\t// extract positions\n\n\tj = 0;\n\toffset = 0;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tx = attribArray[ i ];\n\t\ty = attribArray[ i + 1 ];\n\t\tz = attribArray[ i + 2 ];\n\n\t\tpositions[ j++ ] = x;\n\t\tpositions[ j++ ] = y;\n\t\tpositions[ j++ ] = z;\n\n\t}\n\n\t// extract uvs\n\n\tj = 0;\n\toffset = 3;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tu = attribArray[ i ];\n\t\tv = attribArray[ i + 1 ];\n\n\t\tuvs[ j++ ] = u;\n\t\tuvs[ j++ ] = v;\n\n\t}\n\n\t// extract normals\n\n\tj = 0;\n\toffset = 5;\n\n\tfor( i = offset; i < end; i += stride ) {\n\n\t\tx = attribArray[ i ];\n\t\ty = attribArray[ i + 1 ];\n\t\tz = attribArray[ i + 2 ];\n\n\t\tnormals[ j++ ] = x;\n\t\tnormals[ j++ ] = y;\n\t\tnormals[ j++ ] = z;\n\n\t}\n\n geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );\n geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );\n\n geometry.offsets.push( { start: 0, count: indices.length, index: 0 } );\n\n\tgeometry.computeBoundingSphere();\n\n\treturn geometry;\n\n};\n\n\n// UTF-8 decoder from webgl-loader (r100)\n// http://code.google.com/p/webgl-loader/\n\n// Model manifest description. Contains objects like:\n// name: {\n// materials: { 'material_name': { ... } ... },\n// decodeParams: {\n// decodeOffsets: [ ... ],\n// decodeScales: [ ... ],\n// },\n// urls: {\n// 'url': [\n// { material: 'material_name',\n// attribRange: [#, #],\n// indexRange: [#, #],\n// names: [ 'object names' ... ],\n// lengths: [#, #, # ... ]\n// }\n// ],\n// ...\n// }\n// }\n\nvar DEFAULT_DECODE_PARAMS = {\n\n decodeOffsets: [-4095, -4095, -4095, 0, 0, -511, -511, -511],\n decodeScales: [1/8191, 1/8191, 1/8191, 1/1023, 1/1023, 1/1023, 1/1023, 1/1023]\n\n // TODO: normal decoding? (see walt.js)\n // needs to know: input, output (from vertex format!)\n //\n // Should split attrib/index.\n // 1) Decode position and non-normal attributes.\n // 2) Decode indices, computing normals\n // 3) Maybe normalize normals? Only necessary for refinement, or fixed?\n // 4) Maybe refine normals? Should this be part of regular refinement?\n // 5) Morphing\n\n};\n\n// Triangle strips!\n\n// TODO: will it be an optimization to specialize this method at\n// runtime for different combinations of stride, decodeOffset and\n// decodeScale?\n\nTHREE.UTF8Loader.prototype.decompressAttribsInner_ = function ( str, inputStart, inputEnd,\n output, outputStart, stride,\n decodeOffset, decodeScale ) {\n\n var prev = 0;\n\n for ( var j = inputStart; j < inputEnd; j ++ ) {\n\n var code = str.charCodeAt( j );\n prev += ( code >> 1 ) ^ ( -( code & 1 ) );\n\n output[ outputStart ] = decodeScale * ( prev + decodeOffset );\n outputStart += stride;\n\n }\n\n};\n\nTHREE.UTF8Loader.prototype.decompressIndices_ = function( str, inputStart, numIndices,\n output, outputStart ) {\n\n\tvar highest = 0;\n\n for ( var i = 0; i < numIndices; i ++ ) {\n\n var code = str.charCodeAt( inputStart ++ );\n\n output[ outputStart ++ ] = highest - code;\n\n if ( code === 0 ) {\n\n highest ++;\n\n }\n\n }\n\n};\n\nTHREE.UTF8Loader.prototype.decompressAABBs_ = function ( str, inputStart, numBBoxen,\n decodeOffsets, decodeScales ) {\n var numFloats = 6 * numBBoxen;\n\n var inputEnd = inputStart + numFloats;\n var outputStart = 0;\n\n var bboxen = new Float32Array( numFloats );\n\n for ( var i = inputStart; i < inputEnd; i += 6 ) {\n\n var minX = str.charCodeAt(i + 0) + decodeOffsets[0];\n var minY = str.charCodeAt(i + 1) + decodeOffsets[1];\n var minZ = str.charCodeAt(i + 2) + decodeOffsets[2];\n\n var radiusX = (str.charCodeAt(i + 3) + 1) >> 1;\n var radiusY = (str.charCodeAt(i + 4) + 1) >> 1;\n var radiusZ = (str.charCodeAt(i + 5) + 1) >> 1;\n\n bboxen[ outputStart++ ] = decodeScales[0] * (minX + radiusX);\n bboxen[ outputStart++ ] = decodeScales[1] * (minY + radiusY);\n bboxen[ outputStart++ ] = decodeScales[2] * (minZ + radiusZ);\n\n bboxen[ outputStart++ ] = decodeScales[0] * radiusX;\n bboxen[ outputStart++ ] = decodeScales[1] * radiusY;\n bboxen[ outputStart++ ] = decodeScales[2] * radiusZ;\n\n }\n\n return bboxen;\n\n};\n\nTHREE.UTF8Loader.prototype.decompressMesh = function ( str, meshParams, decodeParams, name, idx, callback ) {\n\n // Extract conversion parameters from attribArrays.\n\n var stride = decodeParams.decodeScales.length;\n\n var decodeOffsets = decodeParams.decodeOffsets;\n var decodeScales = decodeParams.decodeScales;\n\n var attribStart = meshParams.attribRange[0];\n var numVerts = meshParams.attribRange[1];\n\n // Decode attributes.\n\n var inputOffset = attribStart;\n var attribsOut = new Float32Array( stride * numVerts );\n\n for (var j = 0; j < stride; j ++ ) {\n\n var end = inputOffset + numVerts;\n\n\t\tvar decodeScale = decodeScales[j];\n\n if ( decodeScale ) {\n\n // Assume if decodeScale is never set, simply ignore the\n // attribute.\n\n this.decompressAttribsInner_( str, inputOffset, end,\n attribsOut, j, stride,\n decodeOffsets[j], decodeScale );\n }\n\n inputOffset = end;\n\n }\n\n var indexStart = meshParams.indexRange[ 0 ];\n var numIndices = 3 * meshParams.indexRange[ 1 ];\n\n var indicesOut = new Uint16Array( numIndices );\n\n this.decompressIndices_( str, inputOffset, numIndices, indicesOut, 0 );\n\n // Decode bboxen.\n\n var bboxen = undefined;\n var bboxOffset = meshParams.bboxes;\n\n if ( bboxOffset ) {\n\n bboxen = this.decompressAABBs_( str, bboxOffset, meshParams.names.length, decodeOffsets, decodeScales );\n }\n\n callback( name, idx, attribsOut, indicesOut, bboxen, meshParams );\n\n};\n\nTHREE.UTF8Loader.prototype.copyAttrib = function ( stride, attribsOutFixed, lastAttrib, index ) {\n\n for ( var j = 0; j < stride; j ++ ) {\n\n lastAttrib[ j ] = attribsOutFixed[ stride * index + j ];\n\n }\n\n};\n\nTHREE.UTF8Loader.prototype.decodeAttrib2 = function ( str, stride, decodeOffsets, decodeScales, deltaStart,\n numVerts, attribsOut, attribsOutFixed, lastAttrib,\n index ) {\n\n for ( var j = 0; j < 5; j ++ ) {\n\n var code = str.charCodeAt( deltaStart + numVerts*j + index );\n var delta = ( code >> 1) ^ (-(code & 1));\n\n lastAttrib[ j ] += delta;\n attribsOutFixed[ stride * index + j ] = lastAttrib[ j ];\n attribsOut[ stride * index + j ] = decodeScales[ j ] * ( lastAttrib[ j ] + decodeOffsets[ j ] );\n }\n\n};\n\nTHREE.UTF8Loader.prototype.accumulateNormal = function ( i0, i1, i2, attribsOutFixed, crosses ) {\n\n var p0x = attribsOutFixed[ 8*i0 ];\n var p0y = attribsOutFixed[ 8*i0 + 1 ];\n var p0z = attribsOutFixed[ 8*i0 + 2 ];\n\n var p1x = attribsOutFixed[ 8*i1 ];\n var p1y = attribsOutFixed[ 8*i1 + 1 ];\n var p1z = attribsOutFixed[ 8*i1 + 2 ];\n\n var p2x = attribsOutFixed[ 8*i2 ];\n var p2y = attribsOutFixed[ 8*i2 + 1 ];\n var p2z = attribsOutFixed[ 8*i2 + 2 ];\n\n p1x -= p0x;\n p1y -= p0y;\n p1z -= p0z;\n\n p2x -= p0x;\n p2y -= p0y;\n p2z -= p0z;\n\n p0x = p1y*p2z - p1z*p2y;\n p0y = p1z*p2x - p1x*p2z;\n p0z = p1x*p2y - p1y*p2x;\n\n crosses[ 3*i0 ] += p0x;\n crosses[ 3*i0 + 1 ] += p0y;\n crosses[ 3*i0 + 2 ] += p0z;\n\n crosses[ 3*i1 ] += p0x;\n crosses[ 3*i1 + 1 ] += p0y;\n crosses[ 3*i1 + 2 ] += p0z;\n\n crosses[ 3*i2 ] += p0x;\n crosses[ 3*i2 + 1 ] += p0y;\n crosses[ 3*i2 + 2 ] += p0z;\n\n};\n\nTHREE.UTF8Loader.prototype.decompressMesh2 = function( str, meshParams, decodeParams, name, idx, callback ) {\n\n var MAX_BACKREF = 96;\n\n // Extract conversion parameters from attribArrays.\n\n var stride = decodeParams.decodeScales.length;\n\n\tvar decodeOffsets = decodeParams.decodeOffsets;\n var decodeScales = decodeParams.decodeScales;\n\n var deltaStart = meshParams.attribRange[ 0 ];\n var numVerts = meshParams.attribRange[ 1 ];\n\n var codeStart = meshParams.codeRange[ 0 ];\n var codeLength = meshParams.codeRange[ 1 ];\n\n var numIndices = 3 * meshParams.codeRange[ 2 ];\n\n var indicesOut = new Uint16Array( numIndices );\n\n var crosses = new Int32Array( 3 * numVerts );\n\n var lastAttrib = new Uint16Array( stride );\n\n var attribsOutFixed = new Uint16Array( stride * numVerts );\n var attribsOut = new Float32Array( stride * numVerts );\n\n var highest = 0;\n var outputStart = 0;\n\n for ( var i = 0; i < numIndices; i += 3 ) {\n\n var code = str.charCodeAt( codeStart ++ );\n\n var max_backref = Math.min( i, MAX_BACKREF );\n\n if ( code < max_backref ) {\n\n // Parallelogram\n\n var winding = code % 3;\n var backref = i - ( code - winding );\n var i0, i1, i2;\n\n switch ( winding ) {\n\n case 0:\n\n i0 = indicesOut[ backref + 2 ];\n i1 = indicesOut[ backref + 1 ];\n i2 = indicesOut[ backref + 0 ];\n break;\n\n case 1:\n\n i0 = indicesOut[ backref + 0 ];\n i1 = indicesOut[ backref + 2 ];\n i2 = indicesOut[ backref + 1 ];\n break;\n\n case 2:\n\n i0 = indicesOut[ backref + 1 ];\n i1 = indicesOut[ backref + 0 ];\n i2 = indicesOut[ backref + 2 ];\n break;\n\n }\n\n indicesOut[ outputStart ++ ] = i0;\n indicesOut[ outputStart ++ ] = i1;\n\n code = str.charCodeAt( codeStart ++ );\n\n var index = highest - code;\n indicesOut[ outputStart ++ ] = index;\n\n if ( code === 0 ) {\n\n for (var j = 0; j < 5; j ++ ) {\n\n var deltaCode = str.charCodeAt( deltaStart + numVerts * j + highest );\n\n var prediction = ((deltaCode >> 1) ^ (-(deltaCode & 1))) +\n attribsOutFixed[stride*i0 + j] +\n attribsOutFixed[stride*i1 + j] -\n attribsOutFixed[stride*i2 + j];\n\n lastAttrib[j] = prediction;\n\n attribsOutFixed[ stride * highest + j ] = prediction;\n attribsOut[ stride * highest + j ] = decodeScales[ j ] * ( prediction + decodeOffsets[ j ] );\n\n }\n\n highest ++;\n\n } else {\n\n this.copyAttrib( stride, attribsOutFixed, lastAttrib, index );\n\n }\n\n this.accumulateNormal( i0, i1, index, attribsOutFixed, crosses );\n\n } else {\n\n // Simple\n\n var index0 = highest - ( code - max_backref );\n\n indicesOut[ outputStart ++ ] = index0;\n\n if ( code === max_backref ) {\n\n this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n numVerts, attribsOut, attribsOutFixed, lastAttrib,\n highest ++ );\n\n } else {\n\n this.copyAttrib(stride, attribsOutFixed, lastAttrib, index0);\n\n }\n\n code = str.charCodeAt( codeStart ++ );\n\n var index1 = highest - code;\n indicesOut[ outputStart ++ ] = index1;\n\n if ( code === 0 ) {\n\n this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n numVerts, attribsOut, attribsOutFixed, lastAttrib,\n highest ++ );\n\n } else {\n\n this.copyAttrib( stride, attribsOutFixed, lastAttrib, index1 );\n\n }\n\n code = str.charCodeAt( codeStart ++ );\n\n var index2 = highest - code;\n indicesOut[ outputStart ++ ] = index2;\n\n if ( code === 0 ) {\n\n for ( var j = 0; j < 5; j ++ ) {\n\n lastAttrib[ j ] = ( attribsOutFixed[ stride * index0 + j ] + attribsOutFixed[ stride * index1 + j ] ) / 2;\n\n }\n\n this.decodeAttrib2( str, stride, decodeOffsets, decodeScales, deltaStart,\n numVerts, attribsOut, attribsOutFixed, lastAttrib,\n highest ++ );\n\n } else {\n\n this.copyAttrib( stride, attribsOutFixed, lastAttrib, index2 );\n\n }\n\n this.accumulateNormal( index0, index1, index2, attribsOutFixed, crosses );\n\n }\n\n }\n\n for ( var i = 0; i < numVerts; i ++ ) {\n\n var nx = crosses[ 3*i ];\n var ny = crosses[ 3*i + 1 ];\n var nz = crosses[ 3*i + 2 ];\n\n var norm = 511.0 / Math.sqrt( nx*nx + ny*ny + nz*nz );\n\n var cx = str.charCodeAt( deltaStart + 5*numVerts + i );\n var cy = str.charCodeAt( deltaStart + 6*numVerts + i );\n var cz = str.charCodeAt( deltaStart + 7*numVerts + i );\n\n attribsOut[ stride*i + 5 ] = norm*nx + ((cx >> 1) ^ (-(cx & 1)));\n attribsOut[ stride*i + 6 ] = norm*ny + ((cy >> 1) ^ (-(cy & 1)));\n attribsOut[ stride*i + 7 ] = norm*nz + ((cz >> 1) ^ (-(cz & 1)));\n }\n\n callback( name, idx, attribsOut, indicesOut, undefined, meshParams );\n\n};\n\nTHREE.UTF8Loader.prototype.downloadMesh = function ( path, name, meshEntry, decodeParams, callback ) {\n var func = \"THREE.UTF8Loader.downloadMesh\";\n\n\n var loader = this;\n var idx = 0;\n\n function onprogress( req, e ) {\n\n while ( idx < meshEntry.length ) {\n\n var meshParams = meshEntry[ idx ];\n var indexRange = meshParams.indexRange;\n\n if ( indexRange ) {\n\n var meshEnd = indexRange[ 0 ] + 3 * indexRange[ 1 ];\n\n if ( req.responseText.length < meshEnd ) break;\n\n loader.decompressMesh( req.responseText, meshParams, decodeParams, name, idx, callback );\n\n } else {\n\n var codeRange = meshParams.codeRange;\n var meshEnd = codeRange[ 0 ] + codeRange[ 1 ];\n\n if ( req.responseText.length < meshEnd ) break;\n\n loader.decompressMesh2( req.responseText, meshParams, decodeParams, name, idx, callback );\n }\n\n ++idx;\n\n }\n\n };\n\n THREE.UTF8Loader.getHttpRequest( path, function( req, e ) {\n\n if ( req.status === 200 || req.status === 0 ) {\n\n onprogress( req, e );\n\n }\n\n // TODO: handle errors.\n\n }, onprogress );\n};\n\nTHREE.UTF8Loader.prototype.downloadMeshes = function ( path, meshUrlMap, decodeParams, callback ) {\n\n for ( var url in meshUrlMap ) {\n\n var meshEntry = meshUrlMap[url];\n this.downloadMesh( path + url, url, meshEntry, decodeParams, callback );\n\n }\n\n};\n\nTHREE.UTF8Loader.prototype.createMeshCallback = function( materialBaseUrl, loadModelInfo, allDoneCallback ) {\n\n\tvar nCompletedUrls = 0;\n var nExpectedUrls = 0;\n\n var expectedMeshesPerUrl = {};\n var decodedMeshesPerUrl = {};\n\n\tvar modelParts = {};\n\n\tvar meshUrlMap = loadModelInfo.urls;\n\n for ( var url in meshUrlMap ) {\n\n expectedMeshesPerUrl[ url ] = meshUrlMap[ url ].length;\n decodedMeshesPerUrl[ url ] = 0;\n\n\t\tnExpectedUrls ++;\n\n modelParts[ url ] = new THREE.Object3D();\n\n }\n\n var model = new THREE.Object3D();\n\n // Prepare materials first...\n\n var materialCreator = new THREE.MTLLoader.MaterialCreator( materialBaseUrl, loadModelInfo.options );\n materialCreator.setMaterials( loadModelInfo.materials );\n\n materialCreator.preload();\n\n\t// Create callback for creating mesh parts\n\n\tvar bufferGeometryCreator = new THREE.UTF8Loader.BufferGeometryCreator();\n\n\tvar meshCallback = function( name, idx, attribArray, indexArray, bboxen, meshParams ) {\n\n // Got ourselves a new mesh\n\n // name identifies this part of the model (url)\n // idx is the mesh index of this mesh of the part\n // attribArray defines the vertices\n // indexArray defines the faces\n // bboxen defines the bounding box\n // meshParams contains the material info\n\n\t\tvar geometry = bufferGeometryCreator.create( attribArray, indexArray );\n var material = materialCreator.create( meshParams.material );\n\n\t\tvar mesh = new THREE.Mesh( geometry, material );\n modelParts[ name ].add( mesh );\n\n //model.add(new THREE.Mesh(geometry, material));\n\n decodedMeshesPerUrl[ name ] ++;\n\n if ( decodedMeshesPerUrl[ name ] === expectedMeshesPerUrl[ name ] ) {\n\n nCompletedUrls ++;\n\n model.add( modelParts[ name ] );\n\n if ( nCompletedUrls === nExpectedUrls ) {\n\n // ALL DONE!!!\n\n allDoneCallback( model );\n\n }\n\n }\n\n };\n\n\treturn meshCallback;\n\n};\n\nTHREE.UTF8Loader.prototype.downloadModel = function ( geometryBase, materialBase, model, callback ) {\n\n var meshCallback = this.createMeshCallback( materialBase, model, callback );\n this.downloadMeshes( geometryBase, model.urls, model.decodeParams, meshCallback );\n\n};\n\nTHREE.UTF8Loader.prototype.downloadModelJson = function ( jsonUrl, options, callback ) {\n\n THREE.UTF8Loader.getJsonRequest( jsonUrl, function( loaded ) {\n\n if ( ! loaded.decodeParams ) {\n\n if ( options && options.decodeParams ) {\n\n loaded.decodeParams = options.decodeParams;\n\n } else {\n\n loaded.decodeParams = DEFAULT_DECODE_PARAMS;\n\n }\n\n }\n\n loaded.options = options;\n\n var geometryBase = jsonUrl.substr( 0, jsonUrl.lastIndexOf( \"/\" ) + 1 );\n var materialBase = geometryBase;\n\n if ( options && options.geometryBase ) {\n\n geometryBase = options.geometryBase;\n\n if ( geometryBase.charAt( geometryBase.length - 1 ) !== \"/\" ) {\n\n geometryBase = geometryBase + \"/\";\n\n }\n\n }\n\n if ( options && options.materialBase ) {\n\n materialBase = options.materialBase;\n\n if ( materialBase.charAt( materialBase.length - 1 ) !== \"/\" ) {\n\n materialBase = materialBase + \"/\";\n\n }\n\n }\n\n this.downloadModel( geometryBase, materialBase, loaded, callback );\n\n }.bind( this ) );\n\n};\n\n// XMLHttpRequest stuff\n\nTHREE.UTF8Loader.getHttpRequest = function( url, onload, opt_onprogress ) {\n var func = \"THREE.UTF8Loader.getHttpRequest\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n var req = {responseText: res};\n onload(req);\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n var LISTENERS = {\n\n load: function( e ) { onload( req, e ); },\n progress: function( e ) { opt_onprogress( req, e ); }\n\n };\n\n var req = new XMLHttpRequest();\n THREE.UTF8Loader.addListeners( req, LISTENERS );\n\n req.open( 'GET', url, true );\n req.send( null );\n}\n\nTHREE.UTF8Loader.getJsonRequest = function( url, onjson ) {\n\n THREE.UTF8Loader.getHttpRequest( url,\n function( e ) { onjson( JSON.parse( e.responseText ) ); },\n function() {} );\n\n}\n\nTHREE.UTF8Loader.addListeners = function( dom, listeners ) {\n\n // TODO: handle event capture, object binding.\n\n for ( var key in listeners ) {\n\n dom.addEventListener( key, listeners[ key ] );\n\n }\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/VRMLLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/VRMLLoader.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.VRMLLoader = function () {};\n\nTHREE.VRMLLoader.prototype = {\n\n\tconstructor: THREE.VRMLLoader,\n\n\t// for IndexedFaceSet support\n\tisRecordingPoints: false,\n\tisRecordingFaces: false,\n\tpoints: [],\n\tindexes : [],\n\n\t// for Background support\n\tisRecordingAngles: false,\n\tisRecordingColors: false,\n\tangles: [],\n\tcolors: [],\n\n\trecordingFieldname: null,\n\n\tload: function ( url, callback ) {\n var func = \"THREE.VRMLLoader.load\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n \n\t var object = this.parse(res);\n\t this.dispatchEvent({type: 'load', content: object});\n\t if (callback) callback(object);\n \n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar object = scope.parse( event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: object } );\n\n\t\t\tif ( callback ) callback( object );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.send( null );\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tvar parseV1 = function ( lines, scene ) {\n\n\t\t\tconsole.warn( 'VRML V1.0 not supported yet' );\n\n\t\t};\n\n\t\tvar parseV2 = function ( lines, scene ) {\n\t\t\tvar defines = {};\n\t\t\tvar float_pattern = /(\\b|\\-|\\+)([\\d\\.e]+)/;\n\t\t\tvar float3_pattern = /([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+)/;\n\n\t\t\t/**\n\t\t\t* Interpolates colors a and b following their relative distance\n\t\t\t* expressed by t.\n\t\t\t*\n\t\t\t* @param float a\n\t\t\t* @param float b\n\t\t\t* @param float t\n\t\t\t* @returns {Color}\n\t\t\t*/\n\t\t\tvar interpolateColors = function(a, b, t) {\n\t\t\t var deltaR = a.r - b.r;\n\t\t\t var deltaG = a.g - b.g;\n\t\t\t var deltaB = a.b - b.b;\n\n\t\t\t var c = new THREE.Color();\n\n\t\t\t c.r = a.r - t * deltaR;\n\t\t\t c.g = a.g - t * deltaG;\n\t\t\t c.b = a.b - t * deltaB;\n\n\t\t\t return c;\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Vertically paints the faces interpolating between the\n\t\t\t * specified colors at the specified angels. This is used for the Background\n\t\t\t * node, but could be applied to other nodes with multiple faces as well.\n\t\t\t *\n\t\t\t * When used with the Background node, default is directionIsDown is true if\n\t\t\t * interpolating the skyColor down from the Zenith. When interpolationg up from\n\t\t\t * the Nadir i.e. interpolating the groundColor, the directionIsDown is false.\n\t\t\t *\n\t\t\t * The first angle is never specified, it is the Zenith (0 rad). Angles are specified\n\t\t\t * in radians. The geometry is thought a sphere, but could be anything. The color interpolation\n\t\t\t * is linear along the Y axis in any case.\n\t\t\t *\n\t\t\t * You must specify one more color than you have angles at the beginning of the colors array.\n\t\t\t * This is the color of the Zenith (the top of the shape).\n\t\t\t *\n\t\t\t * @param geometry\n\t\t\t * @param radius\n\t\t\t * @param angles\n\t\t\t * @param colors\n\t\t\t * @param boolean directionIsDown Whether to work bottom up or top down.\n\t\t\t */\n\t\t\tvar paintFaces = function (geometry, radius, angles, colors, directionIsDown) {\n\n\t\t\t\tvar f, n, p, vertexIndex, color;\n\n\t\t\t\tvar direction = directionIsDown ? 1 : -1;\n\n\t\t\t\tvar faceIndices = [ 'a', 'b', 'c', 'd' ];\n\n\t\t\t\tvar coord = [ ], aColor, bColor, t = 1, A = {}, B = {}, applyColor = false, colorIndex;\n\n\t\t\t\tfor ( var k = 0; k < angles.length; k++ ) {\n\n\t\t\t\t\tvar vec = { };\n\n\t\t\t\t\t// push the vector at which the color changes\n\t\t\t\t\tvec.y = direction * ( Math.cos( angles[k] ) * radius);\n\n\t\t\t\t\tvec.x = direction * ( Math.sin( angles[k] ) * radius);\n\n\t\t\t\t\tcoord.push( vec );\n\n\t\t\t\t}\n\n\t\t\t\t// painting the colors on the faces\n\t\t\t\tfor ( var i = 0; i < geometry.faces.length ; i++ ) {\n\n\t\t\t\t\tf = geometry.faces[ i ];\n\n\t\t\t\t\tn = ( f instanceof THREE.Face3 ) ? 3 : 4;\n\n\t\t\t\t\tfor ( var j = 0; j < n; j++ ) {\n\n\t\t\t\t\t\tvertexIndex = f[ faceIndices[ j ] ];\n\n\t\t\t\t\t\tp = geometry.vertices[ vertexIndex ];\n\n\t\t\t\t\t\tfor ( var index = 0; index < colors.length; index++ ) {\n\n\t\t\t\t\t\t\t// linear interpolation between aColor and bColor, calculate proportion\n\t\t\t\t\t\t\t// A is previous point (angle)\n\t\t\t\t\t\t\tif ( index === 0 ) {\n\n\t\t\t\t\t\t\t\tA.x = 0;\n\t\t\t\t\t\t\t\tA.y = directionIsDown ? radius : -1 * radius;\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tA.x = coord[ index-1 ].x;\n\t\t\t\t\t\t\t\tA.y = coord[ index-1 ].y;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// B is current point (angle)\n\t\t\t\t\t\t\tB = coord[index];\n\n\t\t\t\t\t\t\tif ( undefined !== B ) {\n\t\t\t\t\t\t\t\t// p has to be between the points A and B which we interpolate\n\t\t\t\t\t\t\t\tapplyColor = directionIsDown ? p.y <= A.y && p.y > B.y : p.y >= A.y && p.y < B.y;\n\n\t\t\t\t\t\t\t\tif (applyColor) {\n\n\t\t\t\t\t\t\t\t\tbColor = colors[ index + 1 ];\n\n\t\t\t\t\t\t\t\t\taColor = colors[ index ];\n\n\t\t\t\t\t\t\t\t\t// below is simple linear interpolation\n\t\t\t\t\t\t\t\t\tt = Math.abs( p.y - A.y ) / ( A.y - B.y );\n\n\t\t\t\t\t\t\t\t\t// to make it faster, you can only calculate this if the y coord changes, the color is the same for points with the same y\n\t\t\t\t\t\t\t\t\tcolor = interpolateColors( aColor, bColor, t );\n\n\t\t\t\t\t\t\t\t\tf.vertexColors[ j ] = color;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else if ( undefined === f.vertexColors[ j ] ) {\n\t\t\t\t\t\t\t\tcolorIndex = directionIsDown ? colors.length -1 : 0;\n\t\t\t\t\t\t\t\tf.vertexColors[ j ] = colors[ colorIndex ];\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar parseProperty = function (node, line) {\n\n\t\t\t\tvar parts = [], part, property = {}, fieldName;\n\n\t\t\t\t/**\n\t\t\t\t * Expression for matching relevant information, such as a name or value, but not the separators\n\t\t\t\t * @type {RegExp}\n\t\t\t\t */\n\t\t\t\tvar regex = /[^\\s,\\[\\]]+/g;\n\n\t\t\t\tvar point, index, angles, colors;\n\n\t\t\t\twhile (null != ( part = regex.exec(line) ) ) {\n\t\t\t\t\tparts.push(part[0]);\n\t\t\t\t}\n\n\t\t\t\tfieldName = parts[0];\n\n\n\t\t\t\t// trigger several recorders\n\t\t\t\tswitch (fieldName) {\n\t\t\t\t\tcase 'skyAngle':\n\t\t\t\t\tcase 'groundAngle':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingAngles = true;\n\t\t\t\t\t\tthis.angles = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'skyColor':\n\t\t\t\t\tcase 'groundColor':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingColors = true;\n\t\t\t\t\t\tthis.colors = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'point':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingPoints = true;\n\t\t\t\t\t\tthis.points = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'coordIndex':\n\t\t\t\t\t\tthis.recordingFieldname = fieldName;\n\t\t\t\t\t\tthis.isRecordingFaces = true;\n\t\t\t\t\t\tthis.indexes = [];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (this.isRecordingFaces) {\n\n\t\t\t\t\t// the parts hold the indexes as strings\n\t\t\t\t\tif (parts.length > 0) {\n\t\t\t\t\t\tindex = [];\n\n\t\t\t\t\t\tfor (var ind = 0;ind < parts.length; ind++) {\n\n\t\t\t\t\t\t\t// the part should either be positive integer or -1\n\t\t\t\t\t\t\tif (!/(-?\\d+)/.test( parts[ind]) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// end of current face\n\t\t\t\t\t\t\tif (parts[ind] === \"-1\") {\n\t\t\t\t\t\t\t\tif (index.length > 0) {\n\t\t\t\t\t\t\t\t this.indexes.push(index);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// start new one\n\t\t\t\t\t\t\t\tindex = [];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tindex.push(parseInt( parts[ind]) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif (/]/.exec(line)) {\n\t\t\t\t\t\tthis.isRecordingFaces = false;\n\t\t\t\t\t\tnode.coordIndex = this.indexes;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (this.isRecordingPoints) {\n\n\t\t\t\t\tparts = float3_pattern.exec(line);\n\n\t\t\t\t\t// parts may be empty on first and last line\n\t\t\t\t\tif (null != parts) {\n\t\t\t\t\t\tpoint = {\n\t\t\t\t\t\t\tx: parseFloat(parts[1]),\n\t\t\t\t\t\t\ty: parseFloat(parts[2]),\n\t\t\t\t\t\t\tz: parseFloat(parts[3])\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.points.push(point);\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif ( /]/.exec(line) ) {\n\t\t\t\t\t\tthis.isRecordingPoints = false;\n\t\t\t\t\t\tnode.points = this.points;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( this.isRecordingAngles ) {\n\n\t\t\t\t\t// the parts hold the angles as strings\n\t\t\t\t\tif ( parts.length > 0 ) {\n\n\t\t\t\t\t\tfor ( var ind = 0;ind < parts.length; ind++ ) {\n\n\t\t\t\t\t\t\t// the part should be a float\n\t\t\t\t\t\t\tif ( ! float_pattern.test( parts[ind] ) ) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.angles.push( parseFloat( parts[ind] ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif ( /]/.exec(line) ) {\n\t\t\t\t\t\tthis.isRecordingAngles = false;\n\t\t\t\t\t\tnode[this.recordingFieldname] = this.angles;\n\t\t\t\t\t}\n\n\t\t\t\t} else if (this.isRecordingColors) {\n\t\t\t\t\t// this is the float3 regex with the g modifier added, you could also explode the line by comma first (faster probably)\n\t\t\t\t\tvar float3_repeatable = /([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+),?\\s+([\\d\\.\\+\\-e]+)/g;\n\n\t\t\t\t\twhile( null !== (parts = float3_repeatable.exec(line) ) ) {\n\n\t\t\t\t\t\tcolor = {\n\t\t\t\t\t\t\tr: parseFloat(parts[1]),\n\t\t\t\t\t\t\tg: parseFloat(parts[2]),\n\t\t\t\t\t\t\tb: parseFloat(parts[3])\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tthis.colors.push(color);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// end\n\t\t\t\t\tif (/]/.exec(line)) {\n\t\t\t\t\t\tthis.isRecordingColors = false;\n\t\t\t\t\t\tnode[this.recordingFieldname] = this.colors;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parts[parts.length -1] !== 'NULL' && fieldName !== 'children') {\n\n\t\t\t\t\tswitch (fieldName) {\n\n\t\t\t\t\t\tcase 'diffuseColor':\n\t\t\t\t\t\tcase 'emissiveColor':\n\t\t\t\t\t\tcase 'specularColor':\n\t\t\t\t\t\tcase 'color':\n\n\t\t\t\t\t\t\tif (parts.length != 4) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid color format detected for ' + fieldName );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'r' : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'g' : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'b' : parseFloat(parts[3])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'translation':\n\t\t\t\t\t\tcase 'scale':\n\t\t\t\t\t\tcase 'size':\n\t\t\t\t\t\t\tif (parts.length != 4) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid vector format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'x' : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'y' : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'z' : parseFloat(parts[3])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'radius':\n\t\t\t\t\t\tcase 'topRadius':\n\t\t\t\t\t\tcase 'bottomRadius':\n\t\t\t\t\t\tcase 'height':\n\t\t\t\t\t\tcase 'transparency':\n\t\t\t\t\t\tcase 'shininess':\n\t\t\t\t\t\tcase 'ambientIntensity':\n\t\t\t\t\t\t\tif (parts.length != 2) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid single float value specification detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = parseFloat(parts[1]);\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'rotation':\n\t\t\t\t\t\t\tif (parts.length != 5) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid quaternion format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = {\n\t\t\t\t\t\t\t\t'x' : parseFloat(parts[1]),\n\t\t\t\t\t\t\t\t'y' : parseFloat(parts[2]),\n\t\t\t\t\t\t\t\t'z' : parseFloat(parts[3]),\n\t\t\t\t\t\t\t\t'w' : parseFloat(parts[4])\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'ccw':\n\t\t\t\t\t\tcase 'solid':\n\t\t\t\t\t\tcase 'colorPerVertex':\n\t\t\t\t\t\tcase 'convex':\n\t\t\t\t\t\t\tif (parts.length != 2) {\n\t\t\t\t\t\t\t\tconsole.warn('Invalid format detected for ' + fieldName);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tproperty = parts[1] === 'TRUE' ? true : false;\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tnode[fieldName] = property;\n\t\t\t\t}\n\n\t\t\t\treturn property;\n\t\t\t};\n\n\t\t\tvar getTree = function ( lines ) {\n\n\t\t\t\tvar tree = { 'string': 'Scene', children: [] };\n\t\t\t\tvar current = tree;\n\t\t\t\tvar matches;\n\t\t\t\tvar specification;\n\n\t\t\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\t\tvar comment = '';\n\n\t\t\t\t\tvar line = lines[ i ];\n\n\t\t\t\t\t// omit whitespace only lines\n\t\t\t\t\tif ( null !== ( result = /^\\s+?$/g.exec( line ) ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tline = line.trim();\n\n\t\t\t\t\t// skip empty lines\n\t\t\t\t\tif (line === '') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( /#/.exec( line ) ) {\n\n\t\t\t\t\t\tvar parts = line.split('#');\n\n\t\t\t\t\t\t// discard everything after the #, it is a comment\n\t\t\t\t\t\tline = parts[0];\n\n\t\t\t\t\t\t// well, let's also keep the comment\n\t\t\t\t\t\tcomment = parts[1];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( matches = /([^\\s]*){1}\\s?{/.exec( line ) ) { // first subpattern should match the Node name\n\n\t\t\t\t\t\tvar block = { 'nodeType' : matches[1], 'string': line, 'parent': current, 'children': [],'comment' : comment};\n\t\t\t\t\t\tcurrent.children.push( block );\n\t\t\t\t\t\tcurrent = block;\n\n\t\t\t\t\t\tif ( /}/.exec( line ) ) {\n\t\t\t\t\t\t\t// example: geometry Box { size 1 1 1 } # all on the same line\n\t\t\t\t\t\t\tspecification = /{(.*)}/.exec( line )[ 1 ];\n\n\t\t\t\t\t\t\t// todo: remove once new parsing is complete?\n\t\t\t\t\t\t\tblock.children.push( specification );\n\n\t\t\t\t\t\t\tparseProperty(current, specification);\n\n\t\t\t\t\t\t\tcurrent = current.parent;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( /}/.exec( line ) ) {\n\n\t\t\t\t\t\tcurrent = current.parent;\n\n\t\t\t\t\t} else if ( line !== '' ) {\n\n\t\t\t\t\t\tparseProperty(current, line);\n\t\t\t\t\t\t// todo: remove once new parsing is complete? we still do not parse geometry and appearance the new way\n\t\t\t\t\t\tcurrent.children.push( line );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn tree;\n\t\t\t}\n\n\t\t\tvar parseNode = function ( data, parent ) {\n\n\t\t\t\t// console.log( data );\n\n\t\t\t\tif ( typeof data === 'string' ) {\n\n\t\t\t\t\tif ( /USE/.exec( data ) ) {\n\n\t\t\t\t\t\tvar defineKey = /USE\\s+?(\\w+)/.exec( data )[ 1 ];\n\n\t\t\t\t\t\tif (undefined == defines[defineKey]) {\n\t\t\t\t\t\t\tconsole.warn(defineKey + ' is not defined.');\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( /appearance/.exec( data ) && defineKey ) {\n\n\t\t\t\t\t\t\t\tparent.material = defines[ defineKey ].clone();\n\n\t\t\t\t\t\t\t} else if ( /geometry/.exec( data ) && defineKey ) {\n\n\t\t\t\t\t\t\t\tparent.geometry = defines[ defineKey ].clone();\n\n\t\t\t\t\t\t\t\t// the solid property is not cloned with clone(), is only needed for VRML loading, so we need to transfer it\n\t\t\t\t\t\t\t\tif (undefined !== defines[ defineKey ].solid && defines[ defineKey ].solid === false) {\n\t\t\t\t\t\t\t\t\tparent.geometry.solid = false;\n\t\t\t\t\t\t\t\t\tparent.material.side = THREE.DoubleSide;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else if (defineKey){\n\n\t\t\t\t\t\t\t\tvar object = defines[ defineKey ].clone();\n\t\t\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tvar object = parent;\n\n\t\t\t\tif ( 'Transform' === data.nodeType || 'Group' === data.nodeType ) {\n\n\t\t\t\t\tobject = new THREE.Object3D();\n\n\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\t\t\t\t\t\tobject.name = /DEF\\s+(\\w+)/.exec( data.string )[ 1 ];\n\t\t\t\t\t\tdefines[ object.name ] = object;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data['translation'] ) {\n\n\t\t\t\t\t\tvar t = data.translation;\n\n\t\t\t\t\t\tobject.position.set(t.x, t.y, t.z);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data.rotation ) {\n\n\t\t\t\t\t\tvar r = data.rotation;\n\n\t\t\t\t\t\tobject.quaternion.setFromAxisAngle( new THREE.Vector3( r.x, r.y, r.z ), r.w );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( undefined !== data.scale ) {\n\n\t\t\t\t\t\tvar s = data.scale;\n\n\t\t\t\t\t\tobject.scale.set( s.x, s.y, s.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tparent.add( object );\n\n\t\t\t\t} else if ( 'Shape' === data.nodeType ) {\n\n\t\t\t\t\tobject = new THREE.Mesh();\n\n\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\n\t\t\t\t\t\tobject.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\n\t\t\t\t\t\tdefines[ object.name ] = object;\n\t\t\t\t\t}\n\n\t\t\t\t\tparent.add( object );\n\n\t\t\t\t} else if ( 'Background' === data.nodeType ) {\n\n\t\t\t\t\tvar segments = 20;\n\n\t\t\t\t\t// sky (full sphere):\n\t\t\t\t\tvar radius = 2e4;\n\n\t\t\t\t\tvar skyGeometry = new THREE.SphereGeometry( radius, segments, segments );\n\n\t\t\t\t\tvar skyMaterial = new THREE.MeshBasicMaterial( { color: 'white', vertexColors: THREE.VertexColors, shading: THREE.NoShading } );\n\n\t\t\t\t\tskyMaterial.side = THREE.BackSide;\n\n\t\t\t\t\tskyMaterial.fog = false;\n\n\t\t\t\t\tskyMaterial.color = new THREE.Color();\n\n\t\t\t\t\tpaintFaces( skyGeometry, radius, data.skyAngle, data.skyColor, true );\n\n\t\t\t\t\tvar sky = new THREE.Mesh( skyGeometry, skyMaterial );\n\n\t\t\t\t\tscene.add( sky );\n\n\t\t\t\t\t// ground (half sphere):\n\n\t\t\t\t\tradius = 1.2e4;\n\n\t\t\t\t\tvar groundGeometry = new THREE.SphereGeometry( radius, segments, segments, 0, 2 * Math.PI, 0.5 * Math.PI, 1.5 * Math.PI );\n\n\t\t\t\t\tvar groundMaterial = new THREE.MeshBasicMaterial( { color: 'white', vertexColors: THREE.VertexColors, shading: THREE.NoShading } );\n\n\t\t\t\t\tgroundMaterial.side = THREE.BackSide;\n\n\t\t\t\t\tgroundMaterial.fog = false;\n\n\t\t\t\t\tgroundMaterial.color = new THREE.Color();\n\n\t\t\t\t\tpaintFaces( groundGeometry, radius, data.groundAngle, data.groundColor, false );\n\n\t\t\t\t\tvar ground = new THREE.Mesh( groundGeometry, groundMaterial );\n\n\t\t\t\t\tscene.add( ground );\n\n\t\t\t\t} else if ( /geometry/.exec( data.string ) ) {\n\n\t\t\t\t\tif ( 'Box' === data.nodeType ) {\n\n\t\t\t\t\t\tvar s = data.size;\n\n\t\t\t\t\t\tparent.geometry = new THREE.BoxGeometry( s.x, s.y, s.z );\n\n\t\t\t\t\t} else if ( 'Cylinder' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.CylinderGeometry( data.radius, data.radius, data.height );\n\n\t\t\t\t\t} else if ( 'Cone' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.CylinderGeometry( data.topRadius, data.bottomRadius, data.height );\n\n\t\t\t\t\t} else if ( 'Sphere' === data.nodeType ) {\n\n\t\t\t\t\t\tparent.geometry = new THREE.SphereGeometry( data.radius );\n\n\t\t\t\t\t} else if ( 'IndexedFaceSet' === data.nodeType ) {\n\n\t\t\t\t\t\tvar geometry = new THREE.Geometry();\n\n\t\t\t\t\t\tvar indexes;\n\n\t\t\t\t\t\tfor ( var i = 0, j = data.children.length; i < j; i++ ) {\n\n\t\t\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\t\t\tvar vec;\n\n\t\t\t\t\t\t\tif ( 'Coordinate' === child.nodeType ) {\n\n\t\t\t\t\t\t\t\tfor ( var k = 0, l = child.points.length; k < l; k++ ) {\n\n\t\t\t\t\t\t\t\t\tvar point = child.points[ k ];\n\n\t\t\t\t\t\t\t\t\tvec = new THREE.Vector3( point.x, point.y, point.z );\n\n\t\t\t\t\t\t\t\t\tgeometry.vertices.push( vec );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar skip = 0;\n\n\t\t\t\t\t\t// read this: http://math.hws.edu/eck/cs424/notes2013/16_Threejs_Advanced.html\n\t\t\t\t\t\tfor ( var i = 0, j = data.coordIndex.length; i < j; i++ ) {\n\n\t\t\t\t\t\t\tindexes = data.coordIndex[i];\n\n\t\t\t\t\t\t\t// vrml support multipoint indexed face sets (more then 3 vertices). You must calculate the composing triangles here\n\t\t\t\t\t\t\tskip = 0;\n\n\t\t\t\t\t\t\t// todo: this is the time to check if the faces are ordered ccw or not (cw)\n\n\t\t\t\t\t\t\t// Face3 only works with triangles, but IndexedFaceSet allows shapes with more then three vertices, build them of triangles\n\t\t\t\t\t\t\twhile ( indexes.length >= 3 && skip < ( indexes.length -2 ) ) {\n\n\t\t\t\t\t\t\t\tvar face = new THREE.Face3(\n\t\t\t\t\t\t\t\t\tindexes[0],\n\t\t\t\t\t\t\t\t\tindexes[skip + 1],\n\t\t\t\t\t\t\t\t\tindexes[skip + 2],\n\t\t\t\t\t\t\t\t\tnull // normal, will be added later\n\t\t\t\t\t\t\t\t\t// todo: pass in the color, if a color index is present\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tskip++;\n\n\t\t\t\t\t\t\t\tgeometry.faces.push( face );\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( false === data.solid ) {\n\t\t\t\t\t\t\tparent.material.side = THREE.DoubleSide;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// we need to store it on the geometry for use with defines\n\t\t\t\t\t\tgeometry.solid = data.solid;\n\n\t\t\t\t\t\tgeometry.computeFaceNormals();\n\t\t\t\t\t\t//geometry.computeVertexNormals(); // does not show\n\t\t\t\t\t\tgeometry.computeBoundingSphere();\n\n\t\t\t\t\t\t// see if it's a define\n\t\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\t\t\t\t\t\t\tgeometry.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\t\t\t\t\t\t\tdefines[ geometry.name ] = geometry;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tparent.geometry = geometry;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t} else if ( /appearance/.exec( data.string ) ) {\n\n\t\t\t\t\tfor ( var i = 0; i < data.children.length; i ++ ) {\n\n\t\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\t\tif ( 'Material' === child.nodeType ) {\n\t\t\t\t\t\t\tvar material = new THREE.MeshPhongMaterial();\n\n\t\t\t\t\t\t\tif ( undefined !== child.diffuseColor ) {\n\n\t\t\t\t\t\t\t\tvar d = child.diffuseColor;\n\n\t\t\t\t\t\t\t\tmaterial.color.setRGB( d.r, d.g, d.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.emissiveColor ) {\n\n\t\t\t\t\t\t\t\tvar e = child.emissiveColor;\n\n\t\t\t\t\t\t\t\tmaterial.emissive.setRGB( e.r, e.g, e.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.specularColor ) {\n\n\t\t\t\t\t\t\t\tvar s = child.specularColor;\n\n\t\t\t\t\t\t\t\tmaterial.specular.setRGB( s.r, s.g, s.b );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( undefined !== child.transparency ) {\n\n\t\t\t\t\t\t\t\tvar t = child.transparency;\n\n\t\t\t\t\t\t\t\t// transparency is opposite of opacity\n\t\t\t\t\t\t\t\tmaterial.opacity = Math.abs( 1 - t );\n\n\t\t\t\t\t\t\t\tmaterial.transparent = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( /DEF/.exec( data.string ) ) {\n\n\t\t\t\t\t\t\t\tmaterial.name = /DEF (\\w+)/.exec( data.string )[ 1 ];\n\n\t\t\t\t\t\t\t\tdefines[ material.name ] = material;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tparent.material = material;\n\n\t\t\t\t\t\t\t// material found, stop looping\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var i = 0, l = data.children.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar child = data.children[ i ];\n\n\t\t\t\t\tparseNode( data.children[ i ], object );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tparseNode( getTree( lines ), scene );\n\n\t\t};\n\n\t\tvar scene = new THREE.Scene();\n\n\t\tvar lines = data.split( '\\n' );\n\n\t\tvar header = lines.shift();\n\n\t\tif ( /V1.0/.exec( header ) ) {\n\n\t\t\tparseV1( lines, scene );\n\n\t\t} else if ( /V2.0/.exec( header ) ) {\n\n\t\t\tparseV2( lines, scene );\n\n\t\t}\n\n\t\treturn scene;\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.VRMLLoader.prototype );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/VTKLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/VTKLoader.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.VTKLoader = function () {};\n\nTHREE.VTKLoader.prototype = {\n\n\tconstructor: THREE.VTKLoader,\n\n\tload: function ( url, callback ) {\n var func = \"THREE.VTKLoader.load\";\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n \n var geometry = this.parse(res);\n this.dispatchEvent({type: 'load', content: geometry});\n if (callback) callback(geometry);\n \n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\t\tvar scope = this;\n\t\tvar request = new XMLHttpRequest();\n\n\t\trequest.addEventListener( 'load', function ( event ) {\n\n\t\t\tvar geometry = scope.parse( event.target.responseText );\n\n\t\t\tscope.dispatchEvent( { type: 'load', content: geometry } );\n\n\t\t\tif ( callback ) callback( geometry );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'progress', function ( event ) {\n\n\t\t\tscope.dispatchEvent( { type: 'progress', loaded: event.loaded, total: event.total } );\n\n\t\t}, false );\n\n\t\trequest.addEventListener( 'error', function () {\n\n\t\t\tscope.dispatchEvent( { type: 'error', message: 'Couldn\\'t load URL [' + url + ']' } );\n\n\t\t}, false );\n\n\t\trequest.open( 'GET', url, true );\n\t\trequest.send( null );\n\n\t},\n\n\tparse: function ( data ) {\n\n\t\tvar geometry = new THREE.Geometry();\n\n\t\tvar vertex = function ( x, y, z ) {\n\n\t\t\tgeometry.vertices.push( new THREE.Vector3( x, y, z ) );\n\n\t\t}\n\n\t\tvar face3 = function ( a, b, c ) {\n\n\t\t\tgeometry.faces.push( new THREE.Face3( a, b, c ) );\n\n\t\t}\n\n\t\tvar pattern, result;\n\n\t\t// float float float\n\n\t\tpattern = /([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)[ ]+([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)[ ]+([\\+|\\-]?[\\d]+[\\.]*[\\d|\\-|e]*)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"1.0 2.0 3.0\", \"1.0\", \"2.0\", \"3.0\"]\n\n\t\t\tvertex( parseFloat( result[ 1 ] ), parseFloat( result[ 2 ] ), parseFloat( result[ 3 ] ) );\n\n\t\t}\n\n\t\t// 3 int int int\n\n\t\tpattern = /3[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"3 1 2 3\", \"1\", \"2\", \"3\"]\n\n\t\t\tface3( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 3 ] ) );\n\n\t\t}\n\n\t\t// 4 int int int int\n\n\t\tpattern = /4[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)[ ]+([\\d]+)/g;\n\n\t\twhile ( ( result = pattern.exec( data ) ) !== null ) {\n\n\t\t\t// [\"4 1 2 3 4\", \"1\", \"2\", \"3\", \"4\"]\n\n\t\t\tface3( parseInt( result[ 1 ] ), parseInt( result[ 2 ] ), parseInt( result[ 4 ] ) );\n\t\t\tface3( parseInt( result[ 2 ] ), parseInt( result[ 3 ] ), parseInt( result[ 4 ] ) );\n\n\t\t}\n\n\t\tgeometry.computeFaceNormals();\n\t\tgeometry.computeVertexNormals();\n\t\tgeometry.computeBoundingSphere();\n\n\t\treturn geometry;\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.VTKLoader.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/msgpack-js.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/msgpack-js.js",
"module-type": "library",
"text": "THREE.msgpack = {};\n\nTHREE.msgpack.inspect = function(buffer) {\n if (buffer === undefined) return \"undefined\";\n var view;\n var type;\n if (buffer instanceof ArrayBuffer) {\n type = \"ArrayBuffer\";\n view = new DataView(buffer);\n }\n else if (buffer instanceof DataView) {\n type = \"DataView\";\n view = buffer;\n }\n if (!view) return JSON.stringify(buffer);\n var bytes = [];\n for (var i = 0; i < buffer.byteLength; i++) {\n if (i > 20) {\n bytes.push(\"...\");\n break;\n }\n var byte = view.getUint8(i).toString(16);\n if (byte.length === 1) byte = \"0\" + byte;\n bytes.push(byte);\n }\n return \"<\" + type + \" \" + bytes.join(\" \") + \">\";\n};\n\n// Encode string as utf8 into dataview at offset\nTHREE.msgpack.utf8Write = function(view, offset, string) {\n var byteLength = view.byteLength;\n for(var i = 0, l = string.length; i < l; i++) {\n var codePoint = string.charCodeAt(i);\n\n // One byte of UTF-8\n if (codePoint < 0x80) {\n view.setUint8(offset++, codePoint >>> 0 & 0x7f | 0x00);\n continue;\n }\n\n // Two bytes of UTF-8\n if (codePoint < 0x800) {\n view.setUint8(offset++, codePoint >>> 6 & 0x1f | 0xc0);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n\n // Three bytes of UTF-8. \n if (codePoint < 0x10000) {\n view.setUint8(offset++, codePoint >>> 12 & 0x0f | 0xe0);\n view.setUint8(offset++, codePoint >>> 6 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n\n // Four bytes of UTF-8\n if (codePoint < 0x110000) {\n view.setUint8(offset++, codePoint >>> 18 & 0x07 | 0xf0);\n view.setUint8(offset++, codePoint >>> 12 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 6 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n throw new Error(\"bad codepoint \" + codePoint);\n }\n};\n\nTHREE.msgpack.utf8Read = function(view, offset, length) {\n var string = \"\";\n for (var i = offset, end = offset + length; i < end; i++) {\n var byte = view.getUint8(i);\n // One byte character\n if ((byte & 0x80) === 0x00) {\n string += String.fromCharCode(byte);\n continue;\n }\n // Two byte character\n if ((byte & 0xe0) === 0xc0) {\n string += String.fromCharCode(\n ((byte & 0x0f) << 6) | \n (view.getUint8(++i) & 0x3f)\n );\n continue;\n }\n // Three byte character\n if ((byte & 0xf0) === 0xe0) {\n string += String.fromCharCode(\n ((byte & 0x0f) << 12) |\n ((view.getUint8(++i) & 0x3f) << 6) |\n ((view.getUint8(++i) & 0x3f) << 0)\n );\n continue;\n }\n // Four byte character\n if ((byte & 0xf8) === 0xf0) {\n string += String.fromCharCode(\n ((byte & 0x07) << 18) |\n ((view.getUint8(++i) & 0x3f) << 12) |\n ((view.getUint8(++i) & 0x3f) << 6) |\n ((view.getUint8(++i) & 0x3f) << 0)\n );\n continue;\n }\n throw new Error(\"Invalid byte \" + byte.toString(16));\n }\n return string;\n};\n\nTHREE.msgpack.utf8ByteCount = function(string) {\n var count = 0;\n for(var i = 0, l = string.length; i < l; i++) {\n var codePoint = string.charCodeAt(i);\n if (codePoint < 0x80) {\n count += 1;\n continue;\n }\n if (codePoint < 0x800) {\n count += 2;\n continue;\n }\n if (codePoint < 0x10000) {\n count += 3;\n continue;\n }\n if (codePoint < 0x110000) {\n count += 4;\n continue;\n }\n throw new Error(\"bad codepoint \" + codePoint);\n }\n return count;\n};\n\nTHREE.msgpack.encode = function(value) {\n var buffer = new ArrayBuffer(sizeof(value));\n var view = new DataView(buffer);\n THREE.msgpack.encode1(value, view, 0);\n return buffer;\n};\n\n// http://wiki.msgpack.org/display/MSGPACK/Format+specification\n// I've extended the protocol to have two new types that were previously reserved.\n// buffer 16 11011000 0xd8\n// buffer 32 11011001 0xd9\n// These work just like raw16 and raw32 except they are node buffers instead of strings.\n//\n// Also I've added a type for `undefined`\n// undefined 11000100 0xc4\n\nTHREE.msgpack.Decoder = function(view, offset) {\n this.offset = offset || 0;\n this.view = view;\n};\nTHREE.msgpack.Decoder.prototype.map = function (length) {\n var value = {};\n for (var i = 0; i < length; i++) {\n var key = this.parse();\n value[key] = this.parse();\n }\n return value;\n};\nTHREE.msgpack.Decoder.prototype.buf = function (length) {\n var value = new ArrayBuffer(length);\n (new Uint8Array(value)).set(new Uint8Array(this.view.buffer, this.offset, length), 0);\n this.offset += length;\n return value;\n};\nTHREE.msgpack.Decoder.prototype.raw = function (length) {\n var value = THREE.msgpack.utf8Read(this.view, this.offset, length);\n this.offset += length;\n return value;\n};\nTHREE.msgpack.Decoder.prototype.array = function (length) {\n var value = new Array(length);\n for (var i = 0; i < length; i++) {\n value[i] = this.parse();\n }\n return value;\n};\nTHREE.msgpack.Decoder.prototype.parse = function () {\n var type = this.view.getUint8(this.offset);\n var value, length;\n // FixRaw\n if ((type & 0xe0) === 0xa0) {\n length = type & 0x1f;\n this.offset++;\n return this.raw(length);\n }\n // FixMap\n if ((type & 0xf0) === 0x80) {\n length = type & 0x0f;\n this.offset++;\n return this.map(length);\n }\n // FixArray\n if ((type & 0xf0) === 0x90) {\n length = type & 0x0f;\n this.offset++;\n return this.array(length);\n }\n // Positive FixNum\n if ((type & 0x80) === 0x00) {\n this.offset++;\n return type;\n }\n // Negative Fixnum\n if ((type & 0xe0) === 0xe0) {\n value = this.view.getInt8(this.offset);\n this.offset++;\n return value;\n }\n switch (type) {\n // raw 16\n case 0xda:\n length = this.view.getUint16(this.offset + 1);\n this.offset += 3;\n return this.raw(length);\n // raw 32\n case 0xdb:\n length = this.view.getUint32(this.offset + 1);\n this.offset += 5;\n return this.raw(length);\n // nil\n case 0xc0:\n this.offset++;\n return null;\n // false\n case 0xc2:\n this.offset++;\n return false;\n // true\n case 0xc3:\n this.offset++;\n return true;\n // undefined\n case 0xc4:\n this.offset++;\n return undefined;\n // uint8\n case 0xcc:\n value = this.view.getUint8(this.offset + 1);\n this.offset += 2;\n return value;\n // uint 16\n case 0xcd:\n value = this.view.getUint16(this.offset + 1);\n this.offset += 3;\n return value;\n // uint 32\n case 0xce:\n value = this.view.getUint32(this.offset + 1);\n this.offset += 5;\n return value;\n // int 8\n case 0xd0:\n value = this.view.getInt8(this.offset + 1);\n this.offset += 2;\n return value;\n // int 16\n case 0xd1:\n value = this.view.getInt16(this.offset + 1);\n this.offset += 3;\n return value;\n // int 32\n case 0xd2:\n value = this.view.getInt32(this.offset + 1);\n this.offset += 5;\n return value;\n // map 16\n case 0xde:\n length = this.view.getUint16(this.offset + 1);\n this.offset += 3;\n return this.map(length);\n // map 32\n case 0xdf:\n length = this.view.getUint32(this.offset + 1);\n this.offset += 5;\n return this.map(length);\n // array 16\n case 0xdc:\n length = this.view.getUint16(this.offset + 1);\n this.offset += 3;\n return this.array(length);\n // array 32\n case 0xdd:\n length = this.view.getUint32(this.offset + 1);\n this.offset += 5;\n return this.array(length);\n // buffer 16\n case 0xd8:\n length = this.view.getUint16(this.offset + 1);\n this.offset += 3;\n return this.buf(length);\n // buffer 32\n case 0xd9:\n length = this.view.getUint32(this.offset + 1);\n this.offset += 5;\n return this.buf(length);\n // float\n case 0xca:\n value = this.view.getFloat32(this.offset + 1);\n this.offset += 5;\n return value;\n // double\n case 0xcb:\n value = this.view.getFloat64(this.offset + 1);\n this.offset += 9;\n return value;\n }\n throw new Error(\"Unknown type 0x\" + type.toString(16));\n};\nTHREE.msgpack.decode = function(buffer) {\n var view = new DataView(buffer);\n var decoder = new THREE.msgpack.Decoder(view);\n var value = decoder.parse();\n if (decoder.offset !== buffer.byteLength) throw new Error((buffer.byteLength - decoder.offset) + \" trailing bytes\");\n return value;\n};\n\nTHREE.msgpack.encode1 = function(value, view, offset) {\n var type = typeof value;\n\n // Strings Bytes\n if (type === \"string\") {\n var length = utf8ByteCount(value);\n // fix raw\n if (length < 0x20) {\n view.setUint8(offset, length | 0xa0);\n THREE.msgpack.utf8Write(view, offset + 1, value);\n return 1 + length;\n }\n // raw 16\n if (length < 0x10000) {\n view.setUint8(offset, 0xda);\n view.setUint16(offset + 1, length);\n THREE.msgpack.utf8Write(view, offset + 3, value);\n return 3 + length;\n }\n // raw 32\n if (length < 0x100000000) {\n view.setUint8(offset, 0xdb);\n view.setUint32(offset + 1, length);\n THREE.msgpack.utf8Write(view, offset + 5, value);\n return 5 + length;\n }\n }\n\n if (value instanceof ArrayBuffer) {\n var length = value.byteLength;\n // buffer 16\n if (length < 0x10000) {\n view.setUint8(offset, 0xd8);\n view.setUint16(offset + 1, length);\n (new Uint8Array(view.buffer)).set(new Uint8Array(value), offset + 3);\n return 3 + length;\n }\n // buffer 32\n if (length < 0x100000000) {\n view.setUint8(offset, 0xd9);\n view.setUint32(offset + 1, length);\n (new Uint8Array(view.buffer)).set(new Uint8Array(value), offset + 5);\n return 5 + length;\n }\n }\n \n if (type === \"number\") {\n // Floating Point\n if ((value << 0) !== value) {\n view.setUint8(offset, 0xcb);\n view.setFloat64(offset + 1, value);\n return 9;\n }\n\n // Integers\n if (value >=0) {\n // positive fixnum\n if (value < 0x80) {\n view.setUint8(offset, value);\n return 1;\n }\n // uint 8\n if (value < 0x100) {\n view.setUint8(offset, 0xcc);\n view.setUint8(offset + 1, value);\n return 2;\n }\n // uint 16\n if (value < 0x10000) {\n view.setUint8(offset, 0xcd);\n view.setUint16(offset + 1, value);\n return 3;\n }\n // uint 32\n if (value < 0x100000000) {\n view.setUint8(offset, 0xce);\n view.setUint32(offset + 1, value);\n return 5;\n }\n throw new Error(\"Number too big 0x\" + value.toString(16));\n }\n // negative fixnum\n if (value >= -0x20) {\n view.setInt8(offset, value);\n return 1;\n }\n // int 8\n if (value >= -0x80) {\n view.setUint8(offset, 0xd0);\n view.setInt8(offset + 1, value);\n return 2;\n }\n // int 16\n if (value >= -0x8000) {\n view.setUint8(offset, 0xd1);\n view.setInt16(offset + 1, value);\n return 3;\n }\n // int 32\n if (value >= -0x80000000) {\n view.setUint8(offset, 0xd2);\n view.setInt32(offset + 1, value);\n return 5;\n }\n throw new Error(\"Number too small -0x\" + (-value).toString(16).substr(1));\n }\n \n // undefined\n if (type === \"undefined\") {\n view.setUint8(offset, 0xc4);\n return 1;\n }\n \n // null\n if (value === null) {\n view.setUint8(offset, 0xc0);\n return 1;\n }\n\n // Boolean\n if (type === \"boolean\") {\n view.setUint8(offset, value ? 0xc3 : 0xc2);\n return 1;\n }\n \n // Container Types\n if (type === \"object\") {\n var length, size = 0;\n var isArray = Array.isArray(value);\n\n if (isArray) {\n length = value.length;\n }\n else {\n var keys = Object.keys(value);\n length = keys.length;\n }\n\n var size;\n if (length < 0x10) {\n view.setUint8(offset, length | (isArray ? 0x90 : 0x80));\n size = 1;\n }\n else if (length < 0x10000) {\n view.setUint8(offset, isArray ? 0xdc : 0xde);\n view.setUint16(offset + 1, length);\n size = 3;\n }\n else if (length < 0x100000000) {\n view.setUint8(offset, isArray ? 0xdd : 0xdf);\n view.setUint32(offset + 1, length);\n size = 5;\n }\n\n if (isArray) {\n for (var i = 0; i < length; i++) {\n size += THREE.msgpack.encode(value[i], view, offset + size);\n }\n }\n else {\n for (var i = 0; i < length; i++) {\n var key = keys[i];\n size += THREE.msgpack.encode(key, view, offset + size);\n size += THREE.msgpack.encode(value[key], view, offset + size);\n }\n }\n \n return size;\n }\n throw new Error(\"Unknown type \" + type);\n};\n\nTHREE.msgpack.sizeof = function(value) {\n var type = typeof value;\n\n // Raw Bytes\n if (type === \"string\") {\n var length = THREE.msgpack.utf8ByteCount(value);\n if (length < 0x20) {\n return 1 + length;\n }\n if (length < 0x10000) {\n return 3 + length;\n }\n if (length < 0x100000000) {\n return 5 + length;\n }\n }\n \n if (value instanceof ArrayBuffer) {\n var length = value.byteLength;\n if (length < 0x10000) {\n return 3 + length;\n }\n if (length < 0x100000000) {\n return 5 + length;\n }\n }\n \n if (type === \"number\") {\n // Floating Point\n // double\n if (value << 0 !== value) return 9;\n\n // Integers\n if (value >=0) {\n // positive fixnum\n if (value < 0x80) return 1;\n // uint 8\n if (value < 0x100) return 2;\n // uint 16\n if (value < 0x10000) return 3;\n // uint 32\n if (value < 0x100000000) return 5;\n // uint 64\n if (value < 0x10000000000000000) return 9;\n throw new Error(\"Number too big 0x\" + value.toString(16));\n }\n // negative fixnum\n if (value >= -0x20) return 1;\n // int 8\n if (value >= -0x80) return 2;\n // int 16\n if (value >= -0x8000) return 3;\n // int 32\n if (value >= -0x80000000) return 5;\n // int 64\n if (value >= -0x8000000000000000) return 9;\n throw new Error(\"Number too small -0x\" + value.toString(16).substr(1));\n }\n \n // Boolean, null, undefined\n if (type === \"boolean\" || type === \"undefined\" || value === null) return 1;\n \n // Container Types\n if (type === \"object\") {\n var length, size = 0;\n if (Array.isArray(value)) {\n length = value.length;\n for (var i = 0; i < length; i++) {\n size += sizeof(value[i]);\n }\n }\n else {\n var keys = Object.keys(value);\n length = keys.length;\n for (var i = 0; i < length; i++) {\n var key = keys[i];\n size += sizeof(key) + sizeof(value[key]);\n }\n }\n if (length < 0x10) {\n return 1 + size;\n }\n if (length < 0x10000) {\n return 3 + size;\n }\n if (length < 0x100000000) {\n return 5 + size;\n }\n throw new Error(\"Array or object too long 0x\" + length.toString(16));\n }\n throw new Error(\"Unknown type \" + type);\n};"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/CTMLoader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/CTMLoader.js",
"module-type": "library",
"text": "/**\n * Loader for CTM encoded models generated by OpenCTM tools:\n *\thttp://openctm.sourceforge.net/\n *\n * Uses js-openctm library by Juan Mellado\n *\thttp://code.google.com/p/js-openctm/\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.CTMLoader = function ( showStatus ) {\n\n\tTHREE.Loader.call( this, showStatus );\n\n};\n\nTHREE.CTMLoader.prototype = Object.create( THREE.Loader.prototype );\n\n// Load multiple CTM parts defined in JSON\n\nTHREE.CTMLoader.prototype.loadParts = function( url, callback, parameters ) {\n var func = \"THREE.CTMLoader.loadParts\";\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n var basePath = parameters.basePath ? parameters.basePath : this.extractUrlBase(url);\n var jsonObject = JSON.parse(res);\n var materials = [], geometries = [], counter = 0;\n function callbackFinal(geometry) {\n counter += 1;\n geometries.push(geometry);\n if (counter === jsonObject.offsets.length) {\n\tcallback(geometries, materials);\n }\n }\n\n // init materials\n for (var i = 0; i < jsonObject.materials.length; i++) {\n materials[i] = scope.createMaterial(jsonObject.materials[i], basePath);\n }\n\n // load joined CTM file\n var partUrl = basePath + jsonObject.data;\n var parametersPart = {useWorker: parameters.useWorker, offsets: jsonObject.offsets};\n scope.load(partUrl, callbackFinal, parametersPart);\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\tvar xhr = new XMLHttpRequest();\n\n\tvar basePath = parameters.basePath ? parameters.basePath : this.extractUrlBase( url );\n\n\txhr.onreadystatechange = function() {\n\n\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\n\t\t\t\tvar jsonObject = JSON.parse( xhr.responseText );\n\n\t\t\t\tvar materials = [], geometries = [], counter = 0;\n\n\t\t\t\tfunction callbackFinal( geometry ) {\n\n\t\t\t\t\tcounter += 1;\n\n\t\t\t\t\tgeometries.push( geometry );\n\n\t\t\t\t\tif ( counter === jsonObject.offsets.length ) {\n\n\t\t\t\t\t\tcallback( geometries, materials );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t// init materials\n\n\t\t\t\tfor ( var i = 0; i < jsonObject.materials.length; i ++ ) {\n\n\t\t\t\t\tmaterials[ i ] = scope.createMaterial( jsonObject.materials[ i ], basePath );\n\n\t\t\t\t}\n\n\t\t\t\t// load joined CTM file\n\n\t\t\t\tvar partUrl = basePath + jsonObject.data;\n\t\t\t\tvar parametersPart = { useWorker: parameters.useWorker, offsets: jsonObject.offsets };\n\t\t\t\tscope.load( partUrl, callbackFinal, parametersPart );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\txhr.open( \"GET\", url, true );\n\txhr.setRequestHeader( \"Content-Type\", \"text/plain\" );\n\txhr.send( null );\n\n};\n\n// Load CTMLoader compressed models\n//\t- parameters\n//\t\t- url (required)\n//\t\t- callback (required)\n\nTHREE.CTMLoader.prototype.load = function( url, callback, parameters ) {\n var func = \"THREE.CTMLoader.load\";\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n\tvar offsets = parameters.offsets !== undefined ? parameters.offsets : [ 0 ];\n\n if (TiddlyWiki && url.match(/^tw:/)) {\n var res = TiddlyWiki.load(url);\n //hack.log(\"res.length = \"+res.length, hack.loader, func);\n\n var binaryData = new Uint8Array(res);\n var s = Date.now();\n if (parameters.useWorker) {\n if (TiddlyWiki) {\n alert(func+\": Worker() not supported !\");\n return;\n }\n var worker = new Worker(\"js/loaders/ctm/CTMWorker.js\");\n worker.onmessage = function(event) {\n\tvar files = event.data;\n\tfor (var i = 0; i < files.length; i++) {\n\t var ctmFile = files[ i ];\n\t var e1 = Date.now();\n\t // console.log( \"CTM data parse time [worker]: \" + (e1-s) + \" ms\" );\n\t scope.createModel( ctmFile, callback );\n\t var e = Date.now();\n\t console.log(\"model load time [worker]: \" + (e-e1) + \" ms, total: \" + (e-s));\n\t}\n };\n worker.postMessage({\"data\": binaryData, \"offsets\": offsets});\n } else {\n for (var i = 0; i < offsets.length; i++) {\n\tvar stream = new CTM.Stream(binaryData);\n\tstream.offset = offsets[i];\n\tvar ctmFile = new CTM.File(stream);\n\tscope.createModel(ctmFile, callback);\n }\n //var e = Date.now();\n //console.log( \"CTM data parse time [inline]: \" + (e-s) + \" ms\" );\n }\n\n hack.log(\"url: \"+url+\": loaded\", hack.loader, func);\n return;\n }\n\n\tvar xhr = new XMLHttpRequest(),\n\t\tcallbackProgress = null;\n\n\tvar length = 0;\n\n\txhr.onreadystatechange = function() {\n\n\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\n\t\t\t\tvar binaryData = new Uint8Array(xhr.response);\n\n\t\t\t\tvar s = Date.now();\n\n\t\t\t\tif ( parameters.useWorker ) {\n\n\t\t\t\t\tvar worker = new Worker( \"js/loaders/ctm/CTMWorker.js\" );\n\n\t\t\t\t\tworker.onmessage = function( event ) {\n\n\t\t\t\t\t\tvar files = event.data;\n\n\t\t\t\t\t\tfor ( var i = 0; i < files.length; i ++ ) {\n\n\t\t\t\t\t\t\tvar ctmFile = files[ i ];\n\n\t\t\t\t\t\t\tvar e1 = Date.now();\n\t\t\t\t\t\t\t// console.log( \"CTM data parse time [worker]: \" + (e1-s) + \" ms\" );\n\n\t\t\t\t\t\t\tscope.createModel( ctmFile, callback );\n\n\t\t\t\t\t\t\tvar e = Date.now();\n\t\t\t\t\t\t\tconsole.log( \"model load time [worker]: \" + (e-e1) + \" ms, total: \" + (e-s));\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t};\n\n\t\t\t\t\tworker.postMessage( { \"data\": binaryData, \"offsets\": offsets } );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tfor ( var i = 0; i < offsets.length; i ++ ) {\n\n\t\t\t\t\t\tvar stream = new CTM.Stream( binaryData );\n\t\t\t\t\t\tstream.offset = offsets[ i ];\n\n\t\t\t\t\t\tvar ctmFile = new CTM.File( stream );\n\n\t\t\t\t\t\tscope.createModel( ctmFile, callback );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//var e = Date.now();\n\t\t\t\t\t//console.log( \"CTM data parse time [inline]: \" + (e-s) + \" ms\" );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( \"Couldn't load [\" + url + \"] [\" + xhr.status + \"]\" );\n\n\t\t\t}\n\n\t\t} else if ( xhr.readyState === 3 ) {\n\n\t\t\tif ( callbackProgress ) {\n\n\t\t\t\tif ( length === 0 ) {\n\n\t\t\t\t\tlength = xhr.getResponseHeader( \"Content-Length\" );\n\n\t\t\t\t}\n\n\t\t\t\tcallbackProgress( { total: length, loaded: xhr.responseText.length } );\n\n\t\t\t}\n\n\t\t} else if ( xhr.readyState === 2 ) {\n\n\t\t\tlength = xhr.getResponseHeader( \"Content-Length\" );\n\n\t\t}\n\n\t}\n\n\txhr.open( \"GET\", url, true );\n\txhr.responseType = \"arraybuffer\";\n\n\txhr.send( null );\n\n};\n\n\nTHREE.CTMLoader.prototype.createModel = function ( file, callback ) {\n\n\tvar Model = function () {\n\n\t\tTHREE.BufferGeometry.call( this );\n\n\t\tthis.materials = [];\n\n\t\tvar indices = file.body.indices,\n\t\tpositions = file.body.vertices,\n\t\tnormals = file.body.normals;\n\n\t\tvar uvs, colors;\n\n\t\tvar uvMaps = file.body.uvMaps;\n\n\t\tif ( uvMaps !== undefined && uvMaps.length > 0 ) {\n\n\t\t\tuvs = uvMaps[ 0 ].uv;\n\n\t\t}\n\n\t\tvar attrMaps = file.body.attrMaps;\n\n\t\tif ( attrMaps !== undefined && attrMaps.length > 0 && attrMaps[ 0 ].name === 'Color' ) {\n\n\t\t\tcolors = attrMaps[ 0 ].attr;\n\n\t\t}\n\n\t\tthis.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );\n\t\tthis.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\n\n\t\tif ( normals !== undefined ) {\n\n\t\t\tthis.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\n\n\t\t}\n\n\t\tif ( uvs !== undefined ) {\n\n\t\t\tthis.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );\n\n\t\t}\n\n\t\tif ( colors !== undefined ) {\n\n\t\t\tthis.addAttribute( 'color', new THREE.BufferAttribute( colors, 4 ) );\n\n\t\t}\n\n\t}\n\n\tModel.prototype = Object.create( THREE.BufferGeometry.prototype );\n\n\tvar geometry = new Model();\n\n\tgeometry.computeOffsets();\n\n\t// compute vertex normals if not present in the CTM model\n\tif ( geometry.attributes[ \"normal\" ] === undefined ) {\n\t\tgeometry.computeVertexNormals();\n\t}\n\n\tcallback( geometry );\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/ctm.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/ctm.js",
"module-type": "library",
"text": "(function(){\n/*\nCopyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n/*\nReferences:\n- \"OpenCTM: The Open Compressed Triangle Mesh file format\" by Marcus Geelnard\n http://openctm.sourceforge.net/\n*/\n\nvar CTM = CTM || {};\n\nCTM.CompressionMethod = {\n RAW: 0x00574152,\n MG1: 0x0031474d,\n MG2: 0x0032474d\n};\n\nCTM.Flags = {\n NORMALS: 0x00000001\n};\n\nCTM.File = function(stream){\n this.load(stream);\n};\n\nCTM.File.prototype.load = function(stream){\n this.header = new CTM.FileHeader(stream);\n\n this.body = new CTM.FileBody(this.header);\n \n this.getReader().read(stream, this.body);\n};\n\nCTM.File.prototype.getReader = function(){\n var reader;\n\n switch(this.header.compressionMethod){\n case CTM.CompressionMethod.RAW:\n reader = new CTM.ReaderRAW();\n break;\n case CTM.CompressionMethod.MG1:\n reader = new CTM.ReaderMG1();\n break;\n case CTM.CompressionMethod.MG2:\n reader = new CTM.ReaderMG2();\n break;\n }\n\n return reader;\n};\n\nCTM.FileHeader = function(stream){\n stream.readInt32(); //magic \"OCTM\"\n this.fileFormat = stream.readInt32();\n this.compressionMethod = stream.readInt32();\n this.vertexCount = stream.readInt32();\n this.triangleCount = stream.readInt32();\n this.uvMapCount = stream.readInt32();\n this.attrMapCount = stream.readInt32();\n this.flags = stream.readInt32();\n this.comment = stream.readString();\n};\n\nCTM.FileHeader.prototype.hasNormals = function(){\n return this.flags & CTM.Flags.NORMALS;\n};\n\nCTM.FileBody = function(header){\n var i = header.triangleCount * 3,\n v = header.vertexCount * 3,\n n = header.hasNormals()? header.vertexCount * 3: 0,\n u = header.vertexCount * 2,\n a = header.vertexCount * 4,\n j = 0;\n\n var data = new ArrayBuffer(\n (i + v + n + (u * header.uvMapCount) + (a * header.attrMapCount) ) * 4);\n\n this.indices = new Uint32Array(data, 0, i);\n\n this.vertices = new Float32Array(data, i * 4, v);\n\n if ( header.hasNormals() ){\n this.normals = new Float32Array(data, (i + v) * 4, n);\n }\n \n if (header.uvMapCount){\n this.uvMaps = [];\n for (j = 0; j < header.uvMapCount; ++ j){\n this.uvMaps[j] = {uv: new Float32Array(data,\n (i + v + n + (j * u) ) * 4, u) };\n }\n }\n \n if (header.attrMapCount){\n this.attrMaps = [];\n for (j = 0; j < header.attrMapCount; ++ j){\n this.attrMaps[j] = {attr: new Float32Array(data,\n (i + v + n + (u * header.uvMapCount) + (j * a) ) * 4, a) };\n }\n }\n};\n\nCTM.FileMG2Header = function(stream){\n stream.readInt32(); //magic \"MG2H\"\n this.vertexPrecision = stream.readFloat32();\n this.normalPrecision = stream.readFloat32();\n this.lowerBoundx = stream.readFloat32();\n this.lowerBoundy = stream.readFloat32();\n this.lowerBoundz = stream.readFloat32();\n this.higherBoundx = stream.readFloat32();\n this.higherBoundy = stream.readFloat32();\n this.higherBoundz = stream.readFloat32();\n this.divx = stream.readInt32();\n this.divy = stream.readInt32();\n this.divz = stream.readInt32();\n \n this.sizex = (this.higherBoundx - this.lowerBoundx) / this.divx;\n this.sizey = (this.higherBoundy - this.lowerBoundy) / this.divy;\n this.sizez = (this.higherBoundz - this.lowerBoundz) / this.divz;\n};\n\nCTM.ReaderRAW = function(){\n};\n\nCTM.ReaderRAW.prototype.read = function(stream, body){\n this.readIndices(stream, body.indices);\n this.readVertices(stream, body.vertices);\n \n if (body.normals){\n this.readNormals(stream, body.normals);\n }\n if (body.uvMaps){\n this.readUVMaps(stream, body.uvMaps);\n }\n if (body.attrMaps){\n this.readAttrMaps(stream, body.attrMaps);\n }\n};\n\nCTM.ReaderRAW.prototype.readIndices = function(stream, indices){\n stream.readInt32(); //magic \"INDX\"\n stream.readArrayInt32(indices);\n};\n\nCTM.ReaderRAW.prototype.readVertices = function(stream, vertices){\n stream.readInt32(); //magic \"VERT\"\n stream.readArrayFloat32(vertices);\n};\n\nCTM.ReaderRAW.prototype.readNormals = function(stream, normals){\n stream.readInt32(); //magic \"NORM\"\n stream.readArrayFloat32(normals);\n};\n\nCTM.ReaderRAW.prototype.readUVMaps = function(stream, uvMaps){\n var i = 0;\n for (; i < uvMaps.length; ++ i){\n stream.readInt32(); //magic \"TEXC\"\n\n uvMaps[i].name = stream.readString();\n uvMaps[i].filename = stream.readString();\n stream.readArrayFloat32(uvMaps[i].uv);\n }\n};\n\nCTM.ReaderRAW.prototype.readAttrMaps = function(stream, attrMaps){\n var i = 0;\n for (; i < attrMaps.length; ++ i){\n stream.readInt32(); //magic \"ATTR\"\n\n attrMaps[i].name = stream.readString();\n stream.readArrayFloat32(attrMaps[i].attr);\n }\n};\n\nCTM.ReaderMG1 = function(){\n};\n\nCTM.ReaderMG1.prototype.read = function(stream, body){\n this.readIndices(stream, body.indices);\n this.readVertices(stream, body.vertices);\n \n if (body.normals){\n this.readNormals(stream, body.normals);\n }\n if (body.uvMaps){\n this.readUVMaps(stream, body.uvMaps);\n }\n if (body.attrMaps){\n this.readAttrMaps(stream, body.attrMaps);\n }\n};\n\nCTM.ReaderMG1.prototype.readIndices = function(stream, indices){\n stream.readInt32(); //magic \"INDX\"\n stream.readInt32(); //packed size\n \n var interleaved = new CTM.InterleavedStream(indices, 3);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n CTM.restoreIndices(indices, indices.length);\n};\n\nCTM.ReaderMG1.prototype.readVertices = function(stream, vertices){\n stream.readInt32(); //magic \"VERT\"\n stream.readInt32(); //packed size\n \n var interleaved = new CTM.InterleavedStream(vertices, 1);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n};\n\nCTM.ReaderMG1.prototype.readNormals = function(stream, normals){\n stream.readInt32(); //magic \"NORM\"\n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(normals, 3);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n};\n\nCTM.ReaderMG1.prototype.readUVMaps = function(stream, uvMaps){\n var i = 0;\n for (; i < uvMaps.length; ++ i){\n stream.readInt32(); //magic \"TEXC\"\n\n uvMaps[i].name = stream.readString();\n uvMaps[i].filename = stream.readString();\n \n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n }\n};\n\nCTM.ReaderMG1.prototype.readAttrMaps = function(stream, attrMaps){\n var i = 0;\n for (; i < attrMaps.length; ++ i){\n stream.readInt32(); //magic \"ATTR\"\n\n attrMaps[i].name = stream.readString();\n \n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n }\n};\n\nCTM.ReaderMG2 = function(){\n};\n\nCTM.ReaderMG2.prototype.read = function(stream, body){\n this.MG2Header = new CTM.FileMG2Header(stream);\n \n this.readVertices(stream, body.vertices);\n this.readIndices(stream, body.indices);\n \n if (body.normals){\n this.readNormals(stream, body);\n }\n if (body.uvMaps){\n this.readUVMaps(stream, body.uvMaps);\n }\n if (body.attrMaps){\n this.readAttrMaps(stream, body.attrMaps);\n }\n};\n\nCTM.ReaderMG2.prototype.readVertices = function(stream, vertices){\n stream.readInt32(); //magic \"VERT\"\n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(vertices, 3);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n \n var gridIndices = this.readGridIndices(stream, vertices);\n \n CTM.restoreVertices(vertices, this.MG2Header, gridIndices, this.MG2Header.vertexPrecision);\n};\n\nCTM.ReaderMG2.prototype.readGridIndices = function(stream, vertices){\n stream.readInt32(); //magic \"GIDX\"\n stream.readInt32(); //packed size\n \n var gridIndices = new Uint32Array(vertices.length / 3);\n \n var interleaved = new CTM.InterleavedStream(gridIndices, 1);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n \n CTM.restoreGridIndices(gridIndices, gridIndices.length);\n \n return gridIndices;\n};\n\nCTM.ReaderMG2.prototype.readIndices = function(stream, indices){\n stream.readInt32(); //magic \"INDX\"\n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(indices, 3);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n CTM.restoreIndices(indices, indices.length);\n};\n\nCTM.ReaderMG2.prototype.readNormals = function(stream, body){\n stream.readInt32(); //magic \"NORM\"\n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(body.normals, 3);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n\n var smooth = CTM.calcSmoothNormals(body.indices, body.vertices);\n\n CTM.restoreNormals(body.normals, smooth, this.MG2Header.normalPrecision);\n};\n\nCTM.ReaderMG2.prototype.readUVMaps = function(stream, uvMaps){\n var i = 0;\n for (; i < uvMaps.length; ++ i){\n stream.readInt32(); //magic \"TEXC\"\n\n uvMaps[i].name = stream.readString();\n uvMaps[i].filename = stream.readString();\n \n var precision = stream.readFloat32();\n \n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(uvMaps[i].uv, 2);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n \n CTM.restoreMap(uvMaps[i].uv, 2, precision);\n }\n};\n\nCTM.ReaderMG2.prototype.readAttrMaps = function(stream, attrMaps){\n var i = 0;\n for (; i < attrMaps.length; ++ i){\n stream.readInt32(); //magic \"ATTR\"\n\n attrMaps[i].name = stream.readString();\n \n var precision = stream.readFloat32();\n \n stream.readInt32(); //packed size\n\n var interleaved = new CTM.InterleavedStream(attrMaps[i].attr, 4);\n LZMA.decompress(stream, stream, interleaved, interleaved.data.length);\n \n CTM.restoreMap(attrMaps[i].attr, 4, precision);\n }\n};\n\nCTM.restoreIndices = function(indices, len){\n var i = 3;\n if (len > 0){\n indices[2] += indices[0];\n indices[1] += indices[0];\n }\n for (; i < len; i += 3){\n indices[i] += indices[i - 3];\n \n if (indices[i] === indices[i - 3]){\n indices[i + 1] += indices[i - 2];\n }else{\n indices[i + 1] += indices[i];\n }\n\n indices[i + 2] += indices[i];\n }\n};\n\nCTM.restoreGridIndices = function(gridIndices, len){\n var i = 1;\n for (; i < len; ++ i){\n gridIndices[i] += gridIndices[i - 1];\n }\n};\n\nCTM.restoreVertices = function(vertices, grid, gridIndices, precision){\n var gridIdx, delta, x, y, z,\n intVertices = new Uint32Array(vertices.buffer, vertices.byteOffset, vertices.length),\n ydiv = grid.divx, zdiv = ydiv * grid.divy,\n prevGridIdx = 0x7fffffff, prevDelta = 0,\n i = 0, j = 0, len = gridIndices.length;\n\n for (; i < len; j += 3){\n x = gridIdx = gridIndices[i ++];\n \n z = ~~(x / zdiv);\n x -= ~~(z * zdiv);\n y = ~~(x / ydiv);\n x -= ~~(y * ydiv);\n\n delta = intVertices[j];\n if (gridIdx === prevGridIdx){\n delta += prevDelta;\n }\n\n vertices[j] = grid.lowerBoundx +\n x * grid.sizex + precision * delta;\n vertices[j + 1] = grid.lowerBoundy +\n y * grid.sizey + precision * intVertices[j + 1];\n vertices[j + 2] = grid.lowerBoundz +\n z * grid.sizez + precision * intVertices[j + 2];\n\n prevGridIdx = gridIdx;\n prevDelta = delta;\n }\n};\n\nCTM.restoreNormals = function(normals, smooth, precision){\n var ro, phi, theta, sinPhi,\n nx, ny, nz, by, bz, len,\n intNormals = new Uint32Array(normals.buffer, normals.byteOffset, normals.length),\n i = 0, k = normals.length,\n PI_DIV_2 = 3.141592653589793238462643 * 0.5;\n\n for (; i < k; i += 3){\n ro = intNormals[i] * precision;\n phi = intNormals[i + 1];\n\n if (phi === 0){\n normals[i] = smooth[i] * ro;\n normals[i + 1] = smooth[i + 1] * ro;\n normals[i + 2] = smooth[i + 2] * ro;\n }else{\n \n if (phi <= 4){\n theta = (intNormals[i + 2] - 2) * PI_DIV_2;\n }else{\n theta = ( (intNormals[i + 2] * 4 / phi) - 2) * PI_DIV_2;\n }\n \n phi *= precision * PI_DIV_2;\n sinPhi = ro * Math.sin(phi);\n\n nx = sinPhi * Math.cos(theta);\n ny = sinPhi * Math.sin(theta);\n nz = ro * Math.cos(phi);\n\n bz = smooth[i + 1];\n by = smooth[i] - smooth[i + 2];\n\n len = Math.sqrt(2 * bz * bz + by * by);\n if (len > 1e-20){\n by /= len;\n bz /= len;\n }\n\n normals[i] = smooth[i] * nz +\n (smooth[i + 1] * bz - smooth[i + 2] * by) * ny - bz * nx;\n normals[i + 1] = smooth[i + 1] * nz -\n (smooth[i + 2] + smooth[i] ) * bz * ny + by * nx;\n normals[i + 2] = smooth[i + 2] * nz +\n (smooth[i] * by + smooth[i + 1] * bz) * ny + bz * nx;\n }\n }\n};\n\nCTM.restoreMap = function(map, count, precision){\n var delta, value,\n intMap = new Uint32Array(map.buffer, map.byteOffset, map.length),\n i = 0, j, len = map.length;\n\n for (; i < count; ++ i){\n delta = 0;\n\n for (j = i; j < len; j += count){\n value = intMap[j];\n \n delta += value & 1? -( (value + 1) >> 1): value >> 1;\n \n map[j] = delta * precision;\n }\n }\n};\n\nCTM.calcSmoothNormals = function(indices, vertices){\n var smooth = new Float32Array(vertices.length),\n indx, indy, indz, nx, ny, nz,\n v1x, v1y, v1z, v2x, v2y, v2z, len,\n i, k;\n\n for (i = 0, k = indices.length; i < k;){\n indx = indices[i ++] * 3;\n indy = indices[i ++] * 3;\n indz = indices[i ++] * 3;\n\n v1x = vertices[indy] - vertices[indx];\n v2x = vertices[indz] - vertices[indx];\n v1y = vertices[indy + 1] - vertices[indx + 1];\n v2y = vertices[indz + 1] - vertices[indx + 1];\n v1z = vertices[indy + 2] - vertices[indx + 2];\n v2z = vertices[indz + 2] - vertices[indx + 2];\n \n nx = v1y * v2z - v1z * v2y;\n ny = v1z * v2x - v1x * v2z;\n nz = v1x * v2y - v1y * v2x;\n \n len = Math.sqrt(nx * nx + ny * ny + nz * nz);\n if (len > 1e-10){\n nx /= len;\n ny /= len;\n nz /= len;\n }\n \n smooth[indx] += nx;\n smooth[indx + 1] += ny;\n smooth[indx + 2] += nz;\n smooth[indy] += nx;\n smooth[indy + 1] += ny;\n smooth[indy + 2] += nz;\n smooth[indz] += nx;\n smooth[indz + 1] += ny;\n smooth[indz + 2] += nz;\n }\n\n for (i = 0, k = smooth.length; i < k; i += 3){\n len = Math.sqrt(smooth[i] * smooth[i] + \n smooth[i + 1] * smooth[i + 1] +\n smooth[i + 2] * smooth[i + 2]);\n\n if(len > 1e-10){\n smooth[i] /= len;\n smooth[i + 1] /= len;\n smooth[i + 2] /= len;\n }\n }\n\n return smooth;\n};\n\nCTM.isLittleEndian = (function(){\n var buffer = new ArrayBuffer(2),\n bytes = new Uint8Array(buffer),\n ints = new Uint16Array(buffer);\n\n bytes[0] = 1;\n\n return ints[0] === 1;\n}());\n\nCTM.InterleavedStream = function(data, count){\n this.data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n this.offset = CTM.isLittleEndian? 3: 0;\n this.count = count * 4;\n this.len = this.data.length;\n};\n\nCTM.InterleavedStream.prototype.writeByte = function(value){\n this.data[this.offset] = value;\n \n this.offset += this.count;\n if (this.offset >= this.len){\n \n this.offset -= this.len - 4;\n if (this.offset >= this.count){\n \n this.offset -= this.count + (CTM.isLittleEndian? 1: -1);\n }\n }\n};\n\nCTM.Stream = function(data){\n this.data = data;\n this.offset = 0;\n};\n\nCTM.Stream.prototype.TWO_POW_MINUS23 = Math.pow(2, -23);\n\nCTM.Stream.prototype.TWO_POW_MINUS126 = Math.pow(2, -126);\n\nCTM.Stream.prototype.readByte = function(){\n return this.data[this.offset ++] & 0xff;\n};\n\nCTM.Stream.prototype.readInt32 = function(){\n var i = this.readByte();\n i |= this.readByte() << 8;\n i |= this.readByte() << 16;\n return i | (this.readByte() << 24);\n};\n\nCTM.Stream.prototype.readFloat32 = function(){\n var m = this.readByte();\n m += this.readByte() << 8;\n\n var b1 = this.readByte();\n var b2 = this.readByte();\n\n m += (b1 & 0x7f) << 16; \n var e = ( (b2 & 0x7f) << 1) | ( (b1 & 0x80) >>> 7);\n var s = b2 & 0x80? -1: 1;\n\n if (e === 255){\n return m !== 0? NaN: s * Infinity;\n }\n if (e > 0){\n return s * (1 + (m * this.TWO_POW_MINUS23) ) * Math.pow(2, e - 127);\n }\n if (m !== 0){\n return s * m * this.TWO_POW_MINUS126;\n }\n return s * 0;\n};\n\nCTM.Stream.prototype.readString = function(){\n var len = this.readInt32();\n\n this.offset += len;\n\n return String.fromCharCode.apply(null,this.data.subarray(this.offset - len, this.offset));\n};\n\nCTM.Stream.prototype.readArrayInt32 = function(array){\n var i = 0, len = array.length;\n \n while(i < len){\n array[i ++] = this.readInt32();\n }\n\n return array;\n};\n\nCTM.Stream.prototype.readArrayFloat32 = function(array){\n var i = 0, len = array.length;\n\n while(i < len){\n array[i ++] = this.readFloat32();\n }\n\n return array;\n};\n\nexports.CTM = CTM;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/lzma.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/lzma.js",
"module-type": "library",
"text": "(function(){\n\nvar LZMA = LZMA || {};\n\nLZMA.OutWindow = function(){\n this._windowSize = 0;\n};\n\nLZMA.OutWindow.prototype.create = function(windowSize){\n if ( (!this._buffer) || (this._windowSize !== windowSize) ){\n this._buffer = [];\n }\n this._windowSize = windowSize;\n this._pos = 0;\n this._streamPos = 0;\n};\n\nLZMA.OutWindow.prototype.flush = function(){\n var size = this._pos - this._streamPos;\n if (size !== 0){\n while(size --){\n this._stream.writeByte(this._buffer[this._streamPos ++]);\n }\n if (this._pos >= this._windowSize){\n this._pos = 0;\n }\n this._streamPos = this._pos;\n }\n};\n\nLZMA.OutWindow.prototype.releaseStream = function(){\n this.flush();\n this._stream = null;\n};\n\nLZMA.OutWindow.prototype.setStream = function(stream){\n this.releaseStream();\n this._stream = stream;\n};\n\nLZMA.OutWindow.prototype.init = function(solid){\n if (!solid){\n this._streamPos = 0;\n this._pos = 0;\n }\n};\n\nLZMA.OutWindow.prototype.copyBlock = function(distance, len){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n while(len --){\n if (pos >= this._windowSize){\n pos = 0;\n }\n this._buffer[this._pos ++] = this._buffer[pos ++];\n if (this._pos >= this._windowSize){\n this.flush();\n }\n }\n};\n\nLZMA.OutWindow.prototype.putByte = function(b){\n this._buffer[this._pos ++] = b;\n if (this._pos >= this._windowSize){\n this.flush();\n }\n};\n\nLZMA.OutWindow.prototype.getByte = function(distance){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n return this._buffer[pos];\n};\n\nLZMA.RangeDecoder = function(){\n};\n\nLZMA.RangeDecoder.prototype.setStream = function(stream){\n this._stream = stream;\n};\n\nLZMA.RangeDecoder.prototype.releaseStream = function(){\n this._stream = null;\n};\n\nLZMA.RangeDecoder.prototype.init = function(){\n var i = 5;\n\n this._code = 0;\n this._range = -1;\n \n while(i --){\n this._code = (this._code << 8) | this._stream.readByte();\n }\n};\n\nLZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits){\n var result = 0, i = numTotalBits, t;\n\n while(i --){\n this._range >>>= 1;\n t = (this._code - this._range) >>> 31;\n this._code -= this._range & (t - 1);\n result = (result << 1) | (1 - t);\n\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n }\n\n return result;\n};\n\nLZMA.RangeDecoder.prototype.decodeBit = function(probs, index){\n var prob = probs[index],\n newBound = (this._range >>> 11) * prob;\n\n if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ){\n this._range = newBound;\n probs[index] += (2048 - prob) >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 0;\n }\n\n this._range -= newBound;\n this._code -= newBound;\n probs[index] -= prob >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 1;\n};\n\nLZMA.initBitModels = function(probs, len){\n while(len --){\n probs[len] = 1024;\n }\n};\n\nLZMA.BitTreeDecoder = function(numBitLevels){\n this._models = [];\n this._numBitLevels = numBitLevels;\n};\n\nLZMA.BitTreeDecoder.prototype.init = function(){\n LZMA.initBitModels(this._models, 1 << this._numBitLevels);\n};\n\nLZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder){\n var m = 1, i = this._numBitLevels;\n\n while(i --){\n m = (m << 1) | rangeDecoder.decodeBit(this._models, m);\n }\n return m - (1 << this._numBitLevels);\n};\n\nLZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < this._numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(this._models, m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n};\n\nLZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(models, startIndex + m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n};\n\nLZMA.LenDecoder = function(){\n this._choice = [];\n this._lowCoder = [];\n this._midCoder = [];\n this._highCoder = new LZMA.BitTreeDecoder(8);\n this._numPosStates = 0;\n};\n\nLZMA.LenDecoder.prototype.create = function(numPosStates){\n for (; this._numPosStates < numPosStates; ++ this._numPosStates){\n this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n }\n};\n\nLZMA.LenDecoder.prototype.init = function(){\n var i = this._numPosStates;\n LZMA.initBitModels(this._choice, 2);\n while(i --){\n this._lowCoder[i].init();\n this._midCoder[i].init();\n }\n this._highCoder.init();\n};\n\nLZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState){\n if (rangeDecoder.decodeBit(this._choice, 0) === 0){\n return this._lowCoder[posState].decode(rangeDecoder);\n }\n if (rangeDecoder.decodeBit(this._choice, 1) === 0){\n return 8 + this._midCoder[posState].decode(rangeDecoder);\n }\n return 16 + this._highCoder.decode(rangeDecoder);\n};\n\nLZMA.Decoder2 = function(){\n this._decoders = [];\n};\n\nLZMA.Decoder2.prototype.init = function(){\n LZMA.initBitModels(this._decoders, 0x300);\n};\n\nLZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder){\n var symbol = 1;\n\n do{\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n};\n\nLZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte){\n var symbol = 1, matchBit, bit;\n\n do{\n matchBit = (matchByte >> 7) & 1;\n matchByte <<= 1;\n bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);\n symbol = (symbol << 1) | bit;\n if (matchBit !== bit){\n while(symbol < 0x100){\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }\n break;\n }\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n};\n\nLZMA.LiteralDecoder = function(){\n};\n\nLZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits){\n var i;\n\n if (this._coders\n && (this._numPrevBits === numPrevBits)\n && (this._numPosBits === numPosBits) ){\n return;\n }\n this._numPosBits = numPosBits;\n this._posMask = (1 << numPosBits) - 1;\n this._numPrevBits = numPrevBits;\n\n this._coders = [];\n\n i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i] = new LZMA.Decoder2();\n }\n};\n\nLZMA.LiteralDecoder.prototype.init = function(){\n var i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i].init();\n }\n};\n\nLZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte){\n return this._coders[( (pos & this._posMask) << this._numPrevBits)\n + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];\n};\n\nLZMA.Decoder = function(){\n this._outWindow = new LZMA.OutWindow();\n this._rangeDecoder = new LZMA.RangeDecoder();\n this._isMatchDecoders = [];\n this._isRepDecoders = [];\n this._isRepG0Decoders = [];\n this._isRepG1Decoders = [];\n this._isRepG2Decoders = [];\n this._isRep0LongDecoders = [];\n this._posSlotDecoder = [];\n this._posDecoders = [];\n this._posAlignDecoder = new LZMA.BitTreeDecoder(4);\n this._lenDecoder = new LZMA.LenDecoder();\n this._repLenDecoder = new LZMA.LenDecoder();\n this._literalDecoder = new LZMA.LiteralDecoder();\n this._dictionarySize = -1;\n this._dictionarySizeCheck = -1;\n\n this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);\n};\n\nLZMA.Decoder.prototype.setDictionarySize = function(dictionarySize){\n if (dictionarySize < 0){\n return false;\n }\n if (this._dictionarySize !== dictionarySize){\n this._dictionarySize = dictionarySize;\n this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);\n this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );\n }\n return true;\n};\n\nLZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb){\n var numPosStates = 1 << pb;\n\n if (lc > 8 || lp > 4 || pb > 4){\n return false;\n }\n\n this._literalDecoder.create(lp, lc);\n\n this._lenDecoder.create(numPosStates);\n this._repLenDecoder.create(numPosStates);\n this._posStateMask = numPosStates - 1;\n\n return true;\n};\n\nLZMA.Decoder.prototype.init = function(){\n var i = 4;\n\n this._outWindow.init(false);\n\n LZMA.initBitModels(this._isMatchDecoders, 192);\n LZMA.initBitModels(this._isRep0LongDecoders, 192);\n LZMA.initBitModels(this._isRepDecoders, 12);\n LZMA.initBitModels(this._isRepG0Decoders, 12);\n LZMA.initBitModels(this._isRepG1Decoders, 12);\n LZMA.initBitModels(this._isRepG2Decoders, 12);\n LZMA.initBitModels(this._posDecoders, 114);\n\n this._literalDecoder.init();\n\n while(i --){\n this._posSlotDecoder[i].init();\n }\n\n this._lenDecoder.init();\n this._repLenDecoder.init();\n this._posAlignDecoder.init();\n this._rangeDecoder.init();\n};\n\nLZMA.Decoder.prototype.decode = function(inStream, outStream, outSize){\n var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,\n posState, decoder2, len, distance, posSlot, numDirectBits;\n\n this._rangeDecoder.setStream(inStream);\n this._outWindow.setStream(outStream);\n\n this.init();\n\n while(outSize < 0 || nowPos64 < outSize){\n posState = nowPos64 & this._posStateMask;\n\n if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0){\n decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);\n\n if (state >= 7){\n prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );\n }else{\n prevByte = decoder2.decodeNormal(this._rangeDecoder);\n }\n this._outWindow.putByte(prevByte);\n\n state = state < 4? 0: state - (state < 10? 3: 6);\n\n }else{\n\n if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1){\n len = 0;\n if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0){\n if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0){\n state = state < 7? 9: 11;\n len = 1;\n }\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0){\n distance = rep1;\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0){\n distance = rep2;\n }else{\n distance = rep3;\n rep3 = rep2;\n }\n rep2 = rep1;\n }\n rep1 = rep0;\n rep0 = distance;\n }\n if (len === 0){\n len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 8: 11;\n }\n }else{\n rep3 = rep2;\n rep2 = rep1;\n rep1 = rep0;\n\n len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 7: 10;\n\n posSlot = this._posSlotDecoder[len <= 5? len - 2: 3].decode(this._rangeDecoder);\n if (posSlot >= 4){\n\n numDirectBits = (posSlot >> 1) - 1;\n rep0 = (2 | (posSlot & 1) ) << numDirectBits;\n\n if (posSlot < 14){\n rep0 += LZMA.reverseDecode2(this._posDecoders,\n rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);\n }else{\n rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;\n rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);\n if (rep0 < 0){\n if (rep0 === -1){\n break;\n }\n return false;\n }\n }\n }else{\n rep0 = posSlot;\n }\n }\n\n if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck){\n return false;\n }\n\n this._outWindow.copyBlock(rep0, len);\n nowPos64 += len;\n prevByte = this._outWindow.getByte(0);\n }\n }\n\n this._outWindow.flush();\n this._outWindow.releaseStream();\n this._rangeDecoder.releaseStream();\n\n return true;\n};\n\nLZMA.Decoder.prototype.setDecoderProperties = function(properties){\n var value, lc, lp, pb, dictionarySize;\n\n if (properties.size < 5){\n return false;\n }\n\n value = properties.readByte();\n lc = value % 9;\n value = ~~(value / 9);\n lp = value % 5;\n pb = ~~(value / 5);\n\n if ( !this.setLcLpPb(lc, lp, pb) ){\n return false;\n }\n\n dictionarySize = properties.readByte();\n dictionarySize |= properties.readByte() << 8;\n dictionarySize |= properties.readByte() << 16;\n dictionarySize += properties.readByte() * 16777216;\n\n return this.setDictionarySize(dictionarySize);\n};\n\nLZMA.decompress = function(properties, inStream, outStream, outSize){\n var decoder = new LZMA.Decoder();\n\n if ( !decoder.setDecoderProperties(properties) ){\n throw \"Incorrect stream properties\";\n }\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw \"Error in data stream\";\n }\n\n return true;\n};\n\nexports.LZMA = LZMA;})();\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-lzma.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-lzma.txt",
"text": "Copyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-openctm.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/js-openctm.txt",
"text": "Copyright (c) 2011 Juan Mellado\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
},
"$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/OpenCTM.txt": {
"type": "text/plain",
"title": "$:/plugins/rboue/Three.js/Lib/Loaders/Ctm/License/OpenCTM.txt",
"text": "Copyright (c) 2009-2010 Marcus Geelnard\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must not\n claim that you wrote the original software. If you use this software\n in a product, an acknowledgment in the product documentation would be\n appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must not\n be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source\n distribution.\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/RaytracingRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/RaytracingRenderer.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RaytracingRenderer = function ( parameters ) {\n\n\tconsole.log( 'THREE.RaytracingRenderer', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n // *TiddlyWiki*\n var _self = this;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tvar context = canvas.getContext( '2d', {\n\t\talpha: parameters.alpha === true\n\t} );\n\n\tvar maxRecursionDepth = 3;\n\n\tvar canvasWidth, canvasHeight;\n\tvar canvasWidthHalf, canvasHeightHalf;\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\n\tvar origin = new THREE.Vector3();\n\tvar direction = new THREE.Vector3();\n\n\tvar cameraPosition = new THREE.Vector3();\n\n\tvar raycaster = new THREE.Raycaster( origin, direction );\n\tvar raycasterLight = new THREE.Raycaster();\n\n\tvar perspective;\n\tvar modelViewMatrix = new THREE.Matrix4();\n\tvar cameraNormalMatrix = new THREE.Matrix3();\n\n\tvar objects;\n\tvar lights = [];\n\tvar cache = {};\n\n\tvar animationFrameId = null;\n\n\tthis.domElement = canvas;\n\n\tthis.autoClear = true;\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tcanvas.width = width;\n\t\tcanvas.height = height;\n\n\t\tcanvasWidth = canvas.width;\n\t\tcanvasHeight = canvas.height;\n\n\t\tcanvasWidthHalf = Math.floor( canvasWidth / 2 );\n\t\tcanvasHeightHalf = Math.floor( canvasHeight / 2 );\n\n\t\tcontext.fillStyle = 'white';\n\n\t};\n\n\tthis.setSize( canvas.width, canvas.height );\n\n\tthis.clear = function () {\n\n\t};\n\n\t//\n\n\tvar spawnRay = ( function () {\n\n\t\tvar diffuseColor = new THREE.Color();\n\t\tvar specularColor = new THREE.Color();\n\t\tvar lightColor = new THREE.Color();\n\t\tvar schlick = new THREE.Color();\n\n\t\tvar lightContribution = new THREE.Color();\n\n\t\tvar eyeVector = new THREE.Vector3();\n\t\tvar lightVector = new THREE.Vector3();\n\t\tvar normalVector = new THREE.Vector3();\n\t\tvar halfVector = new THREE.Vector3();\n\n\t\tvar localPoint = new THREE.Vector3();\n\t\tvar reflectionVector = new THREE.Vector3();\n\n\t\tvar tmpVec = new THREE.Vector3();\n\n\t\tvar tmpColor = [];\n\n\t\tfor ( var i = 0; i < maxRecursionDepth; i ++ ) {\n\n\t\t\ttmpColor[ i ] = new THREE.Color();\n\n\t\t}\n\n\t\treturn function ( rayOrigin, rayDirection, outputColor, recursionDepth ) {\n\n\t\t\tvar ray = raycaster.ray;\n\n\t\t\tray.origin = rayOrigin;\n\t\t\tray.direction = rayDirection;\n\n\t\t\t//\n\n\t\t\tvar rayLight = raycasterLight.ray;\n\n\t\t\t//\n\n\t\t\toutputColor.setRGB( 0, 0, 0 );\n\n\t\t\t//\n\n\t\t\tvar intersections = raycaster.intersectObjects( objects, true );\n\n\t\t\t// ray didn't find anything\n\t\t\t// (here should come setting of background color?)\n\n\t\t\tif ( intersections.length === 0 ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// ray hit\n\n\t\t\tvar intersection = intersections[ 0 ];\n\n\t\t\tvar point = intersection.point;\n\t\t\tvar object = intersection.object;\n\t\t\tvar material = object.material;\n\t\t\tvar face = intersection.face;\n\n\t\t\tvar vertices = object.geometry.vertices;\n\n\t\t\t//\n\n\t\t\tvar _object = cache[ object.id ];\n\n\t\t\tlocalPoint.copy( point ).applyMatrix4( _object.inverseMatrix );\n\t\t\teyeVector.subVectors( raycaster.ray.origin, point ).normalize();\n\n\t\t\t// resolve pixel diffuse color\n\n\t\t\tif ( material instanceof THREE.MeshLambertMaterial ||\n\t\t\t\t material instanceof THREE.MeshPhongMaterial ||\n\t\t\t\t material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tdiffuseColor.copyGammaToLinear( material.color );\n\n\t\t\t} else {\n\n\t\t\t\tdiffuseColor.setRGB( 1, 1, 1 );\n\n\t\t\t}\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\tdiffuseColor.multiply( face.color );\n\n\t\t\t}\n\n\t\t\t// compute light shading\n\n\t\t\trayLight.origin.copy( point );\n\n\t\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tfor ( var i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar light = lights[ i ];\n\n\t\t\t\t\tlightVector.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tlightVector.sub( point );\n\n\t\t\t\t\trayLight.direction.copy( lightVector ).normalize();\n\n\t\t\t\t\tvar intersections = raycasterLight.intersectObjects( objects, true );\n\n\t\t\t\t\t// point in shadow\n\n\t\t\t\t\tif ( intersections.length > 0 ) continue;\n\n\t\t\t\t\t// point visible\n\n\t\t\t\t\toutputColor.add( diffuseColor );\n\n\t\t\t\t}\n\n\t\t\t} else if ( material instanceof THREE.MeshLambertMaterial ||\n\t\t\t\t\t\tmaterial instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\tvar normalComputed = false;\n\n\t\t\t\tfor ( var i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar light = lights[ i ];\n\n\t\t\t\t\tlightColor.copyGammaToLinear( light.color );\n\n\t\t\t\t\tlightVector.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\t\tlightVector.sub( point );\n\n\t\t\t\t\trayLight.direction.copy( lightVector ).normalize();\n\n\t\t\t\t\tvar intersections = raycasterLight.intersectObjects( objects, true );\n\n\t\t\t\t\t// point in shadow\n\n\t\t\t\t\tif ( intersections.length > 0 ) continue;\n\n\t\t\t\t\t// point lit\n\n\t\t\t\t\tif ( normalComputed === false ) {\n\n\t\t\t\t\t\t// the same normal can be reused for all lights\n\t\t\t\t\t\t// (should be possible to cache even more)\n\n\t\t\t\t\t\tcomputePixelNormal( normalVector, localPoint, material.shading, face, vertices );\n\t\t\t\t\t\tnormalVector.applyMatrix3( _object.normalMatrix ).normalize();\n\n\t\t\t\t\t\tnormalComputed = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute attenuation\n\n\t\t\t\t\tvar attenuation = 1.0;\n\n\t\t\t\t\tif ( light.physicalAttenuation === true ) {\n\n\t\t\t\t\t\tattenuation = lightVector.length();\n\t\t\t\t\t\tattenuation = 1.0 / ( attenuation * attenuation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlightVector.normalize();\n\n\t\t\t\t\t// compute diffuse\n\n\t\t\t\t\tvar dot = Math.max( normalVector.dot( lightVector ), 0 );\n\t\t\t\t\tvar diffuseIntensity = dot * light.intensity;\n\n\t\t\t\t\tlightContribution.copy( diffuseColor );\n\t\t\t\t\tlightContribution.multiply( lightColor );\n\t\t\t\t\tlightContribution.multiplyScalar( diffuseIntensity * attenuation );\n\n\t\t\t\t\toutputColor.add( lightContribution );\n\n\t\t\t\t\t// compute specular\n\n\t\t\t\t\tif ( material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\t\t\thalfVector.addVectors( lightVector, eyeVector ).normalize();\n\n\t\t\t\t\t\tvar dotNormalHalf = Math.max( normalVector.dot( halfVector ), 0.0 );\n\t\t\t\t\t\tvar specularIntensity = Math.max( Math.pow( dotNormalHalf, material.shininess ), 0.0 ) * diffuseIntensity;\n\n\t\t\t\t\t\tvar specularNormalization = ( material.shininess + 2.0 ) / 8.0;\n\n\t\t\t\t\t\tspecularColor.copyGammaToLinear( material.specular );\n\n\t\t\t\t\t\tvar alpha = Math.pow( Math.max( 1.0 - lightVector.dot( halfVector ), 0.0 ), 5.0 );\n\n\t\t\t\t\t\tschlick.r = specularColor.r + ( 1.0 - specularColor.r ) * alpha;\n\t\t\t\t\t\tschlick.g = specularColor.g + ( 1.0 - specularColor.g ) * alpha;\n\t\t\t\t\t\tschlick.b = specularColor.b + ( 1.0 - specularColor.b ) * alpha;\n\n\t\t\t\t\t\tlightContribution.copy( schlick );\n\n\t\t\t\t\t\tlightContribution.multiply( lightColor );\n\t\t\t\t\t\tlightContribution.multiplyScalar( specularNormalization * specularIntensity * attenuation );\n\t\t\t\t\t\toutputColor.add( lightContribution );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// reflection / refraction\n\n\t\t\tvar reflectivity = material.reflectivity;\n\n\t\t\tif ( ( material.mirror || material.glass ) && reflectivity > 0 && recursionDepth < maxRecursionDepth ) {\n\n\t\t\t\tif ( material.mirror ) {\n\n\t\t\t\t\treflectionVector.copy( rayDirection );\n\t\t\t\t\treflectionVector.reflect( normalVector );\n\n\t\t\t\t} else if ( material.glass ) {\n\n\t\t\t\t\tvar eta = material.refractionRatio;\n\n\t\t\t\t\tvar dotNI = rayDirection.dot( normalVector )\n\t\t\t\t\tvar k = 1.0 - eta * eta * ( 1.0 - dotNI * dotNI );\n\n\t\t\t\t\tif ( k < 0.0 ) {\n\n\t\t\t\t\t\treflectionVector.set( 0, 0, 0 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\treflectionVector.copy( rayDirection );\n\t\t\t\t\t\treflectionVector.multiplyScalar( eta );\n\n\t\t\t\t\t\tvar alpha = eta * dotNI + Math.sqrt( k );\n\t\t\t\t\t\ttmpVec.copy( normalVector );\n\t\t\t\t\t\ttmpVec.multiplyScalar( alpha );\n\t\t\t\t\t\treflectionVector.sub( tmpVec );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar theta = Math.max( eyeVector.dot( normalVector ), 0.0 );\n\t\t\t\tvar rf0 = reflectivity;\n\t\t\t\tvar fresnel = rf0 + ( 1.0 - rf0 ) * Math.pow( ( 1.0 - theta ), 5.0 );\n\n\t\t\t\tvar weight = fresnel;\n\n\t\t\t\tvar zColor = tmpColor[ recursionDepth ];\n\n\t\t\t\tspawnRay( point, reflectionVector, zColor, recursionDepth + 1 );\n\n\t\t\t\tif ( material.specular !== undefined ) {\n\n\t\t\t\t\tzColor.multiply( material.specular );\n\n\t\t\t\t}\n\n\t\t\t\tzColor.multiplyScalar( weight );\n\t\t\t\toutputColor.multiplyScalar( 1 - weight );\n\t\t\t\toutputColor.add( zColor );\n\n\t\t\t}\n\n\t\t};\n\n\t}() );\n\n\tvar computePixelNormal = ( function () {\n\n\t\tvar tmpVec1 = new THREE.Vector3();\n\t\tvar tmpVec2 = new THREE.Vector3();\n\t\tvar tmpVec3 = new THREE.Vector3();\n\n\t\treturn function ( outputVector, point, shading, face, vertices ) {\n\n\t\t\tvar faceNormal = face.normal;\n\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\tif ( shading === THREE.FlatShading ) {\n\n\t\t\t\toutputVector.copy( faceNormal );\n\n\t\t\t} else if ( shading === THREE.SmoothShading ) {\n\n\t\t\t\t// compute barycentric coordinates\n\n\t\t\t\tvar vA = vertices[ face.a ];\n\t\t\t\tvar vB = vertices[ face.b ];\n\t\t\t\tvar vC = vertices[ face.c ];\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vB, vA ), tmpVec2.subVectors( vC, vA ) );\n\t\t\t\tvar areaABC = faceNormal.dot( tmpVec3 );\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vB, point ), tmpVec2.subVectors( vC, point ) );\n\t\t\t\tvar areaPBC = faceNormal.dot( tmpVec3 );\n\t\t\t\tvar a = areaPBC / areaABC;\n\n\t\t\t\ttmpVec3.crossVectors( tmpVec1.subVectors( vC, point ), tmpVec2.subVectors( vA, point ) );\n\t\t\t\tvar areaPCA = faceNormal.dot( tmpVec3 );\n\t\t\t\tvar b = areaPCA / areaABC;\n\n\t\t\t\tvar c = 1.0 - a - b;\n\n\t\t\t\t// compute interpolated vertex normal\n\n\t\t\t\ttmpVec1.copy( vertexNormals[ 0 ] );\n\t\t\t\ttmpVec1.multiplyScalar( a );\n\n\t\t\t\ttmpVec2.copy( vertexNormals[ 1 ] );\n\t\t\t\ttmpVec2.multiplyScalar( b );\n\n\t\t\t\ttmpVec3.copy( vertexNormals[ 2 ] );\n\t\t\t\ttmpVec3.multiplyScalar( c );\n\n\t\t\t\toutputVector.addVectors( tmpVec1, tmpVec2 );\n\t\t\t\toutputVector.add( tmpVec3 );\n\n\t\t\t}\n\n\t\t};\n\n\t}() );\n\n\tvar renderBlock = ( function () {\n\n\t\tvar blockSize = 64;\n\n\t\tvar canvasBlock = document.createElement( 'canvas' );\n\t\tcanvasBlock.width = blockSize;\n\t\tcanvasBlock.height = blockSize;\n\n\t\tvar contextBlock = canvasBlock.getContext( '2d', {\n\n\t\t\talpha: parameters.alpha === true\n\n\t\t} );\n\n\t\tvar imagedata = contextBlock.getImageData( 0, 0, blockSize, blockSize );\n\t\tvar data = imagedata.data;\n\n\t\tvar pixelColor = new THREE.Color();\n\n\t\treturn function ( blockX, blockY ) {\n\n\t\t\tvar index = 0;\n\n\t\t\tfor ( var y = 0; y < blockSize; y ++ ) {\n\n\t\t\t\tfor ( var x = 0; x < blockSize; x ++, index += 4 ) {\n\n\t\t\t\t\t// spawn primary ray at pixel position\n\n\t\t\t\t\torigin.copy( cameraPosition );\n\n\t\t\t\t\tdirection.set( x + blockX - canvasWidthHalf, - ( y + blockY - canvasHeightHalf ), - perspective );\n\t\t\t\t\tdirection.applyMatrix3( cameraNormalMatrix ).normalize();\n\n\t\t\t\t\tspawnRay( origin, direction, pixelColor, 0 );\n\n\t\t\t\t\t// convert from linear to gamma\n\n\t\t\t\t\tdata[ index ] = Math.sqrt( pixelColor.r ) * 255;\n\t\t\t\t\tdata[ index + 1 ] = Math.sqrt( pixelColor.g ) * 255;\n\t\t\t\t\tdata[ index + 2 ] = Math.sqrt( pixelColor.b ) * 255;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imagedata, blockX, blockY );\n\n\t\t\tblockX += blockSize;\n\n\t\t\tif ( blockX >= canvasWidth ) {\n\n\t\t\t\tblockX = 0;\n\t\t\t\tblockY += blockSize;\n\n\t\t\t if ( blockY >= canvasHeight ) {\n if (TiddlyWiki) {\n // End of rendering\n _self.endingCallback();\n }\n return;\n }\n\n\t\t\t}\n\n\t\t\tcontext.fillRect( blockX, blockY, blockSize, blockSize );\n\n\t\t\tanimationFrameId = requestAnimationFrame( function () {\n\n\t\t\t\trenderBlock( blockX, blockY );\n\n\t\t\t} );\n\n\t\t};\n\n\t}() );\n\n this.render = function ( scene, camera /* *TiddlyWiki* */, endingCallback ) {\n\n if (TiddlyWiki && endingCallback) {\n this.endingCallback = endingCallback;\n }\n\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tcancelAnimationFrame( animationFrameId );\n\n\t\t// update scene graph\n\n\t\tif ( scene.autoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t// update camera matrices\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\t\tcameraPosition.setFromMatrixPosition( camera.matrixWorld );\n\n\t\t//\n\n\t\tcameraNormalMatrix.getNormalMatrix( camera.matrixWorld );\n\t\torigin.copy( cameraPosition );\n\n\t\tperspective = 0.5 / Math.tan( THREE.Math.degToRad( camera.fov * 0.5 ) ) * canvasHeight;\n\n\t\tobjects = scene.children;\n\n\t\t// collect lights and set up object matrices\n\n\t\tlights.length = 0;\n\n\t\tscene.traverse( function ( object ) {\n\n\t\t\tif ( object instanceof THREE.Light ) {\n\n\t\t\t\tlights.push( object );\n\n\t\t\t}\n\n\t\t\tif ( cache[ object.id ] === undefined ) {\n\n\t\t\t\tcache[ object.id ] = {\n\t\t\t\t\tnormalMatrix: new THREE.Matrix3(),\n\t\t\t\t\tinverseMatrix: new THREE.Matrix4()\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t\tmodelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld )\n\n\t\t\tvar _object = cache[ object.id ];\n\n\t\t\t_object.normalMatrix.getNormalMatrix( modelViewMatrix );\n\t\t\t_object.inverseMatrix.getInverse( object.matrixWorld );\n\n\t\t} );\n\n\t\trenderBlock( 0, 0 );\n\n\t};\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/CSS3DRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/CSS3DRenderer.js",
"module-type": "library",
"text": "/**\n * Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CSS3DObject = function ( element ) {\n\n\tTHREE.Object3D.call( this );\n\n\tthis.element = element;\n\tthis.element.style.position = 'absolute';\n\n\tthis.addEventListener( 'removed', function ( event ) {\n\n\t\tif ( this.element.parentNode !== null ) {\n\n\t\t\tthis.element.parentNode.removeChild( this.element );\n\n\t\t}\n\n\t} );\n\n};\n\nTHREE.CSS3DObject.prototype = Object.create( THREE.Object3D.prototype );\n\nTHREE.CSS3DSprite = function ( element ) {\n\n\tTHREE.CSS3DObject.call( this, element );\n\n};\n\nTHREE.CSS3DSprite.prototype = Object.create( THREE.CSS3DObject.prototype );\n\n//\n\nTHREE.CSS3DRenderer = function () {\n\n\tconsole.log( 'THREE.CSS3DRenderer', THREE.REVISION );\n\n\tvar _width, _height;\n\tvar _widthHalf, _heightHalf;\n\n\tvar matrix = new THREE.Matrix4();\n\t\n\tvar cache = {\n\t\tcamera: { fov: 0, style: '' },\n\t\tobjects: {}\n\t};\n\n\tvar domElement = document.createElement( 'div' );\n\tdomElement.style.overflow = 'hidden';\n\n\tdomElement.style.WebkitTransformStyle = 'preserve-3d';\n\tdomElement.style.MozTransformStyle = 'preserve-3d';\n\tdomElement.style.oTransformStyle = 'preserve-3d';\n\tdomElement.style.transformStyle = 'preserve-3d';\n\n\tthis.domElement = domElement;\n\n\tvar cameraElement = document.createElement( 'div' );\n\n\tcameraElement.style.WebkitTransformStyle = 'preserve-3d';\n\tcameraElement.style.MozTransformStyle = 'preserve-3d';\n\tcameraElement.style.oTransformStyle = 'preserve-3d';\n\tcameraElement.style.transformStyle = 'preserve-3d';\n\n\tdomElement.appendChild( cameraElement );\n\n\tthis.setClearColor = function () {\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_widthHalf = _width / 2;\n\t\t_heightHalf = _height / 2;\n\n\t\tdomElement.style.width = width + 'px';\n\t\tdomElement.style.height = height + 'px';\n\n\t\tcameraElement.style.width = width + 'px';\n\t\tcameraElement.style.height = height + 'px';\n\n\t};\n\n\tvar epsilon = function ( value ) {\n\n\t\treturn Math.abs( value ) < 0.000001 ? 0 : value;\n\n\t};\n\n\tvar getCameraCSSMatrix = function ( matrix ) {\n\n\t\tvar elements = matrix.elements;\n\n\t\treturn 'matrix3d(' +\n\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\tepsilon( - elements[ 1 ] ) + ',' +\n\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\tepsilon( elements[ 4 ] ) + ',' +\n\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\tepsilon( elements[ 6 ] ) + ',' +\n\t\t\tepsilon( elements[ 7 ] ) + ',' +\n\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\tepsilon( - elements[ 9 ] ) + ',' +\n\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\tepsilon( - elements[ 13 ] ) + ',' +\n\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\tepsilon( elements[ 15 ] ) +\n\t\t')';\n\n\t};\n\n\tvar getObjectCSSMatrix = function ( matrix ) {\n\n\t\tvar elements = matrix.elements;\n\n\t\treturn 'translate3d(-50%,-50%,0) matrix3d(' +\n\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\tepsilon( elements[ 1 ] ) + ',' +\n\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\tepsilon( - elements[ 4 ] ) + ',' +\n\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\tepsilon( - elements[ 6 ] ) + ',' +\n\t\t\tepsilon( - elements[ 7 ] ) + ',' +\n\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\tepsilon( elements[ 9 ] ) + ',' +\n\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\tepsilon( elements[ 13 ] ) + ',' +\n\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\tepsilon( elements[ 15 ] ) +\n\t\t')';\n\n\t};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tif ( object instanceof THREE.CSS3DObject ) {\n\n\t\t\tvar style;\n\n\t\t\tif ( object instanceof THREE.CSS3DSprite ) {\n\n\t\t\t\t// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/\n\n\t\t\t\tmatrix.copy( camera.matrixWorldInverse );\n\t\t\t\tmatrix.transpose();\n\t\t\t\tmatrix.copyPosition( object.matrixWorld );\n\t\t\t\tmatrix.scale( object.scale );\n\n\t\t\t\tmatrix.elements[ 3 ] = 0;\n\t\t\t\tmatrix.elements[ 7 ] = 0;\n\t\t\t\tmatrix.elements[ 11 ] = 0;\n\t\t\t\tmatrix.elements[ 15 ] = 1;\n\n\t\t\t\tstyle = getObjectCSSMatrix( matrix );\n\n\t\t\t} else {\n\n\t\t\t\tstyle = getObjectCSSMatrix( object.matrixWorld );\n\n\t\t\t}\n\n\t\t\tvar element = object.element;\n\t\t\tvar cachedStyle = cache.objects[ object.id ];\n\n\t\t\tif ( cachedStyle === undefined || cachedStyle !== style ) {\n\n\t\t\t\telement.style.WebkitTransform = style;\n\t\t\t\telement.style.MozTransform = style;\n\t\t\t\telement.style.oTransform = style;\n\t\t\t\telement.style.transform = style;\n\n\t\t\t\tcache.objects[ object.id ] = style;\n\n\t\t\t}\n\n\t\t\tif ( element.parentNode !== cameraElement ) {\n\n\t\t\t\tcameraElement.appendChild( element );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( object.children[ i ], camera );\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tvar fov = 0.5 / Math.tan( THREE.Math.degToRad( camera.fov * 0.5 ) ) * _height;\n\n\t\tif ( cache.camera.fov !== fov ) {\n\n\t\t\tdomElement.style.WebkitPerspective = fov + \"px\";\n\t\t\tdomElement.style.MozPerspective = fov + \"px\";\n\t\t\tdomElement.style.oPerspective = fov + \"px\";\n\t\t\tdomElement.style.perspective = fov + \"px\";\n\n\t\t\tcache.camera.fov = fov;\n\n\t\t}\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tvar style = \"translate3d(0,0,\" + fov + \"px)\" + getCameraCSSMatrix( camera.matrixWorldInverse ) +\n\t\t\t\" translate3d(\" + _widthHalf + \"px,\" + _heightHalf + \"px, 0)\";\n\n\t\tif ( cache.camera.style !== style ) {\n\n\t\t\tcameraElement.style.WebkitTransform = style;\n\t\t\tcameraElement.style.MozTransform = style;\n\t\t\tcameraElement.style.oTransform = style;\n\t\t\tcameraElement.style.transform = style;\n\t\t\t\n\t\t\tcache.camera.style = style;\n\n\t\t}\n\n\t\trenderObject( scene, camera );\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/SoftwareRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/SoftwareRenderer.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author ryg / http://farbrausch.de/~fg\n * @author mraleph / http://mrale.ph/\n */\n\nTHREE.SoftwareRenderer = function ( parameters ) {\n\n\tconsole.log( 'THREE.SoftwareRenderer', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n\tvar canvas = document.createElement( 'canvas' );\n\tvar context = canvas.getContext( '2d', {\n\t\talpha: parameters.alpha === true\n\t} );\n\n\tvar shaders = {};\n\n\tvar canvasWidth, canvasHeight;\n\tvar canvasWBlocks, canvasHBlocks;\n\tvar viewportXScale, viewportYScale, viewportZScale;\n\tvar viewportXOffs, viewportYOffs, viewportZOffs;\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\n\tvar imagedata, data, zbuffer;\n\tvar numBlocks, blockMaxZ, blockFlags;\n\n\tvar BLOCK_ISCLEAR = (1 << 0);\n\tvar BLOCK_NEEDCLEAR = (1 << 1);\n\n\tvar subpixelBits = 4;\n\tvar subpixelBias = (1 << subpixelBits) - 1;\n\tvar blockShift = 3;\n\tvar blockSize = 1 << blockShift;\n\tvar maxZVal = (1 << 24); // Note: You want to size this so you don't get overflows.\n\n\tvar rectx1 = Infinity, recty1 = Infinity;\n\tvar rectx2 = 0, recty2 = 0;\n\n\tvar prevrectx1 = Infinity, prevrecty1 = Infinity;\n\tvar prevrectx2 = 0, prevrecty2 = 0;\n\n\tvar projector = new THREE.Projector();\n\n\tvar vector1 = new THREE.Vector3();\n\tvar vector2 = new THREE.Vector3();\n\tvar vector3 = new THREE.Vector3();\n\n\tthis.domElement = canvas;\n\n\tthis.autoClear = true;\n\n\t// WebGLRenderer compatibility\n\n\tthis.supportsVertexTextures = function () {};\n\tthis.setFaceCulling = function () {};\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tcanvasWBlocks = Math.floor( width / blockSize );\n\t\tcanvasHBlocks = Math.floor( height / blockSize );\n\t\tcanvasWidth = canvasWBlocks * blockSize;\n\t\tcanvasHeight = canvasHBlocks * blockSize;\n\n\t\tvar fixScale = 1 << subpixelBits;\n\n\t\tviewportXScale = fixScale * canvasWidth / 2;\n\t\tviewportYScale = -fixScale * canvasHeight / 2;\n\t\tviewportZScale = maxZVal / 2;\n\t\tviewportXOffs = fixScale * canvasWidth / 2 + 0.5;\n\t\tviewportYOffs = fixScale * canvasHeight / 2 + 0.5;\n\t\tviewportZOffs = maxZVal / 2 + 0.5;\n\n\t\tcanvas.width = canvasWidth;\n\t\tcanvas.height = canvasHeight;\n\n\t\tcontext.fillStyle = clearColor.getStyle();\n\t\tcontext.fillRect( 0, 0, canvasWidth, canvasHeight );\n\n\t\timagedata = context.getImageData( 0, 0, canvasWidth, canvasHeight );\n\t\tdata = imagedata.data;\n\n\t\tzbuffer = new Int32Array( data.length / 4 );\n\n\t\tnumBlocks = canvasWBlocks * canvasHBlocks;\n\t\tblockMaxZ = new Int32Array( numBlocks );\n\t\tblockFlags = new Uint8Array( numBlocks );\n\n\t\tfor ( var i = 0, l = zbuffer.length; i < l; i ++ ) {\n\n\t\t\tzbuffer[ i ] = maxZVal;\n\n\t\t}\n\n\t\tfor ( var i = 0; i < numBlocks; i ++ ) {\n\n\t\t\tblockFlags[ i ] = BLOCK_ISCLEAR;\n\n\t\t}\n\n\t};\n\n\tthis.setSize( canvas.width, canvas.height );\n\n\tthis.clear = function () {\n\n\t\trectx1 = Infinity;\n\t\trecty1 = Infinity;\n\t\trectx2 = 0;\n\t\trecty2 = 0;\n\n\t\tfor ( var i = 0; i < numBlocks; i ++ ) {\n\n\t\t\tblockMaxZ[ i ] = maxZVal;\n\t\t\tblockFlags[ i ] = (blockFlags[ i ] & BLOCK_ISCLEAR) ? BLOCK_ISCLEAR : BLOCK_NEEDCLEAR;\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tvar renderData = projector.projectScene( scene, camera, false, false );\n\t\tvar elements = renderData.elements;\n\n\t\tfor ( var e = 0, el = elements.length; e < el; e ++ ) {\n\n\t\t\tvar element = elements[ e ];\n\t\t\tvar material = element.material;\n\t\t\tvar shader = getMaterialShader( material );\n\n\t\t\tif ( element instanceof THREE.RenderableFace ) {\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\telement.v1.positionScreen,\n\t\t\t\t\telement.v2.positionScreen,\n\t\t\t\t\telement.v3.positionScreen,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t} else if ( element instanceof THREE.RenderableSprite ) {\n\n\t\t\t\tvar scaleX = element.scale.x * 0.5;\n\t\t\t\tvar scaleY = element.scale.y * 0.5;\n\n\t\t\t\tvector1.copy( element );\n\t\t\t\tvector1.x -= scaleX;\n\t\t\t\tvector1.y += scaleY;\n\n\t\t\t\tvector2.copy( element );\n\t\t\t\tvector2.x -= scaleX;\n\t\t\t\tvector2.y -= scaleY;\n\n\t\t\t\tvector3.copy( element );\n\t\t\t\tvector3.x += scaleX;\n\t\t\t\tvector3.y += scaleY;\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\tvector1, vector2, vector3,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t\tvector1.copy( element );\n\t\t\t\tvector1.x += scaleX;\n\t\t\t\tvector1.y += scaleY;\n\n\t\t\t\tvector2.copy( element );\n\t\t\t\tvector2.x -= scaleX;\n\t\t\t\tvector2.y -= scaleY;\n\n\t\t\t\tvector3.copy( element );\n\t\t\t\tvector3.x += scaleX;\n\t\t\t\tvector3.y -= scaleY;\n\n\t\t\t\tdrawTriangle(\n\t\t\t\t\tvector1, vector2, vector3,\n\t\t\t\t\tshader, element, material\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfinishClear();\n\n\t\tvar x = Math.min( rectx1, prevrectx1 );\n\t\tvar y = Math.min( recty1, prevrecty1 );\n\t\tvar width = Math.max( rectx2, prevrectx2 ) - x;\n\t\tvar height = Math.max( recty2, prevrecty2 ) - y;\n\n\t\t/*\n\t\t// debug; draw zbuffer\n\n\t\tfor ( var i = 0, l = zbuffer.length; i < l; i++ ) {\n\n\t\t\tvar o = i * 4;\n\t\t\tvar v = (65535 - zbuffer[ i ]) >> 3;\n\t\t\tdata[ o + 0 ] = v;\n\t\t\tdata[ o + 1 ] = v;\n\t\t\tdata[ o + 2 ] = v;\n\t\t\tdata[ o + 3 ] = 255;\n\t\t}\n\t\t*/\n\n\t\tif ( x !== Infinity ) {\n\n\t\t\tcontext.putImageData( imagedata, 0, 0, x, y, width, height );\n\n\t\t}\n\n\t\tprevrectx1 = rectx1; prevrecty1 = recty1;\n\t\tprevrectx2 = rectx2; prevrecty2 = recty2;\n\n\t};\n\n\tfunction getMaterialShader( material ) {\n\n\t\tvar id = material.id;\n\t\tvar shader = shaders[ id ];\n\n\t\tif ( shaders[ id ] === undefined ) {\n\n\t\t\tif ( material instanceof THREE.MeshBasicMaterial ||\n\t\t\t material instanceof THREE.MeshLambertMaterial ||\n\t\t\t material instanceof THREE.MeshPhongMaterial ||\n\t\t\t material instanceof THREE.SpriteMaterial ) {\n\n\t\t\t\tvar string;\n\n\t\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t\tstring = [\n\t\t\t\t\t\t'buffer[ offset ] = face.color.r * 255;',\n\t\t\t\t\t\t'buffer[ offset + 1 ] = face.color.g * 255;',\n\t\t\t\t\t\t'buffer[ offset + 2 ] = face.color.b * 255;',\n\t\t\t\t\t\t'buffer[ offset + 3 ] = material.opacity * 255;',\n\t\t\t\t\t].join('\\n');\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstring = [\n\t\t\t\t\t\t'buffer[ offset ] = material.color.r * 255;',\n\t\t\t\t\t\t'buffer[ offset + 1 ] = material.color.g * 255;',\n\t\t\t\t\t\t'buffer[ offset + 2 ] = material.color.b * 255;',\n\t\t\t\t\t\t'buffer[ offset + 3 ] = material.opacity * 255;',\n\t\t\t\t\t].join('\\n');\n\n\t\t\t\t}\n\n\t\t\t\tshader = new Function( 'buffer, offset, u, v, face, material', string );\n\n\t\t\t} else {\n\n\t\t\t\tvar string = [\n\t\t\t\t\t'buffer[ offset ] = u * 255;',\n\t\t\t\t\t'buffer[ offset + 1 ] = v * 255;',\n\t\t\t\t\t'buffer[ offset + 2 ] = 0;',\n\t\t\t\t\t'buffer[ offset + 3 ] = 255;'\n\t\t\t\t].join('\\n');\n\n\t\t\t\tshader = new Function( 'buffer, offset, u, v', string );\n\n\t\t\t}\n\n\t\t\tshaders[ id ] = shader;\n\n\t\t}\n\n\t\treturn shader;\n\n\t}\n\n\tfunction clearRectangle( x1, y1, x2, y2 ) {\n\n\t\tvar xmin = Math.max( Math.min( x1, x2 ), 0 );\n\t\tvar xmax = Math.min( Math.max( x1, x2 ), canvasWidth );\n\t\tvar ymin = Math.max( Math.min( y1, y2 ), 0 );\n\t\tvar ymax = Math.min( Math.max( y1, y2 ), canvasHeight );\n\n\t\tvar offset = ( xmin + ymin * canvasWidth ) * 4 + 3;\n\t\tvar linestep = ( canvasWidth - ( xmax - xmin ) ) * 4;\n\n\t\tfor ( var y = ymin; y < ymax; y ++ ) {\n\n\t\t\tfor ( var x = xmin; x < xmax; x ++ ) {\n\n\t\t\t\tdata[ offset += 4 ] = 0;\n\n\t\t\t}\n\n\t\t\toffset += linestep;\n\n\t\t}\n\n\t}\n\n\tfunction drawTriangle( v1, v2, v3, shader, face, material ) {\n\n\t\t// TODO: Implement per-pixel z-clipping\n\n\t\tif ( v1.z < -1 || v1.z > 1 || v2.z < -1 || v2.z > 1 || v3.z < -1 || v3.z > 1 ) return;\n\n\t\t// https://gist.github.com/2486101\n\t\t// explanation: http://pouet.net/topic.php?which=8760&page=1\n\n\t\t// 28.4 fixed-point coordinates\n\n\t\tvar x1 = (v1.x * viewportXScale + viewportXOffs) | 0;\n\t\tvar x2 = (v2.x * viewportXScale + viewportXOffs) | 0;\n\t\tvar x3 = (v3.x * viewportXScale + viewportXOffs) | 0;\n\n\t\tvar y1 = (v1.y * viewportYScale + viewportYOffs) | 0;\n\t\tvar y2 = (v2.y * viewportYScale + viewportYOffs) | 0;\n\t\tvar y3 = (v3.y * viewportYScale + viewportYOffs) | 0;\n\n\t\t// Z values (.28 fixed-point)\n\n\t\tvar z1 = (v1.z * viewportZScale + viewportZOffs) | 0;\n\t\tvar z2 = (v2.z * viewportZScale + viewportZOffs) | 0;\n\t\tvar z3 = (v3.z * viewportZScale + viewportZOffs) | 0;\n\n\t\t// Deltas\n\n\t\tvar dx12 = x1 - x2, dy12 = y2 - y1;\n\t\tvar dx23 = x2 - x3, dy23 = y3 - y2;\n\t\tvar dx31 = x3 - x1, dy31 = y1 - y3;\n\n\t\t// Bounding rectangle\n\n\t\tvar minx = Math.max( ( Math.min( x1, x2, x3 ) + subpixelBias ) >> subpixelBits, 0 );\n\t\tvar maxx = Math.min( ( Math.max( x1, x2, x3 ) + subpixelBias ) >> subpixelBits, canvasWidth );\n\t\tvar miny = Math.max( ( Math.min( y1, y2, y3 ) + subpixelBias ) >> subpixelBits, 0 );\n\t\tvar maxy = Math.min( ( Math.max( y1, y2, y3 ) + subpixelBias ) >> subpixelBits, canvasHeight );\n\n\t\trectx1 = Math.min( minx, rectx1 );\n\t\trectx2 = Math.max( maxx, rectx2 );\n\t\trecty1 = Math.min( miny, recty1 );\n\t\trecty2 = Math.max( maxy, recty2 );\n\n\t\t// Block size, standard 8x8 (must be power of two)\n\n\t\tvar q = blockSize;\n\n\t\t// Start in corner of 8x8 block\n\n\t\tminx &= ~(q - 1);\n\t\tminy &= ~(q - 1);\n\n\t\t// Constant part of half-edge functions\n\n\t\tvar c1 = dy12 * ((minx << subpixelBits) - x1) + dx12 * ((miny << subpixelBits) - y1);\n\t\tvar c2 = dy23 * ((minx << subpixelBits) - x2) + dx23 * ((miny << subpixelBits) - y2);\n\t\tvar c3 = dy31 * ((minx << subpixelBits) - x3) + dx31 * ((miny << subpixelBits) - y3);\n\n\t\t// Correct for fill convention\n\n\t\tif ( dy12 > 0 || ( dy12 == 0 && dx12 > 0 ) ) c1 ++;\n\t\tif ( dy23 > 0 || ( dy23 == 0 && dx23 > 0 ) ) c2 ++;\n\t\tif ( dy31 > 0 || ( dy31 == 0 && dx31 > 0 ) ) c3 ++;\n\n\t\t// Note this doesn't kill subpixel precision, but only because we test for >=0 (not >0).\n\t\t// It's a bit subtle. :)\n\t\tc1 = (c1 - 1) >> subpixelBits;\n\t\tc2 = (c2 - 1) >> subpixelBits;\n\t\tc3 = (c3 - 1) >> subpixelBits;\n\n\t\t// Z interpolation setup\n\n\t\tvar dz12 = z1 - z2, dz31 = z3 - z1;\n\t\tvar invDet = 1.0 / (dx12*dy31 - dx31*dy12);\n\t\tvar dzdx = (invDet * (dz12*dy31 - dz31*dy12)); // dz per one subpixel step in x\n\t\tvar dzdy = (invDet * (dz12*dx31 - dx12*dz31)); // dz per one subpixel step in y\n\n\t\t// Z at top/left corner of rast area\n\n\t\tvar cz = ( z1 + ((minx << subpixelBits) - x1) * dzdx + ((miny << subpixelBits) - y1) * dzdy ) | 0;\n\n\t\t// Z pixel steps\n\n\t\tvar zfixscale = (1 << subpixelBits);\n\t\tdzdx = (dzdx * zfixscale) | 0;\n\t\tdzdy = (dzdy * zfixscale) | 0;\n\n\t\t// Set up min/max corners\n\t\tvar qm1 = q - 1; // for convenience\n\t\tvar nmin1 = 0, nmax1 = 0;\n\t\tvar nmin2 = 0, nmax2 = 0;\n\t\tvar nmin3 = 0, nmax3 = 0;\n\t\tvar nminz = 0, nmaxz = 0;\n\t\tif (dx12 >= 0) nmax1 -= qm1*dx12; else nmin1 -= qm1*dx12;\n\t\tif (dy12 >= 0) nmax1 -= qm1*dy12; else nmin1 -= qm1*dy12;\n\t\tif (dx23 >= 0) nmax2 -= qm1*dx23; else nmin2 -= qm1*dx23;\n\t\tif (dy23 >= 0) nmax2 -= qm1*dy23; else nmin2 -= qm1*dy23;\n\t\tif (dx31 >= 0) nmax3 -= qm1*dx31; else nmin3 -= qm1*dx31;\n\t\tif (dy31 >= 0) nmax3 -= qm1*dy31; else nmin3 -= qm1*dy31;\n\t\tif (dzdx >= 0) nmaxz += qm1*dzdx; else nminz += qm1*dzdx;\n\t\tif (dzdy >= 0) nmaxz += qm1*dzdy; else nminz += qm1*dzdy;\n\n\t\t// Loop through blocks\n\t\tvar linestep = canvasWidth - q;\n\t\tvar scale = 1.0 / (c1 + c2 + c3);\n\n\t\tvar cb1 = c1;\n\t\tvar cb2 = c2;\n\t\tvar cb3 = c3;\n\t\tvar cbz = cz;\n\t\tvar qstep = -q;\n\t\tvar e1x = qstep * dy12;\n\t\tvar e2x = qstep * dy23;\n\t\tvar e3x = qstep * dy31;\n\t\tvar ezx = qstep * dzdx;\n\t\tvar x0 = minx;\n\n\t\tfor ( var y0 = miny; y0 < maxy; y0 += q ) {\n\n\t\t\t// New block line - keep hunting for tri outer edge in old block line dir\n\t\t\twhile ( x0 >= minx && x0 < maxx && cb1 >= nmax1 && cb2 >= nmax2 && cb3 >= nmax3 ) {\n\n\t\t\t\tx0 += qstep;\n\t\t\t\tcb1 += e1x;\n\t\t\t\tcb2 += e2x;\n\t\t\t\tcb3 += e3x;\n\t\t\t\tcbz += ezx;\n\n\t\t\t}\n\n\t\t\t// Okay, we're now in a block we know is outside. Reverse direction and go into main loop.\n\t\t\tqstep = -qstep;\n\t\t\te1x = -e1x;\n\t\t\te2x = -e2x;\n\t\t\te3x = -e3x;\n\t\t\tezx = -ezx;\n\n\t\t\twhile ( 1 ) {\n\n\t\t\t\t// Step everything\n\t\t\t\tx0 += qstep;\n\t\t\t\tcb1 += e1x;\n\t\t\t\tcb2 += e2x;\n\t\t\t\tcb3 += e3x;\n\t\t\t\tcbz += ezx;\n\n\t\t\t\t// We're done with this block line when at least one edge completely out\n\t\t\t\t// If an edge function is too small and decreasing in the current traversal\n\t\t\t\t// dir, we're done with this line.\n\t\t\t\tif (x0 < minx || x0 >= maxx) break;\n\t\t\t\tif (cb1 < nmax1) if (e1x < 0) break; else continue;\n\t\t\t\tif (cb2 < nmax2) if (e2x < 0) break; else continue;\n\t\t\t\tif (cb3 < nmax3) if (e3x < 0) break; else continue;\n\n\t\t\t\t// We can skip this block if it's already fully covered\n\t\t\t\tvar blockX = x0 >> blockShift;\n\t\t\t\tvar blockY = y0 >> blockShift;\n\t\t\t\tvar blockId = blockX + blockY * canvasWBlocks;\n\t\t\t\tvar minz = cbz + nminz;\n\n\t\t\t\t// farthest point in block closer than closest point in our tri?\n\t\t\t\tif ( blockMaxZ[ blockId ] < minz ) continue;\n\n\t\t\t\t// Need to do a deferred clear?\n\t\t\t\tvar bflags = blockFlags[ blockId ];\n\t\t\t\tif ( bflags & BLOCK_NEEDCLEAR) clearBlock( blockX, blockY );\n\t\t\t\tblockFlags[ blockId ] = bflags & ~( BLOCK_ISCLEAR | BLOCK_NEEDCLEAR );\n\n\t\t\t\t// Offset at top-left corner\n\t\t\t\tvar offset = x0 + y0 * canvasWidth;\n\n\t\t\t\t// Accept whole block when fully covered\n\t\t\t\tif ( cb1 >= nmin1 && cb2 >= nmin2 && cb3 >= nmin3 ) {\n\n\t\t\t\t\tvar maxz = cbz + nmaxz;\n\t\t\t\t\tblockMaxZ[ blockId ] = Math.min( blockMaxZ[ blockId ], maxz );\n\n\t\t\t\t\tvar cy1 = cb1;\n\t\t\t\t\tvar cy2 = cb2;\n\t\t\t\t\tvar cyz = cbz;\n\n\t\t\t\t\tfor ( var iy = 0; iy < q; iy ++ ) {\n\n\t\t\t\t\t\tvar cx1 = cy1;\n\t\t\t\t\t\tvar cx2 = cy2;\n\t\t\t\t\t\tvar cxz = cyz;\n\n\t\t\t\t\t\tfor ( var ix = 0; ix < q; ix ++ ) {\n\n\t\t\t\t\t\t\tvar z = cxz;\n\n\t\t\t\t\t\t\tif ( z < zbuffer[ offset ] ) {\n\t\t\t\t\t\t\t\tzbuffer[ offset ] = z;\n\t\t\t\t\t\t\t\tvar u = cx1 * scale;\n\t\t\t\t\t\t\t\tvar v = cx2 * scale;\n\t\t\t\t\t\t\t\tshader( data, offset * 4, u, v, face, material );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcx1 += dy12;\n\t\t\t\t\t\t\tcx2 += dy23;\n\t\t\t\t\t\t\tcxz += dzdx;\n\t\t\t\t\t\t\toffset++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcy1 += dx12;\n\t\t\t\t\t\tcy2 += dx23;\n\t\t\t\t\t\tcyz += dzdy;\n\t\t\t\t\t\toffset += linestep;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else { // Partially covered block\n\n\t\t\t\t\tvar cy1 = cb1;\n\t\t\t\t\tvar cy2 = cb2;\n\t\t\t\t\tvar cy3 = cb3;\n\t\t\t\t\tvar cyz = cbz;\n\n\t\t\t\t\tfor ( var iy = 0; iy < q; iy ++ ) {\n\n\t\t\t\t\t\tvar cx1 = cy1;\n\t\t\t\t\t\tvar cx2 = cy2;\n\t\t\t\t\t\tvar cx3 = cy3;\n\t\t\t\t\t\tvar cxz = cyz;\n\n\t\t\t\t\t\tfor ( var ix = 0; ix < q; ix ++ ) {\n\n\t\t\t\t\t\t\tif ( ( cx1 | cx2 | cx3 ) >= 0 ) {\n\n\t\t\t\t\t\t\t\tvar z = cxz;\n\n\t\t\t\t\t\t\t\tif ( z < zbuffer[ offset ] ) {\n\t\t\t\t\t\t\t\t\tvar u = cx1 * scale;\n\t\t\t\t\t\t\t\t\tvar v = cx2 * scale;\n\n\t\t\t\t\t\t\t\t\tzbuffer[ offset ] = z;\n\t\t\t\t\t\t\t\t\tshader( data, offset * 4, u, v, face, material );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcx1 += dy12;\n\t\t\t\t\t\t\tcx2 += dy23;\n\t\t\t\t\t\t\tcx3 += dy31;\n\t\t\t\t\t\t\tcxz += dzdx;\n\t\t\t\t\t\t\toffset++;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcy1 += dx12;\n\t\t\t\t\t\tcy2 += dx23;\n\t\t\t\t\t\tcy3 += dx31;\n\t\t\t\t\t\tcyz += dzdy;\n\t\t\t\t\t\toffset += linestep;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Advance to next row of blocks\n\t\t\tcb1 += q*dx12;\n\t\t\tcb2 += q*dx23;\n\t\t\tcb3 += q*dx31;\n\t\t\tcbz += q*dzdy;\n\t\t}\n\n\t}\n\n\tfunction clearBlock( blockX, blockY ) {\n\n\t\tvar zoffset = blockX * blockSize + blockY * blockSize * canvasWidth;\n\t\tvar poffset = zoffset * 4;\n\n\t\tvar zlinestep = canvasWidth - blockSize;\n\t\tvar plinestep = zlinestep * 4;\n\n\t\tfor ( var y = 0; y < blockSize; y ++ ) {\n\n\t\t\tfor ( var x = 0; x < blockSize; x ++ ) {\n\n\t\t\t\tzbuffer[ zoffset ++ ] = maxZVal;\n\n\t\t\t\tdata[ poffset ++ ] = clearColor.r * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = clearColor.g * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = clearColor.b * 255 | 0;\n\t\t\t\tdata[ poffset ++ ] = 255;\n\n\t\t\t}\n\n\t\t\tzoffset += zlinestep;\n\t\t\tpoffset += plinestep;\n\n\t\t}\n\n\t}\n\n\tfunction finishClear( ) {\n\n\t\tvar block = 0;\n\n\t\tfor ( var y = 0; y < canvasHBlocks; y ++ ) {\n\n\t\t\tfor ( var x = 0; x < canvasWBlocks; x ++ ) {\n\n\t\t\t\tif ( blockFlags[ block ] & BLOCK_NEEDCLEAR ) {\n\n\t\t\t\t\tclearBlock( x, y );\n\t\t\t\t\tblockFlags[ block ] = BLOCK_ISCLEAR;\n\n\t\t\t\t}\n\n\t\t\t\tblock ++;\n\t\t\t}\n\n\t\t}\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/WebGLRenderer3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLRenderer3.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n *\n * parameters = {\n * canvas: canvas,\n * contextAttributes: {\n * alpha: false,\n * depth: true,\n * stencil: false,\n * antialias: true,\n * premultipliedAlpha: true,\n * preserveDrawingBuffer: false\n * }\n * }\n *\n */\n\nTHREE.WebGLRenderer3 = function ( parameters ) {\n\n\tconsole.log( 'THREE.WebGLRenderer3', THREE.REVISION );\n\n\tparameters = parameters || {};\n\n\tvar scope = this;\n\n\tvar canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' );\n\n\tvar devicePixelRatio = parameters.devicePixelRatio !== undefined\n\t\t\t\t? parameters.devicePixelRatio\n\t\t\t\t: self.devicePixelRatio !== undefined\n\t\t\t\t\t? self.devicePixelRatio\n\t\t\t\t\t: 1;\n\n\tvar gl;\n\n\ttry {\n\n\t\tvar attributes = parameters.contextAttributes || {};\n\t\t\n\t\tif ( attributes.alpha === undefined ) attributes.alpha = false;\n\n\t\tgl = canvas.getContext( 'webgl', attributes ) || canvas.getContext( 'experimental-webgl', attributes );\n\n\t\tif ( gl === null ) {\n\n\t\t\tthrow 'Error creating WebGL context.';\n\n\t\t}\n\n\t} catch ( exception ) {\n\n\t\tconsole.error( exception );\n\n\t}\n\n\tvar precision = 'highp';\n\tvar extensions = {};\n\n\tif ( gl !== null ) {\n\n\t\textensions.element_index_uint = gl.getExtension( 'OES_element_index_uint' );\n\t\textensions.texture_float = gl.getExtension( 'OES_texture_float' );\n\t\textensions.texture_float_linear = gl.getExtension( 'OES_texture_float_linear' );\n\t\textensions.standard_derivatives = gl.getExtension( 'OES_standard_derivatives' );\n\t\textensions.texture_filter_anisotropic = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\textensions.compressed_texture_s3tc = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\n\t\tgl.clearColor( 0, 0, 0, 1 );\n\t\tgl.clearDepth( 1 );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.enable( gl.DEPTH_TEST );\n\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\tgl.enable( gl.CULL_FACE );\n\t\tgl.frontFace( gl.CCW );\n\t\tgl.cullFace( gl.BACK );\n\n\t\tgl.enable( gl.BLEND );\n\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\tgl.blendFunc( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA );\n\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t}\n\n\tvar clearColor = new THREE.Color( 0x000000 );\n\tvar clearAlpha = 0;\n\n\t//\n\n\tvar vector3 = new THREE.Vector3();\n\tvar frustum = new THREE.Frustum();\n\tvar normalMatrix = new THREE.Matrix3();\n\tvar modelViewMatrix = new THREE.Matrix4();\n\tvar cameraViewProjectionMatrix = new THREE.Matrix4();\n\n\t// buffers\n\n\tvar buffers = {};\n\n\tvar getBuffer = function ( geometry, material ) {\n\n\t\tvar hash = geometry.id.toString() + '+' + material.id.toString();\n\n\t\tif ( buffers[ hash ] !== undefined ) {\n\n\t\t\treturn buffers[ hash ];\n\n\t\t}\n\n\t\tvar vertices = geometry.vertices;\n\t\tvar faces = geometry.faces;\n\n\t\t//\n\n\t\tvar positions = [];\n\t\tvar addPosition = function ( position ) {\n\n\t\t\tpositions.push( position.x, position.y, position.z );\n\n\t\t}\n\n\t\tvar normals = [];\n\t\tvar addNormal = function ( normal ) {\n\n\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t}\n\n\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\tvar face = faces[ i ];\n\t\t\tvar vertexNormals = face.vertexNormals.length > 0;\n\n\t\t\taddPosition( vertices[ face.a ] );\n\t\t\taddPosition( vertices[ face.b ] );\n\t\t\taddPosition( vertices[ face.c ] );\n\n\t\t\tif ( vertexNormals === true ) {\n\n\t\t\t\taddNormal( face.vertexNormals[ 0 ] );\n\t\t\t\taddNormal( face.vertexNormals[ 1 ] );\n\t\t\t\taddNormal( face.vertexNormals[ 2 ] );\n\n\t\t\t} else {\n\n\t\t\t\taddNormal( face.normal );\n\t\t\t\taddNormal( face.normal );\n\t\t\t\taddNormal( face.normal );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvar buffer = {\n\t\t\tpositions: gl.createBuffer(),\n\t\t\tnormals: gl.createBuffer(),\n\t\t\tcount: positions.length / 3\n\t\t};\n\n\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.positions );\n\t\tgl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions ), gl.STATIC_DRAW );\n\n\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.normals );\n\t\tgl.bufferData( gl.ARRAY_BUFFER, new Float32Array( normals ), gl.STATIC_DRAW );\n\n\t\tbuffers[ hash ] = buffer;\n\n\t\tscope.info.memory.geometries ++;\n\n\t\treturn buffer;\n\n\t};\n\n\t// programs\n\n\tvar programs = {};\n\tvar programsCache = {};\n\n\tvar getProgram = function ( material ) {\n\n\t\tif ( programs[ material.id ] !== undefined ) {\n\n\t\t\treturn programs[ material.id ];\n\n\t\t}\n\n\t\tvar vertexShader = [\n\t\t\t'precision ' + precision + ' float;',\n\t\t\t\"precision \" + precision + \" int;\",\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t''\n\t\t].join( '\\n' );\n\n\t\tvar fragmentShader = [\n\t\t\t'precision ' + precision + ' float;',\n\t\t\t\"precision \" + precision + \" int;\",\n\t\t\t''\n\t\t].join( '\\n' );\n\n\t\tif ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\tvertexShader += material.vertexShader;\n\t\t\tfragmentShader += material.fragmentShader;\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\tvertexShader += [\n\t\t\t\t'varying vec3 vNormal;',\n\t\t\t\t'void main() {',\n\t\t\t\t'\tvNormal = normalize( normalMatrix * normal );',\n\t\t\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t\tfragmentShader += [\n\t\t\t\t'varying vec3 vNormal;',\n\t\t\t\t'uniform float opacity;',\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t} else {\n\n\t\t\tvertexShader += [\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t\tfragmentShader += [\n\t\t\t\t'void main() {',\n\t\t\t\t'\tgl_FragColor = vec4( 1.0, 0, 0, 1.0 );',\n\t\t\t\t'}'\n\t\t\t].join( '\\n' );\n\n\t\t}\n\n\t\tvar program;\n\t\tvar code = vertexShader + fragmentShader;\n\n\t\tif ( programsCache[ code ] !== undefined ) {\n\n\t\t\tprogram = programsCache[ code ];\n\t\t\tprograms[ material.id ] = program;\n\n\t\t} else {\n\n\t\t\tprogram = gl.createProgram();\n\n\t\t\tgl.attachShader( program, createShader( gl.VERTEX_SHADER, vertexShader ) );\n\t\t\tgl.attachShader( program, createShader( gl.FRAGMENT_SHADER, fragmentShader ) );\n\t\t\tgl.linkProgram( program );\n\n\t\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === true ) {\n\n\t\t\t\tprogramsCache[ code ] = program;\n\t\t\t\tprograms[ material.id ] = program;\n\n\t\t\t\tscope.info.memory.programs ++;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'Program Info Log: ' + gl.getProgramInfoLog( program ) );\n\t\t\t\tconsole.error( 'VALIDATE_STATUS: ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) );\n\t\t\t\tconsole.error( 'GL_ERROR: ' + gl.getError() );\n\n\t\t\t\t// fallback\n\n\t\t\t\tprogram = getProgram( new THREE.MeshBasicMaterial() );\n\t\t\t\tprograms[ material.id ] = program;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn program;\n\n\t};\n\n\tvar createShader = function ( type, string ) {\n\n\t\tvar shader = gl.createShader( type );\n\n\t\tgl.shaderSource( shader, string );\n\t\tgl.compileShader( shader );\n\n\t\tif ( gl.getShaderParameter( shader, gl.COMPILE_STATUS ) === true ) {\n\n\t\t\t// console.log( string );\n\n\t\t} else {\n\n\t\t\tconsole.error( gl.getShaderInfoLog( shader ), string );\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn shader;\n\n\t};\n\n\tthis.info = {\n\n\t\tmemory: {\n\n\t\t\tprograms: 0,\n\t\t\tgeometries: 0,\n\t\t\ttextures: 0\n\n\t\t},\n\n\t\trender: {\n\n\t\t\tcalls: 0,\n\t\t\tvertices: 0,\n\t\t\tfaces: 0,\n\t\t\tpoints: 0\n\n\t\t}\n\n\t};\n\n\tthis.domElement = canvas;\n\tthis.extensions = extensions;\n\n\tthis.autoClear = true; // TODO: Make private\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\tclearColor.set( color );\n\t\tclearAlpha = alpha !== undefined ? alpha : 1;\n\n\t\tgl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha );\n\n\t};\n\n\tthis.setSize = function ( width, height, updateStyle ) {\n\n\t\tcanvas.width = width * devicePixelRatio;\n\t\tcanvas.height = height * devicePixelRatio;\n\n\t\tif ( devicePixelRatio !== 1 && updateStyle !== false ) {\n\n\t\t\tcanvas.style.width = width + 'px';\n\t\t\tcanvas.style.height = height + 'px';\n\n\t\t}\n\n\t\tgl.viewport( 0, 0, canvas.width, canvas.height );\n\n\t};\n\n\tthis.clear = function ( color, depth, stencil ) {\n\n\t\tvar bits = 0;\n\n\t\tif ( color === undefined || color ) bits |= gl.COLOR_BUFFER_BIT;\n\t\tif ( depth === undefined || depth ) bits |= gl.DEPTH_BUFFER_BIT;\n\t\tif ( stencil === undefined || stencil ) bits |= gl.STENCIL_BUFFER_BIT;\n\n\t\tgl.clear( bits );\n\n\t};\n\n\t// blending\n\n\tvar currentBlending = null;\n\n\tvar setBlending = function ( blending ) {\n\n\t\tif ( blending !== currentBlending ) {\n\n\t\t\tif ( blending === THREE.NoBlending ) {\n\n\t\t\t\tgl.disable( gl.BLEND );\n\n\t\t\t} else {\n\n\t\t\t\tgl.enable( gl.BLEND );\n\n\t\t\t}\n\n\t\t\tcurrentBlending = blending;\n\n\t\t}\n\n\t};\n\n\t// depthTest\n\n\tvar currentDepthTest = null;\n\n\tvar setDepthTest = function ( value ) {\n\n\t\tif ( value !== currentDepthTest ) {\n\n\t\t\tvalue === true ? gl.enable( gl.DEPTH_TEST ) : gl.disable( gl.DEPTH_TEST );\n\t\t\tcurrentDepthTest = value;\n\n\t\t}\n\n\t};\n\n\t// depthWrite\n\n\tvar currentDepthWrite = null;\n\n\tvar setDepthWrite = function ( value ) {\n\n\t\tif ( value !== currentDepthWrite ) {\n\n\t\t\tgl.depthMask( value );\n\t\t\tcurrentDepthWrite = value;\n\n\t\t}\n\n\t};\n\n\tvar objectsOpaque = [];\n\tvar objectsTransparent = [];\n\n\tvar projectObject = function ( object ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tif ( object instanceof THREE.Mesh && frustum.intersectsObject( object ) === true ) {\n\n\t\t\t// TODO: Do not polute scene graph with .z\n\n\t\t\tif ( object.renderDepth !== null ) {\n\n\t\t\t\tobject.z = object.renderDepth;\n\n\t\t\t} else {\n\n\t\t\t\tvector3.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\tvector3.applyProjection( cameraViewProjectionMatrix );\n\n\t\t\t\tobject.z = vector3.z;\n\n\t\t\t}\n\n\t\t\tif ( object.material.transparent === true ) {\n\n\t\t\t\tobjectsTransparent.push( object );\n\n\t\t\t} else {\n\n\t\t\t\tobjectsOpaque.push( object );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\tprojectObject( object.children[ i ] );\n\n\t\t}\n\n\t};\n\n\tvar sortOpaque = function ( a, b ) {\n\n\t\treturn a.z - b.z;\n\n\t};\n\n\tvar sortTransparent = function ( a, b ) {\n\n\t\treturn a.z !== b.z ? b.z - a.z : b.id - a.id;\n\n\t};\n\n\tvar currentBuffer, currentMaterial, currentProgram;\n\tvar locations = {};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tvar buffer = getBuffer( object.geometry, object.material );\n\n\t\tvar material = object.material;\n\n\t\tif ( material !== currentMaterial ) {\n\n\t\t\tvar program = getProgram( object.material );\n\n\t\t\tif ( program !== currentProgram ) {\n\n\t\t\t\tgl.useProgram( program );\n\n\t\t\t\tlocations.modelViewMatrix = gl.getUniformLocation( program, 'modelViewMatrix' );\n\t\t\t\tlocations.normalMatrix = gl.getUniformLocation( program, 'normalMatrix' );\n\t\t\t\tlocations.projectionMatrix = gl.getUniformLocation( program, 'projectionMatrix' );\n\n\t\t\t\tlocations.position = gl.getAttribLocation( program, 'position' );\n\t\t\t\tlocations.normal = gl.getAttribLocation( program, 'normal' );\n\n\t\t\t\tgl.uniformMatrix4fv( locations.projectionMatrix, false, camera.projectionMatrix.elements );\n\n\t\t\t\tcurrentProgram = program;\n\n\t\t\t}\n\n\t\t\tif ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\t\tgl.uniform1f( gl.getUniformLocation( program, 'opacity' ), material.opacity );\n\n\t\t\t} else if ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\t\tvar uniforms = material.uniforms;\n\n\t\t\t\tfor ( var uniform in uniforms ) {\n\n\t\t\t\t\tvar location = gl.getUniformLocation( program, uniform );\n\n\t\t\t\t\tvar type = uniforms[ uniform ].type;\n\t\t\t\t\tvar value = uniforms[ uniform ].value;\n\n\t\t\t\t\tif ( type === \"i\" ) { // single integer\n\n\t\t\t\t\t\tgl.uniform1i( location, value );\n\n\t\t\t\t\t} else if ( type === \"f\" ) { // single float\n\n\t\t\t\t\t\tgl.uniform1f( location, value );\n\n\t\t\t\t\t} else if ( type === \"v2\" ) { // single THREE.Vector2\n\n\t\t\t\t\t\tgl.uniform2f( location, value.x, value.y );\n\n\t\t\t\t\t} else if ( type === \"v3\" ) { // single THREE.Vector3\n\n\t\t\t\t\t\tgl.uniform3f( location, value.x, value.y, value.z );\n\n\t\t\t\t\t} else if ( type === \"v4\" ) { // single THREE.Vector4\n\n\t\t\t\t\t\tgl.uniform4f( location, value.x, value.y, value.z, value.w );\n\n\t\t\t\t\t} else if ( type === \"c\" ) { // single THREE.Color\n\n\t\t\t\t\t\tgl.uniform3f( location, value.r, value.g, value.b );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcurrentMaterial = material;\n\n\t\t}\n\n\t\tif ( buffer !== currentBuffer ) {\n\n\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.positions );\n\t\t\tgl.enableVertexAttribArray( locations.position );\n\t\t\tgl.vertexAttribPointer( locations.position, 3, gl.FLOAT, false, 0, 0 );\n\n\t\t\tif ( locations.normal >= 0 ) {\n\n\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer.normals );\n\t\t\t\tgl.enableVertexAttribArray( locations.normal );\n\t\t\t\tgl.vertexAttribPointer( locations.normal, 3, gl.FLOAT, false, 0, 0 );\n\n\t\t\t}\n\n\t\t\tcurrentBuffer = buffer;\n\n\t\t}\n\n\t\tmodelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\tnormalMatrix.getNormalMatrix( modelViewMatrix );\n\n\t\tgl.uniformMatrix4fv( locations.modelViewMatrix, false, modelViewMatrix.elements );\n\t\tgl.uniformMatrix3fv( locations.normalMatrix, false, normalMatrix.elements );\n\n\t\tgl.drawArrays( gl.TRIANGLES, 0, buffer.count );\n\n\t\tscope.info.render.calls ++;\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tcameraViewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tfrustum.setFromMatrix( cameraViewProjectionMatrix );\n\n\t\tobjectsOpaque.length = 0;\n\t\tobjectsTransparent.length = 0;\n\n\t\tscope.info.render.calls = 0;\n\n\t\tcurrentBuffer = undefined;\n\t\tcurrentMaterial = undefined;\n\t\tcurrentProgram = undefined;\n\n\t\tprojectObject( scene );\n\n\t\tif ( objectsOpaque.length > 0 ) {\n\n\t\t\tobjectsOpaque.sort( sortOpaque );\n\n\t\t\tsetBlending( THREE.NoBlending );\n\n\t\t\tfor ( var i = 0, l = objectsOpaque.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( objectsOpaque[ i ], camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( objectsTransparent.length > 0 ) {\n\n\t\t\tobjectsTransparent.sort( sortTransparent );\n\n\t\t\tsetBlending( THREE.NormalBlending );\n\n\t\t\tfor ( var i = 0, l = objectsTransparent.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( objectsTransparent[ i ], camera );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/WebGLDeferredRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/WebGLDeferredRenderer.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author MPanknin / http://www.redplant.de/\n */\n\nTHREE.WebGLDeferredRenderer = function ( parameters ) {\n\n\tvar _this = this;\n\n\tvar fullWidth = parameters.width !== undefined ? parameters.width : 800;\n\tvar fullHeight = parameters.height !== undefined ? parameters.height : 600;\n\tvar currentScale = parameters.scale !== undefined ? parameters.scale : 1;\n\n\tvar scaledWidth = Math.floor( currentScale * fullWidth );\n\tvar scaledHeight = Math.floor( currentScale * fullHeight );\n\n\tvar brightness = parameters.brightness !== undefined ? parameters.brightness : 1;\n\tvar tonemapping = parameters.tonemapping !== undefined ? parameters.tonemapping : THREE.SimpleOperator;\n\tvar antialias = parameters.antialias !== undefined ? parameters.antialias : false;\n\n\tthis.renderer = parameters.renderer;\n\n\tif ( this.renderer === undefined ) {\n\n\t\tthis.renderer = new THREE.WebGLRenderer( { antialias: false } );\n\t\tthis.renderer.setSize( fullWidth, fullHeight );\n\t\tthis.renderer.setClearColor( 0x000000, 0 );\n\n\t\tthis.renderer.autoClear = false;\n\n\t}\n\n\tthis.domElement = this.renderer.domElement;\n\n\t//\n\n\tvar gl = this.renderer.context;\n\n\t//\n\n\tvar currentCamera = null;\n\tvar projectionMatrixInverse = new THREE.Matrix4();\n\n\tvar positionVS = new THREE.Vector3();\n\tvar directionVS = new THREE.Vector3();\n\tvar tempVS = new THREE.Vector3();\n\n\tvar rightVS = new THREE.Vector3();\n\tvar normalVS = new THREE.Vector3();\n\tvar upVS = new THREE.Vector3();\n\n\t//\n\n\tvar geometryLightSphere = new THREE.SphereGeometry( 1, 16, 8 );\n\tvar geometryLightPlane = new THREE.PlaneGeometry( 2, 2 );\n\n\tvar black = new THREE.Color( 0x000000 );\n\n\tvar colorShader = THREE.ShaderDeferred[ \"color\" ];\n\tvar normalDepthShader = THREE.ShaderDeferred[ \"normalDepth\" ];\n\n\t//\n\n\tvar emissiveLightShader = THREE.ShaderDeferred[ \"emissiveLight\" ];\n\tvar pointLightShader = THREE.ShaderDeferred[ \"pointLight\" ];\n\tvar spotLightShader = THREE.ShaderDeferred[ \"spotLight\" ];\n\tvar directionalLightShader = THREE.ShaderDeferred[ \"directionalLight\" ];\n\tvar hemisphereLightShader = THREE.ShaderDeferred[ \"hemisphereLight\" ];\n\tvar areaLightShader = THREE.ShaderDeferred[ \"areaLight\" ];\n\n\tvar compositeShader = THREE.ShaderDeferred[ \"composite\" ];\n\n\t//\n\n\tvar compColor, compNormal, compDepth, compLight, compFinal;\n\tvar passColor, passNormal, passDepth, passLightFullscreen, passLightProxy, compositePass;\n\n\tvar effectFXAA;\n\n\t//\n\n\tvar lightSceneFullscreen, lightSceneProxy;\n\n\t//\n\n\tvar resizableMaterials = [];\n\n\t//\n\n\tvar invisibleMaterial = new THREE.ShaderMaterial();\n\tinvisibleMaterial.visible = false;\n\n\n\tvar defaultNormalDepthMaterial = new THREE.ShaderMaterial( {\n\n\t\tuniforms: THREE.UniformsUtils.clone( normalDepthShader.uniforms ),\n\t\tvertexShader: normalDepthShader.vertexShader,\n\t\tfragmentShader: normalDepthShader.fragmentShader,\n\t\tblending:\t\tTHREE.NoBlending\n\n\t} );\n\n\t//\n\n\tvar initDeferredMaterials = function ( object ) {\n\n\t\tif ( object.material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\tvar colorMaterials = [];\n\t\t\tvar normalDepthMaterials = [];\n\n\t\t\tvar materials = object.material.materials;\n\n\t\t\tfor ( var i = 0, il = materials.length; i < il; i ++ ) {\n\n\t\t\t\tvar deferredMaterials = createDeferredMaterials( materials[ i ] );\n\n\t\t\t\tif ( deferredMaterials.transparent ) {\n\n\t\t\t\t\tcolorMaterials.push( invisibleMaterial );\n\t\t\t\t\tnormalDepthMaterials.push( invisibleMaterial );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcolorMaterials.push( deferredMaterials.colorMaterial );\n\t\t\t\t\tnormalDepthMaterials.push( deferredMaterials.normalDepthMaterial );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tobject.userData.colorMaterial = new THREE.MeshFaceMaterial( colorMaterials );\n\t\t\tobject.userData.normalDepthMaterial = new THREE.MeshFaceMaterial( normalDepthMaterials );\n\n\t\t} else {\n\n\t\t\tvar deferredMaterials = createDeferredMaterials( object.material );\n\n\t\t\tobject.userData.colorMaterial = deferredMaterials.colorMaterial;\n\t\t\tobject.userData.normalDepthMaterial = deferredMaterials.normalDepthMaterial;\n\t\t\tobject.userData.transparent = deferredMaterials.transparent;\n\n\t\t}\n\n\t};\n\n\tvar createDeferredMaterials = function ( originalMaterial ) {\n\n\t\tvar deferredMaterials = {};\n\n\t\t// color material\n\t\t// -----------------\n\t\t// \tdiffuse color\n\t\t//\tspecular color\n\t\t//\tshininess\n\t\t//\tdiffuse map\n\t\t//\tvertex colors\n\t\t//\talphaTest\n\t\t// \tmorphs\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( colorShader.uniforms );\n\t\tvar defines = { \"USE_MAP\": !! originalMaterial.map, \"USE_ENVMAP\": !! originalMaterial.envMap, \"GAMMA_INPUT\": true };\n\n\t\tvar material = new THREE.ShaderMaterial( {\n\n\t\t\tfragmentShader: colorShader.fragmentShader,\n\t\t\tvertexShader: \tcolorShader.vertexShader,\n\t\t\tuniforms: \t\tuniforms,\n\t\t\tdefines: \t\tdefines,\n\t\t\tshading:\t\toriginalMaterial.shading\n\n\t\t} );\n\n\t\tif ( originalMaterial instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\tvar diffuse = black;\n\t\t\tvar emissive = originalMaterial.color;\n\n\t\t} else {\n\n\t\t\tvar diffuse = originalMaterial.color;\n\t\t\tvar emissive = originalMaterial.emissive !== undefined ? originalMaterial.emissive : black;\n\n\t\t}\n\n\t\tvar specular = originalMaterial.specular !== undefined ? originalMaterial.specular : black;\n\t\tvar shininess = originalMaterial.shininess !== undefined ? originalMaterial.shininess : 1;\n\t\tvar wrapAround = originalMaterial.wrapAround !== undefined ? ( originalMaterial.wrapAround ? -1 : 1 ) : 1;\n\t\tvar additiveSpecular = originalMaterial.metal !== undefined ? ( originalMaterial.metal ? 1 : -1 ) : -1;\n\n\t\tuniforms.emissive.value.copyGammaToLinear( emissive );\n\t\tuniforms.diffuse.value.copyGammaToLinear( diffuse );\n\t\tuniforms.specular.value.copyGammaToLinear( specular );\n\t\tuniforms.shininess.value = shininess;\n\t\tuniforms.wrapAround.value = wrapAround;\n\t\tuniforms.additiveSpecular.value = additiveSpecular;\n\n\t\tuniforms.map.value = originalMaterial.map;\n\n\t\tif ( originalMaterial.envMap ) {\n\n\t\t\tuniforms.envMap.value = originalMaterial.envMap;\n\t\t\tuniforms.useRefract.value = originalMaterial.envMap.mapping instanceof THREE.CubeRefractionMapping;\n\t\t\tuniforms.refractionRatio.value = originalMaterial.refractionRatio;\n\t\t\tuniforms.combine.value = originalMaterial.combine;\n\t\t\tuniforms.reflectivity.value = originalMaterial.reflectivity;\n\t\t\tuniforms.flipEnvMap.value = ( originalMaterial.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : -1;\n\n\t\t\tuniforms.samplerNormalDepth.value = compNormalDepth.renderTarget2;\n\t\t\tuniforms.viewWidth.value = scaledWidth;\n\t\t\tuniforms.viewHeight.value = scaledHeight;\n\n\t\t\tresizableMaterials.push( { \"material\": material } );\n\n\t\t}\n\n\t\tmaterial.vertexColors = originalMaterial.vertexColors;\n\t\tmaterial.morphTargets = originalMaterial.morphTargets;\n\t\tmaterial.morphNormals = originalMaterial.morphNormals;\n\t\tmaterial.skinning = originalMaterial.skinning;\n\n\t\tmaterial.alphaTest = originalMaterial.alphaTest;\n\t\tmaterial.wireframe = originalMaterial.wireframe;\n\n\t\t// uv repeat and offset setting priorities\n\t\t//\t1. color map\n\t\t//\t2. specular map\n\t\t//\t3. normal map\n\t\t//\t4. bump map\n\n\t\tvar uvScaleMap;\n\n\t\tif ( originalMaterial.map ) {\n\n\t\t\tuvScaleMap = originalMaterial.map;\n\n\t\t} else if ( originalMaterial.specularMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.specularMap;\n\n\t\t} else if ( originalMaterial.normalMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.normalMap;\n\n\t\t} else if ( originalMaterial.bumpMap ) {\n\n\t\t\tuvScaleMap = originalMaterial.bumpMap;\n\n\t\t}\n\n\t\tif ( uvScaleMap !== undefined ) {\n\n\t\t\tvar offset = uvScaleMap.offset;\n\t\t\tvar repeat = uvScaleMap.repeat;\n\n\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t}\n\n\t\tdeferredMaterials.colorMaterial = material;\n\n\t\t// normal + depth material\n\t\t// -----------------\n\t\t//\tvertex normals\n\t\t//\tmorph normals\n\t\t//\tbump map\n\t\t//\tbump scale\n\t\t// clip depth\n\n\t\tif ( originalMaterial.morphTargets || originalMaterial.skinning || originalMaterial.bumpMap ) {\n\n\t\t\tvar uniforms = THREE.UniformsUtils.clone( normalDepthShader.uniforms );\n\t\t\tvar defines = { \"USE_BUMPMAP\": !!originalMaterial.bumpMap };\n\n\t\t\tvar normalDepthMaterial = new THREE.ShaderMaterial( {\n\n\t\t\t\tuniforms: uniforms,\n\t\t\t\tvertexShader: normalDepthShader.vertexShader,\n\t\t\t\tfragmentShader: normalDepthShader.fragmentShader,\n\t\t\t\tshading:\t\toriginalMaterial.shading,\n\t\t\t\tdefines:\t\tdefines,\n\t\t\t\tblending:\t\tTHREE.NoBlending\n\n\t\t\t} );\n\n\t\t\tnormalDepthMaterial.morphTargets = originalMaterial.morphTargets;\n\t\t\tnormalDepthMaterial.morphNormals = originalMaterial.morphNormals;\n\t\t\tnormalDepthMaterial.skinning = originalMaterial.skinning;\n\n\t\t\tif ( originalMaterial.bumpMap ) {\n\n\t\t\t\tuniforms.bumpMap.value = originalMaterial.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = originalMaterial.bumpScale;\n\n\t\t\t\tvar offset = originalMaterial.bumpMap.offset;\n\t\t\t\tvar repeat = originalMaterial.bumpMap.repeat;\n\n\t\t\t\tuniforms.offsetRepeat.value.set( offset.x, offset.y, repeat.x, repeat.y );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tvar normalDepthMaterial = defaultNormalDepthMaterial.clone();\n\n\t\t}\n\n\t\tnormalDepthMaterial.wireframe = originalMaterial.wireframe;\n\t\tnormalDepthMaterial.vertexColors = originalMaterial.vertexColors;\n\n\t\tdeferredMaterials.normalDepthMaterial = normalDepthMaterial;\n\n\t\t//\n\n\t\tdeferredMaterials.transparent = originalMaterial.transparent;\n\n\t\treturn deferredMaterials;\n\n\t};\n\n\tvar updatePointLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\t// skip infinite pointlights\n\t\t// right now you can't switch between infinite and finite pointlights\n\t\t// it's just too messy as they use different proxies\n\n\t\tvar distance = light.distance;\n\n\t\tif ( distance > 0 ) {\n\n\t\t\tlightProxy.scale.set( 1, 1, 1 ).multiplyScalar( distance );\n\t\t\tuniforms[ \"lightRadius\" ].value = distance;\n\n\t\t\tpositionVS.setFromMatrixPosition( light.matrixWorld );\n\t\t\tpositionVS.applyMatrix4( currentCamera.matrixWorldInverse );\n\n\t\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\n\t\t\tlightProxy.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tuniforms[ \"lightRadius\" ].value = Infinity;\n\n\t\t}\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredPointLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: THREE.UniformsUtils.clone( pointLightShader.uniforms ),\n\t\t\tvertexShader: pointLightShader.vertexShader,\n\t\t\tfragmentShader: pointLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\ttransparent:\ttrue,\n\n\t\t\tside: THREE.BackSide\n\n\t\t} );\n\n\t\t// infinite pointlights use full-screen quad proxy\n\t\t// regular pointlights use sphere proxy\n\n\t\tvar geometry;\n\n\t\tif ( light.distance > 0 ) {\n\n\t\t\tgeometry = geometryLightSphere;\n\n\t\t} else {\n\n\t\t\tgeometry = geometryLightPlane;\n\n\t\t\tmaterialLight.depthTest = false;\n\t\t\tmaterialLight.side = THREE.FrontSide;\n\n\t\t}\n\n\t\tmaterialLight.uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tmaterialLight.uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tmaterialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tmaterialLight.uniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometry, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdatePointLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateSpotLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tvar viewMatrix = currentCamera.matrixWorldInverse;\n\t\tvar modelMatrix = light.matrixWorld;\n\n\t\tpositionVS.setFromMatrixPosition( modelMatrix );\n\t\tpositionVS.applyMatrix4( viewMatrix );\n\n\t\tdirectionVS.setFromMatrixPosition( modelMatrix );\n\t\ttempVS.setFromMatrixPosition( light.target.matrixWorld );\n\t\tdirectionVS.sub( tempVS );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( viewMatrix );\n\n\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\tuniforms[ \"lightAngle\" ].value = light.angle;\n\t\tuniforms[ \"lightDistance\" ].value = light.distance;\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredSpotLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( spotLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: uniforms,\n\t\t\tvertexShader: spotLightShader.vertexShader,\n\t\t\tfragmentShader: spotLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateSpotLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateDirectionalLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tdirectionVS.setFromMatrixPosition( light.matrixWorld );\n\t\ttempVS.setFromMatrixPosition( light.target.matrixWorld );\n\t\tdirectionVS.sub( tempVS );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( currentCamera.matrixWorldInverse );\n\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredDirectionalLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( directionalLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: uniforms,\n\t\t\tvertexShader: directionalLightShader.vertexShader,\n\t\t\tfragmentShader: directionalLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateDirectionalLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateHemisphereLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tdirectionVS.setFromMatrixPosition( light.matrixWorld );\n\t\tdirectionVS.normalize();\n\t\tdirectionVS.transformDirection( currentCamera.matrixWorldInverse );\n\n\t\tuniforms[ \"lightDirectionVS\" ].value.copy( directionVS );\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColorSky\" ].value.copyGammaToLinear( light.color );\n\t\tuniforms[ \"lightColorGround\" ].value.copyGammaToLinear( light.groundColor );\n\n\t};\n\n\tvar createDeferredHemisphereLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( hemisphereLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: uniforms,\n\t\t\tvertexShader: hemisphereLightShader.vertexShader,\n\t\t\tfragmentShader: hemisphereLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateHemisphereLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar updateAreaLightProxy = function ( lightProxy ) {\n\n\t\tvar light = lightProxy.userData.originalLight;\n\t\tvar uniforms = lightProxy.material.uniforms;\n\n\t\tvar modelMatrix = light.matrixWorld;\n\t\tvar viewMatrix = currentCamera.matrixWorldInverse;\n\n\t\tpositionVS.setFromMatrixPosition( modelMatrix );\n\t\tpositionVS.applyMatrix4( viewMatrix );\n\n\t\tuniforms[ \"lightPositionVS\" ].value.copy( positionVS );\n\n\t\trightVS.copy( light.right );\n\t\trightVS.transformDirection( modelMatrix );\n\t\trightVS.transformDirection( viewMatrix );\n\n\t\tnormalVS.copy( light.normal );\n\t\tnormalVS.transformDirection( modelMatrix );\n\t\tnormalVS.transformDirection( viewMatrix );\n\n\t\tupVS.crossVectors( rightVS, normalVS );\n\t\tupVS.normalize();\n\n\t\tuniforms[ \"lightRightVS\" ].value.copy( rightVS );\n\t\tuniforms[ \"lightNormalVS\" ].value.copy( normalVS );\n\t\tuniforms[ \"lightUpVS\" ].value.copy( upVS );\n\n\t\tuniforms[ \"lightWidth\" ].value = light.width;\n\t\tuniforms[ \"lightHeight\" ].value = light.height;\n\n\t\tuniforms[ \"constantAttenuation\" ].value = light.constantAttenuation;\n\t\tuniforms[ \"linearAttenuation\" ].value = light.linearAttenuation;\n\t\tuniforms[ \"quadraticAttenuation\" ].value = light.quadraticAttenuation;\n\n\t\t// linear space colors\n\n\t\tvar intensity = light.intensity * light.intensity;\n\n\t\tuniforms[ \"lightIntensity\" ].value = intensity;\n\t\tuniforms[ \"lightColor\" ].value.copyGammaToLinear( light.color );\n\n\t};\n\n\tvar createDeferredAreaLight = function ( light ) {\n\n\t\t// setup light material\n\n\t\tvar uniforms = THREE.UniformsUtils.clone( areaLightShader.uniforms );\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: uniforms,\n\t\t\tvertexShader: areaLightShader.vertexShader,\n\t\t\tfragmentShader: areaLightShader.fragmentShader,\n\n\t\t\tblending:\t\tTHREE.AdditiveBlending,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\ttransparent:\ttrue\n\n\t\t} );\n\n\t\tuniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tuniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tuniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\t\tuniforms[ 'samplerNormalDepth' ].value = compNormalDepth.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for color and intensity updates\n\n\t\tmeshLight.userData.originalLight = light;\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\t// sync proxy uniforms to the original light\n\n\t\tupdateAreaLightProxy( meshLight );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar createDeferredEmissiveLight = function () {\n\n\t\t// setup light material\n\n\t\tvar materialLight = new THREE.ShaderMaterial( {\n\n\t\t\tuniforms: THREE.UniformsUtils.clone( emissiveLightShader.uniforms ),\n\t\t\tvertexShader: emissiveLightShader.vertexShader,\n\t\t\tfragmentShader: emissiveLightShader.fragmentShader,\n\t\t\tdepthTest:\t\tfalse,\n\t\t\tdepthWrite:\t\tfalse,\n\t\t\tblending:\t\tTHREE.NoBlending\n\n\t\t} );\n\n\t\tmaterialLight.uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\tmaterialLight.uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\tmaterialLight.uniforms[ 'samplerColor' ].value = compColor.renderTarget2;\n\n\t\t// create light proxy mesh\n\n\t\tvar meshLight = new THREE.Mesh( geometryLightPlane, materialLight );\n\n\t\t// keep reference for size reset\n\n\t\tresizableMaterials.push( { \"material\": materialLight } );\n\n\t\treturn meshLight;\n\n\t};\n\n\tvar initDeferredProperties = function ( object ) {\n\n\t\tif ( object.userData.deferredInitialized ) return;\n\n\t\tif ( object.material ) initDeferredMaterials( object );\n\n\t\tif ( object instanceof THREE.PointLight ) {\n\n\t\t\tvar proxy = createDeferredPointLight( object );\n\n\t\t\tif ( object.distance > 0 ) {\n\n\t\t\t\tlightSceneProxy.add( proxy );\n\n\t\t\t} else {\n\n\t\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t\t}\n\n\t\t} else if ( object instanceof THREE.SpotLight ) {\n\n\t\t\tvar proxy = createDeferredSpotLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.DirectionalLight ) {\n\n\t\t\tvar proxy = createDeferredDirectionalLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.HemisphereLight ) {\n\n\t\t\tvar proxy = createDeferredHemisphereLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t} else if ( object instanceof THREE.AreaLight ) {\n\n\t\t\tvar proxy = createDeferredAreaLight( object );\n\t\t\tlightSceneFullscreen.add( proxy );\n\n\t\t}\n\n\t\tobject.userData.deferredInitialized = true;\n\n\t};\n\n\t//\n\n\tvar setMaterialColor = function ( object ) {\n\n\t\tif ( object.material ) {\n\n\t\t\tif ( object.userData.transparent ) {\n\n\t\t\t\tobject.material = invisibleMaterial;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = object.userData.colorMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tvar setMaterialNormalDepth = function ( object ) {\n\n\t\tif ( object.material ) {\n\n\t\t\tif ( object.userData.transparent ) {\n\n\t\t\t\tobject.material = invisibleMaterial;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = object.userData.normalDepthMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// external API\n\n\tthis.setAntialias = function ( enabled ) {\n\n\t\tantialias = enabled;\n\n\t\tif ( antialias ) {\n\n\t\t\teffectFXAA.enabled = true;\n\t\t\tcompositePass.renderToScreen = false;\n\n\t\t} else {\n\n\t\t\teffectFXAA.enabled = false;\n\t\t\tcompositePass.renderToScreen = true;\n\t\t}\n\n\t};\n\n\tthis.getAntialias = function () {\n\n\t\treturn antialias;\n\n\t};\n\n\tthis.addEffect = function ( effect, normalDepthUniform, colorUniform ) {\n\n\t\tif ( effect.material && effect.uniforms ) {\n\n\t\t\tif ( normalDepthUniform ) effect.uniforms[ normalDepthUniform ].value = compNormalDepth.renderTarget2;\n\t\t\tif ( colorUniform ) \t effect.uniforms[ colorUniform ].value = compColor.renderTarget2;\n\n\t\t\tif ( normalDepthUniform || colorUniform ) {\n\n\t\t\t\tresizableMaterials.push( { \"material\": effect.material, \"normalDepth\": normalDepthUniform, \"color\": colorUniform } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tcompFinal.insertPass( effect, -1 );\n\n\t};\n\n\tthis.setScale = function ( scale ) {\n\n\t\tcurrentScale = scale;\n\n\t\tscaledWidth = Math.floor( currentScale * fullWidth );\n\t\tscaledHeight = Math.floor( currentScale * fullHeight );\n\n\t\tcompNormalDepth.setSize( scaledWidth, scaledHeight );\n\t\tcompColor.setSize( scaledWidth, scaledHeight );\n\t\tcompLight.setSize( scaledWidth, scaledHeight );\n\t\tcompFinal.setSize( scaledWidth, scaledHeight );\n\n\t\tcompColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\t\tcompLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\tfor ( var i = 0, il = resizableMaterials.length; i < il; i ++ ) {\n\n\t\t\tvar materialEntry = resizableMaterials[ i ];\n\n\t\t\tvar material = materialEntry.material;\n\t\t\tvar uniforms = material.uniforms;\n\n\t\t\tvar colorLabel = materialEntry.color !== undefined ? materialEntry.color : 'samplerColor';\n\t\t\tvar normalDepthLabel = materialEntry.normalDepth !== undefined ? materialEntry.normalDepth : 'samplerNormalDepth';\n\n\t\t\tif ( uniforms[ colorLabel ] ) uniforms[ colorLabel ].value = compColor.renderTarget2;\n\t\t\tif ( uniforms[ normalDepthLabel ] ) uniforms[ normalDepthLabel ].value = compNormalDepth.renderTarget2;\n\n\t\t\tif ( uniforms[ 'viewWidth' ] ) uniforms[ \"viewWidth\" ].value = scaledWidth;\n\t\t\tif ( uniforms[ 'viewHeight' ] ) uniforms[ \"viewHeight\" ].value = scaledHeight;\n\n\t\t}\n\n\t\tcompositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;\n\n\t\teffectFXAA.uniforms[ 'resolution' ].value.set( 1 / fullWidth, 1 / fullHeight );\n\n\t};\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tfullWidth = width;\n\t\tfullHeight = height;\n\n\t\tthis.renderer.setSize( fullWidth, fullHeight );\n\n\t\tthis.setScale( currentScale );\n\n\t};\n\n\t//\n\n\tfunction updateLightProxy ( proxy ) {\n\n\t\tvar uniforms = proxy.material.uniforms;\n\n\t\tif ( uniforms[ \"matProjInverse\" ] ) uniforms[ \"matProjInverse\" ].value = projectionMatrixInverse;\n\t\tif ( uniforms[ \"matView\" ] ) uniforms[ \"matView\" ].value = currentCamera.matrixWorldInverse;\n\n\t\tvar originalLight = proxy.userData.originalLight;\n\n\t\tif ( originalLight ) {\n\n\t\t\tproxy.visible = originalLight.visible;\n\n\t\t\tif ( originalLight instanceof THREE.PointLight ) {\n\n\t\t\t\tupdatePointLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.SpotLight ) {\n\n\t\t\t\tupdateSpotLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tupdateDirectionalLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tupdateHemisphereLightProxy( proxy );\n\n\t\t\t} else if ( originalLight instanceof THREE.AreaLight ) {\n\n\t\t\t\tupdateAreaLightProxy( proxy );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\t// setup deferred properties\n\n\t\tif ( ! scene.userData.lightSceneProxy ) {\n\n\t\t\tscene.userData.lightSceneProxy = new THREE.Scene();\n\t\t\tscene.userData.lightSceneFullscreen = new THREE.Scene();\n\n\t\t\tvar meshLight = createDeferredEmissiveLight();\n\t\t\tscene.userData.lightSceneFullscreen.add( meshLight );\n\n\t\t}\n\n\t\tcurrentCamera = camera;\n\n\t\tlightSceneProxy = scene.userData.lightSceneProxy;\n\t\tlightSceneFullscreen = scene.userData.lightSceneFullscreen;\n\n\t\tpassColor.camera = currentCamera;\n\t\tpassNormalDepth.camera = currentCamera;\n\t\tpassLightProxy.camera = currentCamera;\n\t\tpassLightFullscreen.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\n\t\tpassColor.scene = scene;\n\t\tpassNormalDepth.scene = scene;\n\t\tpassLightFullscreen.scene = lightSceneFullscreen;\n\t\tpassLightProxy.scene = lightSceneProxy;\n\n\t\tscene.traverse( initDeferredProperties );\n\n\t\t// update scene graph only once per frame\n\t\t// (both color and normalDepth passes use exactly the same scene state)\n\n\t\tscene.autoUpdate = false;\n\t\tscene.updateMatrixWorld();\n\n\t\t// 1) g-buffer normals + depth pass\n\n\t\tscene.traverse( setMaterialNormalDepth );\n\n\t\t// clear shared depth buffer\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = true;\n\n\t\t// write 1 to shared stencil buffer\n\t\t// for non-background pixels\n\n\t\t//gl.enable( gl.STENCIL_TEST );\n\t\tgl.stencilOp( gl.REPLACE, gl.REPLACE, gl.REPLACE );\n\t\tgl.stencilFunc( gl.ALWAYS, 1, 0xffffffff );\n\t\tgl.clearStencil( 0 );\n\n\t\tcompNormalDepth.render();\n\n\t\t// just touch foreground pixels (stencil == 1)\n\t\t// both in color and light passes\n\n\t\tgl.stencilFunc( gl.EQUAL, 1, 0xffffffff );\n\t\tgl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );\n\n\t\t// 2) g-buffer color pass\n\n\t\tscene.traverse( setMaterialColor );\n\n\t\t// must use clean slate depth buffer\n\t\t// otherwise there are z-fighting glitches\n\t\t// not enough precision between two geometry passes\n\t\t// just to use EQUAL depth test\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = false;\n\n\t\tcompColor.render();\n\n\t\t// 3) light pass\n\n\t\t// do not clear depth buffer in this pass\n\t\t// depth from geometry pass is used for light culling\n\t\t// (write light proxy color pixel if behind scene pixel)\n\n\t\tthis.renderer.autoClearDepth = false;\n\n\t\tscene.autoUpdate = true;\n\n\t\tgl.depthFunc( gl.GEQUAL );\n\n\t\tprojectionMatrixInverse.getInverse( currentCamera.projectionMatrix );\n\n\t\tfor ( var i = 0, il = lightSceneProxy.children.length; i < il; i ++ ) {\n\n\t\t\tvar proxy = lightSceneProxy.children[ i ];\n\t\t\tupdateLightProxy( proxy );\n\n\t\t}\n\n\t\tfor ( var i = 0, il = lightSceneFullscreen.children.length; i < il; i ++ ) {\n\n\t\t\tvar proxy = lightSceneFullscreen.children[ i ];\n\t\t\tupdateLightProxy( proxy );\n\n\t\t}\n\n\t\tcompLight.render();\n\n\t\t// 4) composite pass\n\n\t\t// return back to usual depth and stencil handling state\n\n\t\tthis.renderer.autoClearDepth = true;\n\t\tthis.renderer.autoClearStencil = true;\n\t\tgl.depthFunc( gl.LEQUAL );\n\t\tgl.disable( gl.STENCIL_TEST );\n\n\t\tcompFinal.render( 0.1 );\n\n\t};\n\n\t//\n\n\tvar createRenderTargets = function ( ) {\n\n\t\tvar rtParamsFloatLinear = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: true,\n\t\t\t\t\t\t\t\t\tformat: THREE.RGBAFormat, type: THREE.FloatType };\n\n\t\tvar rtParamsFloatNearest = { minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter, stencilBuffer: true,\n\t\t\t\t\t\t\t\t\t format: THREE.RGBAFormat, type: THREE.FloatType };\n\n\t\tvar rtParamsUByte = { minFilter: THREE.NearestFilter, magFilter: THREE.LinearFilter, stencilBuffer: false,\n\t\t\t\t\t\t\t format: THREE.RGBFormat, type: THREE.UnsignedByteType };\n\n\t\t// g-buffers\n\n\t\tvar rtColor = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );\n\t\tvar rtNormalDepth = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatNearest );\n\t\tvar rtLight = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsFloatLinear );\n\t\tvar rtFinal = new THREE.WebGLRenderTarget( scaledWidth, scaledHeight, rtParamsUByte );\n\n\t\trtColor.generateMipmaps = false;\n\t\trtNormalDepth.generateMipmaps = false;\n\t\trtLight.generateMipmaps = false;\n\t\trtFinal.generateMipmaps = false;\n\n\t\t// normal + depth composer\n\n\t\tpassNormalDepth = new THREE.RenderPass();\n\t\tpassNormalDepth.clear = true;\n\n\t\tcompNormalDepth = new THREE.EffectComposer( _this.renderer, rtNormalDepth );\n\t\tcompNormalDepth.addPass( passNormalDepth );\n\n\t\t// color composer\n\n\t\tpassColor = new THREE.RenderPass();\n\t\tpassColor.clear = true;\n\n\t\tcompColor = new THREE.EffectComposer( _this.renderer, rtColor );\n\t\tcompColor.addPass( passColor );\n\n\t\tcompColor.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\t// light composer\n\n\t\tpassLightFullscreen = new THREE.RenderPass();\n\t\tpassLightFullscreen.clear = true;\n\n\t\tpassLightProxy = new THREE.RenderPass();\n\t\tpassLightProxy.clear = false;\n\n\t\tcompLight = new THREE.EffectComposer( _this.renderer, rtLight );\n\t\tcompLight.addPass( passLightFullscreen );\n\t\tcompLight.addPass( passLightProxy );\n\n\t\tcompLight.renderTarget2.shareDepthFrom = compNormalDepth.renderTarget2;\n\n\t\t// final composer\n\n\t\tcompositePass = new THREE.ShaderPass( compositeShader );\n\t\tcompositePass.uniforms[ 'samplerLight' ].value = compLight.renderTarget2;\n\t\tcompositePass.uniforms[ 'brightness' ].value = brightness;\n\t\tcompositePass.material.blending = THREE.NoBlending;\n\t\tcompositePass.clear = true;\n\n\t\tvar defines;\n\n\t\tswitch ( tonemapping ) {\n\n\t\t\tcase THREE.SimpleOperator: defines = { \"TONEMAP_SIMPLE\": true }; break;\n\t\t\tcase THREE.LinearOperator: defines = { \"TONEMAP_LINEAR\": true }; break;\n\t\t\tcase THREE.ReinhardOperator: defines = { \"TONEMAP_REINHARD\": true }; break;\n\t\t\tcase THREE.FilmicOperator: defines = { \"TONEMAP_FILMIC\": true }; break;\n\t\t\tcase THREE.UnchartedOperator: defines = { \"TONEMAP_UNCHARTED\": true }; break;\n\n\t\t}\n\n\t\tcompositePass.material.defines = defines;\n\n\t\t// FXAA\n\n\t\teffectFXAA = new THREE.ShaderPass( THREE.FXAAShader );\n\t\teffectFXAA.uniforms[ 'resolution' ].value.set( 1 / fullWidth, 1 / fullHeight );\n\t\teffectFXAA.renderToScreen = true;\n\n\t\t//\n\n\t\tcompFinal = new THREE.EffectComposer( _this.renderer, rtFinal );\n\t\tcompFinal.addPass( compositePass );\n\t\tcompFinal.addPass( effectFXAA );\n\n\t\tif ( antialias ) {\n\n\t\t\teffectFXAA.enabled = true;\n\t\t\tcompositePass.renderToScreen = false;\n\n\t\t} else {\n\n\t\t\teffectFXAA.enabled = false;\n\t\t\tcompositePass.renderToScreen = true;\n\n\t\t}\n\n\t};\n\n\t// init\n\n\tcreateRenderTargets();\n\n};\n\n// tonemapping operator types\n\nTHREE.NoOperator = 0;\nTHREE.SimpleOperator = 1;\nTHREE.LinearOperator = 2;\nTHREE.ReinhardOperator = 3;\nTHREE.FilmicOperator = 4;\nTHREE.UnchartedOperator = 5;\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/CSS2DRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/CSS2DRenderer.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CSS2DObject = function ( element ) {\n\n\tTHREE.Object3D.call( this );\n\n\tthis.element = element;\n\tthis.element.style.position = 'absolute';\n\n\tthis.addEventListener( 'removed', function ( event ) {\n\n\t\tif ( this.element.parentNode !== null ) {\n\n\t\t\tthis.element.parentNode.removeChild( this.element );\n\n\t\t}\n\n\t} );\n\n};\n\nTHREE.CSS2DObject.prototype = Object.create( THREE.Object3D.prototype );\n\n//\n\nTHREE.CSS2DRenderer = function () {\n\n\tconsole.log( 'THREE.CSS2DRenderer', THREE.REVISION );\n\n\tvar _width, _height;\n\tvar _widthHalf, _heightHalf;\n\n\tvar vector = new THREE.Vector3();\n\tvar viewMatrix = new THREE.Matrix4();\n\tvar viewProjectionMatrix = new THREE.Matrix4();\n\n\tvar domElement = document.createElement( 'div' );\n\tdomElement.style.overflow = 'hidden';\n\n\tthis.domElement = domElement;\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width;\n\t\t_height = height;\n\n\t\t_widthHalf = _width / 2;\n\t\t_heightHalf = _height / 2;\n\n\t\tdomElement.style.width = width + 'px';\n\t\tdomElement.style.height = height + 'px';\n\n\t};\n\n\tvar renderObject = function ( object, camera ) {\n\n\t\tif ( object instanceof THREE.CSS2DObject ) {\n\n\t\t\tvector.setFromMatrixPosition( object.matrixWorld );\n\t\t\tvector.applyProjection( viewProjectionMatrix );\n\n\t\t\tvar element = object.element;\n\t\t\tvar style = 'translate(-50%,-50%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\telement.style.WebkitTransform = style;\n\t\t\telement.style.MozTransform = style;\n\t\t\telement.style.oTransform = style;\n\t\t\telement.style.transform = style;\n\n\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( var i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( object.children[ i ], camera );\n\n\t\t}\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tcamera.matrixWorldInverse.getInverse( camera.matrixWorld );\n\n\t\tviewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );\n\t\tviewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix );\n\n\t\trenderObject( scene, camera );\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Renderers/SVGRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Renderers/SVGRenderer.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.SVGRenderer = function () {\n\n\tconsole.log( 'THREE.SVGRenderer', THREE.REVISION );\n\n\tvar _this = this,\n\t_renderData, _elements, _lights,\n\t_projector = new THREE.Projector(),\n\t_svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'),\n\t_svgWidth, _svgHeight, _svgWidthHalf, _svgHeightHalf,\n\n\t_v1, _v2, _v3, _v4,\n\n\t_clipBox = new THREE.Box2(),\n\t_elemBox = new THREE.Box2(),\n\n\t_color = new THREE.Color(),\n\t_diffuseColor = new THREE.Color(),\n\t_ambientLight = new THREE.Color(),\n\t_directionalLights = new THREE.Color(),\n\t_pointLights = new THREE.Color(),\n\t_clearColor = new THREE.Color(),\n\t_clearAlpha = 1,\n\n\t_w, // z-buffer to w-buffer\n\t_vector3 = new THREE.Vector3(), // Needed for PointLight\n\t_centroid = new THREE.Vector3(),\n\n\t_svgPathPool = [], _svgLinePool = [], _svgRectPool = [],\n\t_svgNode, _pathCount = 0, _lineCount = 0, _rectCount = 0,\n\t_quality = 1;\n\n\tthis.domElement = _svg;\n\n\tthis.autoClear = true;\n\tthis.sortObjects = true;\n\tthis.sortElements = true;\n\n\tthis.info = {\n\n\t\trender: {\n\n\t\t\tvertices: 0,\n\t\t\tfaces: 0\n\n\t\t}\n\n\t}\n\n\tthis.setQuality = function( quality ) {\n\n\t\tswitch(quality) {\n\n\t\t\tcase \"high\": _quality = 1; break;\n\t\t\tcase \"low\": _quality = 0; break;\n\n\t\t}\n\n\t};\n\n\t// WebGLRenderer compatibility\n\n\tthis.supportsVertexTextures = function () {};\n\tthis.setFaceCulling = function () {};\n\n\tthis.setClearColor = function ( color, alpha ) {\n\n\t\t_clearColor.set( color );\n\t\t_clearAlpha = alpha !== undefined ? alpha : 1;\n\n\t};\n\n\tthis.setSize = function( width, height ) {\n\n\t\t_svgWidth = width; _svgHeight = height;\n\t\t_svgWidthHalf = _svgWidth / 2; _svgHeightHalf = _svgHeight / 2;\n\n\t\t_svg.setAttribute( 'viewBox', ( - _svgWidthHalf ) + ' ' + ( - _svgHeightHalf ) + ' ' + _svgWidth + ' ' + _svgHeight );\n\t\t_svg.setAttribute( 'width', _svgWidth );\n\t\t_svg.setAttribute( 'height', _svgHeight );\n\n\t\t_clipBox.min.set( - _svgWidthHalf, - _svgHeightHalf );\n\t\t_clipBox.max.set( _svgWidthHalf, _svgHeightHalf );\n\n\t};\n\n\tthis.clear = function () {\n\n\t\t_pathCount = 0;\n\t\t_lineCount = 0;\n\t\t_rectCount = 0;\n\n\t\twhile ( _svg.childNodes.length > 0 ) {\n\n\t\t\t_svg.removeChild( _svg.childNodes[ 0 ] );\n\n\t\t}\n\t\t\n\t\t_svg.style.backgroundColor = 'rgba(' + ( ( _clearColor.r * 255 ) | 0 ) + ',' + ( ( _clearColor.g * 255 ) | 0 ) + ',' + ( ( _clearColor.b * 255 ) | 0 ) + ',' + _clearAlpha + ')';\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tif ( camera instanceof THREE.Camera === false ) {\n\n\t\t\tconsole.error( 'THREE.SVGRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.autoClear === true ) this.clear();\n\n\t\t_this.info.render.vertices = 0;\n\t\t_this.info.render.faces = 0;\n\n\t\t_renderData = _projector.projectScene( scene, camera, this.sortObjects, this.sortElements );\n\t\t_elements = _renderData.elements;\n\t\t_lights = _renderData.lights;\n\n\t\tcalculateLights( _lights );\n\n\t\tfor ( var e = 0, el = _elements.length; e < el; e ++ ) {\n\n\t\t\tvar element = _elements[ e ];\n\t\t\tvar material = element.material;\n\n\t\t\tif ( material === undefined || material.opacity === 0 ) continue;\n\n\t\t\t_elemBox.makeEmpty();\n\n\t\t\tif ( element instanceof THREE.RenderableSprite ) {\n\n\t\t\t\t_v1 = element;\n\t\t\t\t_v1.x *= _svgWidthHalf; _v1.y *= - _svgHeightHalf;\n\n\t\t\t\trenderSprite( _v1, element, material );\n\n\t\t\t} else if ( element instanceof THREE.RenderableLine ) {\n\n\t\t\t\t_v1 = element.v1; _v2 = element.v2;\n\n\t\t\t\t_v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;\n\n\t\t\t\t_elemBox.setFromPoints( [ _v1.positionScreen, _v2.positionScreen ] );\n\n\t\t\t\tif ( _clipBox.isIntersectionBox( _elemBox ) === true ) {\n\n\t\t\t\t\trenderLine( _v1, _v2, element, material );\n\n\t\t\t\t}\n\n\t\t\t} else if ( element instanceof THREE.RenderableFace ) {\n\n\t\t\t\t_v1 = element.v1; _v2 = element.v2; _v3 = element.v3;\n\n\t\t\t\tif ( _v1.positionScreen.z < -1 || _v1.positionScreen.z > 1 ) continue;\n\t\t\t\tif ( _v2.positionScreen.z < -1 || _v2.positionScreen.z > 1 ) continue;\n\t\t\t\tif ( _v3.positionScreen.z < -1 || _v3.positionScreen.z > 1 ) continue;\n\n\t\t\t\t_v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf;\n\t\t\t\t_v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= - _svgHeightHalf;\n\n\t\t\t\t_elemBox.setFromPoints( [\n\t\t\t\t\t_v1.positionScreen,\n\t\t\t\t\t_v2.positionScreen,\n\t\t\t\t\t_v3.positionScreen\n\t\t\t\t] );\n\n\t\t\t\tif ( _clipBox.isIntersectionBox( _elemBox ) === true ) {\n\n\t\t\t\t\trenderFace3( _v1, _v2, _v3, element, material );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction calculateLights( lights ) {\n\n\t\t_ambientLight.setRGB( 0, 0, 0 );\n\t\t_directionalLights.setRGB( 0, 0, 0 );\n\t\t_pointLights.setRGB( 0, 0, 0 );\n\n\t\tfor ( var l = 0, ll = lights.length; l < ll; l++ ) {\n\n\t\t\tvar light = lights[ l ];\n\t\t\tvar lightColor = light.color;\n\n\t\t\tif ( light instanceof THREE.AmbientLight ) {\n\n\t\t\t\t_ambientLight.r += lightColor.r;\n\t\t\t\t_ambientLight.g += lightColor.g;\n\t\t\t\t_ambientLight.b += lightColor.b;\n\n\t\t\t} else if ( light instanceof THREE.DirectionalLight ) {\n\n\t\t\t\t_directionalLights.r += lightColor.r;\n\t\t\t\t_directionalLights.g += lightColor.g;\n\t\t\t\t_directionalLights.b += lightColor.b;\n\n\t\t\t} else if ( light instanceof THREE.PointLight ) {\n\n\t\t\t\t_pointLights.r += lightColor.r;\n\t\t\t\t_pointLights.g += lightColor.g;\n\t\t\t\t_pointLights.b += lightColor.b;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction calculateLight( lights, position, normal, color ) {\n\n\t\tfor ( var l = 0, ll = lights.length; l < ll; l ++ ) {\n\n\t\t\tvar light = lights[ l ];\n\t\t\tvar lightColor = light.color;\n\n\t\t\tif ( light instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tvar lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld ).normalize();\n\n\t\t\t\tvar amount = normal.dot( lightPosition );\n\n\t\t\t\tif ( amount <= 0 ) continue;\n\n\t\t\t\tamount *= light.intensity;\n\n\t\t\t\tcolor.r += lightColor.r * amount;\n\t\t\t\tcolor.g += lightColor.g * amount;\n\t\t\t\tcolor.b += lightColor.b * amount;\n\n\t\t\t} else if ( light instanceof THREE.PointLight ) {\n\n\t\t\t\tvar lightPosition = _vector3.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tvar amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );\n\n\t\t\t\tif ( amount <= 0 ) continue;\n\n\t\t\t\tamount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 );\n\n\t\t\t\tif ( amount == 0 ) continue;\n\n\t\t\t\tamount *= light.intensity;\n\n\t\t\t\tcolor.r += lightColor.r * amount;\n\t\t\t\tcolor.g += lightColor.g * amount;\n\t\t\t\tcolor.b += lightColor.b * amount;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction renderSprite( v1, element, material ) {\n\n\t\tvar scaleX = element.scale.x * _svgWidthHalf;\n\t\tvar scaleY = element.scale.y * _svgHeightHalf;\n\n\t\t_svgNode = getRectNode( _rectCount ++ );\n\n\t\t_svgNode.setAttribute( 'x', v1.x - ( scaleX * 0.5 ) );\n\t\t_svgNode.setAttribute( 'y', v1.y - ( scaleY * 0.5 ) );\n\t\t_svgNode.setAttribute( 'width', scaleX );\n\t\t_svgNode.setAttribute( 'height', scaleY );\n\n\t\tif ( material instanceof THREE.SpriteMaterial ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: ' + material.color.getStyle() );\n\n\t\t}\n\n\t\t_svg.appendChild( _svgNode );\n\n\t}\n\n\tfunction renderLine( v1, v2, element, material ) {\n\n\t\t_svgNode = getLineNode( _lineCount ++ );\n\n\t\t_svgNode.setAttribute( 'x1', v1.positionScreen.x );\n\t\t_svgNode.setAttribute( 'y1', v1.positionScreen.y );\n\t\t_svgNode.setAttribute( 'x2', v2.positionScreen.x );\n\t\t_svgNode.setAttribute( 'y2', v2.positionScreen.y );\n\n\t\tif ( material instanceof THREE.LineBasicMaterial ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: none; stroke: ' + material.color.getStyle() + '; stroke-width: ' + material.linewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.linecap + '; stroke-linejoin: ' + material.linejoin );\n\n\t\t\t_svg.appendChild( _svgNode );\n\n\t\t}\n\n\t}\n\n\tfunction renderFace3( v1, v2, v3, element, material ) {\n\n\t\t_this.info.render.vertices += 3;\n\t\t_this.info.render.faces ++;\n\n\t\t_svgNode = getPathNode( _pathCount ++ );\n\t\t_svgNode.setAttribute( 'd', 'M ' + v1.positionScreen.x + ' ' + v1.positionScreen.y + ' L ' + v2.positionScreen.x + ' ' + v2.positionScreen.y + ' L ' + v3.positionScreen.x + ',' + v3.positionScreen.y + 'z' );\n\n\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t_color.copy( material.color );\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t_color.multiply( element.color );\n\n\t\t\t}\n\n\t\t} else if ( material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t_diffuseColor.copy( material.color );\n\n\t\t\tif ( material.vertexColors === THREE.FaceColors ) {\n\n\t\t\t\t_diffuseColor.multiply( element.color );\n\n\t\t\t}\n\n\t\t\t_color.copy( _ambientLight );\n\n\t\t\t_centroid.copy( v1.positionWorld ).add( v2.positionWorld ).add( v3.positionWorld ).divideScalar( 3 );\n\n\t\t\tcalculateLight( _lights, _centroid, element.normalModel, _color );\n\n\t\t\t_color.multiply( _diffuseColor ).add( material.emissive );\n\n\t\t} else if ( material instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\t_w = 1 - ( material.__2near / (material.__farPlusNear - element.z * material.__farMinusNear) );\n\t\t\t_color.setRGB( _w, _w, _w );\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\tvar normal = element.normalModelView;\n\n\t\t\t_color.setRGB( normal.x, normal.y, normal.z ).multiplyScalar( 0.5 ).addScalar( 0.5 );\n\n\t\t}\n\n\t\tif ( material.wireframe ) {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: none; stroke: ' + _color.getStyle() + '; stroke-width: ' + material.wireframeLinewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.wireframeLinecap + '; stroke-linejoin: ' + material.wireframeLinejoin );\n\n\t\t} else {\n\n\t\t\t_svgNode.setAttribute( 'style', 'fill: ' + _color.getStyle() + '; fill-opacity: ' + material.opacity );\n\n\t\t}\n\n\t\t_svg.appendChild( _svgNode );\n\n\t}\n\n\tfunction getLineNode( id ) {\n\n\t\tif ( _svgLinePool[ id ] == null ) {\n\n\t\t\t_svgLinePool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'line' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgLinePool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgLinePool[ id ];\n\n\t\t}\n\n\t\treturn _svgLinePool[ id ];\n\n\t}\n\n\tfunction getPathNode( id ) {\n\n\t\tif ( _svgPathPool[ id ] == null ) {\n\n\t\t\t_svgPathPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgPathPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgPathPool[ id ];\n\n\t\t}\n\n\t\treturn _svgPathPool[ id ];\n\n\t}\n\n\tfunction getRectNode( id ) {\n\n\t\tif ( _svgRectPool[ id ] == null ) {\n\n\t\t\t_svgRectPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'rect' );\n\n\t\t\tif ( _quality == 0 ) {\n\n\t\t\t\t_svgRectPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed\n\n\t\t\t}\n\n\t\t\treturn _svgRectPool[ id ];\n\n\t\t}\n\n\t\treturn _svgRectPool[ id ];\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/DeviceOrientationControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/DeviceOrientationControls.js",
"module-type": "library",
"text": "/**\n * @author richt / http://richt.me\n * @author WestLangley / http://github.com/WestLangley\n *\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nTHREE.DeviceOrientationControls = function ( object ) {\n\n\tvar scope = this;\n\n\tthis.object = object;\n\n\tthis.object.rotation.reorder( \"YXZ\" );\n\n\tthis.freeze = true;\n\n\tthis.deviceOrientation = {};\n\n\tthis.screenOrientation = 0;\n\n\tvar onDeviceOrientationChangeEvent = function ( event ) {\n\n\t\tscope.deviceOrientation = event;\n\n\t};\n\n\tvar onScreenOrientationChangeEvent = function () {\n\n\t\tscope.screenOrientation = window.orientation || 0;\n\n\t};\n\n\t// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n\tvar setObjectQuaternion = function () {\n\n\t\tvar zee = new THREE.Vector3( 0, 0, 1 );\n\n\t\tvar euler = new THREE.Euler();\n\n\t\tvar q0 = new THREE.Quaternion();\n\n\t\tvar q1 = new THREE.Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n\t\treturn function ( quaternion, alpha, beta, gamma, orient ) {\n\n\t\t\teuler.set( beta, alpha, - gamma, 'YXZ' ); // 'ZXY' for the device, but 'YXZ' for us\n\n\t\t\tquaternion.setFromEuler( euler ); // orient the device\n\n\t\t\tquaternion.multiply( q1 ); // camera looks out the back of the device, not the top\n\n\t\t\tquaternion.multiply( q0.setFromAxisAngle( zee, - orient ) ); // adjust for screen orientation\n\n\t\t}\n\n\t}();\n\n\tthis.connect = function() {\n\n\t\tonScreenOrientationChangeEvent(); // run once on load\n\n\t\twindow.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t\tscope.freeze = false;\n\n\t};\n\n\tthis.disconnect = function() {\n\n\t\tscope.freeze = true;\n\n\t\twindow.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n\t\twindow.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n\t};\n\n\tthis.update = function () {\n\n\t\tif ( scope.freeze ) return;\n\n\t\tvar alpha = scope.deviceOrientation.gamma ? THREE.Math.degToRad( scope.deviceOrientation.alpha ) : 0; // Z\n\t\tvar beta = scope.deviceOrientation.beta ? THREE.Math.degToRad( scope.deviceOrientation.beta ) : 0; // X'\n\t\tvar gamma = scope.deviceOrientation.gamma ? THREE.Math.degToRad( scope.deviceOrientation.gamma ) : 0; // Y''\n\t\tvar orient = scope.screenOrientation ? THREE.Math.degToRad( scope.screenOrientation ) : 0; // O\n\n\t\tsetObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/EditorControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/EditorControls.js",
"module-type": "library",
"text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n */\n\nTHREE.EditorControls = function ( object, domElement ) {\n\n\tdomElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\tthis.center = new THREE.Vector3();\n\n\t// internals\n\n\tvar scope = this;\n\tvar vector = new THREE.Vector3();\n\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2 };\n\tvar state = STATE.NONE;\n\n\tvar center = this.center;\n\tvar normalMatrix = new THREE.Matrix3();\n\tvar pointer = new THREE.Vector2();\n\tvar pointerOld = new THREE.Vector2();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\n\tthis.focus = function ( target, frame ) {\n\n\t\tvar scale = new THREE.Vector3();\n\t\ttarget.matrixWorld.decompose( center, new THREE.Quaternion(), scale );\n\n\t\tif ( frame && target.geometry ) {\n\n\t\t\tscale = ( scale.x + scale.y + scale.z ) / 3;\n\t\t\tcenter.add(target.geometry.boundingSphere.center.clone().multiplyScalar( scale ));\n\t\t\tvar radius = target.geometry.boundingSphere.radius * ( scale );\n\t\t\tvar pos = object.position.clone().sub( center ).normalize().multiplyScalar( radius * 2 );\n\t\t\tobject.position.copy( center ).add( pos );\n\n\t\t}\n\n\t\tobject.lookAt( center );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.pan = function ( distance ) {\n\n\t\tnormalMatrix.getNormalMatrix( object.matrix );\n\n\t\tdistance.applyMatrix3( normalMatrix );\n\t\tdistance.multiplyScalar( vector.copy( center ).sub( object.position ).length() * 0.001 );\n\n\t\tobject.position.add( distance );\n\t\tcenter.add( distance );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.zoom = function ( distance ) {\n\n\t\tnormalMatrix.getNormalMatrix( object.matrix );\n\n\t\tdistance.applyMatrix3( normalMatrix );\n\t\tdistance.multiplyScalar( vector.copy( center ).sub( object.position ).length() * 0.001 );\n\n\t\tobject.position.add( distance );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\tthis.rotate = function ( delta ) {\n\n\t\tvector.copy( object.position ).sub( center );\n\n\t\tvar theta = Math.atan2( vector.x, vector.z );\n\t\tvar phi = Math.atan2( Math.sqrt( vector.x * vector.x + vector.z * vector.z ), vector.y );\n\n\t\ttheta += delta.x;\n\t\tphi += delta.y;\n\n\t\tvar EPS = 0.000001;\n\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = vector.length();\n\n\t\tvector.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\tvector.y = radius * Math.cos( phi );\n\t\tvector.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\tobject.position.copy( center ).add( vector );\n\n\t\tobject.lookAt( center );\n\n\t\tscope.dispatchEvent( changeEvent );\n\n\t};\n\n\t// mouse\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t} else if ( event.button === 1 ) {\n\n\t\t\tstate = STATE.ZOOM;\n\n\t\t} else if ( event.button === 2 ) {\n\n\t\t\tstate = STATE.PAN;\n\n\t\t}\n\n\t\tpointerOld.set( event.clientX, event.clientY );\n\n\t\tdomElement.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdomElement.addEventListener( 'mouseup', onMouseUp, false );\n\t\tdomElement.addEventListener( 'mouseout', onMouseUp, false );\n\t\tdomElement.addEventListener( 'dblclick', onMouseUp, false );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tpointer.set( event.clientX, event.clientY );\n\n\t\tvar movementX = pointer.x - pointerOld.x;\n\t\tvar movementY = pointer.y - pointerOld.y;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tscope.rotate( new THREE.Vector3( - movementX * 0.005, - movementY * 0.005, 0 ) );\n\n\t\t} else if ( state === STATE.ZOOM ) {\n\n\t\t\tscope.zoom( new THREE.Vector3( 0, 0, movementY ) );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tscope.pan( new THREE.Vector3( - movementX, movementY, 0 ) );\n\n\t\t}\n\n\t\tpointerOld.set( event.clientX, event.clientY );\n\n\t}\n\n\tfunction onMouseUp( event ) {\n\n\t\tdomElement.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdomElement.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tdomElement.removeEventListener( 'mouseout', onMouseUp, false );\n\t\tdomElement.removeEventListener( 'dblclick', onMouseUp, false );\n\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\t// if ( scope.enabled === false ) return;\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = - event.wheelDelta;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = event.detail * 10;\n\n\t\t}\n\n\t\tscope.zoom( new THREE.Vector3( 0, 0, delta ) );\n\n\t}\n\n\tdomElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tdomElement.addEventListener( 'mousedown', onMouseDown, false );\n\tdomElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tdomElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\t// touch\n\n\tvar touch = new THREE.Vector3();\n\n\tvar touches = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];\n\tvar prevTouches = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ];\n\n\tvar prevDistance = null;\n\n\tfunction touchStart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );\n\t\t\t\tprevDistance = touches[ 0 ].distanceTo( touches[ 1 ] );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tprevTouches[ 0 ].copy( touches[ 0 ] );\n\t\tprevTouches[ 1 ].copy( touches[ 1 ] );\n\n\t}\n\n\n\tfunction touchMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar getClosest = function( touch, touches ) {\n\n\t\t\tvar closest = touches[ 0 ];\n\n\t\t\tfor ( var i in touches ) {\n\t\t\t\tif ( closest.distanceTo(touch) > touches[ i ].distanceTo(touch) ) closest = touches[ i ];\n\t\t\t}\n\n\t\t\treturn closest;\n\n\t\t}\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\tscope.rotate( touches[ 0 ].sub( getClosest( touches[ 0 ] ,prevTouches ) ).multiplyScalar( - 0.005 ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\ttouches[ 0 ].set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, 0 );\n\t\t\t\ttouches[ 1 ].set( event.touches[ 1 ].pageX, event.touches[ 1 ].pageY, 0 );\n\t\t\t\tdistance = touches[ 0 ].distanceTo( touches[ 1 ] );\n\t\t\t\tscope.zoom( new THREE.Vector3( 0, 0, prevDistance - distance ) );\n\t\t\t\tprevDistance = distance;\n\n\n\t\t\t\tvar offset0 = touches[ 0 ].clone().sub( getClosest( touches[ 0 ] ,prevTouches ) );\n\t\t\t\tvar offset1 = touches[ 1 ].clone().sub( getClosest( touches[ 1 ] ,prevTouches ) );\n\t\t\t\toffset0.x = -offset0.x;\n\t\t\t\toffset1.x = -offset1.x;\n\n\t\t\t\tscope.pan( offset0.add( offset1 ).multiplyScalar( 0.5 ) );\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tprevTouches[ 0 ].copy( touches[ 0 ] );\n\t\tprevTouches[ 1 ].copy( touches[ 1 ] );\n\n\t}\n\n\tdomElement.addEventListener( 'touchstart', touchStart, false );\n\tdomElement.addEventListener( 'touchmove', touchMove, false );\n\n};\n\nTHREE.EditorControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/FirstPersonControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/FirstPersonControls.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author paulirish / http://paulirish.com/\n */\n\nTHREE.FirstPersonControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\tthis.target = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\tthis.movementSpeed = 1.0;\n\tthis.lookSpeed = 0.005;\n\n\tthis.lookVertical = true;\n\tthis.autoForward = false;\n\t// this.invertVertical = false;\n\n\tthis.activeLook = true;\n\n\tthis.heightSpeed = false;\n\tthis.heightCoef = 1.0;\n\tthis.heightMin = 0.0;\n\tthis.heightMax = 1.0;\n\n\tthis.constrainVertical = false;\n\tthis.verticalMin = 0;\n\tthis.verticalMax = Math.PI;\n\n\tthis.autoSpeedFactor = 0.0;\n\n\tthis.mouseX = 0;\n\tthis.mouseY = 0;\n\n\tthis.lat = 0;\n\tthis.lon = 0;\n\tthis.phi = 0;\n\tthis.theta = 0;\n\n\tthis.moveForward = false;\n\tthis.moveBackward = false;\n\tthis.moveLeft = false;\n\tthis.moveRight = false;\n\tthis.freeze = false;\n\n\tthis.mouseDragOn = false;\n\n\tthis.viewHalfX = 0;\n\tthis.viewHalfY = 0;\n\n\tif ( this.domElement !== document ) {\n\n\t\tthis.domElement.setAttribute( 'tabindex', -1 );\n\n\t}\n\n\t//\n\n\tthis.handleResize = function () {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.viewHalfX = window.innerWidth / 2;\n\t\t\tthis.viewHalfY = window.innerHeight / 2;\n\n\t\t} else {\n\n\t\t\tthis.viewHalfX = this.domElement.offsetWidth / 2;\n\t\t\tthis.viewHalfY = this.domElement.offsetHeight / 2;\n\n\t\t}\n\n\t};\n\n\tthis.onMouseDown = function ( event ) {\n\n\t\tif ( this.domElement !== document ) {\n\n\t\t\tthis.domElement.focus();\n\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.activeLook ) {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveForward = true; break;\n\t\t\t\tcase 2: this.moveBackward = true; break;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.mouseDragOn = true;\n\n\t};\n\n\tthis.onMouseUp = function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.activeLook ) {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveForward = false; break;\n\t\t\t\tcase 2: this.moveBackward = false; break;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.mouseDragOn = false;\n\n\t};\n\n\tthis.onMouseMove = function ( event ) {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.mouseX = event.pageX - this.viewHalfX;\n\t\t\tthis.mouseY = event.pageY - this.viewHalfY;\n\n\t\t} else {\n\n\t\t\tthis.mouseX = event.pageX - this.domElement.offsetLeft - this.viewHalfX;\n\t\t\tthis.mouseY = event.pageY - this.domElement.offsetTop - this.viewHalfY;\n\n\t\t}\n\n\t};\n\n\tthis.onKeyDown = function ( event ) {\n\n\t\t//event.preventDefault();\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 38: /*up*/\n\t\t\tcase 87: /*W*/ this.moveForward = true; break;\n\n\t\t\tcase 37: /*left*/\n\t\t\tcase 65: /*A*/ this.moveLeft = true; break;\n\n\t\t\tcase 40: /*down*/\n\t\t\tcase 83: /*S*/ this.moveBackward = true; break;\n\n\t\t\tcase 39: /*right*/\n\t\t\tcase 68: /*D*/ this.moveRight = true; break;\n\n\t\t\tcase 82: /*R*/ this.moveUp = true; break;\n\t\t\tcase 70: /*F*/ this.moveDown = true; break;\n\n\t\t\tcase 81: /*Q*/ this.freeze = !this.freeze; break;\n\n\t\t}\n\n\t};\n\n\tthis.onKeyUp = function ( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 38: /*up*/\n\t\t\tcase 87: /*W*/ this.moveForward = false; break;\n\n\t\t\tcase 37: /*left*/\n\t\t\tcase 65: /*A*/ this.moveLeft = false; break;\n\n\t\t\tcase 40: /*down*/\n\t\t\tcase 83: /*S*/ this.moveBackward = false; break;\n\n\t\t\tcase 39: /*right*/\n\t\t\tcase 68: /*D*/ this.moveRight = false; break;\n\n\t\t\tcase 82: /*R*/ this.moveUp = false; break;\n\t\t\tcase 70: /*F*/ this.moveDown = false; break;\n\n\t\t}\n\n\t};\n\n\tthis.update = function( delta ) {\n\n\t\tif ( this.freeze ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.heightSpeed ) {\n\n\t\t\tvar y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax );\n\t\t\tvar heightDelta = y - this.heightMin;\n\n\t\t\tthis.autoSpeedFactor = delta * ( heightDelta * this.heightCoef );\n\n\t\t} else {\n\n\t\t\tthis.autoSpeedFactor = 0.0;\n\n\t\t}\n\n\t\tvar actualMoveSpeed = delta * this.movementSpeed;\n\n\t\tif ( this.moveForward || ( this.autoForward && !this.moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this.autoSpeedFactor ) );\n\t\tif ( this.moveBackward ) this.object.translateZ( actualMoveSpeed );\n\n\t\tif ( this.moveLeft ) this.object.translateX( - actualMoveSpeed );\n\t\tif ( this.moveRight ) this.object.translateX( actualMoveSpeed );\n\n\t\tif ( this.moveUp ) this.object.translateY( actualMoveSpeed );\n\t\tif ( this.moveDown ) this.object.translateY( - actualMoveSpeed );\n\n\t\tvar actualLookSpeed = delta * this.lookSpeed;\n\n\t\tif ( !this.activeLook ) {\n\n\t\t\tactualLookSpeed = 0;\n\n\t\t}\n\n\t\tvar verticalLookRatio = 1;\n\n\t\tif ( this.constrainVertical ) {\n\n\t\t\tverticalLookRatio = Math.PI / ( this.verticalMax - this.verticalMin );\n\n\t\t}\n\n\t\tthis.lon += this.mouseX * actualLookSpeed;\n\t\tif( this.lookVertical ) this.lat -= this.mouseY * actualLookSpeed * verticalLookRatio;\n\n\t\tthis.lat = Math.max( - 85, Math.min( 85, this.lat ) );\n\t\tthis.phi = THREE.Math.degToRad( 90 - this.lat );\n\n\t\tthis.theta = THREE.Math.degToRad( this.lon );\n\n\t\tif ( this.constrainVertical ) {\n\n\t\t\tthis.phi = THREE.Math.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax );\n\n\t\t}\n\n\t\tvar targetPosition = this.target,\n\t\t\tposition = this.object.position;\n\n\t\ttargetPosition.x = position.x + 100 * Math.sin( this.phi ) * Math.cos( this.theta );\n\t\ttargetPosition.y = position.y + 100 * Math.cos( this.phi );\n\t\ttargetPosition.z = position.z + 100 * Math.sin( this.phi ) * Math.sin( this.theta );\n\n\t\tthis.object.lookAt( targetPosition );\n\n\t};\n\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousemove', bind( this, this.onMouseMove ), false );\n\tthis.domElement.addEventListener( 'mousedown', bind( this, this.onMouseDown ), false );\n\tthis.domElement.addEventListener( 'mouseup', bind( this, this.onMouseUp ), false );\n\t\n\twindow.addEventListener( 'keydown', bind( this, this.onKeyDown ), false );\n\twindow.addEventListener( 'keyup', bind( this, this.onKeyUp ), false );\n\n\tfunction bind( scope, fn ) {\n\n\t\treturn function () {\n\n\t\t\tfn.apply( scope, arguments );\n\n\t\t};\n\n\t};\n\n\tthis.handleResize();\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/FlyControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/FlyControls.js",
"module-type": "library",
"text": "/**\n * @author James Baicoianu / http://www.baicoianu.com/\n */\n\nTHREE.FlyControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\tif ( domElement ) this.domElement.setAttribute( 'tabindex', -1 );\n\n\t// API\n\n\tthis.movementSpeed = 1.0;\n\tthis.rollSpeed = 0.005;\n\n\tthis.dragToLook = false;\n\tthis.autoForward = false;\n\n\t// disable default target object behavior\n\n\t// internals\n\n\tthis.tmpQuaternion = new THREE.Quaternion();\n\n\tthis.mouseStatus = 0;\n\n\tthis.moveState = { up: 0, down: 0, left: 0, right: 0, forward: 0, back: 0, pitchUp: 0, pitchDown: 0, yawLeft: 0, yawRight: 0, rollLeft: 0, rollRight: 0 };\n\tthis.moveVector = new THREE.Vector3( 0, 0, 0 );\n\tthis.rotationVector = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tthis.keydown = function( event ) {\n\n\t\tif ( event.altKey ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//event.preventDefault();\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 16: /* shift */ this.movementSpeedMultiplier = .1; break;\n\n\t\t\tcase 87: /*W*/ this.moveState.forward = 1; break;\n\t\t\tcase 83: /*S*/ this.moveState.back = 1; break;\n\n\t\t\tcase 65: /*A*/ this.moveState.left = 1; break;\n\t\t\tcase 68: /*D*/ this.moveState.right = 1; break;\n\n\t\t\tcase 82: /*R*/ this.moveState.up = 1; break;\n\t\t\tcase 70: /*F*/ this.moveState.down = 1; break;\n\n\t\t\tcase 38: /*up*/ this.moveState.pitchUp = 1; break;\n\t\t\tcase 40: /*down*/ this.moveState.pitchDown = 1; break;\n\n\t\t\tcase 37: /*left*/ this.moveState.yawLeft = 1; break;\n\t\t\tcase 39: /*right*/ this.moveState.yawRight = 1; break;\n\n\t\t\tcase 81: /*Q*/ this.moveState.rollLeft = 1; break;\n\t\t\tcase 69: /*E*/ this.moveState.rollRight = 1; break;\n\n\t\t}\n\n\t\tthis.updateMovementVector();\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.keyup = function( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 16: /* shift */ this.movementSpeedMultiplier = 1; break;\n\n\t\t\tcase 87: /*W*/ this.moveState.forward = 0; break;\n\t\t\tcase 83: /*S*/ this.moveState.back = 0; break;\n\n\t\t\tcase 65: /*A*/ this.moveState.left = 0; break;\n\t\t\tcase 68: /*D*/ this.moveState.right = 0; break;\n\n\t\t\tcase 82: /*R*/ this.moveState.up = 0; break;\n\t\t\tcase 70: /*F*/ this.moveState.down = 0; break;\n\n\t\t\tcase 38: /*up*/ this.moveState.pitchUp = 0; break;\n\t\t\tcase 40: /*down*/ this.moveState.pitchDown = 0; break;\n\n\t\t\tcase 37: /*left*/ this.moveState.yawLeft = 0; break;\n\t\t\tcase 39: /*right*/ this.moveState.yawRight = 0; break;\n\n\t\t\tcase 81: /*Q*/ this.moveState.rollLeft = 0; break;\n\t\t\tcase 69: /*E*/ this.moveState.rollRight = 0; break;\n\n\t\t}\n\n\t\tthis.updateMovementVector();\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.mousedown = function( event ) {\n\n\t\tif ( this.domElement !== document ) {\n\n\t\t\tthis.domElement.focus();\n\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.dragToLook ) {\n\n\t\t\tthis.mouseStatus ++;\n\n\t\t} else {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveState.forward = 1; break;\n\t\t\t\tcase 2: this.moveState.back = 1; break;\n\n\t\t\t}\n\n\t\t\tthis.updateMovementVector();\n\n\t\t}\n\n\t};\n\n\tthis.mousemove = function( event ) {\n\n\t\tif ( !this.dragToLook || this.mouseStatus > 0 ) {\n\n\t\t\tvar container = this.getContainerDimensions();\n\t\t\tvar halfWidth = container.size[ 0 ] / 2;\n\t\t\tvar halfHeight = container.size[ 1 ] / 2;\n\n\t\t\tthis.moveState.yawLeft = - ( ( event.pageX - container.offset[ 0 ] ) - halfWidth ) / halfWidth;\n\t\t\tthis.moveState.pitchDown = ( ( event.pageY - container.offset[ 1 ] ) - halfHeight ) / halfHeight;\n\n\t\t\tthis.updateRotationVector();\n\n\t\t}\n\n\t};\n\n\tthis.mouseup = function( event ) {\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( this.dragToLook ) {\n\n\t\t\tthis.mouseStatus --;\n\n\t\t\tthis.moveState.yawLeft = this.moveState.pitchDown = 0;\n\n\t\t} else {\n\n\t\t\tswitch ( event.button ) {\n\n\t\t\t\tcase 0: this.moveState.forward = 0; break;\n\t\t\t\tcase 2: this.moveState.back = 0; break;\n\n\t\t\t}\n\n\t\t\tthis.updateMovementVector();\n\n\t\t}\n\n\t\tthis.updateRotationVector();\n\n\t};\n\n\tthis.update = function( delta ) {\n\n\t\tvar moveMult = delta * this.movementSpeed;\n\t\tvar rotMult = delta * this.rollSpeed;\n\n\t\tthis.object.translateX( this.moveVector.x * moveMult );\n\t\tthis.object.translateY( this.moveVector.y * moveMult );\n\t\tthis.object.translateZ( this.moveVector.z * moveMult );\n\n\t\tthis.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize();\n\t\tthis.object.quaternion.multiply( this.tmpQuaternion );\n\n\t\t// expose the rotation vector for convenience\n\t\tthis.object.rotation.setFromQuaternion( this.object.quaternion, this.object.rotation.order );\n\n\n\t};\n\n\tthis.updateMovementVector = function() {\n\n\t\tvar forward = ( this.moveState.forward || ( this.autoForward && !this.moveState.back ) ) ? 1 : 0;\n\n\t\tthis.moveVector.x = ( -this.moveState.left + this.moveState.right );\n\t\tthis.moveVector.y = ( -this.moveState.down + this.moveState.up );\n\t\tthis.moveVector.z = ( -forward + this.moveState.back );\n\n\t\t//console.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] );\n\n\t};\n\n\tthis.updateRotationVector = function() {\n\n\t\tthis.rotationVector.x = ( -this.moveState.pitchDown + this.moveState.pitchUp );\n\t\tthis.rotationVector.y = ( -this.moveState.yawRight + this.moveState.yawLeft );\n\t\tthis.rotationVector.z = ( -this.moveState.rollRight + this.moveState.rollLeft );\n\n\t\t//console.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] );\n\n\t};\n\n\tthis.getContainerDimensions = function() {\n\n\t\tif ( this.domElement != document ) {\n\n\t\t\treturn {\n\t\t\t\tsize\t: [ this.domElement.offsetWidth, this.domElement.offsetHeight ],\n\t\t\t\toffset\t: [ this.domElement.offsetLeft, this.domElement.offsetTop ]\n\t\t\t};\n\n\t\t} else {\n\n\t\t\treturn {\n\t\t\t\tsize\t: [ window.innerWidth, window.innerHeight ],\n\t\t\t\toffset\t: [ 0, 0 ]\n\t\t\t};\n\n\t\t}\n\n\t};\n\n\tfunction bind( scope, fn ) {\n\n\t\treturn function () {\n\n\t\t\tfn.apply( scope, arguments );\n\n\t\t};\n\n\t};\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousemove', bind( this, this.mousemove ), false );\n\tthis.domElement.addEventListener( 'mousedown', bind( this, this.mousedown ), false );\n\tthis.domElement.addEventListener( 'mouseup', bind( this, this.mouseup ), false );\n\n\twindow.addEventListener( 'keydown', bind( this, this.keydown ), false );\n\twindow.addEventListener( 'keyup', bind( this, this.keyup ), false );\n\n\tthis.updateMovementVector();\n\tthis.updateRotationVector();\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/OculusControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/OculusControls.js",
"module-type": "library",
"text": "/**\n * @author possan / http://possan.se/\n *\n * Oculus headtracking control\n * - use together with the oculus-rest project to get headtracking\n * coordinates from the rift: http://github.com/possan/oculus-rest\n */\n\nTHREE.OculusControls = function ( object ) {\n\n\tthis.object = object;\n\tthis.target = new THREE.Vector3( 0, 0, 0 );\n\n\tthis.headquat = new THREE.Quaternion();\n\tthis.freeze = false;\n\n\tthis.loadAjaxJSON = function ( url, callback ) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.onreadystatechange = function () {\n\t\t\tif ( xhr.readyState === xhr.DONE ) {\n\t\t\t\tif ( xhr.status === 200 || xhr.status === 0 ) {\n\t\t\t\t\tif ( xhr.responseText ) {\n\t\t\t\t\t\tvar json = JSON.parse( xhr.responseText );\n\t\t\t\t\t\tcallback( json );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhr.open( \"GET\", url, true );\n\t\txhr.withCredentials = false;\n\t\txhr.send( null );\n\t};\n\n\tthis.gotCoordinates = function( r ) {\n\t\tthis.headquat.set(r.quat.x, r.quat.y, r.quat.z, r.quat.w);\n\t\tthis.queuePoll();\n\t}\n\n\tthis.pollOnce = function() {\n\t\tthis.loadAjaxJSON('http://localhost:50000', bind(this, this.gotCoordinates));\n\t}\n\n\tthis.queuePoll = function() {\n\t\tsetTimeout(bind(this, this.pollOnce), 10);\n\t}\n\n\tthis.update = function( delta ) {\n\t\tif ( this.freeze ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.object.quaternion.multiply(this.headquat);\n\t};\n\n\tfunction bind( scope, fn ) {\n\t\treturn function () {\n\t\t\tfn.apply( scope, arguments );\n\t\t};\n\t};\n\n\tthis.connect = function() {\n\t\tthis.queuePoll();\n\t};\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/OrbitControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/OrbitControls.js",
"module-type": "library",
"text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n */\n/*global THREE, console */\n\n// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n// supported.\n//\n// Orbit - left mouse / touch: one finger move\n// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n// Pan - right mouse, or arrow keys / touch: three finter swipe\n//\n// This is a drop-in replacement for (most) TrackballControls used in examples.\n// That is, include this js file and wherever you see:\n// \tcontrols = new THREE.TrackballControls( camera );\n// controls.target.z = 150;\n// Simple substitute \"OrbitControls\" and the control should work as-is.\n\nTHREE.OrbitControls = function ( object, domElement ) {\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\t// Set to false to disable this control\n\tthis.enabled = true;\n\n\t// \"target\" sets the location of focus, where the control orbits around\n\t// and where it pans with respect to.\n\tthis.target = new THREE.Vector3();\n\n\t// center is old, deprecated; use \"target\" instead\n\tthis.center = this.target;\n\n\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t// backwards compatibility\n\tthis.noZoom = false;\n\tthis.zoomSpeed = 1.0;\n\n\t// Limits to how far you can dolly in and out\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\t// Set to true to disable this control\n\tthis.noRotate = false;\n\tthis.rotateSpeed = 1.0;\n\n\t// Set to true to disable this control\n\tthis.noPan = false;\n\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t// Set to true to automatically rotate around the target\n\tthis.autoRotate = false;\n\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t// How far you can orbit vertically, upper and lower limits.\n\t// Range is 0 to Math.PI radians.\n\tthis.minPolarAngle = 0; // radians\n\tthis.maxPolarAngle = Math.PI; // radians\n\n\t// Set to true to disable use of the keys\n\tthis.noKeys = false;\n\n\t// The four arrow keys\n\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t////////////\n\t// internals\n\n\tvar scope = this;\n\n\tvar EPS = 0.000001;\n\n\tvar rotateStart = new THREE.Vector2();\n\tvar rotateEnd = new THREE.Vector2();\n\tvar rotateDelta = new THREE.Vector2();\n\n\tvar panStart = new THREE.Vector2();\n\tvar panEnd = new THREE.Vector2();\n\tvar panDelta = new THREE.Vector2();\n\tvar panOffset = new THREE.Vector3();\n\n\tvar offset = new THREE.Vector3();\n\n\tvar dollyStart = new THREE.Vector2();\n\tvar dollyEnd = new THREE.Vector2();\n\tvar dollyDelta = new THREE.Vector2();\n\n\tvar phiDelta = 0;\n\tvar thetaDelta = 0;\n\tvar scale = 1;\n\tvar pan = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\tvar lastQuaternion = new THREE.Quaternion();\n\n\tvar STATE = { NONE : -1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\tvar state = STATE.NONE;\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\n\t// so camera.up is the orbit axis\n\n\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\tvar quatInverse = quat.clone().inverse();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\tthis.rotateLeft = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tthetaDelta -= angle;\n\n\t};\n\n\tthis.rotateUp = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tphiDelta -= angle;\n\n\t};\n\n\t// pass in distance in world space to move left\n\tthis.panLeft = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get X column of matrix\n\t\tpanOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] );\n\t\tpanOffset.multiplyScalar( - distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\n\t// pass in distance in world space to move up\n\tthis.panUp = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get Y column of matrix\n\t\tpanOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] );\n\t\tpanOffset.multiplyScalar( distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\t\n\t// pass in x,y of change desired in pixel space,\n\t// right and down are positive\n\tthis.pan = function ( deltaX, deltaY ) {\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( scope.object.fov !== undefined ) {\n\n\t\t\t// perspective\n\t\t\tvar position = scope.object.position;\n\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\tvar targetDistance = offset.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\tscope.panLeft( 2 * deltaX * targetDistance / element.clientHeight );\n\t\t\tscope.panUp( 2 * deltaY * targetDistance / element.clientHeight );\n\n\t\t} else if ( scope.object.top !== undefined ) {\n\n\t\t\t// orthographic\n\t\t\tscope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth );\n\t\t\tscope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic or perspective\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t}\n\n\t};\n\n\tthis.dollyIn = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale /= dollyScale;\n\n\t};\n\n\tthis.dollyOut = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale *= dollyScale;\n\n\t};\n\n\tthis.update = function () {\n\n\t\tvar position = this.object.position;\n\n\t\toffset.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"y-axis-is-up\" space\n\t\toffset.applyQuaternion( quat );\n\n\t\t// angle from z-axis around y-axis\n\n\t\tvar theta = Math.atan2( offset.x, offset.z );\n\n\t\t// angle from y-axis\n\n\t\tvar phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\n\t\tif ( this.autoRotate ) {\n\n\t\t\tthis.rotateLeft( getAutoRotationAngle() );\n\n\t\t}\n\n\t\ttheta += thetaDelta;\n\t\tphi += phiDelta;\n\n\t\t// restrict phi to be between desired limits\n\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = offset.length() * scale;\n\n\t\t// restrict radius to be between desired limits\n\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\t\n\t\t// move target to panned location\n\t\tthis.target.add( pan );\n\n\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\toffset.y = radius * Math.cos( phi );\n\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\toffset.applyQuaternion( quatInverse );\n\n\t\tposition.copy( this.target ).add( offset );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tthetaDelta = 0;\n\t\tphiDelta = 0;\n\t\tscale = 1;\n\t\tpan.set( 0, 0, 0 );\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( lastPosition.distanceToSquared( this.object.position ) > EPS\n\t\t || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {\n\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( this.object.position );\n\t\t\tlastQuaternion.copy (this.object.quaternion );\n\n\t\t}\n\n\t};\n\n\n\tthis.reset = function () {\n\n\t\tstate = STATE.NONE;\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\n\t\tthis.update();\n\n\t};\n\n\tfunction getAutoRotationAngle() {\n\n\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t}\n\n\tfunction getZoomScale() {\n\n\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t}\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 1 ) {\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tstate = STATE.DOLLY;\n\n\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 2 ) {\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tstate = STATE.PAN;\n\n\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tscope.dollyIn();\n\n\t\t\t} else {\n\n\t\t\t\tscope.dollyOut();\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\n\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t}\n\n\t\tscope.update();\n\n\t}\n\n\tfunction onMouseUp( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\tif ( scope.enabled === false || scope.noZoom === true ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta;\n\n\t\t} else if ( event.detail !== undefined ) { // Firefox\n\n\t\t\tdelta = - event.detail;\n\n\t\t}\n\n\t\tif ( delta > 0 ) {\n\n\t\t\tscope.dollyOut();\n\n\t\t} else {\n\n\t\t\tscope.dollyIn();\n\n\t\t}\n\n\t\tscope.update();\n\t\tscope.dispatchEvent( startEvent );\n\t\tscope.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction onKeyDown( event ) {\n\n\t\tif ( scope.enabled === false || scope.noKeys === true || scope.noPan === true ) return;\n\t\t\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase scope.keys.UP:\n\t\t\t\tscope.pan( 0, scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\tscope.pan( 0, - scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.LEFT:\n\t\t\t\tscope.pan( scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.RIGHT:\n\t\t\t\tscope.pan( - scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tscope.dollyOut();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tscope.dollyIn();\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\t\n\t\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/OrbitZControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/OrbitZControls.js",
"module-type": "library",
"text": "/**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n *\n * cook for adaptation to Z up (initially Y up).\n */\n/*global THREE, console */\n\n// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n// the \"up\" direction as +Z. Touch on tablet and phones is supported (but not tested, sorry).\n//\n// Orbit - left mouse / touch: one finger move\n// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n// Pan - right mouse, or arrow keys / touch: three finter swipe\n\nTHREE.OrbitZControls = function ( object, domElement ) {\n var func = \"THREE.OrbitZControls\";\n flagLog = false;\n logPoint = function(p) {return \"\"+p.x+\", \"+p.y+\", \"+p.z;};\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n if (flagLog) console.log(func+\": object.position = \"+logPoint(this.object.position));\n if (flagLog) console.log(func+\": object.up = \"+logPoint(this.object.up));\n\n\t// API\n\n\t// Set to false to disable this control\n\tthis.enabled = true;\n\n\t// \"target\" sets the location of focus, where the control orbits around\n\t// and where it pans with respect to.\n\tthis.target = new THREE.Vector3();\n\n\t// center is old, deprecated; use \"target\" instead\n\tthis.center = this.target;\n\n\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t// backwards compatibility\n\tthis.noZoom = false;\n\tthis.zoomSpeed = 1.0;\n\n\t// Limits to how far you can dolly in and out\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\t// Set to true to disable this control\n\tthis.noRotate = false;\n\tthis.rotateSpeed = 1.0;\n\n\t// Set to true to disable this control\n\tthis.noPan = false;\n\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t// Set to true to automatically rotate around the target\n\tthis.autoRotate = false;\n\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t// How far you can orbit vertically, upper and lower limits.\n\t// Range is 0 to Math.PI radians.\n\tthis.minPolarAngle = 0; // radians\n\tthis.maxPolarAngle = Math.PI; // radians\n\n\t// Set to true to disable use of the keys\n\tthis.noKeys = false;\n\n\t// The four arrow keys\n\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t////////////\n\t// internals\n\n\tvar scope = this;\n\n\tvar EPS = 0.000001;\n\n\tvar rotateStart = new THREE.Vector2();\n\tvar rotateEnd = new THREE.Vector2();\n\tvar rotateDelta = new THREE.Vector2();\n\n\tvar panStart = new THREE.Vector2();\n\tvar panEnd = new THREE.Vector2();\n\tvar panDelta = new THREE.Vector2();\n\tvar panOffset = new THREE.Vector3();\n\n\tvar offset = new THREE.Vector3();\n\n\tvar dollyStart = new THREE.Vector2();\n\tvar dollyEnd = new THREE.Vector2();\n\tvar dollyDelta = new THREE.Vector2();\n\n\tvar phiDelta = 0;\n\tvar thetaDelta = 0;\n\tvar scale = 1;\n\tvar pan = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\tvar lastQuaternion = new THREE.Quaternion();\n\n\tvar STATE = { NONE : -1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\tvar state = STATE.NONE;\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\n\t// so camera.up is the orbit axis\n\n\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 0, 1 ) );\n\tvar quatInverse = quat.clone().inverse();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\tthis.rotateLeft = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tthetaDelta -= angle;\n\n\t};\n\n\tthis.rotateUp = function ( angle ) {\n\n\t\tif ( angle === undefined ) {\n\n\t\t\tangle = getAutoRotationAngle();\n\n\t\t}\n\n\t\tphiDelta -= angle;\n\n\t};\n\n\t// pass in distance in world space to move left\n\tthis.panLeft = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get X column of matrix\n\t\tpanOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] );\n\t\tpanOffset.multiplyScalar( - distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\n\t// pass in distance in world space to move up\n\tthis.panUp = function ( distance ) {\n\n\t\tvar te = this.object.matrix.elements;\n\n\t\t// get Z column of matrix\n\t\tpanOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] );\n\t\tpanOffset.multiplyScalar( distance );\n\t\t\n\t\tpan.add( panOffset );\n\n\t};\n\t\n\t// pass in x,y of change desired in pixel space,\n\t// right and down are positive\n\tthis.pan = function ( deltaX, deltaY ) {\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( scope.object.fov !== undefined ) {\n\n\t\t\t// perspective\n\t\t\tvar position = scope.object.position;\n\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\tvar targetDistance = offset.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\tscope.panLeft( 2 * deltaX * targetDistance / element.clientHeight );\n\t\t\tscope.panUp( 2 * deltaY * targetDistance / element.clientHeight );\n\n\t\t} else if ( scope.object.top !== undefined ) {\n\n\t\t\t// orthographic\n\t\t\tscope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth );\n\t\t\tscope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic or perspective\n\t\t\tconsole.warn( 'WARNING: OrbitZControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t}\n\n\t};\n\n\tthis.dollyIn = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale /= dollyScale;\n\n\t};\n\n\tthis.dollyOut = function ( dollyScale ) {\n\n\t\tif ( dollyScale === undefined ) {\n\n\t\t\tdollyScale = getZoomScale();\n\n\t\t}\n\n\t\tscale *= dollyScale;\n\n\t};\n\n\tthis.update = function () {\n var func = \"THREE.OrbitZControls.update\";\n\n if (flagLog) console.log(func+\": ====================\");\n if (flagLog) console.log(func+\": this.target = \"+logPoint(this.target));\n\n\t\tvar position = this.object.position;\n\n\t\toffset.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"z-axis-is-up\" space\n\t\toffset.applyQuaternion( quat );\n\n if (flagLog) console.log(func+\": offset = \"+logPoint(offset));\n\n\t\t// angle from x-axis around z-axis\n\n\t\tvar theta = Math.atan2( offset.y, offset.x );\n\n\t\t// angle from z-axis\n\n\t\tvar phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.y * offset.y ), offset.z );\n\n if (flagLog) console.log(func+\": theta = \"+(theta * 180 / Math.PI)+\" degrés, phi = \"+(phi * 180 / Math.PI)+\" degrés\");\n\n\t\tif ( this.autoRotate ) {\n\n\t\t\tthis.rotateLeft( getAutoRotationAngle() );\n\n\t\t}\n\n\t\ttheta += thetaDelta;\n\t\tphi += phiDelta;\n\n\t\t// restrict phi to be between desired limits\n\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\tvar radius = offset.length() * scale;\n\n\t\t// restrict radius to be between desired limits\n\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\t\n\t\t// move target to panned location\n\t\tthis.target.add( pan );\n\n\t\toffset.x = radius * Math.sin( phi ) * Math.cos( theta );\n\t\toffset.z = radius * Math.cos( phi );\n\t\toffset.y = radius * Math.sin( phi ) * Math.sin( theta );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\toffset.applyQuaternion( quatInverse );\n\n\t\tposition.copy( this.target ).add( offset );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tthetaDelta = 0;\n\t\tphiDelta = 0;\n\t\tscale = 1;\n\t\tpan.set( 0, 0, 0 );\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( lastPosition.distanceToSquared( this.object.position ) > EPS\n\t\t || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {\n\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( this.object.position );\n\t\t\tlastQuaternion.copy (this.object.quaternion );\n\n\t\t}\n\n\t};\n\n\n\tthis.reset = function () {\n\n\t\tstate = STATE.NONE;\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\n\t\tthis.update();\n\n\t};\n\n\tfunction getAutoRotationAngle() {\n\n\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t}\n\n\tfunction getZoomScale() {\n\n\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t}\n\n\tfunction onMouseDown( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tevent.preventDefault();\n\n\t\tif ( event.button === 0 ) {\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\tstate = STATE.ROTATE;\n\n\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 1 ) {\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tstate = STATE.DOLLY;\n\n\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t} else if ( event.button === 2 ) {\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tstate = STATE.PAN;\n\n\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction onMouseMove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\trotateStart.copy( rotateEnd );\n\n\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\tscope.dollyIn();\n\n\t\t\t} else {\n\n\t\t\t\tscope.dollyOut();\n\n\t\t\t}\n\n\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\n\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\tpanStart.copy( panEnd );\n\n\t\t}\n\n\t\tscope.update();\n\n\t}\n\n\tfunction onMouseUp( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tfunction onMouseWheel( event ) {\n\n\t\tif ( scope.enabled === false || scope.noZoom === true ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta;\n\n\t\t} else if ( event.detail !== undefined ) { // Firefox\n\n\t\t\tdelta = - event.detail;\n\n\t\t}\n\n\t\tif ( delta > 0 ) {\n\n\t\t\tscope.dollyOut();\n\n\t\t} else {\n\n\t\t\tscope.dollyIn();\n\n\t\t}\n\n\t\tscope.update();\n\t\tscope.dispatchEvent( startEvent );\n\t\tscope.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction onKeyDown( event ) {\n\n\t\tif ( scope.enabled === false || scope.noKeys === true || scope.noPan === true ) return;\n\t\t\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase scope.keys.UP:\n\t\t\t\tscope.pan( 0, scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\tscope.pan( 0, - scope.keyPanSpeed );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.LEFT:\n\t\t\t\tscope.pan( scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase scope.keys.RIGHT:\n\t\t\t\tscope.pan( - scope.keyPanSpeed, 0 );\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\n\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tscope.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\tif ( scope.noRotate === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tscope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tscope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\tif ( scope.noZoom === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tscope.dollyOut();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tscope.dollyIn();\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\tif ( scope.noPan === true ) return;\n\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\t\t\t\n\t\t\t\tscope.pan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\tscope.update();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( /* event */ ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tscope.dispatchEvent( endEvent );\n\t\tstate = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.OrbitZControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/OrthographicTrackballControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/OrthographicTrackballControls.js",
"module-type": "library",
"text": "/**\n * @author Eberhard Graether / http://egraether.com/\n * @author Patrick Fuller / http://patrick-fuller.com\n */\n\nTHREE.OrthographicTrackballControls = function ( object, domElement ) {\n\n\tvar _this = this;\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5 };\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\n\tthis.screen = { width: 0, height: 0, offsetLeft: 0, offsetTop: 0 };\n\tthis.radius = ( this.screen.width + this.screen.height ) / 4;\n\n\tthis.rotateSpeed = 1.0;\n\tthis.zoomSpeed = 1.2;\n\tthis.panSpeed = 0.3;\n\n\tthis.noRotate = false;\n\tthis.noZoom = false;\n\tthis.noPan = false;\n\n\tthis.staticMoving = false;\n\tthis.dynamicDampingFactor = 0.2;\n\n\tthis.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ];\n\n\t// internals\n\n\tthis.target = new THREE.Vector3();\n\n\tvar lastPosition = new THREE.Vector3();\n\n\tvar _state = STATE.NONE,\n\t_prevState = STATE.NONE,\n\n\t_eye = new THREE.Vector3(),\n\n\t_rotateStart = new THREE.Vector3(),\n\t_rotateEnd = new THREE.Vector3(),\n\n\t_zoomStart = new THREE.Vector2(),\n\t_zoomEnd = new THREE.Vector2(),\n\t_zoomFactor = 1,\n\n\t_touchZoomDistanceStart = 0,\n\t_touchZoomDistanceEnd = 0,\n\n\t_panStart = new THREE.Vector2(),\n\t_panEnd = new THREE.Vector2();\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\tthis.up0 = this.object.up.clone();\n\n\tthis.left0 = this.object.left;\n\tthis.right0 = this.object.right;\n\tthis.top0 = this.object.top;\n\tthis.bottom0 = this.object.bottom;\n\tthis.center0 = new THREE.Vector2((this.left0 + this.right0) / 2.0, (this.top0 + this.bottom0) / 2.0);\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\n\n\t// methods\n\n\tthis.handleResize = function () {\n\n\t\tthis.screen.width = window.innerWidth;\n\t\tthis.screen.height = window.innerHeight;\n\n\t\tthis.screen.offsetLeft = 0;\n\t\tthis.screen.offsetTop = 0;\n\n\t\tthis.radius = ( this.screen.width + this.screen.height ) / 4;\n\n\t};\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tthis.getMouseOnScreen = function ( clientX, clientY ) {\n\n\t\treturn new THREE.Vector2(\n\t\t\t( clientX - _this.screen.offsetLeft ) / _this.radius * 0.5,\n\t\t\t( clientY - _this.screen.offsetTop ) / _this.radius * 0.5\n\t\t);\n\n\t};\n\n\tthis.getMouseProjectionOnBall = function ( clientX, clientY ) {\n\n\t\tvar mouseOnBall = new THREE.Vector3(\n\t\t\t( clientX - _this.screen.width * 0.5 - _this.screen.offsetLeft ) / _this.radius,\n\t\t\t( _this.screen.height * 0.5 + _this.screen.offsetTop - clientY ) / _this.radius,\n\t\t\t0.0\n\t\t);\n\n\t\tvar length = mouseOnBall.length();\n\n\t\tif ( length > 1.0 ) {\n\n\t\t\tmouseOnBall.normalize();\n\n\t\t} else {\n\n\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length * length );\n\n\t\t}\n\n\t\t_eye.copy( _this.object.position ).sub( _this.target );\n\n\t\tvar projection = _this.object.up.clone().setLength( mouseOnBall.y );\n\t\tprojection.add( _this.object.up.clone().cross( _eye ).setLength( mouseOnBall.x ) );\n\t\tprojection.add( _eye.setLength( mouseOnBall.z ) );\n\n\t\treturn projection;\n\n\t};\n\n\tthis.rotateCamera = function () {\n\n\t\tvar angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() );\n\n\t\tif ( angle ) {\n\n\t\t\tvar axis = ( new THREE.Vector3() ).crossVectors( _rotateStart, _rotateEnd ).normalize(),\n\t\t\t\tquaternion = new THREE.Quaternion();\n\n\t\t\tangle *= _this.rotateSpeed;\n\n\t\t\tquaternion.setFromAxisAngle( axis, -angle );\n\n\t\t\t_eye.applyQuaternion( quaternion );\n\t\t\t_this.object.up.applyQuaternion( quaternion );\n\n\t\t\t_rotateEnd.applyQuaternion( quaternion );\n\n\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t_rotateStart.copy( _rotateEnd );\n\n\t\t\t} else {\n\n\t\t\t\tquaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) );\n\t\t\t\t_rotateStart.applyQuaternion( quaternion );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.zoomCamera = function () {\n\n\t\tif ( _state === STATE.TOUCH_ZOOM ) {\n\n\t\t\tvar factor = _touchZoomDistanceStart / _touchZoomDistanceEnd;\n\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd;\n\t\t\t_zoomFactor *= factor;\n\n\t\t\t_this.object.left = _zoomFactor * _this.left0 + ( 1 - _zoomFactor ) * _this.center0.x;\n\t\t\t_this.object.right = _zoomFactor * _this.right0 + ( 1 - _zoomFactor ) * _this.center0.x;\n\t\t\t_this.object.top = _zoomFactor * _this.top0 + ( 1 - _zoomFactor ) * _this.center0.y;\n\t\t\t_this.object.bottom = _zoomFactor * _this.bottom0 + ( 1 - _zoomFactor ) * _this.center0.y;\n\n\t\t} else {\n\n\t\t\tvar factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed;\n\n\t\t\tif ( factor !== 1.0 && factor > 0.0 ) {\n\t\t\t\t_zoomFactor *= factor;\n\n\t\t\t\t_this.object.left = _zoomFactor * _this.left0 + ( 1 - _zoomFactor ) * _this.center0.x;\n\t\t\t\t_this.object.right = _zoomFactor * _this.right0 + ( 1 - _zoomFactor ) * _this.center0.x;\n\t\t\t\t_this.object.top = _zoomFactor * _this.top0 + ( 1 - _zoomFactor ) * _this.center0.y;\n\t\t\t\t_this.object.bottom = _zoomFactor * _this.bottom0 + ( 1 - _zoomFactor ) * _this.center0.y;\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_zoomStart.copy( _zoomEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.panCamera = function () {\n\n\t\tvar mouseChange = _panEnd.clone().sub( _panStart );\n\n\t\tif ( mouseChange.lengthSq() ) {\n\n\t\t\tmouseChange.multiplyScalar( _eye.length() * _this.panSpeed );\n\n\t\t\tvar pan = _eye.clone().cross( _this.object.up ).setLength( mouseChange.x );\n\t\t\tpan.add( _this.object.up.clone().setLength( mouseChange.y ) );\n\n\t\t\t_this.object.position.add( pan );\n\t\t\t_this.target.add( pan );\n\n\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t_panStart = _panEnd;\n\n\t\t\t} else {\n\n\t\t\t\t_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.update = function () {\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\tif ( !_this.noRotate ) {\n\n\t\t\t_this.rotateCamera();\n\n\t\t}\n\n\t\tif ( !_this.noZoom ) {\n\n\t\t\t_this.zoomCamera();\n\t\t\t_this.object.updateProjectionMatrix();\n\n\t\t}\n\n\t\tif ( !_this.noPan ) {\n\n\t\t\t_this.panCamera();\n\n\t\t}\n\n\t\t_this.object.position.addVectors( _this.target, _eye );\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\tif ( lastPosition.distanceToSquared( _this.object.position ) > 0 ) {\n\n\t\t\t_this.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( _this.object.position );\n\n\t\t}\n\n\t};\n\n\tthis.reset = function () {\n\n\t\t_state = STATE.NONE;\n\t\t_prevState = STATE.NONE;\n\n\t\t_this.target.copy( _this.target0 );\n\t\t_this.object.position.copy( _this.position0 );\n\t\t_this.object.up.copy( _this.up0 );\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\t_this.object.left = _this.left0;\n\t\t_this.object.right = _this.right0;\n\t\t_this.object.top = _this.top0;\n\t\t_this.object.bottom = _this.bottom0;\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\t_this.dispatchEvent( changeEvent );\n\n\t\tlastPosition.copy( _this.object.position );\n\n\t};\n\n\t// listeners\n\n\tfunction keydown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\twindow.removeEventListener( 'keydown', keydown );\n\n\t\t_prevState = _state;\n\n\t\tif ( _state !== STATE.NONE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) {\n\n\t\t\t_state = STATE.ROTATE;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) {\n\n\t\t\t_state = STATE.ZOOM;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) {\n\n\t\t\t_state = STATE.PAN;\n\n\t\t}\n\n\t}\n\n\tfunction keyup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\t_state = _prevState;\n\n\t\twindow.addEventListener( 'keydown', keydown, false );\n\n\t}\n\n\tfunction mousedown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.NONE ) {\n\n\t\t\t_state = event.button;\n\n\t\t}\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomStart = _zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', mousemove, false );\n\t\tdocument.addEventListener( 'mouseup', mouseup, false );\n\n\t}\n\n\tfunction mousemove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panEnd = _this.getMouseOnScreen( event.clientX, event.clientY );\n\n\t\t}\n\n\t}\n\n\tfunction mouseup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t_state = STATE.NONE;\n\n\t\tdocument.removeEventListener( 'mousemove', mousemove );\n\t\tdocument.removeEventListener( 'mouseup', mouseup );\n\n\t}\n\n\tfunction mousewheel( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta / 40;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = - event.detail / 3;\n\n\t\t}\n\n\t\t_zoomStart.y += delta * 0.01;\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_state = STATE.TOUCH_ROTATE;\n\t\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_state = STATE.TOUCH_ZOOM;\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_state = STATE.TOUCH_PAN;\n\t\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy )\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t_panStart = _panEnd = _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t_state = STATE.NONE;\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousedown', mousedown, false );\n\n\tthis.domElement.addEventListener( 'mousewheel', mousewheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', keydown, false );\n\twindow.addEventListener( 'keyup', keyup, false );\n\n\tthis.handleResize();\n\n};\n\nTHREE.OrthographicTrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/PointerLockControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/PointerLockControls.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PointerLockControls = function ( camera ) {\n\n\tvar scope = this;\n\n\tcamera.rotation.set( 0, 0, 0 );\n\n\tvar pitchObject = new THREE.Object3D();\n\tpitchObject.add( camera );\n\n\tvar yawObject = new THREE.Object3D();\n\tyawObject.position.y = 10;\n\tyawObject.add( pitchObject );\n\n\tvar moveForward = false;\n\tvar moveBackward = false;\n\tvar moveLeft = false;\n\tvar moveRight = false;\n\n\tvar isOnObject = false;\n\tvar canJump = false;\n\n\tvar prevTime = performance.now();\n\n\tvar velocity = new THREE.Vector3();\n\n\tvar PI_2 = Math.PI / 2;\n\n\tvar onMouseMove = function ( event ) {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tvar movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;\n\t\tvar movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;\n\n\t\tyawObject.rotation.y -= movementX * 0.002;\n\t\tpitchObject.rotation.x -= movementY * 0.002;\n\n\t\tpitchObject.rotation.x = Math.max( - PI_2, Math.min( PI_2, pitchObject.rotation.x ) );\n\n\t};\n\n\tvar onKeyDown = function ( event ) {\n\n\t\tswitch ( event.keyCode ) {\n\n\t\t\tcase 38: // up\n\t\t\tcase 87: // w\n\t\t\t\tmoveForward = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 37: // left\n\t\t\tcase 65: // a\n\t\t\t\tmoveLeft = true; break;\n\n\t\t\tcase 40: // down\n\t\t\tcase 83: // s\n\t\t\t\tmoveBackward = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 39: // right\n\t\t\tcase 68: // d\n\t\t\t\tmoveRight = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 32: // space\n\t\t\t\tif ( canJump === true ) velocity.y += 350;\n\t\t\t\tcanJump = false;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tvar onKeyUp = function ( event ) {\n\n\t\tswitch( event.keyCode ) {\n\n\t\t\tcase 38: // up\n\t\t\tcase 87: // w\n\t\t\t\tmoveForward = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 37: // left\n\t\t\tcase 65: // a\n\t\t\t\tmoveLeft = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 40: // down\n\t\t\tcase 83: // s\n\t\t\t\tmoveBackward = false;\n\t\t\t\tbreak;\n\n\t\t\tcase 39: // right\n\t\t\tcase 68: // d\n\t\t\t\tmoveRight = false;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t};\n\n\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\tdocument.addEventListener( 'keydown', onKeyDown, false );\n\tdocument.addEventListener( 'keyup', onKeyUp, false );\n\n\tthis.enabled = false;\n\n\tthis.getObject = function () {\n\n\t\treturn yawObject;\n\n\t};\n\n\tthis.isOnObject = function ( boolean ) {\n\n\t\tisOnObject = boolean;\n\t\tcanJump = boolean;\n\n\t};\n\n\tthis.getDirection = function() {\n\n\t\t// assumes the camera itself is not rotated\n\n\t\tvar direction = new THREE.Vector3( 0, 0, -1 );\n\t\tvar rotation = new THREE.Euler( 0, 0, 0, \"YXZ\" );\n\n\t\treturn function( v ) {\n\n\t\t\trotation.set( pitchObject.rotation.x, yawObject.rotation.y, 0 );\n\n\t\t\tv.copy( direction ).applyEuler( rotation );\n\n\t\t\treturn v;\n\n\t\t}\n\n\t}();\n\n\tthis.update = function () {\n\n\t\tif ( scope.enabled === false ) return;\n\n\t\tvar time = performance.now();\n\t\tvar delta = ( time - prevTime ) / 1000;\n\n\t\tvelocity.x -= velocity.x * 10.0 * delta;\n\t\tvelocity.z -= velocity.z * 10.0 * delta;\n\n\t\tvelocity.y -= 9.8 * 100.0 * delta; // 100.0 = mass\n\n\t\tif ( moveForward ) velocity.z -= 400.0 * delta;\n\t\tif ( moveBackward ) velocity.z += 400.0 * delta;\n\n\t\tif ( moveLeft ) velocity.x -= 400.0 * delta;\n\t\tif ( moveRight ) velocity.x += 400.0 * delta;\n\n\t\tif ( isOnObject === true ) {\n\n\t\t\tvelocity.y = Math.max( 0, velocity.y );\n\n\t\t}\n\n\t\tyawObject.translateX( velocity.x * delta );\n\t\tyawObject.translateY( velocity.y * delta ); \n\t\tyawObject.translateZ( velocity.z * delta );\n\n\t\tif ( yawObject.position.y < 10 ) {\n\n\t\t\tvelocity.y = 0;\n\t\t\tyawObject.position.y = 10;\n\n\t\t\tcanJump = true;\n\n\t\t}\n\n\t\tprevTime = time;\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/TrackballControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/TrackballControls.js",
"module-type": "library",
"text": "/**\n * @author Eberhard Graether / http://egraether.com/\n * @author Mark Lundin \t/ http://mark-lundin.com\n */\n\nTHREE.TrackballControls = function ( object, domElement ) {\n\n\tvar _this = this;\n\tvar STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 };\n\n\tthis.object = object;\n\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t// API\n\n\tthis.enabled = true;\n\n\tthis.screen = { left: 0, top: 0, width: 0, height: 0 };\n\n\tthis.rotateSpeed = 1.0;\n\tthis.zoomSpeed = 1.2;\n\tthis.panSpeed = 0.3;\n\n\tthis.noRotate = false;\n\tthis.noZoom = false;\n\tthis.noPan = false;\n\tthis.noRoll = false;\n\n\tthis.staticMoving = false;\n\tthis.dynamicDampingFactor = 0.2;\n\n\tthis.minDistance = 0;\n\tthis.maxDistance = Infinity;\n\n\tthis.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ];\n\n\t// internals\n\n\tthis.target = new THREE.Vector3();\n\n\tvar EPS = 0.000001;\n\n\tvar lastPosition = new THREE.Vector3();\n\n\tvar _state = STATE.NONE,\n\t_prevState = STATE.NONE,\n\n\t_eye = new THREE.Vector3(),\n\n\t_rotateStart = new THREE.Vector3(),\n\t_rotateEnd = new THREE.Vector3(),\n\n\t_zoomStart = new THREE.Vector2(),\n\t_zoomEnd = new THREE.Vector2(),\n\n\t_touchZoomDistanceStart = 0,\n\t_touchZoomDistanceEnd = 0,\n\n\t_panStart = new THREE.Vector2(),\n\t_panEnd = new THREE.Vector2();\n\n\t// for reset\n\n\tthis.target0 = this.target.clone();\n\tthis.position0 = this.object.position.clone();\n\tthis.up0 = this.object.up.clone();\n\n\t// events\n\n\tvar changeEvent = { type: 'change' };\n\tvar startEvent = { type: 'start'};\n\tvar endEvent = { type: 'end'};\n\n\n\t// methods\n\n\tthis.handleResize = function () {\n\n\t\tif ( this.domElement === document ) {\n\n\t\t\tthis.screen.left = 0;\n\t\t\tthis.screen.top = 0;\n\t\t\tthis.screen.width = window.innerWidth;\n\t\t\tthis.screen.height = window.innerHeight;\n\n\t\t} else {\n\n\t\t\tvar box = this.domElement.getBoundingClientRect();\n\t\t\t// adjustments come from similar code in the jquery offset() function\n\t\t\tvar d = this.domElement.ownerDocument.documentElement;\n\t\t\tthis.screen.left = box.left + window.pageXOffset - d.clientLeft;\n\t\t\tthis.screen.top = box.top + window.pageYOffset - d.clientTop;\n\t\t\tthis.screen.width = box.width;\n\t\t\tthis.screen.height = box.height;\n\n\t\t}\n\n\t};\n\n\tthis.handleEvent = function ( event ) {\n\n\t\tif ( typeof this[ event.type ] == 'function' ) {\n\n\t\t\tthis[ event.type ]( event );\n\n\t\t}\n\n\t};\n\n\tvar getMouseOnScreen = ( function () {\n\n\t\tvar vector = new THREE.Vector2();\n\n\t\treturn function ( pageX, pageY ) {\n\n\t\t\tvector.set(\n\t\t\t\t( pageX - _this.screen.left ) / _this.screen.width,\n\t\t\t\t( pageY - _this.screen.top ) / _this.screen.height\n\t\t\t);\n\n\t\t\treturn vector;\n\n\t\t};\n\n\t}() );\n\n\tvar getMouseProjectionOnBall = ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar objectUp = new THREE.Vector3();\n\t\tvar mouseOnBall = new THREE.Vector3();\n\n\t\treturn function ( pageX, pageY ) {\n\n\t\t\tmouseOnBall.set(\n\t\t\t\t( pageX - _this.screen.width * 0.5 - _this.screen.left ) / (_this.screen.width*.5),\n\t\t\t\t( _this.screen.height * 0.5 + _this.screen.top - pageY ) / (_this.screen.height*.5),\n\t\t\t\t0.0\n\t\t\t);\n\n\t\t\tvar length = mouseOnBall.length();\n\n\t\t\tif ( _this.noRoll ) {\n\n\t\t\t\tif ( length < Math.SQRT1_2 ) {\n\n\t\t\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length*length );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmouseOnBall.z = .5 / length;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t} else if ( length > 1.0 ) {\n\n\t\t\t\tmouseOnBall.normalize();\n\n\t\t\t} else {\n\n\t\t\t\tmouseOnBall.z = Math.sqrt( 1.0 - length * length );\n\n\t\t\t}\n\n\t\t\t_eye.copy( _this.object.position ).sub( _this.target );\n\n\t\t\tvector.copy( _this.object.up ).setLength( mouseOnBall.y )\n\t\t\tvector.add( objectUp.copy( _this.object.up ).cross( _eye ).setLength( mouseOnBall.x ) );\n\t\t\tvector.add( _eye.setLength( mouseOnBall.z ) );\n\n\t\t\treturn vector;\n\n\t\t};\n\n\t}() );\n\n\tthis.rotateCamera = (function(){\n\n\t\tvar axis = new THREE.Vector3(),\n\t\t\tquaternion = new THREE.Quaternion();\n\n\n\t\treturn function () {\n\n\t\t\tvar angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() );\n\n\t\t\tif ( angle ) {\n\n\t\t\t\taxis.crossVectors( _rotateStart, _rotateEnd ).normalize();\n\n\t\t\t\tangle *= _this.rotateSpeed;\n\n\t\t\t\tquaternion.setFromAxisAngle( axis, -angle );\n\n\t\t\t\t_eye.applyQuaternion( quaternion );\n\t\t\t\t_this.object.up.applyQuaternion( quaternion );\n\n\t\t\t\t_rotateEnd.applyQuaternion( quaternion );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_rotateStart.copy( _rotateEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tquaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) );\n\t\t\t\t\t_rotateStart.applyQuaternion( quaternion );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}());\n\n\tthis.zoomCamera = function () {\n\n\t\tif ( _state === STATE.TOUCH_ZOOM_PAN ) {\n\n\t\t\tvar factor = _touchZoomDistanceStart / _touchZoomDistanceEnd;\n\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd;\n\t\t\t_eye.multiplyScalar( factor );\n\n\t\t} else {\n\n\t\t\tvar factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed;\n\n\t\t\tif ( factor !== 1.0 && factor > 0.0 ) {\n\n\t\t\t\t_eye.multiplyScalar( factor );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_zoomStart.copy( _zoomEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.panCamera = (function(){\n\n\t\tvar mouseChange = new THREE.Vector2(),\n\t\t\tobjectUp = new THREE.Vector3(),\n\t\t\tpan = new THREE.Vector3();\n\n\t\treturn function () {\n\n\t\t\tmouseChange.copy( _panEnd ).sub( _panStart );\n\n\t\t\tif ( mouseChange.lengthSq() ) {\n\n\t\t\t\tmouseChange.multiplyScalar( _eye.length() * _this.panSpeed );\n\n\t\t\t\tpan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x );\n\t\t\t\tpan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) );\n\n\t\t\t\t_this.object.position.add( pan );\n\t\t\t\t_this.target.add( pan );\n\n\t\t\t\tif ( _this.staticMoving ) {\n\n\t\t\t\t\t_panStart.copy( _panEnd );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}());\n\n\tthis.checkDistances = function () {\n\n\t\tif ( !_this.noZoom || !_this.noPan ) {\n\n\t\t\tif ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) {\n\n\t\t\t\t_this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) );\n\n\t\t\t}\n\n\t\t\tif ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) {\n\n\t\t\t\t_this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.update = function () {\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\tif ( !_this.noRotate ) {\n\n\t\t\t_this.rotateCamera();\n\n\t\t}\n\n\t\tif ( !_this.noZoom ) {\n\n\t\t\t_this.zoomCamera();\n\n\t\t}\n\n\t\tif ( !_this.noPan ) {\n\n\t\t\t_this.panCamera();\n\n\t\t}\n\n\t\t_this.object.position.addVectors( _this.target, _eye );\n\n\t\t_this.checkDistances();\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\tif ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) {\n\n\t\t\t_this.dispatchEvent( changeEvent );\n\n\t\t\tlastPosition.copy( _this.object.position );\n\n\t\t}\n\n\t};\n\n\tthis.reset = function () {\n\n\t\t_state = STATE.NONE;\n\t\t_prevState = STATE.NONE;\n\n\t\t_this.target.copy( _this.target0 );\n\t\t_this.object.position.copy( _this.position0 );\n\t\t_this.object.up.copy( _this.up0 );\n\n\t\t_eye.subVectors( _this.object.position, _this.target );\n\n\t\t_this.object.lookAt( _this.target );\n\n\t\t_this.dispatchEvent( changeEvent );\n\n\t\tlastPosition.copy( _this.object.position );\n\n\t};\n\n\t// listeners\n\n\tfunction keydown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\twindow.removeEventListener( 'keydown', keydown );\n\n\t\t_prevState = _state;\n\n\t\tif ( _state !== STATE.NONE ) {\n\n\t\t\treturn;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) {\n\n\t\t\t_state = STATE.ROTATE;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) {\n\n\t\t\t_state = STATE.ZOOM;\n\n\t\t} else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) {\n\n\t\t\t_state = STATE.PAN;\n\n\t\t}\n\n\t}\n\n\tfunction keyup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\t_state = _prevState;\n\n\t\twindow.addEventListener( 'keydown', keydown, false );\n\n\t}\n\n\tfunction mousedown( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.NONE ) {\n\n\t\t\t_state = event.button;\n\n\t\t}\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateStart.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) );\n\t\t\t_rotateEnd.copy( _rotateStart );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomStart.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\t\t\t_zoomEnd.copy(_zoomStart);\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panStart.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\t\t\t_panEnd.copy(_panStart)\n\n\t\t}\n\n\t\tdocument.addEventListener( 'mousemove', mousemove, false );\n\t\tdocument.addEventListener( 'mouseup', mouseup, false );\n\n\t\t_this.dispatchEvent( startEvent );\n\n\t}\n\n\tfunction mousemove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tif ( _state === STATE.ROTATE && !_this.noRotate ) {\n\n\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) );\n\n\t\t} else if ( _state === STATE.ZOOM && !_this.noZoom ) {\n\n\t\t\t_zoomEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\n\t\t} else if ( _state === STATE.PAN && !_this.noPan ) {\n\n\t\t\t_panEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) );\n\n\t\t}\n\n\t}\n\n\tfunction mouseup( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t_state = STATE.NONE;\n\n\t\tdocument.removeEventListener( 'mousemove', mousemove );\n\t\tdocument.removeEventListener( 'mouseup', mouseup );\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction mousewheel( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar delta = 0;\n\n\t\tif ( event.wheelDelta ) { // WebKit / Opera / Explorer 9\n\n\t\t\tdelta = event.wheelDelta / 40;\n\n\t\t} else if ( event.detail ) { // Firefox\n\n\t\t\tdelta = - event.detail / 3;\n\n\t\t}\n\n\t\t_zoomStart.y += delta * 0.01;\n\t\t_this.dispatchEvent( startEvent );\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tfunction touchstart( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_state = STATE.TOUCH_ROTATE;\n\t\t\t\t_rotateStart.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\t_rotateEnd.copy( _rotateStart );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_state = STATE.TOUCH_ZOOM_PAN;\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panStart.copy( getMouseOnScreen( x, y ) );\n\t\t\t\t_panEnd.copy( _panStart );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\t\t_this.dispatchEvent( startEvent );\n\n\n\t}\n\n\tfunction touchmove( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t_touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panEnd.copy( getMouseOnScreen( x, y ) );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t_state = STATE.NONE;\n\n\t\t}\n\n\t}\n\n\tfunction touchend( event ) {\n\n\t\tif ( _this.enabled === false ) return;\n\n\t\tswitch ( event.touches.length ) {\n\n\t\t\tcase 1:\n\t\t\t\t_rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) );\n\t\t\t\t_rotateStart.copy( _rotateEnd );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t_touchZoomDistanceStart = _touchZoomDistanceEnd = 0;\n\n\t\t\t\tvar x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2;\n\t\t\t\tvar y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2;\n\t\t\t\t_panEnd.copy( getMouseOnScreen( x, y ) );\n\t\t\t\t_panStart.copy( _panEnd );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t_state = STATE.NONE;\n\t\t_this.dispatchEvent( endEvent );\n\n\t}\n\n\tthis.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );\n\n\tthis.domElement.addEventListener( 'mousedown', mousedown, false );\n\n\tthis.domElement.addEventListener( 'mousewheel', mousewheel, false );\n\tthis.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox\n\n\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\twindow.addEventListener( 'keydown', keydown, false );\n\twindow.addEventListener( 'keyup', keyup, false );\n\n\tthis.handleResize();\n\n\t// force an update at start\n\tthis.update();\n\n};\n\nTHREE.TrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Controls/TransformControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/TransformControls.js",
"module-type": "library",
"text": "/**\n * @author arodic / https://github.com/arodic\n */\n /*jshint sub:true*/\n\n(function () {\n\n\t'use strict';\n\n\tvar GizmoMaterial = function ( parameters ) {\n\n\t\tTHREE.MeshBasicMaterial.call( this );\n\n\t\tthis.depthTest = false;\n\t\tthis.depthWrite = false;\n\t\tthis.side = THREE.FrontSide;\n\t\tthis.transparent = true;\n\n\t\tthis.setValues( parameters );\n\n\t\tthis.oldColor = this.color.clone();\n\t\tthis.oldOpacity = this.opacity;\n\n\t\tthis.highlight = function( highlighted ) {\n\n\t\t\tif ( highlighted ) {\n\n\t\t\t\tthis.color.setRGB( 1, 1, 0 );\n\t\t\t\tthis.opacity = 1;\n\n\t\t\t} else {\n\n\t\t\t\t\tthis.color.copy( this.oldColor );\n\t\t\t\t\tthis.opacity = this.oldOpacity;\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tGizmoMaterial.prototype = Object.create( THREE.MeshBasicMaterial.prototype );\n\n\tvar GizmoLineMaterial = function ( parameters ) {\n\n\t\tTHREE.LineBasicMaterial.call( this );\n\n\t\tthis.depthTest = false;\n\t\tthis.depthWrite = false;\n\t\tthis.transparent = true;\n\t\tthis.linewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t\tthis.oldColor = this.color.clone();\n\t\tthis.oldOpacity = this.opacity;\n\n\t\tthis.highlight = function( highlighted ) {\n\n\t\t\tif ( highlighted ) {\n\n\t\t\t\tthis.color.setRGB( 1, 1, 0 );\n\t\t\t\tthis.opacity = 1;\n\n\t\t\t} else {\n\n\t\t\t\t\tthis.color.copy( this.oldColor );\n\t\t\t\t\tthis.opacity = this.oldOpacity;\n\n\t\t\t}\n\n\t\t};\n\n\t};\n\n\tGizmoLineMaterial.prototype = Object.create( THREE.LineBasicMaterial.prototype );\n\n\tTHREE.TransformGizmo = function () {\n\n\t\tvar scope = this;\n\t\tvar showPickers = false; //debug\n\t\tvar showActivePlane = false; //debug\n\n\t\tthis.init = function () {\n\n\t\t\tTHREE.Object3D.call( this );\n\n\t\t\tthis.handles = new THREE.Object3D();\n\t\t\tthis.pickers = new THREE.Object3D();\n\t\t\tthis.planes = new THREE.Object3D();\n\n\t\t\tthis.add(this.handles);\n\t\t\tthis.add(this.pickers);\n\t\t\tthis.add(this.planes);\n\n\t\t\t//// PLANES\n\n\t\t\tvar planeGeometry = new THREE.PlaneGeometry( 50, 50, 2, 2 );\n\t\t\tvar planeMaterial = new THREE.MeshBasicMaterial( { wireframe: true } );\n\t\t\tplaneMaterial.side = THREE.DoubleSide;\n\n\t\t\tvar planes = {\n\t\t\t\t\"XY\": new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"YZ\": new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"XZ\": new THREE.Mesh( planeGeometry, planeMaterial ),\n\t\t\t\t\"XYZE\": new THREE.Mesh( planeGeometry, planeMaterial )\n\t\t\t};\n\n\t\t\tthis.activePlane = planes[\"XYZE\"];\n\n\t\t\tplanes[\"YZ\"].rotation.set( 0, Math.PI/2, 0 );\n\t\t\tplanes[\"XZ\"].rotation.set( -Math.PI/2, 0, 0 );\n\n\t\t\tfor (var i in planes) {\n\t\t\t\tplanes[i].name = i;\n\t\t\t\tthis.planes.add(planes[i]);\n\t\t\t\tthis.planes[i] = planes[i];\n\t\t\t\tplanes[i].visible = false;\n\t\t\t}\n\n\t\t\t//// HANDLES AND PICKERS\n\n\t\t\tvar setupGizmos = function( gizmoMap, parent ) {\n\n\t\t\t\tfor ( var name in gizmoMap ) {\n\n\t\t\t\t\tfor ( i = gizmoMap[name].length; i--;) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar object = gizmoMap[name][i][0];\n\t\t\t\t\t\tvar position = gizmoMap[name][i][1];\n\t\t\t\t\t\tvar rotation = gizmoMap[name][i][2];\n\n\t\t\t\t\t\tobject.name = name;\n\n\t\t\t\t\t\tif ( position ) object.position.set( position[0], position[1], position[2] );\n\t\t\t\t\t\tif ( rotation ) object.rotation.set( rotation[0], rotation[1], rotation[2] );\n\t\t\t\t\t\t\n\t\t\t\t\t\tparent.add( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tsetupGizmos(this.handleGizmos, this.handles);\n\t\t\tsetupGizmos(this.pickerGizmos, this.pickers);\n\n\t\t\t// reset Transformations\n\n\t\t\tthis.traverse(function ( child ) {\n\t\t\t\tif (child instanceof THREE.Mesh) {\n\t\t\t\t\tchild.updateMatrix();\n\n\t\t\t\t\tvar tempGeometry = new THREE.Geometry();\n\t\t\t\t\ttempGeometry.merge( child.geometry, child.matrix );\n\n\t\t\t\t\tchild.geometry = tempGeometry;\n\t\t\t\t\tchild.position.set( 0, 0, 0 );\n\t\t\t\t\tchild.rotation.set( 0, 0, 0 );\n\t\t\t\t\tchild.scale.set( 1, 1, 1 );\n\t\t\t\t}\n\t\t\t});\n\n\t\t};\n\n\t\tthis.hide = function () {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tchild.visible = false;\n\t\t\t});\n\t\t};\n\n\t\tthis.show = function () {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tchild.visible = true;\n\t\t\t\tif (child.parent == scope.pickers ) child.visible = showPickers;\n\t\t\t\tif (child.parent == scope.planes ) child.visible = false;\n\t\t\t});\n\t\t\tthis.activePlane.visible = showActivePlane;\n\t\t};\n\n\t\tthis.highlight = function ( axis ) {\n\t\t\tthis.traverse(function( child ) {\n\t\t\t\tif ( child.material && child.material.highlight ){\n\t\t\t\t\tif ( child.name == axis ) {\n\t\t\t\t\t\tchild.material.highlight( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.material.highlight( false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t};\n\n\tTHREE.TransformGizmo.prototype = Object.create( THREE.Object3D.prototype );\n\n\tTHREE.TransformGizmo.prototype.update = function ( rotation, eye ) {\n\n\t\tvar vec1 = new THREE.Vector3( 0, 0, 0 );\n\t\tvar vec2 = new THREE.Vector3( 0, 1, 0 );\n\t\tvar lookAtMatrix = new THREE.Matrix4();\n\n\t\tthis.traverse(function(child) {\n\t\t\tif ( child.name.search(\"E\") != -1 ) {\n\t\t\t\tchild.quaternion.setFromRotationMatrix( lookAtMatrix.lookAt( eye, vec1, vec2 ) );\n\t\t\t} else if ( child.name.search(\"X\") != -1 || child.name.search(\"Y\") != -1 || child.name.search(\"Z\") != -1 ) {\n\t\t\t\tchild.quaternion.setFromEuler( rotation );\n\t\t\t}\n\t\t});\n\n\t};\n\n\tTHREE.TransformGizmoTranslate = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar arrowGeometry = new THREE.Geometry();\n\t\tvar mesh = new THREE.Mesh( new THREE.CylinderGeometry( 0, 0.05, 0.2, 12, 1, false ) );\n\t\tmesh.position.y = 0.5;\n\t\tmesh.updateMatrix();\n\n\t\tarrowGeometry.merge( mesh.geometry, mesh.matrix );\n\t\t\n\t\tvar lineXGeometry = new THREE.Geometry();\n\t\tlineXGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ) );\n\n\t\tvar lineYGeometry = new THREE.Geometry();\n\t\tlineYGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );\n\n\t\tvar lineZGeometry = new THREE.Geometry();\n\t\tlineZGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 1 ) );\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0xff0000 } ) ), [ 0.5, 0, 0 ], [ 0, 0, -Math.PI/2 ] ],\n\t\t\t\t[ new THREE.Line( lineXGeometry, new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x00ff00 } ) ), [ 0, 0.5, 0 ] ],\n\t\t\t\t[\tnew THREE.Line( lineYGeometry, new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x0000ff } ) ), [ 0, 0, 0.5 ], [ Math.PI/2, 0, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineZGeometry, new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.OctahedronGeometry( 0.1, 0 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, 0, 0 ] ]\n\t\t\t],\n\t\t\tXY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ), [ 0.15, 0.15, 0 ] ]\n\t\t\t],\n\t\t\tYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0x00ffff, opacity: 0.25 } ) ), [ 0, 0.15, 0.15 ], [ 0, Math.PI/2, 0 ] ]\n\t\t\t],\n\t\t\tXZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.29, 0.29 ), new GizmoMaterial( { color: 0xff00ff, opacity: 0.25 } ) ), [ 0.15, 0, 0.15 ], [ -Math.PI/2, 0, 0 ] ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0.6, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0.6, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0.6 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.OctahedronGeometry( 0.2, 0 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t],\n\t\t\tXY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ), [ 0.2, 0.2, 0 ] ]\n\t\t\t],\n\t\t\tYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0x00ffff, opacity: 0.25 } ) ), [ 0, 0.2, 0.2 ], [ 0, Math.PI/2, 0 ] ]\n\t\t\t],\n\t\t\tXZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.PlaneGeometry( 0.4, 0.4 ), new GizmoMaterial( { color: 0xff00ff, opacity: 0.25 } ) ), [ 0.2, 0, 0.2 ], [ -Math.PI/2, 0, 0 ] ]\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis, eye ) {\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\teye.applyMatrix4( tempMatrix.getInverse( tempMatrix.extractRotation( this.planes[ \"XY\" ].matrixWorld ) ) );\n\n\t\t\tif ( axis == \"X\" ) {\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.y) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"XZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Y\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Z\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XZ\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.y) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"XYZ\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tif ( axis == \"XY\" ) this.activePlane = this.planes[ \"XY\" ];\n\n\t\t\tif ( axis == \"YZ\" ) this.activePlane = this.planes[ \"YZ\" ];\n\n\t\t\tif ( axis == \"XZ\" ) this.activePlane = this.planes[ \"XZ\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoTranslate.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformGizmoRotate = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar CircleGeometry = function ( radius, facing, arc ) {\n\n\t\t\t\tvar geometry = new THREE.Geometry();\n\t\t\t\tarc = arc ? arc : 1;\n\t\t\t\tfor ( var i = 0; i <= 64 * arc; ++i ) {\n\t\t\t\t\tif ( facing == 'x' ) geometry.vertices.push( new THREE.Vector3( 0, Math.cos( i / 32 * Math.PI ), Math.sin( i / 32 * Math.PI ) ).multiplyScalar(radius) );\n\t\t\t\t\tif ( facing == 'y' ) geometry.vertices.push( new THREE.Vector3( Math.cos( i / 32 * Math.PI ), 0, Math.sin( i / 32 * Math.PI ) ).multiplyScalar(radius) );\n\t\t\t\t\tif ( facing == 'z' ) geometry.vertices.push( new THREE.Vector3( Math.sin( i / 32 * Math.PI ), Math.cos( i / 32 * Math.PI ), 0 ).multiplyScalar(radius) );\n\t\t\t\t}\n\n\t\t\t\treturn geometry;\n\t\t};\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'x',0.5), new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'y',0.5), new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'z',0.5), new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tE: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1.25,'z',1), new GizmoLineMaterial( { color: 0xcccc00 } ) ) ]\n\t\t\t],\n\t\t\tXYZE: [\n\t\t\t\t[ new THREE.Line( new CircleGeometry(1,'z',1), new GizmoLineMaterial( { color: 0x787878 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, -Math.PI/2, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1, 0.12, 4, 12, Math.PI ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tE: [\n\t\t\t\t[ new THREE.Mesh( new THREE.TorusGeometry( 1.25, 0.12, 2, 24 ), new GizmoMaterial( { color: 0xffff00, opacity: 0.25 } ) ) ]\n\t\t\t],\n\t\t\tXYZE: [\n\t\t\t\t[ new THREE.Mesh( new THREE.Geometry() ) ]// TODO\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis ) {\n\n\t\t\tif ( axis == \"E\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tif ( axis == \"X\" ) this.activePlane = this.planes[ \"YZ\" ];\n\n\t\t\tif ( axis == \"Y\" ) this.activePlane = this.planes[ \"XZ\" ];\n\n\t\t\tif ( axis == \"Z\" ) this.activePlane = this.planes[ \"XY\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.update = function ( rotation, eye2 ) {\n\n\t\t\tTHREE.TransformGizmo.prototype.update.apply( this, arguments );\n\n\t\t\tvar group = {\n\t\t\t\thandles: this[\"handles\"],\n\t\t\t\tpickers: this[\"pickers\"],\n\t\t\t};\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\tvar worldRotation = new THREE.Euler( 0, 0, 1 );\n\t\t\tvar tempQuaternion = new THREE.Quaternion();\n\t\t\tvar unitX = new THREE.Vector3( 1, 0, 0 );\n\t\t\tvar unitY = new THREE.Vector3( 0, 1, 0 );\n\t\t\tvar unitZ = new THREE.Vector3( 0, 0, 1 );\n\t\t\tvar quaternionX = new THREE.Quaternion();\n\t\t\tvar quaternionY = new THREE.Quaternion();\n\t\t\tvar quaternionZ = new THREE.Quaternion();\n\t\t\tvar eye = eye2.clone();\n\n\t\t\tworldRotation.copy( this.planes[\"XY\"].rotation );\n\t\t\ttempQuaternion.setFromEuler( worldRotation );\n\n\t\t\ttempMatrix.makeRotationFromQuaternion( tempQuaternion ).getInverse( tempMatrix );\n\t\t\teye.applyMatrix4( tempMatrix );\n\n\t\t\tthis.traverse(function(child) {\n\n\t\t\t\ttempQuaternion.setFromEuler( worldRotation );\n\n\t\t\t\tif ( child.name == \"X\" ) {\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, Math.atan2( -eye.y, eye.z ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t\tif ( child.name == \"Y\" ) {\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, Math.atan2( eye.x, eye.z ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionY );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t\tif ( child.name == \"Z\" ) {\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, Math.atan2( eye.y, eye.x ) );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionZ );\n\t\t\t\t\tchild.quaternion.copy( tempQuaternion );\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoRotate.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformGizmoScale = function () {\n\n\t\tTHREE.TransformGizmo.call( this );\n\n\t\tvar arrowGeometry = new THREE.Geometry();\n\t\tvar mesh = new THREE.Mesh( new THREE.BoxGeometry( 0.125, 0.125, 0.125 ) );\n\t\tmesh.position.y = 0.5;\n\t\tmesh.updateMatrix();\n\n\t\tarrowGeometry.merge( mesh.geometry, mesh.matrix );\n\n\t\tvar lineXGeometry = new THREE.Geometry();\n\t\tlineXGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 1, 0, 0 ) );\n\n\t\tvar lineYGeometry = new THREE.Geometry();\n\t\tlineYGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 1, 0 ) );\n\n\t\tvar lineZGeometry = new THREE.Geometry();\n\t\tlineZGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, 1 ) );\n\n\t\tthis.handleGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0xff0000 } ) ), [ 0.5, 0, 0 ], [ 0, 0, -Math.PI/2 ] ],\n\t\t\t\t[ new THREE.Line( lineXGeometry, new GizmoLineMaterial( { color: 0xff0000 } ) ) ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x00ff00 } ) ), [ 0, 0.5, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineYGeometry, new GizmoLineMaterial( { color: 0x00ff00 } ) ) ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( arrowGeometry, new GizmoMaterial( { color: 0x0000ff } ) ), [ 0, 0, 0.5 ], [ Math.PI/2, 0, 0 ] ],\n\t\t\t\t[ new THREE.Line( lineZGeometry, new GizmoLineMaterial( { color: 0x0000ff } ) ) ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.BoxGeometry( 0.125, 0.125, 0.125 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.pickerGizmos = {\n\t\t\tX: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0xff0000, opacity: 0.25 } ) ), [ 0.6, 0, 0 ], [ 0, 0, -Math.PI/2 ] ]\n\t\t\t],\n\t\t\tY: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x00ff00, opacity: 0.25 } ) ), [ 0, 0.6, 0 ] ]\n\t\t\t],\n\t\t\tZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.CylinderGeometry( 0.2, 0, 1, 4, 1, false ), new GizmoMaterial( { color: 0x0000ff, opacity: 0.25 } ) ), [ 0, 0, 0.6 ], [ Math.PI/2, 0, 0 ] ]\n\t\t\t],\n\t\t\tXYZ: [\n\t\t\t\t[ new THREE.Mesh( new THREE.BoxGeometry( 0.4, 0.4, 0.4 ), new GizmoMaterial( { color: 0xffffff, opacity: 0.25 } ) ) ]\n\t\t\t]\n\t\t};\n\n\t\tthis.setActivePlane = function ( axis, eye ) {\n\n\t\t\tvar tempMatrix = new THREE.Matrix4();\n\t\t\teye.applyMatrix4( tempMatrix.getInverse( tempMatrix.extractRotation( this.planes[ \"XY\" ].matrixWorld ) ) );\n\n\t\t\tif ( axis == \"X\" ) {\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.y) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"XZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Y\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XY\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.z) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"Z\" ){\n\t\t\t\tthis.activePlane = this.planes[ \"XZ\" ];\n\t\t\t\tif ( Math.abs(eye.x) > Math.abs(eye.y) ) this.activePlane = this.planes[ \"YZ\" ];\n\t\t\t}\n\n\t\t\tif ( axis == \"XYZ\" ) this.activePlane = this.planes[ \"XYZE\" ];\n\n\t\t\tthis.hide();\n\t\t\tthis.show();\n\n\t\t};\n\n\t\tthis.init();\n\n\t};\n\n\tTHREE.TransformGizmoScale.prototype = Object.create( THREE.TransformGizmo.prototype );\n\n\tTHREE.TransformControls = function ( camera, domElement ) {\n\n\t\t// TODO: Make non-uniform scale and rotate play nice in hierarchies\n\t\t// TODO: ADD RXYZ contol\n\n\t\tTHREE.Object3D.call( this );\n\n\t\tdomElement = ( domElement !== undefined ) ? domElement : document;\n\n\t\tthis.gizmo = {};\n\t\tthis.gizmo[\"translate\"] = new THREE.TransformGizmoTranslate();\n\t\tthis.gizmo[\"rotate\"] = new THREE.TransformGizmoRotate();\n\t\tthis.gizmo[\"scale\"] = new THREE.TransformGizmoScale();\n\n\t\tthis.add(this.gizmo[\"translate\"]);\n\t\tthis.add(this.gizmo[\"rotate\"]);\n\t\tthis.add(this.gizmo[\"scale\"]);\n\n\t\tthis.gizmo[\"translate\"].hide();\n\t\tthis.gizmo[\"rotate\"].hide();\n\t\tthis.gizmo[\"scale\"].hide();\n\n\t\tthis.object = undefined;\n\t\tthis.snap = null;\n\t\tthis.space = \"world\";\n\t\tthis.size = 1;\n\t\tthis.axis = null;\n\n\t\tvar scope = this;\n\t\t\n\t\tvar _dragging = false;\n\t\tvar _mode = \"translate\";\n\t\tvar _plane = \"XY\";\n\n\t\tvar changeEvent = { type: \"change\" };\n\n\t\tvar ray = new THREE.Raycaster();\n\t\tvar projector = new THREE.Projector();\n\t\tvar pointerVector = new THREE.Vector3();\n\n\t\tvar point = new THREE.Vector3();\n\t\tvar offset = new THREE.Vector3();\n\n\t\tvar rotation = new THREE.Vector3();\n\t\tvar offsetRotation = new THREE.Vector3();\n\t\tvar scale = 1;\n\n\t\tvar lookAtMatrix = new THREE.Matrix4();\n\t\tvar eye = new THREE.Vector3();\n\n\t\tvar tempMatrix = new THREE.Matrix4();\n\t\tvar tempVector = new THREE.Vector3();\n\t\tvar tempQuaternion = new THREE.Quaternion();\n\t\tvar unitX = new THREE.Vector3( 1, 0, 0 );\n\t\tvar unitY = new THREE.Vector3( 0, 1, 0 );\n\t\tvar unitZ = new THREE.Vector3( 0, 0, 1 );\n\n\t\tvar quaternionXYZ = new THREE.Quaternion();\n\t\tvar quaternionX = new THREE.Quaternion();\n\t\tvar quaternionY = new THREE.Quaternion();\n\t\tvar quaternionZ = new THREE.Quaternion();\n\t\tvar quaternionE = new THREE.Quaternion();\n\n\t\tvar oldPosition = new THREE.Vector3();\n\t\tvar oldScale = new THREE.Vector3();\n\t\tvar oldRotationMatrix = new THREE.Matrix4();\n\n\t\tvar parentRotationMatrix = new THREE.Matrix4();\n\t\tvar parentScale = new THREE.Vector3();\n\n\t\tvar worldPosition = new THREE.Vector3();\n\t\tvar worldRotation = new THREE.Euler();\n\t\tvar worldRotationMatrix = new THREE.Matrix4();\n\t\tvar camPosition = new THREE.Vector3();\n\t\tvar camRotation = new THREE.Euler();\n\n\t\tdomElement.addEventListener( \"mousedown\", onPointerDown, false );\n\t\tdomElement.addEventListener( \"touchstart\", onPointerDown, false );\n\n\t\tdomElement.addEventListener( \"mousemove\", onPointerHover, false );\n\t\tdomElement.addEventListener( \"touchmove\", onPointerHover, false );\n\n\t\tdomElement.addEventListener( \"mousemove\", onPointerMove, false );\n\t\tdomElement.addEventListener( \"touchmove\", onPointerMove, false );\n\n\t\tdomElement.addEventListener( \"mouseup\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"mouseout\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchend\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchcancel\", onPointerUp, false );\n\t\tdomElement.addEventListener( \"touchleave\", onPointerUp, false );\n\n\t\tthis.attach = function ( object ) {\n\n\t\t\tscope.object = object;\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\n\t\t\tthis.gizmo[_mode].show();\n\n\t\t\tscope.update();\n\n\t\t};\n\n\t\tthis.detach = function ( object ) {\n\n\t\t\tscope.object = undefined;\n\t\t\tthis.axis = undefined;\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\n\n\t\t};\n\n\t\tthis.setMode = function ( mode ) {\n\n\t\t\t_mode = mode ? mode : _mode;\n\n\t\t\tif ( _mode == \"scale\" ) scope.space = \"local\";\n\n\t\t\tthis.gizmo[\"translate\"].hide();\n\t\t\tthis.gizmo[\"rotate\"].hide();\n\t\t\tthis.gizmo[\"scale\"].hide();\t\n\t\t\tthis.gizmo[_mode].show();\n\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t};\n\n\t\tthis.setSnap = function ( snap ) {\n\n\t\t\tscope.snap = snap;\n\n\t\t};\n\n\t\tthis.setSize = function ( size ) {\n\n\t\t\tscope.size = size;\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\t\t\t\n\t\t};\n\n\t\tthis.setSpace = function ( space ) {\n\n\t\t\tscope.space = space;\n\t\t\tthis.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t};\n\n\t\tthis.update = function () {\n\n\t\t\tif ( scope.object === undefined ) return;\n\n\t\t\tscope.object.updateMatrixWorld();\n\t\t\tworldPosition.setFromMatrixPosition( scope.object.matrixWorld );\n\t\t\tworldRotation.setFromRotationMatrix( tempMatrix.extractRotation( scope.object.matrixWorld ) );\n\n\t\t\tcamera.updateMatrixWorld();\n\t\t\tcamPosition.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tcamRotation.setFromRotationMatrix( tempMatrix.extractRotation( camera.matrixWorld ) );\n\n\t\t\tscale = worldPosition.distanceTo( camPosition ) / 6 * scope.size;\n\t\t\tthis.position.copy( worldPosition );\n\t\t\tthis.scale.set( scale, scale, scale );\n\n\t\t\teye.copy( camPosition ).sub( worldPosition ).normalize();\n\n\t\t\tif ( scope.space == \"local\" )\n\t\t\t\tthis.gizmo[_mode].update( worldRotation, eye );\n\n\t\t\telse if ( scope.space == \"world\" )\n\t\t\t\tthis.gizmo[_mode].update( new THREE.Euler(), eye );\n\n\t\t\tthis.gizmo[_mode].highlight( scope.axis );\n\n\t\t};\n\n\t\tfunction onPointerHover( event ) {\n\n\t\t\tif ( scope.object === undefined || _dragging === true ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tvar pointer = event.changedTouches ? event.changedTouches[ 0 ] : event;\n\n\t\t\tvar intersect = intersectObjects( pointer, scope.gizmo[_mode].pickers.children );\n\n\t\t\tif ( intersect ) {\n\n\t\t\t\tscope.axis = intersect.object.name;\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t} else if ( scope.axis !== null ) {\n\n\t\t\t\tscope.axis = null;\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onPointerDown( event ) {\n\n\t\t\tif ( scope.object === undefined || _dragging === true ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar pointer = event.changedTouches ? event.changedTouches[ 0 ] : event;\n\n\t\t\tif ( pointer.button === 0 || pointer.button === undefined ) {\n\n\t\t\t\tvar intersect = intersectObjects( pointer, scope.gizmo[_mode].pickers.children );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tscope.axis = intersect.object.name;\n\n\t\t\t\t\tscope.update();\n\n\t\t\t\t\teye.copy( camPosition ).sub( worldPosition ).normalize();\n\n\t\t\t\t\tscope.gizmo[_mode].setActivePlane( scope.axis, eye );\n\n\t\t\t\t\tvar planeIntersect = intersectObjects( pointer, [scope.gizmo[_mode].activePlane] );\n\n\t\t\t\t\toldPosition.copy( scope.object.position );\n\t\t\t\t\toldScale.copy( scope.object.scale );\n\n\t\t\t\t\toldRotationMatrix.extractRotation( scope.object.matrix );\n\t\t\t\t\tworldRotationMatrix.extractRotation( scope.object.matrixWorld );\n\n\t\t\t\t\tparentRotationMatrix.extractRotation( scope.object.parent.matrixWorld );\n\t\t\t\t\tparentScale.setFromMatrixScale( tempMatrix.getInverse( scope.object.parent.matrixWorld ) );\n\n\t\t\t\t\toffset.copy( planeIntersect.point );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_dragging = true;\n\n\t\t}\n\n\t\tfunction onPointerMove( event ) {\n\n\t\t\tif ( scope.object === undefined || scope.axis === null || _dragging === false ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar pointer = event.changedTouches? event.changedTouches[0] : event;\n\n\t\t\tvar planeIntersect = intersectObjects( pointer, [scope.gizmo[_mode].activePlane] );\n\n\t\t\tpoint.copy( planeIntersect.point );\n\n\t\t\tif ( _mode == \"translate\" ) {\n\n\t\t\t\tpoint.sub( offset );\n\t\t\t\tpoint.multiply(parentScale);\n\n\t\t\t\tif ( scope.space == \"local\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\tif ( scope.axis.search(\"X\") == -1 ) point.x = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") == -1 ) point.y = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") == -1 ) point.z = 0;\n\n\t\t\t\t\tpoint.applyMatrix4( oldRotationMatrix );\n\n\t\t\t\t\tscope.object.position.copy( oldPosition );\n\t\t\t\t\tscope.object.position.add( point );\n\n\t\t\t\t} \n\n\t\t\t\tif ( scope.space == \"world\" || scope.axis.search(\"XYZ\") != -1 ) {\n\n\t\t\t\t\tif ( scope.axis.search(\"X\") == -1 ) point.x = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") == -1 ) point.y = 0;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") == -1 ) point.z = 0;\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tscope.object.position.copy( oldPosition );\n\t\t\t\t\tscope.object.position.add( point );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( scope.snap !== null ) {\n\t\t\t\t\n\t\t\t\t\tif ( scope.axis.search(\"X\") != -1 ) scope.object.position.x = Math.round( scope.object.position.x / scope.snap ) * scope.snap;\n\t\t\t\t\tif ( scope.axis.search(\"Y\") != -1 ) scope.object.position.y = Math.round( scope.object.position.y / scope.snap ) * scope.snap;\n\t\t\t\t\tif ( scope.axis.search(\"Z\") != -1 ) scope.object.position.z = Math.round( scope.object.position.z / scope.snap ) * scope.snap;\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t} else if ( _mode == \"scale\" ) {\n\n\t\t\t\tpoint.sub( offset );\n\t\t\t\tpoint.multiply(parentScale);\n\n\t\t\t\tif ( scope.space == \"local\" ) {\n\n\t\t\t\t\tif ( scope.axis == \"XYZ\") {\n\n\t\t\t\t\t\tscale = 1 + ( ( point.y ) / 50 );\n\n\t\t\t\t\t\tscope.object.scale.x = oldScale.x * scale;\n\t\t\t\t\t\tscope.object.scale.y = oldScale.y * scale;\n\t\t\t\t\t\tscope.object.scale.z = oldScale.z * scale;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\t\tif ( scope.axis == \"X\" ) scope.object.scale.x = oldScale.x * ( 1 + point.x / 50 );\n\t\t\t\t\t\tif ( scope.axis == \"Y\" ) scope.object.scale.y = oldScale.y * ( 1 + point.y / 50 );\n\t\t\t\t\t\tif ( scope.axis == \"Z\" ) scope.object.scale.z = oldScale.z * ( 1 + point.z / 50 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( _mode == \"rotate\" ) {\n\n\t\t\t\tpoint.sub( worldPosition );\n\t\t\t\tpoint.multiply(parentScale);\n\t\t\t\ttempVector.copy(offset).sub( worldPosition );\n\t\t\t\ttempVector.multiply(parentScale);\n\n\t\t\t\tif ( scope.axis == \"E\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( lookAtMatrix ) );\n\t\t\t\t\ttempVector.applyMatrix4( tempMatrix.getInverse( lookAtMatrix ) );\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tquaternionE.setFromAxisAngle( eye, rotation.z - offsetRotation.z );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionE );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t} else if ( scope.axis == \"XYZE\" ) {\n\n\t\t\t\t\tquaternionE.setFromEuler( point.clone().cross(tempVector).normalize() ); // rotation axis\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\t\t\t\t\tquaternionX.setFromAxisAngle( quaternionE, - point.clone().angleTo(tempVector) );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t} else if ( scope.space == \"local\" ) {\n\n\t\t\t\t\tpoint.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\ttempVector.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) );\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( oldRotationMatrix );\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, rotation.x - offsetRotation.x );\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, rotation.y - offsetRotation.y );\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, rotation.z - offsetRotation.z );\n\n\t\t\t\t\tif ( scope.axis == \"X\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionX );\n\t\t\t\t\tif ( scope.axis == \"Y\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionY );\n\t\t\t\t\tif ( scope.axis == \"Z\" ) quaternionXYZ.multiplyQuaternions( quaternionXYZ, quaternionZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( quaternionXYZ );\n\n\t\t\t\t} else if ( scope.space == \"world\" ) {\n\n\t\t\t\t\trotation.set( Math.atan2( point.z, point.y ), Math.atan2( point.x, point.z ), Math.atan2( point.y, point.x ) );\n\t\t\t\t\toffsetRotation.set( Math.atan2( tempVector.z, tempVector.y ), Math.atan2( tempVector.x, tempVector.z ), Math.atan2( tempVector.y, tempVector.x ) );\n\n\t\t\t\t\ttempQuaternion.setFromRotationMatrix( tempMatrix.getInverse( parentRotationMatrix ) );\n\n\t\t\t\t\tquaternionX.setFromAxisAngle( unitX, rotation.x - offsetRotation.x );\n\t\t\t\t\tquaternionY.setFromAxisAngle( unitY, rotation.y - offsetRotation.y );\n\t\t\t\t\tquaternionZ.setFromAxisAngle( unitZ, rotation.z - offsetRotation.z );\n\t\t\t\t\tquaternionXYZ.setFromRotationMatrix( worldRotationMatrix );\n\n\t\t\t\t\tif ( scope.axis == \"X\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionX );\n\t\t\t\t\tif ( scope.axis == \"Y\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionY );\n\t\t\t\t\tif ( scope.axis == \"Z\" ) tempQuaternion.multiplyQuaternions( tempQuaternion, quaternionZ );\n\n\t\t\t\t\ttempQuaternion.multiplyQuaternions( tempQuaternion, quaternionXYZ );\n\n\t\t\t\t\tscope.object.quaternion.copy( tempQuaternion );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tscope.update();\n\t\t\tscope.dispatchEvent( changeEvent );\n\n\t\t}\n\n\t\tfunction onPointerUp( event ) {\n\n\t\t\t_dragging = false;\n\t\t\tonPointerHover( event );\n\n\t\t}\n\n\t\tfunction intersectObjects( pointer, objects ) {\n\n\t\t\tvar rect = domElement.getBoundingClientRect();\n\t\t\tvar x = (pointer.clientX - rect.left) / rect.width;\n\t\t\tvar y = (pointer.clientY - rect.top) / rect.height;\n\t\t\tpointerVector.set( ( x ) * 2 - 1, - ( y ) * 2 + 1, 0.5 );\n\n\t\t\tprojector.unprojectVector( pointerVector, camera );\n\t\t\tray.set( camPosition, pointerVector.sub( camPosition ).normalize() );\n\n\t\t\tvar intersections = ray.intersectObjects( objects, true );\n\t\t\treturn intersections[0] ? intersections[0] : false;\n\n\t\t}\n\n\t};\n\n\tTHREE.TransformControls.prototype = Object.create( THREE.Object3D.prototype );\n\n}());"
},
"$:/plugins/rboue/Three.js/Lib/Controls/VRControls.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Controls/VRControls.js",
"module-type": "library",
"text": "/**\n * @author dmarcos / https://github.com/dmarcos\n */\n\nTHREE.VRControls = function ( camera, done ) {\n\n\tthis._camera = camera;\n\n\tthis._init = function () {\n\t\tvar self = this;\n\t\tif ( !navigator.mozGetVRDevices && !navigator.getVRDevices ) {\n\t\t\tif ( done ) {\n\t\t\t\tdone(\"Your browser is not VR Ready\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( navigator.getVRDevices ) {\n\t\t\tnavigator.getVRDevices().then( gotVRDevices );\n\t\t} else {\n\t\t\tnavigator.mozGetVRDevices( gotVRDevices );\n\t\t}\n\t\tfunction gotVRDevices( devices ) {\n\t\t\tvar vrInput;\n\t\t\tvar error;\n\t\t\tfor ( var i = 0; i < devices.length; ++i ) {\n\t\t\t\tif ( devices[i] instanceof PositionSensorVRDevice ) {\n\t\t\t\t\tvrInput = devices[i]\n\t\t\t\t\tself._vrInput = vrInput;\n\t\t\t\t\tbreak; // We keep the first we encounter\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( done ) {\n\t\t\t\tif ( !vrInput ) {\n\t\t\t\t error = 'HMD not available';\n\t\t\t\t}\n\t\t\t\tdone( error );\n\t\t\t}\n\t\t}\n\t};\n\n\tthis._init();\n\n\tthis.update = function() {\n\t\tvar camera = this._camera;\n\t\tvar quat;\n\t\tvar vrState = this.getVRState();\n\t\tif ( !vrState ) {\n\t\t\treturn;\n\t\t}\n\t\t// Applies head rotation from sensors data.\n\t\tif ( camera ) {\n\t\t\tcamera.quaternion.fromArray( vrState.hmd.rotation );\n\t\t}\n\t};\n\n\tthis.getVRState = function() {\n\t\tvar vrInput = this._vrInput;\n\t\tvar orientation;\n\t\tvar vrState;\n\t\tif ( !vrInput ) {\n\t\t\treturn null;\n\t\t}\n\t\torientation\t= vrInput.getState().orientation;\n\t\tvrState = {\n\t\t\thmd : {\n\t\t\t\trotation : [\n\t\t\t\t\torientation.x,\n\t\t\t\t\torientation.y,\n\t\t\t\t\torientation.z,\n\t\t\t\t\torientation.w\n\t\t\t\t]\n\t\t\t}\n\t\t};\n\t\treturn vrState;\n\t};\n\n};"
},
"$:/plugins/rboue/Three.js/config.json": {
"title": "$:/plugins/rboue/Three.js/config.json",
"type": "application/json",
"text": "{\n\"\":\"Actually nothing.\",\n\n\"\":\"\"\n}"
},
"$:/plugins/rboue/Three.js/icon": {
"created": "20150122113649353",
"modified": "20150122113650949",
"title": "$:/plugins/rboue/Three.js/icon",
"type": "image/png",
"text": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCAYZvJsQjgAAABl0RVh0Q29tbWVudABDcmVhdGVk\nIHdpdGggR0lNUFeBDhcAABHaSURBVHja7Z15VJNX3se/N7IoWElQgwiEVUBZBJdSSweFEZdaWjew\nIrZqO9O302l9562n9cx5zxydMzOnp6eli+2r09KilipuoxVKlUarUOqGBRcUiBKIiQjGLEAggZD7\n/kHTwRGyB7I837845Fnuc3+f53eX53d/l1BK4UqilOLBgwdob2+HQqGAQqGAUqmEWq2GUDMxPFWe\n22To/CrOvohw7wfCsWPHgs1mw8/PD2w2GwEBAfD39wchxKXqizg7ACqVCiKRCCKRCGKxGMHtm+36\nQGLuRyQ4OBihoaEICQmBr68vA8BISqfTQSQSQSAQoPJ2j9E32t4Sct4jUVFRiIqKAo/HA4vFYgCw\nh1tvampCXV0dvOtyHbrAvfH7SVxcHMLDw52iuXBoANra2nDp0iV4XnveKdupvoRiMnfuXAQEBDAA\nmOVWhUKcO3cOE1t+7xI9VFnY52TevHkICwtjADDk5uvr61FRUYEw2ZuuNTT5RS0T80laWhpiYmIc\npnlwCAAaGxvxww8/uKzhhwIhPT0d06ZNc28A7ty5gxMnToAn/ZNbGP6R55/8IVmyZAmCg4PdC4De\n3l6cOnUKrNpstzT8I5p1hGRkZMDT09P1ARAIBGg6nMwYfghF5VwhkZGRrgmAWq1GSUkJJtzayBjf\ngLpjvyLLli2Dl5fXiNxvRKat2trasL3wdD5jfOPyqV9P//blifD79++7hgeoqalB+4nfMIa3QAFL\nfyRJSUnOCQClFHw+H7rqFYzxrZBnynGSnp5ut3kDuzQBWq0WBw4cYIxvA/VdeJYePHgQWq3WOQDQ\naDQoKioCR/gyY3wbid30Ev3666+h0WgcG4DOzk78vfBkeGDrHxnj21hT7r5G/154Mryzs9MxAVAq\nlTh6dOfPo/193pWVKs9t+kdRZX5HR4djdQK7urpQtWMK89aPJAyv3yPjx48ffQ+gVqvxbtHpcMYk\nI6t3i06Hq9Xq0fUAWq0WRUVFYNr80dG9qZ+SdevWwcPDY+Q9gE6nw6FDhxjjj3LH8PDhw7DmJbbY\nA5SXl4NeXskY3wHkmXKcZGRkjJwHqKmpYYzvQOq78Cytr68fGQDa29uZuX0HVMvROdSSOQKzAOjr\n68MHR6rzmep2TB04cAD9/f326wOUlZVhzJUc5u13YLHmHCWZmZm29wDNzc2M8Z1AuuoV9M6dO7YF\noLe3Fw374xnjO4l2fXslT6fT2a4J4PP56L+0nAFgBNXs/z6ZPn06OBwOfHx80N/fD5VKBbFYDK/r\na43awi+dT5544gnrAWhvb0fNFxEuZ3wx9yPC5XIxbtw4AAMBLDKZDOyml0b1WaW8f5KFCxciICBg\n2HJQSnH16lVyryzVYFlTXhUTNpttHQB79+5FgOQPLgFA57TdJD4+HhEREdRQ0KVUKs2pr68/pKpc\nMqLPHZR1nsTHm97UarVafPPNN2R844tDnqOM/JLk5ORYDsDt27dx6+BMpzd+R1QhycjIeHvixInv\nmNWh0ulQU1NDpOXz7V4HcevrSXBwsNn3+SX0jgwXfRWz9joxtCaRZejCe76vc/qvfNwllSQ7O5ua\na3wAYLFYmD17Nn3qjTa0Bn5it8V8kdm1FhkfAAghWLhwIe2K3jNk+U6dOmWZB6irq4P4eIpTv/0z\nN94iU6bYJk6BUopTp04RW3eGe6YXkeXLl9O+vj6cPHmSnD17Fh0dHQgMDMTSpUuRkmKaDdRqNc5+\nMGnI32Jz60hoaKh5AOzatQvh8i1OC0DyS03+XC5XZuvrlpaWElvmK0h5VUxqa2vxyiuvoLGx8ZHr\nLly4kBQUFCA0NNToPX/88UcyVL9FyvsnWbdunekA3Lp1C7cPJTmt8X9ZYmWX8ut0OhQVFRFbdIxl\nYZ8THx8frF69mhqK+p00aVLOhQsXDkVEGB6N9fT0oOLDyUP+NiPvJgkJCTGtD3D+/Hnn9fuzjjxk\n/I6ODpSXl5Pdu3eTvXv3kjNnzhBrImlYLBZWrVplE7i4XC42bNhw21jIt1QqPfjCCy8Y/e4/btw4\nSAI+HrIvUFVVZVonUCaTYfKd/3Lat3/+/IEee01NDVmxYgXhcrlYvHgx3bhxI33xxRdpeno65XK5\n2LRpExEKhRZ17Hx9feHz1HdWdwq1F5+jCoUiwpRjq6qqKJ/PN3rPwMDAIf/PEb5M5XK5cQCqq6ud\n9uUf++S3xNvbG9u3bydz5syhx44do0PF0nd2dqKwsJBOnz6d7tmzxyJDmto5M6StB6eZde+ysjKj\nxzz22GPD/nb58mXDAPT39zt1oMfcuXOxZcsWsm3bNmrKXLhGo8HGjRvpzp07zYbAy8sLZPa/rPIC\nYrE425zjm5ubjR5jKD6w/9LyR+rlIQAEAoHTvv13p+wgx44dQ35+vlkAU0qxefNmev78ebONGRsb\na1WZvb29D5lzvI+Pj9FjjAWF3Lp1a3gA6urqnBYAHo+HLVu2WHRuX18fXn/9dbODKy2dvNHL3BxB\niYmJxkcWMsMj3xs3bgwNgFarxXBzys4g7cXnaGtrq8Xlr66uNtsLsFgstAfvtLgZ2Lroksnl9fLy\nwpo1awzXgVZr9GPWuJt5dHDU0K8ACIVCOLM+PZdhda+8pKTE7HOMfW0zprS0NJPK/dZbb5GwsDBq\nxL2bdK3BfQmWK7T/ANDQ0GD1NSxpAr29va2655tvvomEhASDhsvJySHbtm2jxiaoLl48/rMp9xxs\n618B4PQc6XJmAGQyWba115BKpSNebu+6XFpWVobt27eT4ODgh0CYOXMmKSwsJMXFxXTMmDEGr3Pp\n0iUSIPlrsin3PCvU5T8EgFKpREfjAafOe+7n53fI2mtwOByzz+np6bG67J+V/hy+detW2tLSQhsb\nG0l1dTWRSCSktraWbtiwgRrLDiIUConi9G9N7k8sUOT8Sb/CmAUMJGx0dg03A2aOwsPDLfE8Vt83\nVZ7b9LcvT0R0dHQ0TZs2jc6ePZtOnTrVJINeuXKFNBYnmN35FYvFrgXA/z5dY/UIJisry6zjKaWY\neu91m4ycUuW5TRd2BkfU1taaFKepUqnw7bffGg0LG04ikejfANy9e9fpAajgFK83NA1qTJGRkSQ9\nPd2symxtbbV5kEjbd0/RP+/67oPKykoilUpzBg/Zent70dTUREpLS8mPHwfA4+oai+FrbW0FABCd\nTofydx5zmaDPJX9WWXTewYMHSXa2ealry8vLiTNPnS/a2klYQ30hclbR5MNk6dKlZr+Vr732mtnG\nV6lUTr9AVqlUgjUaQx97idSsprt378amTZtMgoDFYuGdd94hO3bsMNuQFRUVTr99mFQqhUt5AGAg\n8KGgoADFxcUkLCxsWCMlJSURPp9P3n77bWpuEkaZTPaZK2Q6l8vl8FAoFC4FgE/9elpd/QNZs2YN\nzc7Oxrlz50hFRQXu3r0LFosFHo+HzMxMJCYmWmRAjUaD0tKCuQEuUFcKhQIeSqUSfnAtyfjpVDK1\ngQQFBdHU1FSamppqmz4GpSgpKSEBkr+6RKdZqVSC1d3dDVfU9b0xtL6+3mbttEajwb59+8hjgg0u\nM2JSqVRgCdST8uCiajk6h/70009W50JUKBRNe/bsIZNEr7jUGsmenh6QE//wdflVv21Bf6mZM+eZ\nWdOnTzerw9fV1YUzZ84QZ9230KSRkzsAoJeY+xFJTk5GdHQ0HS7LJqUUYrGYXL9+3S32NHIrAAZr\nQvQa1e2e9PH67/mUUiiVSrfbwcxtAWA0IBZTBQwAjBgAGDEAMHJPAKo4+yKYanBPCTnvEVbEWJmQ\nqQr3lI+PD1imrDdj5MIAWLuyhZHzis1mMwAwADAAuDcAkydPZmrCTcXlchkP4M6aMGECWIQQiLkf\nEaY63Et3p+wgwC8zgcHBwUyNuJn0NmcBA+lVGLmX9EkjGQ/AADCQW66CU7yeqRb3kJDzHvH19f03\nAAAwP8KriKka91BUVNSvf3sM/qfgMlM55qot6P+Iv78//Pz84OHhAS8vL3h7e4PFGni3ent7odVq\nodFooNFoIJPJIJfLRzX2cEgAeDweBIw9DUoZ+SUJDQ0Fj8cDl8vV5+2x0JC/Q3d3N8RiMWlpaUFL\nSwtC7v/3iEAxOGv4Q4smjh07hnE385gg0UHSJR0iCQkJVieFNEUajQY3b94k165dA1f8ql3up4nb\nR5599tmhARAIBGg6nOz2AFRwitfnzY8siomJoXpXPtLq6urCuXPnht0LyGL3P7CXwtAA9Pf3g/+u\nn1sDELjsJ5KQkGD2knF7qbOzE2fOnCGm7BVoijLf7iCDoX4I7zFjxsDj8W/cclr43tRPyW82tyMx\nMdFhjK8fomdlZdHQFdVWF8rriRLynx7tEf+WnJzsdsaXhX1O8vLyqCNHR8XGxtL4FxqsgiApKemR\n/z0CgL+/P+ThBW7jBSZEr1GtXr3aaCZOR1BQUBANee6iRbZRRHxBhkqEOWQPx5Q9Z11FPlFvjPf0\n9HSa8s6YMYO2TMw3G4Inn3xyyP8PCUBYWBiEnPfcwgtER0dTJyyzWceLJn0w5I5hwwIAAOnp6W7h\nAcaOHet0ZdZveG2qDNlyWABiYmLcIlBEKpXOcbYy379/3+RjWwM/IYOnfk0GAAAWLFjg8h7g8lBb\naTmwenp6YE7Gkvnz5xv83SAAkZGRLj8iIDWrqUgkcopnpJSirKzM5LJ2x35FjGVANzrPuXjxYpf3\nAje/nkElEglxdOOfPHmSmLOv06JFi4weYxQADoeDMXOPuXxf4PreGFpbW+uQz9nT04P9+/cTUrPa\nZOP7pfN/DfqwCgB9L9IdIobavnuK/mXX8YgbN244BAgajQZ8Pp9UfDgZE1t+b7Lx70z+kKSkpJjW\nBJqaQ6+5uRkN++Pd5kPR/ZBdZNasWYiOjqaGduO0h+RyOf/atWuZPVVPW1Tfw+0UbhUAAMDn89F/\nabnbfS1Uz/iaxMTEgMfj2eV7AaUU7e3tRCgUoq6uDsHtmy2u43GpZSQtLc30TrA5APT396OgoABh\nsjfd9pNxBad4/bxgFHG5XLDZbLDZbA6bzZZ5eXmZZOiuri4oFAqiUCggl8shkUjg3/w7m9Rne/BO\nkpeXB3O+ZpqdRrW9vR01X0QwUUMGAInwbCvy8vICpRRqtRqhD/5nROrryT+2EnO3zbEoj25DQwOa\n/zWbgcCBFJtbR0JDQ80+z6J4p5iYGKu3TmdkO3mmHLfI+BYDAACZmZnQxO1jIBjtoWLcPmLNhzuL\nASCEICsrC4qILxgIRknKyC9JVlYWrAlhsyrklRCCVatW/brUmNHI6e6UHWTlypWwNn7R6phnDw8P\n5Obmuk0AiSOo2f99kpubC1tMUNkk6N3b2xtr165FW9Bfahjz2Fdn2Ac/WLt2rdXb1ls1DBxOarUa\n+/fvt9l+uoweVmvgJ+T555+3aRSTTQEABmYLjxw5Ar/bmxgIbKiOqEKycuVK2Dp62eYAAANTnqWl\npbDVahZ3V19CMVm2bBnssWDFLgDoITh9+jS0F59jILBCXk+UkAULFsBeq5XsBoBeLS0tqN8Xx0Bg\ngeJfaCBBQUF2vYfdAQCA7u5uHD16FK6275699CD0M7J8+XKMxFK1EQFA3yRcvHgRitO/ZSAwIHbG\nKfL4449jpBaojhgAeonFYpSWliJcvoUBYZCa/d8nzzzzDOzt8kcdAL03uHr1Ku6VpTIQAJjydBVJ\nTEzEaCxLHxUA9Orq6sL3338Pn/r1bglCd+xXZNGiRTAletclAdBLIBDg7NmzI5YkabTVMjGfZGRk\nwNCSLbcCQC+hUIjKykoESP5AXdXwaWlpAwE1DpKFxKEA0EsikaCyshIc4csuAYIs7HMyb948hIWF\nOVzZHBIAvTo7O3H16lV0VSx2ShDGp50kM2fOxHA7lTMAmDFqaGpqQl1dHbzrch26wL3x+0lcXBzC\nw8PhSMmmnBqAwdLpdBCJRBAIBKi83ROeKs9tGtV+C+c9EhUVhaioKPB4PIxWXkG3AeA/pVKpIBKJ\nIBKJIJFIENT2hl0fSBLwMQkKCkJoaChCQkJGdQjHADCMOjo6IJVKoVQqoVAooFAo0N3dDZVKZXSR\nRsvEfOLr6wsfHx/9yh+w2WxMmjQJ5i66cAb9P0ino5gBTAIlAAAAAElFTkSuQmCC\n"
},
"$:/plugins/rboue/Three.js/license": {
"title": "$:/plugins/rboue/Three.js/license",
"text": "!Plugin license\nCopyright (C) 2015 René Boué (rboue) <rboue01 (at) gmail (dot) com><br>\nAll rights reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http://www.gnu.org/licenses/>.\n\n!Three.js r69 license\nThe Three.js r69 LICENSE file is as follows :\n\n```\nThe MIT License\n\nCopyright © 2010-2014 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```"
},
"$:/plugins/rboue/Three.js/readme": {
"title": "$:/plugins/rboue/Three.js/readme",
"text": "Three.js r69 for ~TiddlyWiki."
},
"$:/plugins/rboue/Three.js/tiddlywiki.js": {
"text": "/*\\\ntitle: $:/plugins/rboue/Three.js/tiddlywiki.js\ntype: application/javascript\nmodule-type: library\n\n Adaptation of Three.js to TiddlyWiki.\n\n\\*/\n(function() {\n\n var TiddlyWiki = function(widget, tiddlerTitle, widgetConfiguration) {\n this.widget = widget; // widget\n this.tiddlerTitle = tiddlerTitle; // title of the main code tiddler\n this.widgetConfiguration = widgetConfiguration; // widget's configuration object\n };\n\n // Static members\n\n // Initialized at TiddlyWiki session opening\n TiddlyWiki.sessionConfiguration = null; // Session configuration\n\n // Static initialisations\n TiddlyWiki.init = function(sessionConfiguration) {\n TiddlyWiki.sessionConfiguration = sessionConfiguration;\n };\n\n // Get CSS raw source of a tiddler image\n TiddlyWiki.getRawTiddlerImage = function(tiddlerName) {\n if (!$tw || !$tw.wiki) return false;\n // Check if it is an image tiddler\n if (!$tw.wiki.isImageTiddler(tiddlerName)) return false;\n var tiddler = $tw.wiki.getTiddler(tiddlerName);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) return false;\n var text = tiddler.fields.text;\n if (!text) return false;\n var type = tiddler.fields.type;\n // Render the appropriate element for the image type\n var src = \"\";\n switch(type) {\n case \"image/svg+xml\":\n src = \"data:image/svg+xml,\" + encodeURIComponent(text);\n break;\n default:\n src = \"data:\" + type + \";base64,\" + text;\n break;\n }\n\n return src;\n }; \n\n // Loading of TiddlyWiki specific URL\n // Parameters :\n // <url> : URL with specific syntax : \"tw:<tiddler title>\"\n // <type> : \"image\" for image tiddler, \"ArrayBuffer\" for tiddler with base64 content.\n // Returns the tiddler data (text or binary) or null.\n // The type of data (text or binary) is deduced from the tiddler's type.\n // Type image/xx means tiddler image.\n // Type application/octet-stream means binary data coded with base64. In that case an ArrayBuffer\n // is returned.\n // Other types means plain text.\n TiddlyWiki.load = function(url) {\n var func = \"TiddlyWiki.load\";\n if (!url || !url.match(/^tw:/)) return null;\n hack.log(\"url: \"+url, hack.loader, func);\n var tiddlerTitle = tiddlyWiki.resolvePath(url.replace(\"tw:\", \"\"), true);\n var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) {\n throw new Error(\"TiddlyWiki.load: \\\"\" + url + \"\\\" : unknown tiddler.\");\n }\n if (tiddler.fields.type.match(/^image\\//))\n return TiddlyWiki.getRawTiddlerImage(tiddlerTitle);\n else {\n if (!tiddler.fields.text) {\n console.error(\"TiddlyWiki.load: \\\"\" + url + \"\\\" seems to be unreachable or the tiddler is empty.\");\n return null;\n }\n if (tiddler.fields.type == \"application/octet-stream\")\n return StringView.makeFromBase64(tiddler.fields.text).buffer;\n else\n return tiddler.fields.text;\n }\n };\n\n // Export current view to an image tiddler\n // Parameters :\n // <domElement> : DOM element, <canvas> or <svg>.\n // <url> : URL with specific syntax : \"tw:<tiddler title>\".\n // <type> : type of image tiddler : \"image/png\" (default) or \"image/jpeg\".\n // <flagOverwrite> : if true, overwrites existing tiddler without asking.\n // Saves view data as a tiddler image with required type.\n TiddlyWiki.exportToTiddler = function(domElement, url, type, flagOverwrite) {\n var func = \"TiddlyWiki.exportToTiddler\";\n if (!url || !url.match(/^tw:/)) {\n console.error(func+\": bad URL format, not a tiddler.\");\n return;\n }\n hack.log(\"url: \"+url, hack.render, func);\n var tag = domElement.tagName.toUpperCase();\n if (!type) {\n if (tag == \"SVG\")\n type = \"image/svg+xml\";\n else\n type = \"image/png\";\n }\n if ((((type == \"image/png\") || (type == \"image/jpeg\")) && (tag != \"CANVAS\")) ||\n ((type == \"image/svg+xml\") && (tag != \"SVG\"))) {\n console.error(func+\": bad tiddler type : \"+type)\n return;\n }\n var tiddlerTitle = tiddlyWiki.resolvePath(url.replace(\"tw:\", \"\"), true);\n if (!flagOverwrite) {\n var tiddler = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler) != \"undefined\") && tiddler) {\n if (!confirm(\"View image saving : tiddler <\"+tiddlerTitle+\"> exists, would you like to overwrite it ?\")) return;\n }\n }\n var data = null;\n if (tag == \"SVG\") {\n data = domElement.outerHTML;\n type = \"\"; // bad TiddlyWiki behavior (with 5.1.5) !?\n } else\n data = domElement.toDataURL(type).replace(/^data:.*?;base64,/, \"\");\n //console.log(func+\": data = \"+data);\n\n // Create the image tiddler\n $tw.wiki.addTiddler(new $tw.Tiddler({title: tiddlerTitle, type: type, text: data}));\n };\n\n // Create a Worker to execute inline code\n TiddlyWiki.createWorker = function (func) {\n var blobURL = URL.createObjectURL(new Blob(\n [\"(\", func.toString(), \")()\"],\n {type: \"application/javascript\"}\n ));\n var worker = new Worker(blobURL);\n URL.revokeObjectURL(blobURL);\n\n return worker;\n };\n\n\n // Instance members\n\n TiddlyWiki.prototype = {\n\n // Resolve file path.\n //\n // Following behaviour apply only if widget's configuration's object property \"filesystem\"\n // is defined. If not, file is assumed to be a tiddler's title.\n //\n // File path resolution is as close as possible to Unix (for executables, libraries,\n // manuals, ...).\n // We make assumption that tiddler title follows classical Unix Path pattern\n // like : /dir1/dir2/ ... /dir/file. If not the case, file should be\n // in the \"current\" directory, or completely out of path convention.\n // The curent directory (if any) is the \"directory\" of the current sheet tiddler.\n // Example :\n // File to resolve = myTiddler\n // Tiddler title of the current sheet = MyProject/MySubProject/calc1\n // Current directory = MyProject/MySubProject\n // Sheet file in filesystem mode = calc1\n // File path = MyProject/MySubProject/myTiddler\n //\n // Unlike Unix, there is no notion of root directory or \"/\". TiddlyWiki has no\n // real filesystem so we can't rely on a root node. Relative versus absolute\n // path is deduced from the following. If the first caracter of a file\n // path is \"/\" and there is no more \"/\" after that, then the current directory is \"\".\n // Remark that the behavior is identical to Unix. A file path beginning with a \"/\"\n // will be directly converted in a tiddler title.\n // By default (and unlike Unix), malformed path like multiple \"/\" instead of one\n // are not accepted. For example \"//\" is not reduced to \"/\" and treated like a\n // path separator. It is the responsibility of the user to be clear about the significance of\n // it's file reference, path-like name or tiddler title. For same reason,\n // blank characters, eventually around \"/\", are treated like ordinary characters\n // and not deleted in the final tiddler title.\n // With optionnal <flagNormalize> parameter set, malformed path are normalized like\n // Unix does, but blank characters are still not deleted.\n //\n // If not found in the current directory, a file is searched under a collection\n // of path directories, pre-defined in the PATH variable. Those directories are\n // absolute (i.e. not relative to current directory).\n // Syntax of the PATH variable :\n // <path1>';'<path2>';' ... ';'<pathN>\n // The PATH is searched first in a variable defined with a <$set> widget (not actually\n // implemented, maybe in the future if someone asks :), then in the \"path\" parameter\n // of the <$edit-socialcalc> widget, then in the widget's configuration object, under\n // filesystem.PATH property. The widget's configuration object is searched first in\n // $:/config/Three.js tiddler of \"application/json\" type, then in\n // $:/plugins/Three.js/config-defaults.json tiddler.\n // Please note that final PATH value is never a combination of different sources. The first\n // source that defines a valid PATH (either <$set> variable, \"path\" parameter of\n // <$edit-socialcalc> widget or widget's configuration object) gives the proper PATH value\n // and stops all subsequent PATH search.\n //\n // Search algorithm :\n // <file> : input file path.\n // <tiddlerTitle> : output.\n // <currentTiddlerTitle> : tiddler title of the current sheet.\n // PATH <- value of a \"path\" variable defined with <$set> widget, or \"path\" field\n // of <currentTiddlerTitle>.\n // currentDir <- path of <currentTiddlerTitle> (anything before the last '/', or \"\").\n // if <file> begins with \"./\" or \"../\" then\n // # Relative path\n // <finalPath> <- ... (search à la Unix)\n // if tiddler <finalPath> found then return <finalPath>\n // else\n // # Under <currentDir> or under a PATH directory, or absolute\n // if tiddler <currentDir>/<file> found then return <currentDir>/<file>\n // if <PATH> exists then\n // for all <dir> in <PATH>\n // if tiddler <dir>/<file> found then return <dir>/<file>\n // end for\n // end if\n // if tiddler <file> found then return file\n // end if\n //\n resolvePath: function(file, flagNormalize) {\n var fonc = \"TiddlyWiki.resolvePath\";\n\n hack.log(\"============= file = \"+file, hack.filesystem, fonc);\n\n if (!file) return null;\n var tiddlerTitle = \"\";\n var tiddler = false;\n if (!this.widgetConfiguration || !this.widgetConfiguration.filesystem) {\n hack.log(\"no filesystem in widget's configuration !\", hack.filesystem, fonc);\n return(file);\n }\n\n // Initialisation\n var currentTiddlerTitle = this.tiddlerTitle\n var currentDir = \"\";\n tiddler = $tw.wiki.getTiddler(currentTiddlerTitle);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) return null;\n \n // In case current tiddler is edited, we refer to the \"file\", not the draft tiddler\n if (tiddler.isDraft()) currentTiddlerTitle = tiddler.fields[\"draft.of\"];\n hack.log(\"currentTiddlerTitle = \"+currentTiddlerTitle, hack.filesystem, fonc);\n \n // Get PATH\n var tabPath = null;\n if (this.widgetConfiguration.filesystem.PATH && this.widgetConfiguration.filesystem.PATH != \"\")\n tabPath = this.widgetConfiguration.filesystem.PATH.split(/[\\s]*;[\\s]*/);\n hack.log(\"tabPath = \"+(tabPath ? tabPath.join(\" | \"): tabPath), hack.filesystem, fonc);\n\n currentDir = currentTiddlerTitle.replace(/[\\/][^\\/]*$/, \"\").replace(/[\\/][.][\\/]/, \"/\");;\n hack.log(\"currentDir = \"+currentDir, hack.filesystem, fonc);\n\n // File normalization\n if (flagNormalize) {\n file = file.replace(/[\\/][\\/]+/g, \"/\").replace(/\\/\\.\\//g, \"/\");\n hack.log(\"file normalized = \"+file, hack.filesystem, fonc);\n }\n\n if (file.match(/^\\.\\/|^\\.\\.\\/|\\/\\.\\.\\//)) {\n // Relative path or with relative sub-expressions\n \n hack.log(\"relative path\", hack.filesystem, fonc);\n tabCurrentDir = currentDir.split(\"/\");\n hack.log(\"tabCurrentDir = \"+tabCurrentDir.join(\" | \"), hack.filesystem, fonc);\n tabPageName = file.split(\"/\");\n var tabTiddlerTitle = [];\n for (var i = 0; i < tabCurrentDir.length; i++)\n tabTiddlerTitle.push(tabCurrentDir[i]);\n hack.log(\"tabTiddlerTitle = \"+tabTiddlerTitle.join(\" | \"), hack.filesystem, fonc);\n var indexInCurrentDir = tabCurrentDir.length - 1;\n hack.log(\"indexInCurrentDir = \"+indexInCurrentDir, hack.filesystem, fonc);\n var flagAbsolute = false;\n for (var i = 0; i < tabPageName.length; i++) {\n hack.log(\"boucle: tabPageName[\"+i+\"] = \"+tabPageName[i], hack.filesystem, fonc);\n hack.log(\" indexInCurrentDir = \"+indexInCurrentDir, hack.filesystem, fonc);\n hack.log(\" tabTiddlerTitle = \"+tabTiddlerTitle.join(\" | \"), hack.filesystem, fonc);\n if (tabPageName[i] == \".\") continue;\n if (tabPageName[i] == \"..\") {\n indexInCurrentDir--;\n if (tabTiddlerTitle.length == 0) {\n // Malformed path -> it seems to be an absolute non-path tiddler title\n hack.log(\" malformed path case 1\", hack.filesystem, fonc);\n flagAbsolute = true;\n break;\n }\n tabTiddlerTitle.pop();\n continue;\n }\n indexInCurrentDir++; // alas ! maybe we will return above currentDir\n hack.log(\" tabCurrentDir[indexInCurrentDir] = \"+tabCurrentDir[indexInCurrentDir], hack.filesystem, fonc);\n if (indexInCurrentDir < tabCurrentDir.length - 1) {\n // We wander above currentDir\n if ((indexInCurrentDir < 0) || (tabPageName[i] != tabCurrentDir[indexInCurrentDir])) {\n // Malformed path -> it seems to be an absolute non-path tiddler title\n hack.log(\" malformed path case 2\", hack.filesystem, fonc);\n flagAbsolute = true;\n break;\n }\n }\n tabTiddlerTitle.push(tabPageName[i])\n }\n\n if (!flagAbsolute) {\n tiddlerTitle = tabTiddlerTitle.join(\"/\");\n } else {\n tiddlerTitle = file;\n }\n\n } else {\n // Not relative path\n hack.log(\"absolute path (under curent dir, PATH dirs or really absolute)\", hack.filesystem, fonc);\n var flagFind = false;\n \n // Search under currentDir\n tiddlerTitle = currentDir + \"/\" + file;\n var tiddler1 = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler1) != \"undefined\") && tiddler1)\n flagFind = true;\n \n if (!flagFind && tabPath) {\n // Search under PATH directories\n for (var i = 0; i < tabPath.length; i++) {\n tiddlerTitle = tabPath[i] + \"/\" + file;\n var tiddler2 = $tw.wiki.getTiddler(tiddlerTitle);\n if ((typeof(tiddler2) != \"undefined\") && tiddler2) {\n flagFind = true;\n break;\n }\n }\n }\n \n // Maybe a tiddler already\n if (!flagFind)\n tiddlerTitle = file;\n }\n\n hack.log(\"============= tiddler = \"+tiddlerTitle, hack.filesystem, fonc);\n return tiddlerTitle;\n }\n };\n\n exports.TiddlyWiki = TiddlyWiki;\n\n})();",
"title": "$:/plugins/rboue/Three.js/tiddlywiki.js",
"type": "application/javascript",
"module-type": "library"
},
"$:/plugins/rboue/Three.js/view3js.js": {
"text": "/*\\\ntitle: $:/plugins/rboue/Three.js/view3js.js\ntype: application/javascript\nmodule-type: widget\n\nThe view3js widget displays a 3D view defined in a local tiddler.\n\n```\n<$view3js tiddler=\"TiddlerTitle\" width=\"320\" height=\"400\" class=\"classnames\"/>\n```\n\nThe widget generates an HTML5 WebGL node with a 3D view produced by main javascript code tiddler.\n\nThe width and height attributes are interpreted as a number of pixels, and do not need to include the \"px\" suffix.\nThe path attribute contains a collection of pseudo-path directory to search files to be loaded.\n\n\\*/\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CONST_NODE_ID_PREFIX = \"ThreejsWidget\"; // prefix of root node's id attribute\nvar CONST_MIN_HEIGHT = 300; // root node minimal height\nvar CONST_PLUGIN_PATH = \"$:/plugins/rboue/Three.js\";\nvar CONST_CONFIG_TIDDLER = \"$:/config/rboue/Three.js\";\nvar CONST_CONFIG_DEFAULT_TIDDLER = CONST_PLUGIN_PATH+\"/config.json\";\n\n// Get session configuration.\nvar sessionConfig = null;\nvar configTiddler = $tw.wiki.getTiddler(CONST_CONFIG_TIDDLER);\nif ((typeof(configTiddler) != \"undefined\") && configTiddler) {\n sessionConfig = $tw.wiki.getTiddlerData(configTiddler, null)\n}\nif (!sessionConfig) {\n var configTiddlerDefault = $tw.wiki.getTiddler(CONST_CONFIG_DEFAULT_TIDDLER);\n if ((typeof(configTiddlerDefault) != \"undefined\") && configTiddlerDefault) {\n sessionConfig = $tw.wiki.getTiddlerData(configTiddlerDefault, null)\n }\n}\n\n// Create objects\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\nvar StringView = require(\"./Lib/stringview.js\").StringView;\nvar TiddlyWiki = require(\"./tiddlywiki.js\").TiddlyWiki;\nTiddlyWiki.init(sessionConfig);\n\nvar View3jsWidget = function(parseTreeNode,options) {\n this.initialise(parseTreeNode,options);\n};\nView3jsWidget.instanceNb = 0; // count class instances\n\n// Inherit from the base widget class\nView3jsWidget.prototype = new Widget();\n\n//=======================================================================================\n\n// Render this widget into the DOM\nView3jsWidget.prototype.render = function(parent,nextSibling) {\n var fonc = \"View3jsWidget.render\";\n var self = this;\n\n // Debug tools\n var hack = {\n flagActiv: true, // Activate the logs\n log: function(mess, flagNoLog, fonc) {\n if (!hack.flagActiv || flagNoLog) return;\n var id = \"[]\";\n if (tiddlyWiki) id = \"[\"+tiddlyWiki.widget.nodeRootId+\"]\";\n console.log(id+(fonc ? fonc+\": \" : \"\")+mess);\n },\n logPoint: function(x,y) {return \"(\"+x+\",\"+y+\")\";},\n // Following are flags activating logs for specific fonctionnalities.\n // Value : false to activate, true to desactivate (no log).\n bug: false, // current bug investigation\n filesystem: true, // filesystem\n loader: true, // loader\n sceneLoader: true, // Scene loader\n render: true // rendering\n };\n window.hack = hack;\n\n // Create objects (continued)\n // Unfortunately, we can't create THREE object at TiddlyWiki start time (i.e. before\n // any widget instance) :\n // There is a complaint \"ReferenceError: Float32Array is not defined\" because a lot\n // of code is running at load time (many functions auto-defines themselves, allocating\n // Float32Array and returning a sub-function.\n // Float32Array is an object specific to WebGL. It seems that TiddlyWiki denies the use\n // of WebGL in sandbox environment !\n // The THREE module is loaded only once, thanks to the TiddlyWiki's load mechanism.\n window.StringView = StringView;\n window.TiddlyWiki = TiddlyWiki;\n window.THREE = require(\"./Lib/three-min.js\").THREE;\n\n this.parentDomNode = parent;\n this.computeAttributes();\n this.execute();\n\n // Create element and assign attributes\n this.nodeRoot = this.document.createElement(\"div\");\n this.nodeRootId = CONST_NODE_ID_PREFIX + \"-\" + ++View3jsWidget.instanceNb;\n this.nodeRoot.setAttribute(\"id\", this.nodeRootId);\n if (this[\"class\"])\n this.nodeRoot.setAttribute(\"class\", this[\"class\"]);\t\t\n if (this.width) {\n var widthStyle = parseInt(this.width,10) + \"px\";\n this.nodeRoot.setAttribute(\"width\", widthStyle);\n this.nodeRoot.style.width = widthStyle;\n }\n if (this.height) {\n var heightStyle = parseInt(this.height,10) + \"px\";\n this.nodeRoot.setAttribute(\"height\", heightStyle);\n this.nodeRoot.style.height = heightStyle;\n } else {\n this.nodeRoot.setAttribute(\"height\", \"\" + CONST_MIN_HEIGHT + \"px\");\n this.nodeRoot.style.height = \"\" + CONST_MIN_HEIGHT + \"px\";\n }\n\n // Insert element\n parent.insertBefore(this.nodeRoot,nextSibling);\n this.domNodes.push(this.nodeRoot);\n\n // UI template\n var uiNodeCreate = function(id, that) {\n // Create a node : <div id=\"<id>\"></div>\n var node = that.document.createElement(\"div\");\n node.setAttribute(\"id\", id);\n parent.insertBefore(node, nextSibling);\n that.domNodes.push(node);\n return node;\n };\n this.nodeError = uiNodeCreate(this.nodeRootId + \"-error\", this);\n\n // Test browser compatibility with WebGL\n var webgl = (function () {\n try {\n var canvas = document.createElement(\"canvas\");\n return !! window.WebGLRenderingContext && (canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\"));\n } catch(e) {\n return false;\n }\n })();\n if (!webgl) {\n this.nodeError.innerHTML = window.WebGLRenderingContext ?\n 'Your graphics card does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" target=\"_blank\">WebGL</a>.<br/>' +\n 'Find out how to get it <a href=\"http://get.webgl.org/\" target=\"_blank\">here</a>.'\n :\n 'Your browser does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" target=\"_blank\">WebGL</a>.<br/>' +\n 'Find out how to get it <a href=\"http://get.webgl.org/\" target=\"_blank\">here</a>.';\n return;\n }\n\n // Get code tiddler\n if (!this.tiddler) {\n this.nodeError.innerHTML = \"Error: you must specify a code tiddler\";\n return;\n }\n var tiddler = this.wiki.getTiddler(this.tiddler);\n if ((typeof(tiddler) == \"undefined\") || !tiddler) {\n this.nodeError.innerHTML = \"Error: unknown tiddler: \"+this.tiddler;\n return;\n }\n\n // Get widget configuration\n var widgetConfig = {};\n if (this.path) {\n widgetConfig.filesystem = {PATH: this.path};\n } else {\n if (sessionConfig && sessionConfig.filesystem) {\n widgetConfig.filesystem = {};\n if (sessionConfig.filesystem.PATH)\n widgetConfig.filesystem.PATH = sessionConfig.filesystem.PATH;\n }\n }\n\n window.tiddlyWiki = new TiddlyWiki(this, this.tiddler, widgetConfig);\n\n // Create viewer\n\n // Execute user code\n // Prototype :\n // function main(input)\n // Returns : {onTiddlerRefresh: <refresh function>}\n //\n this.input = {node: this.nodeRoot};\n try {\n this.output = eval(tiddler.fields.text+\";main(this.input);\");\n } catch(e) {\n this.nodeError.innerHTML = \"Error when executing javascript code in <b>\"+this.tiddler+\"</b> tiddler :<br><b>\"+e+\"</b>\";\n alert(\"Stop on error\"); // stop debug and log in case of deaf mad program\n }\n};\n \n// Compute the internal state of the widget\nView3jsWidget.prototype.execute = function() {\n // Get our parameters\n this.tiddler = this.getAttribute(\"tiddler\");\n this.width = this.getAttribute(\"width\");\n this.height = this.getAttribute(\"height\");\n this.path = this.getAttribute(\"path\");\n this[\"class\"] = this.getAttribute(\"class\");\n};\n\n// Selectively refreshes the widget if needed. Returns true if the widget or any\n// of its children needed re-rendering\nView3jsWidget.prototype.refresh = function(changedTiddlers) {\n var fonc = \"View3jsWidget.refresh\";\n\n var changedAttributes = this.computeAttributes();\n if (changedAttributes.tiddler ||\n changedAttributes.width ||\n changedAttributes.height ||\n changedAttributes.path ||\n changedAttributes[\"class\"] ||\n changedTiddlers[this.tiddler]) {\n this.refreshSelf();\n //hack.log(\"after this.refreshSelf()\", false, fonc);\n return true;\n } else {\n //hack.log(\"other case\", false, fonc);\n if (this.output && this.output.onTiddlerRefresh) this.output.onTiddlerRefresh();\n return false;\t\t\n }\n};\n\nexports.view3js = View3jsWidget;\n\n})();\n",
"title": "$:/plugins/rboue/Three.js/view3js.js",
"type": "application/javascript",
"module-type": "widget"
}
}
}
{
"tiddlers": {
"$:/plugins/rboue/Three.js/Lib/SimplexNoise.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/SimplexNoise.js",
"module-type": "library",
"text": "// Ported from Stefan Gustavson's java implementation\n// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf\n// Read Stefan's excellent paper for details on how this code works.\n//\n// Sean McCullough banksean@gmail.com\n//\n// Added 4D noise\n// Joshua Koo zz85nus@gmail.com \n\n/**\n * You can pass in a random number generator object if you like.\n * It is assumed to have a random() method.\n */\nvar SimplexNoise = function(r) {\n\tif (r == undefined) r = Math;\n this.grad3 = [[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0], \n [1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1], \n [0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]]; \n\n this.grad4 = [[0,1,1,1], [0,1,1,-1], [0,1,-1,1], [0,1,-1,-1],\n\t [0,-1,1,1], [0,-1,1,-1], [0,-1,-1,1], [0,-1,-1,-1],\n\t [1,0,1,1], [1,0,1,-1], [1,0,-1,1], [1,0,-1,-1],\n\t [-1,0,1,1], [-1,0,1,-1], [-1,0,-1,1], [-1,0,-1,-1],\n\t [1,1,0,1], [1,1,0,-1], [1,-1,0,1], [1,-1,0,-1],\n\t [-1,1,0,1], [-1,1,0,-1], [-1,-1,0,1], [-1,-1,0,-1],\n\t [1,1,1,0], [1,1,-1,0], [1,-1,1,0], [1,-1,-1,0],\n\t [-1,1,1,0], [-1,1,-1,0], [-1,-1,1,0], [-1,-1,-1,0]];\n\n this.p = [];\n for (var i=0; i<256; i++) {\n\t this.p[i] = Math.floor(r.random()*256);\n }\n // To remove the need for index wrapping, double the permutation table length \n this.perm = []; \n for(var i=0; i<512; i++) {\n\t\tthis.perm[i]=this.p[i & 255];\n\t} \n\n // A lookup table to traverse the simplex around a given point in 4D. \n // Details can be found where this table is used, in the 4D noise method. \n this.simplex = [ \n [0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0], \n [0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0], \n [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0], \n [1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0], \n [1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0], \n [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0], \n [2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0], \n [2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]; \n};\n\nSimplexNoise.prototype.dot = function(g, x, y) { \n\treturn g[0]*x + g[1]*y;\n};\n\nSimplexNoise.prototype.dot3 = function(g, x, y, z) {\n return g[0]*x + g[1]*y + g[2]*z; \n}\n\nSimplexNoise.prototype.dot4 = function(g, x, y, z, w) {\n return g[0]*x + g[1]*y + g[2]*z + g[3]*w;\n};\n\nSimplexNoise.prototype.noise = function(xin, yin) { \n var n0, n1, n2; // Noise contributions from the three corners \n // Skew the input space to determine which simplex cell we're in \n var F2 = 0.5*(Math.sqrt(3.0)-1.0); \n var s = (xin+yin)*F2; // Hairy factor for 2D \n var i = Math.floor(xin+s); \n var j = Math.floor(yin+s); \n var G2 = (3.0-Math.sqrt(3.0))/6.0; \n var t = (i+j)*G2; \n var X0 = i-t; // Unskew the cell origin back to (x,y) space \n var Y0 = j-t; \n var x0 = xin-X0; // The x,y distances from the cell origin \n var y0 = yin-Y0; \n // For the 2D case, the simplex shape is an equilateral triangle. \n // Determine which simplex we are in. \n var i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords \n if(x0>y0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) \n else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1) \n // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and \n // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where \n // c = (3-sqrt(3))/6 \n var x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords \n var y1 = y0 - j1 + G2; \n var x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords \n var y2 = y0 - 1.0 + 2.0 * G2; \n // Work out the hashed gradient indices of the three simplex corners \n var ii = i & 255; \n var jj = j & 255; \n var gi0 = this.perm[ii+this.perm[jj]] % 12; \n var gi1 = this.perm[ii+i1+this.perm[jj+j1]] % 12; \n var gi2 = this.perm[ii+1+this.perm[jj+1]] % 12; \n // Calculate the contribution from the three corners \n var t0 = 0.5 - x0*x0-y0*y0; \n if(t0<0) n0 = 0.0; \n else { \n t0 *= t0; \n n0 = t0 * t0 * this.dot(this.grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient \n } \n var t1 = 0.5 - x1*x1-y1*y1; \n if(t1<0) n1 = 0.0; \n else { \n t1 *= t1; \n n1 = t1 * t1 * this.dot(this.grad3[gi1], x1, y1); \n }\n var t2 = 0.5 - x2*x2-y2*y2; \n if(t2<0) n2 = 0.0; \n else { \n t2 *= t2; \n n2 = t2 * t2 * this.dot(this.grad3[gi2], x2, y2); \n } \n // Add contributions from each corner to get the final noise value. \n // The result is scaled to return values in the interval [-1,1]. \n return 70.0 * (n0 + n1 + n2); \n};\n\n// 3D simplex noise \nSimplexNoise.prototype.noise3d = function(xin, yin, zin) { \n var n0, n1, n2, n3; // Noise contributions from the four corners \n // Skew the input space to determine which simplex cell we're in \n var F3 = 1.0/3.0; \n var s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D \n var i = Math.floor(xin+s); \n var j = Math.floor(yin+s); \n var k = Math.floor(zin+s); \n var G3 = 1.0/6.0; // Very nice and simple unskew factor, too \n var t = (i+j+k)*G3; \n var X0 = i-t; // Unskew the cell origin back to (x,y,z) space \n var Y0 = j-t; \n var Z0 = k-t; \n var x0 = xin-X0; // The x,y,z distances from the cell origin \n var y0 = yin-Y0; \n var z0 = zin-Z0; \n // For the 3D case, the simplex shape is a slightly irregular tetrahedron. \n // Determine which simplex we are in. \n var i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords \n var i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords \n if(x0>=y0) { \n if(y0>=z0) \n { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order \n else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order \n else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order \n } \n else { // x0<y0 \n if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } // Z Y X order \n else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } // Y Z X order \n else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } // Y X Z order \n } \n // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), \n // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and \n // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where \n // c = 1/6.\n var x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords \n var y1 = y0 - j1 + G3; \n var z1 = z0 - k1 + G3; \n var x2 = x0 - i2 + 2.0*G3; // Offsets for third corner in (x,y,z) coords \n var y2 = y0 - j2 + 2.0*G3; \n var z2 = z0 - k2 + 2.0*G3; \n var x3 = x0 - 1.0 + 3.0*G3; // Offsets for last corner in (x,y,z) coords \n var y3 = y0 - 1.0 + 3.0*G3; \n var z3 = z0 - 1.0 + 3.0*G3; \n // Work out the hashed gradient indices of the four simplex corners \n var ii = i & 255; \n var jj = j & 255; \n var kk = k & 255; \n var gi0 = this.perm[ii+this.perm[jj+this.perm[kk]]] % 12; \n var gi1 = this.perm[ii+i1+this.perm[jj+j1+this.perm[kk+k1]]] % 12; \n var gi2 = this.perm[ii+i2+this.perm[jj+j2+this.perm[kk+k2]]] % 12; \n var gi3 = this.perm[ii+1+this.perm[jj+1+this.perm[kk+1]]] % 12; \n // Calculate the contribution from the four corners \n var t0 = 0.6 - x0*x0 - y0*y0 - z0*z0; \n if(t0<0) n0 = 0.0; \n else { \n t0 *= t0; \n n0 = t0 * t0 * this.dot3(this.grad3[gi0], x0, y0, z0); \n }\n var t1 = 0.6 - x1*x1 - y1*y1 - z1*z1; \n if(t1<0) n1 = 0.0; \n else { \n t1 *= t1; \n n1 = t1 * t1 * this.dot3(this.grad3[gi1], x1, y1, z1); \n } \n var t2 = 0.6 - x2*x2 - y2*y2 - z2*z2; \n if(t2<0) n2 = 0.0; \n else { \n t2 *= t2; \n n2 = t2 * t2 * this.dot3(this.grad3[gi2], x2, y2, z2); \n } \n var t3 = 0.6 - x3*x3 - y3*y3 - z3*z3; \n if(t3<0) n3 = 0.0; \n else { \n t3 *= t3; \n n3 = t3 * t3 * this.dot3(this.grad3[gi3], x3, y3, z3); \n } \n // Add contributions from each corner to get the final noise value. \n // The result is scaled to stay just inside [-1,1] \n return 32.0*(n0 + n1 + n2 + n3); \n};\n\n// 4D simplex noise\nSimplexNoise.prototype.noise4d = function( x, y, z, w ) {\n\t// For faster and easier lookups\n\tvar grad4 = this.grad4;\n\tvar simplex = this.simplex;\n\tvar perm = this.perm;\n\t\n // The skewing and unskewing factors are hairy again for the 4D case\n var F4 = (Math.sqrt(5.0)-1.0)/4.0;\n var G4 = (5.0-Math.sqrt(5.0))/20.0;\n var n0, n1, n2, n3, n4; // Noise contributions from the five corners\n // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in\n var s = (x + y + z + w) * F4; // Factor for 4D skewing\n var i = Math.floor(x + s);\n var j = Math.floor(y + s);\n var k = Math.floor(z + s);\n var l = Math.floor(w + s);\n var t = (i + j + k + l) * G4; // Factor for 4D unskewing\n var X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space\n var Y0 = j - t;\n var Z0 = k - t;\n var W0 = l - t;\n var x0 = x - X0; // The x,y,z,w distances from the cell origin\n var y0 = y - Y0;\n var z0 = z - Z0;\n var w0 = w - W0;\n\n // For the 4D case, the simplex is a 4D shape I won't even try to describe.\n // To find out which of the 24 possible simplices we're in, we need to\n // determine the magnitude ordering of x0, y0, z0 and w0.\n // The method below is a good way of finding the ordering of x,y,z,w and\n // then find the correct traversal order for the simplex we’re in.\n // First, six pair-wise comparisons are performed between each possible pair\n // of the four coordinates, and the results are used to add up binary bits\n // for an integer index.\n var c1 = (x0 > y0) ? 32 : 0;\n var c2 = (x0 > z0) ? 16 : 0;\n var c3 = (y0 > z0) ? 8 : 0;\n var c4 = (x0 > w0) ? 4 : 0;\n var c5 = (y0 > w0) ? 2 : 0;\n var c6 = (z0 > w0) ? 1 : 0;\n var c = c1 + c2 + c3 + c4 + c5 + c6;\n var i1, j1, k1, l1; // The integer offsets for the second simplex corner\n var i2, j2, k2, l2; // The integer offsets for the third simplex corner\n var i3, j3, k3, l3; // The integer offsets for the fourth simplex corner\n // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.\n // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w\n // impossible. Only the 24 indices which have non-zero entries make any sense.\n // We use a thresholding to set the coordinates in turn from the largest magnitude.\n // The number 3 in the \"simplex\" array is at the position of the largest coordinate.\n i1 = simplex[c][0]>=3 ? 1 : 0;\n j1 = simplex[c][1]>=3 ? 1 : 0;\n k1 = simplex[c][2]>=3 ? 1 : 0;\n l1 = simplex[c][3]>=3 ? 1 : 0;\n // The number 2 in the \"simplex\" array is at the second largest coordinate.\n i2 = simplex[c][0]>=2 ? 1 : 0;\n j2 = simplex[c][1]>=2 ? 1 : 0; k2 = simplex[c][2]>=2 ? 1 : 0;\n l2 = simplex[c][3]>=2 ? 1 : 0;\n // The number 1 in the \"simplex\" array is at the second smallest coordinate.\n i3 = simplex[c][0]>=1 ? 1 : 0;\n j3 = simplex[c][1]>=1 ? 1 : 0;\n k3 = simplex[c][2]>=1 ? 1 : 0;\n l3 = simplex[c][3]>=1 ? 1 : 0;\n // The fifth corner has all coordinate offsets = 1, so no need to look that up.\n var x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords\n var y1 = y0 - j1 + G4;\n var z1 = z0 - k1 + G4;\n var w1 = w0 - l1 + G4;\n var x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords\n var y2 = y0 - j2 + 2.0*G4;\n var z2 = z0 - k2 + 2.0*G4;\n var w2 = w0 - l2 + 2.0*G4;\n var x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords\n var y3 = y0 - j3 + 3.0*G4;\n var z3 = z0 - k3 + 3.0*G4;\n var w3 = w0 - l3 + 3.0*G4;\n var x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords\n var y4 = y0 - 1.0 + 4.0*G4;\n var z4 = z0 - 1.0 + 4.0*G4;\n var w4 = w0 - 1.0 + 4.0*G4;\n // Work out the hashed gradient indices of the five simplex corners\n var ii = i & 255;\n var jj = j & 255;\n var kk = k & 255;\n var ll = l & 255;\n var gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32;\n var gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32;\n var gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32;\n var gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32;\n var gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32;\n // Calculate the contribution from the five corners\n var t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0;\n if(t0<0) n0 = 0.0;\n else {\n t0 *= t0;\n n0 = t0 * t0 * this.dot4(grad4[gi0], x0, y0, z0, w0);\n }\n var t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1;\n if(t1<0) n1 = 0.0;\n else {\n t1 *= t1;\n n1 = t1 * t1 * this.dot4(grad4[gi1], x1, y1, z1, w1);\n }\n var t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2;\n if(t2<0) n2 = 0.0;\n else {\n t2 *= t2;\n n2 = t2 * t2 * this.dot4(grad4[gi2], x2, y2, z2, w2);\n } var t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3;\n if(t3<0) n3 = 0.0;\n else {\n t3 *= t3;\n n3 = t3 * t3 * this.dot4(grad4[gi3], x3, y3, z3, w3);\n }\n var t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4;\n if(t4<0) n4 = 0.0;\n else {\n t4 *= t4;\n n4 = t4 * t4 * this.dot4(grad4[gi4], x4, y4, z4, w4);\n }\n // Sum up and scale the result to cover the range [-1,1]\n return 27.0 * (n0 + n1 + n2 + n3 + n4);\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Utils/UVsUtils.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Utils/UVsUtils.js",
"module-type": "library",
"text": "/*\n * @author gyuque / http://github.com/gyuque\n * Cylinder Mapping for ExtrudeGeometry\n */\n\nTHREE.UVsUtils = {\n\n};\n\nTHREE.UVsUtils.CylinderUVGenerator = function() {\n this.uRepeat = 1;\n this.targetGeometry = null;\n this.lengthCache = null;\n};\n\nTHREE.UVsUtils.CylinderUVGenerator.prototype = {\n generateTopUV: THREE.ExtrudeGeometry.WorldUVGenerator.generateTopUV,\n generateBottomUV: THREE.ExtrudeGeometry.WorldUVGenerator.generateBottomUV,\n \n generateSideWallUV: function( geometry, extrudedShape, wallContour, extrudeOptions,\n indexA, indexB, indexC, indexD, stepIndex, stepsLength,\n contourIndex1, contourIndex2 ) {\n // first call\n if (this.targetGeometry !== geometry) {\n this.prepare(geometry, wallContour);\n }\n\n // generate uv\n var u_list = this.lengthCache;\n var v1 = stepIndex / stepsLength;\n var v2 = ( stepIndex + 1 ) / stepsLength;\n \n var u1 = u_list[contourIndex1];\n var u2 = u_list[contourIndex2];\n if (u1 < u2) {u1 += 1.0;}\n \n u1 *= this.uRepeat;\n u2 *= this.uRepeat;\n return [\n new THREE.Vector2( u1, v1 ),\n new THREE.Vector2( u2, v1 ),\n new THREE.Vector2( u2, v2 ),\n new THREE.Vector2( u1, v2 )\n ];\n },\n \n prepare: function(geometry, wallContour) {\n var p1, p2;\n var u_list = [];\n var lengthSum = 0;\n var len = wallContour.length;\n for (var i = 0;i < len;i++) {\n p1 = wallContour[ i ];\n p2 = wallContour[ (i+1) % len ];\n\n var dx = p1.x - p2.x;\n var dy = p1.y - p2.y;\n var segmentLength = Math.sqrt(dx*dx + dy*dy);\n \n u_list.push(lengthSum);\n lengthSum += segmentLength;\n }\n \n this.normalizeArray(u_list, lengthSum);\n this.targetGeometry = geometry;\n this.lengthCache = u_list;\n },\n \n normalizeArray: function(ls, v) {\n var len = ls.length;\n for (var i = 0;i < len;i++) {\n ls[i] /= v;\n }\n \n return ls;\n }\n};\n\n\n\n/* \n * @author zz85 / http://github.com/zz85\n * @author WestLangley / http://github.com/WestLangley\n *\n * tool for \"unwrapping\" and debugging three.js \n * geometries UV mapping\n *\n * Sample usage:\n *\tdocument.body.appendChild(\n *\t\tTHREE.UVsDebug(\n *\t\t\tnew THREE.SphereGeometry(10,10,10,10));\n *\n */\n \nTHREE.UVsDebug = function( geometry, size ) {\n\n // handles wrapping of uv.x > 1 only\n \n var abc = 'abcd';\n\n var uv, u, ax, ay;\n var i, il, j, jl;\n var vnum;\n\n var a = new THREE.Vector2();\n var b = new THREE.Vector2();\n\n var faces = geometry.faces;\n var uvs = geometry.faceVertexUvs[ 0 ];\n\n var canvas = document.createElement( 'canvas' );\n var width = size || 1024; // power of 2 required for wrapping\n var height = size || 1024;\n canvas.width = width;\n canvas.height = height;\n\n var ctx = canvas.getContext( '2d' );\n ctx.lineWidth = 2;\n ctx.strokeStyle = 'rgba( 0, 0, 0, 1.0 )';\n ctx.textAlign = 'center';\n\n // paint background white\n\n ctx.fillStyle = 'rgba( 255, 255, 255, 1.0 )';\n ctx.fillRect( 0, 0, width, height );\n\n for ( i = 0, il = uvs.length; i < il; i++ ) {\n\n uv = uvs[ i ];\n\n // draw lines\n\n ctx.beginPath();\n\n a.set( 0, 0 );\n\n for ( j = 0, jl = uv.length; j < jl; j++ ) {\n\n u = uv[ j ];\n\n a.x += u.x;\n a.y += u.y;\n\n if ( j == 0 ) {\n\n ctx.moveTo( u.x * width, ( 1 - u.y ) * height );\n\n } else {\n\n ctx.lineTo( u.x * width, ( 1 - u.y ) * height );\n\n }\n\n }\n\n ctx.closePath();\n ctx.stroke();\n\n a.divideScalar( jl );\n\n // label the face number\n\n ctx.font = \"12pt Arial bold\";\n ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n ctx.fillText( i, a.x * width, ( 1 - a.y ) * height );\n\n if ( a.x > 0.95 ) { // wrap x // 0.95 is arbitrary\n\n ctx.fillText( i, ( a.x % 1 ) * width, ( 1 - a.y ) * height );\n\n }\n\n ctx.font = \"8pt Arial bold\";\n ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n // label uv edge orders\n\n for ( j = 0, jl = uv.length; j < jl; j++ ) {\n\n u = uv[ j ];\n b.addVectors( a, u ).divideScalar( 2 );\n\n vnum = faces[ i ][ abc[ j ] ];\n ctx.fillText( abc[ j ] + vnum, b.x * width, ( 1 - b.y ) * height );\n\n if ( b.x > 0.95 ) { // wrap x\n\n ctx.fillText( abc[ j ] + vnum, ( b.x % 1 ) * width, ( 1 - b.y ) * height );\n\n }\n\n }\n\n }\n\n return canvas;\n\n}\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Utils/GeometryUtils.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Utils/GeometryUtils.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.GeometryUtils = {\n\n\t// Merge two geometries or geometry and geometry from object (using object's transform)\n\n\tmerge: function ( geometry1, geometry2, materialIndexOffset ) {\n\n\t\tconsole.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );\n\n\t\tvar matrix;\n\n\t\tif ( geometry2 instanceof THREE.Mesh ) {\n\n\t\t\tgeometry2.matrixAutoUpdate && geometry2.updateMatrix();\n\n\t\t\tmatrix = geometry2.matrix;\n\t\t\tgeometry2 = geometry2.geometry;\n\n\t\t}\n\n\t\tgeometry1.merge( geometry2, matrix, materialIndexOffset );\n\n\t},\n\n\t// Get random point in triangle (via barycentric coordinates)\n\t// \t(uniform distribution)\n\t// \thttp://www.cgafaq.info/wiki/Random_Point_In_Triangle\n\n\trandomPointInTriangle: function () {\n\n\t\tvar vector = new THREE.Vector3();\n\n\t\treturn function ( vectorA, vectorB, vectorC ) {\n\n\t\t\tvar point = new THREE.Vector3();\n\n\t\t\tvar a = THREE.Math.random16();\n\t\t\tvar b = THREE.Math.random16();\n\n\t\t\tif ( ( a + b ) > 1 ) {\n\n\t\t\t\ta = 1 - a;\n\t\t\t\tb = 1 - b;\n\n\t\t\t}\n\n\t\t\tvar c = 1 - a - b;\n\n\t\t\tpoint.copy( vectorA );\n\t\t\tpoint.multiplyScalar( a );\n\n\t\t\tvector.copy( vectorB );\n\t\t\tvector.multiplyScalar( b );\n\n\t\t\tpoint.add( vector );\n\n\t\t\tvector.copy( vectorC );\n\t\t\tvector.multiplyScalar( c );\n\n\t\t\tpoint.add( vector );\n\n\t\t\treturn point;\n\n\t\t};\n\n\t}(),\n\n\t// Get random point in face (triangle)\n\t// (uniform distribution)\n\n\trandomPointInFace: function ( face, geometry, useCachedAreas ) {\n\n\t\tvar vA, vB, vC;\n\n\t\tvA = geometry.vertices[ face.a ];\n\t\tvB = geometry.vertices[ face.b ];\n\t\tvC = geometry.vertices[ face.c ];\n\n\t\treturn THREE.GeometryUtils.randomPointInTriangle( vA, vB, vC );\n\n\t},\n\n\t// Get uniformly distributed random points in mesh\n\t// \t- create array with cumulative sums of face areas\n\t// - pick random number from 0 to total area\n\t// - find corresponding place in area array by binary search\n\t//\t- get random point in face\n\n\trandomPointsInGeometry: function ( geometry, n ) {\n\n\t\tvar face, i,\n\t\t\tfaces = geometry.faces,\n\t\t\tvertices = geometry.vertices,\n\t\t\til = faces.length,\n\t\t\ttotalArea = 0,\n\t\t\tcumulativeAreas = [],\n\t\t\tvA, vB, vC, vD;\n\n\t\t// precompute face areas\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tface = faces[ i ];\n\n\t\t\tvA = vertices[ face.a ];\n\t\t\tvB = vertices[ face.b ];\n\t\t\tvC = vertices[ face.c ];\n\n\t\t\tface._area = THREE.GeometryUtils.triangleArea( vA, vB, vC );\n\n\t\t\ttotalArea += face._area;\n\n\t\t\tcumulativeAreas[ i ] = totalArea;\n\n\t\t}\n\n\t\t// binary search cumulative areas array\n\n\t\tfunction binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}\n\n\t\t// pick random face weighted by face area\n\n\t\tvar r, index,\n\t\t\tresult = [];\n\n\t\tvar stats = {};\n\n\t\tfor ( i = 0; i < n; i ++ ) {\n\n\t\t\tr = THREE.Math.random16() * totalArea;\n\n\t\t\tindex = binarySearchIndices( r );\n\n\t\t\tresult[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true );\n\n\t\t\tif ( ! stats[ index ] ) {\n\n\t\t\t\tstats[ index ] = 1;\n\n\t\t\t} else {\n\n\t\t\t\tstats[ index ] += 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\trandomPointsInBufferGeometry: function ( geometry, n ) {\n\n\t\tvar i,\n\t\t\tvertices = geometry.attributes.position.array,\n\t\t\ttotalArea = 0,\n\t\t\tcumulativeAreas = [],\n\t\t\tvA, vB, vC;\n\n\t\t// precompute face areas\n\t\tvA = new THREE.Vector3();\n\t\tvB = new THREE.Vector3();\n\t\tvC = new THREE.Vector3();\n\n\t\t// geometry._areas = [];\n\t\tvar il = vertices.length / 9;\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tvA.set( vertices[i * 9 + 0], vertices[i * 9 + 1], vertices[i * 9 + 2] );\n\t\t\tvB.set( vertices[i * 9 + 3], vertices[i * 9 + 4], vertices[i * 9 + 5] );\n\t\t\tvC.set( vertices[i * 9 + 6], vertices[i * 9 + 7], vertices[i * 9 + 8] );\n\n\t\t\tarea = THREE.GeometryUtils.triangleArea( vA, vB, vC );\n\t\t\ttotalArea += area;\n\n\t\t\tcumulativeAreas.push(totalArea);\n\t\t}\n\n\t\t// binary search cumulative areas array\n\n\t\tfunction binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}\n\n\t\t// pick random face weighted by face area\n\n\t\tvar r, index,\n\t\t\tresult = [];\n\n\t\tfor ( i = 0; i < n; i ++ ) {\n\n\t\t\tr = THREE.Math.random16() * totalArea;\n\n\t\t\tindex = binarySearchIndices( r );\n\n\t\t\t// result[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true );\n\t\t\tvA.set( vertices[index * 9 + 0], vertices[index * 9 + 1], vertices[index * 9 + 2] );\n\t\t\tvB.set( vertices[index * 9 + 3], vertices[index * 9 + 4], vertices[index * 9 + 5] );\n\t\t\tvC.set( vertices[index * 9 + 6], vertices[index * 9 + 7], vertices[index * 9 + 8] );\n\t\t\tresult[ i ] = THREE.GeometryUtils.randomPointInTriangle( vA, vB, vC );\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\t// Get triangle area (half of parallelogram)\n\t// http://mathworld.wolfram.com/TriangleArea.html\n\n\ttriangleArea: function () {\n\n\t\tvar vector1 = new THREE.Vector3();\n\t\tvar vector2 = new THREE.Vector3();\n\n\t\treturn function ( vectorA, vectorB, vectorC ) {\n\n\t\t\tvector1.subVectors( vectorB, vectorA );\n\t\t\tvector2.subVectors( vectorC, vectorA );\n\t\t\tvector1.cross( vector2 );\n\n\t\t\treturn 0.5 * vector1.length();\n\n\t\t};\n\n\t}(),\n\n\tcenter: function ( geometry ) {\n\n\t\tconsole.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );\n\t\treturn geometry.center();\n\n\t}\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Effects/VREffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/VREffect.js",
"module-type": "library",
"text": "/**\n * @author dmarcos / https://github.com/dmarcos\n *\n * It handles stereo rendering\n * If mozGetVRDevices and getVRDevices APIs are not available it gracefuly falls back to a\n * regular renderer\n *\n * The HMD supported is the Oculus DK1 and The Web API doesn't currently allow\n * to query for the display resolution (only the chrome API allows it).\n * The dimensions of the screen are temporarly hardcoded (1280 x 800).\n *\n * For VR mode to work it has to be used with the Oculus enabled builds of Firefox or Chrome:\n *\n * Firefox:\n *\n * OSX: http://people.mozilla.com/~vladimir/vr/firefox-33.0a1.en-US.mac.dmg\n * WIN: http://people.mozilla.com/~vladimir/vr/firefox-33.0a1.en-US.win64-x86_64.zip\n *\n * Chrome builds:\n *\n * https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list\n *\n */\nTHREE.VREffect = function ( renderer, done ) {\n\tthis._renderer = renderer;\n\n\tthis._init = function() {\n\t\tvar self = this;\n\t\tif ( !navigator.mozGetVRDevices && !navigator.getVRDevices ) {\n\t\t\tif ( done ) {\n\t\t\t\tdone(\"Your browser is not VR Ready\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif ( navigator.getVRDevices ) {\n\t\t\tnavigator.getVRDevices().then( gotVRDevices );\n\t\t} else {\n\t\t\tnavigator.mozGetVRDevices( gotVRDevices );\n\t\t}\n\t\tfunction gotVRDevices( devices ) {\n\t\t\tvar vrHMD;\n\t\t\tvar error;\n\t\t\tfor ( var i = 0; i < devices.length; ++i ) {\n\t\t\t\tif ( devices[i] instanceof HMDVRDevice ) {\n\t\t\t\t\tvrHMD = devices[i];\n\t\t\t\t\tself._vrHMD = vrHMD;\n\t\t\t\t\tself.leftEyeTranslation = vrHMD.getEyeTranslation( \"left\" );\n\t\t\t\t\tself.rightEyeTranslation = vrHMD.getEyeTranslation( \"right\" );\n\t\t\t\t\tself.leftEyeFOV = vrHMD.getRecommendedEyeFieldOfView( \"left\" );\n\t\t\t\t\tself.rightEyeFOV = vrHMD.getRecommendedEyeFieldOfView( \"right\" );\n\t\t\t\t\tbreak; // We keep the first we encounter\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( done ) {\n\t\t\t\tif ( !vrHMD ) {\n\t\t\t\t error = 'HMD not available';\n\t\t\t\t}\n\t\t\t\tdone( error );\n\t\t\t}\n\t\t}\n\t};\n\n\tthis._init();\n\n\tthis.render = function ( scene, camera ) {\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\trenderer.enableScissorTest( false );\n\t\t// VR render mode if HMD is available\n\t\tif ( vrHMD ) {\n\t\t\tthis.renderStereo.apply( this, arguments );\n\t\t\treturn;\n\t\t}\n\t\t// Regular render mode if not HMD\n\t\trenderer.render.apply( this._renderer , arguments );\n\t};\n\n\tthis.renderStereo = function( scene, camera, renderTarget, forceClear ) {\n\t\tvar cameraLeft;\n\t\tvar cameraRight;\n\t\tvar leftEyeTranslation = this.leftEyeTranslation;\n\t\tvar rightEyeTranslation = this.rightEyeTranslation;\n\t\tvar renderer = this._renderer;\n\t\tvar rendererWidth = renderer.domElement.width / renderer.devicePixelRatio;\n\t\tvar rendererHeight = renderer.domElement.height / renderer.devicePixelRatio;\n\t\tvar eyeDivisionLine = rendererWidth / 2;\n\t\trenderer.enableScissorTest( true );\n\t\trenderer.clear();\n\n\t\t// Grab camera matrix from user.\n\t\t// This is interpreted as the head base.\n\t\tif ( camera.matrixAutoUpdate ) {\n\t\t\tcamera.updateMatrix();\n\t\t}\n\t\tvar eyeWorldMatrix = camera.matrixWorld.clone();\n\n\t\tcameraLeft = camera.clone();\n\t\tcameraRight = camera.clone();\n\t\tcameraLeft.projectionMatrix = this.FovToProjection( this.leftEyeFOV );\n\t\tcameraRight.projectionMatrix = this.FovToProjection( this.rightEyeFOV );\n\t\tcameraLeft.position.add(new THREE.Vector3(\n\t\t\tleftEyeTranslation.x, leftEyeTranslation.y, leftEyeTranslation.z) );\n\t\tcameraRight.position.add(new THREE.Vector3(\n\t\t\trightEyeTranslation.x, rightEyeTranslation.y, rightEyeTranslation.z) );\n\n\t\t// render left eye\n\t\trenderer.setViewport( 0, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.setScissor( 0, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.render( scene, cameraLeft );\n\n\t\t// render right eye\n\t\trenderer.setViewport( eyeDivisionLine, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.setScissor( eyeDivisionLine, 0, eyeDivisionLine, rendererHeight );\n\t\trenderer.render( scene, cameraRight );\n\n\t};\n\n\tthis.setFullScreen = function( enable ) {\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\tvar canvasOriginalSize = this._canvasOriginalSize;\n\t\tif (!vrHMD) {\n\t\t\treturn;\n\t\t}\n\t\t// If state doesn't change we do nothing\n\t\tif ( enable === this._fullScreen ) {\n\t\t\treturn;\n\t\t}\n\t\tthis._fullScreen = !!enable;\n\n\t\t// VR Mode disabled\n\t\tif ( !enable ) {\n\t\t\t// Restores canvas original size\n\t\t\trenderer.setSize( canvasOriginalSize.width, canvasOriginalSize.height );\n\t\t\treturn;\n\t\t}\n\t\t// VR Mode enabled\n\t\tthis._canvasOriginalSize = {\n\t\t\twidth: renderer.domElement.width,\n\t\t\theight: renderer.domElement.height\n\t\t};\n\t\t// Hardcoded Rift display size\n\t\trenderer.setSize( 1280, 800, false );\n\t\tthis.startFullscreen();\n\t};\n\n\tthis.startFullscreen = function() {\n\t\tvar self = this;\n\t\tvar renderer = this._renderer;\n\t\tvar vrHMD = this._vrHMD;\n\t\tvar canvas = renderer.domElement;\n\t\tvar fullScreenChange =\n\t\t\tcanvas.mozRequestFullScreen? 'mozfullscreenchange' : 'webkitfullscreenchange';\n\n\t\tdocument.addEventListener( fullScreenChange, onFullScreenChanged, false );\n\t\tfunction onFullScreenChanged() {\n\t\t\tif ( !document.mozFullScreenElement && !document.webkitFullScreenElement ) {\n\t\t\t\tself.setFullScreen( false );\n\t\t\t}\n\t\t}\n\t\tif ( canvas.mozRequestFullScreen ) {\n\t\t\tcanvas.mozRequestFullScreen( { vrDisplay: vrHMD } );\n\t\t} else {\n\t\t\tcanvas.webkitRequestFullscreen( { vrDisplay: vrHMD } );\n\t\t}\n\t};\n\n\tthis.FovToNDCScaleOffset = function( fov ) {\n\t\tvar pxscale = 2.0 / (fov.leftTan + fov.rightTan);\n\t\tvar pxoffset = (fov.leftTan - fov.rightTan) * pxscale * 0.5;\n\t\tvar pyscale = 2.0 / (fov.upTan + fov.downTan);\n\t\tvar pyoffset = (fov.upTan - fov.downTan) * pyscale * 0.5;\n\t\treturn { scale: [pxscale, pyscale], offset: [pxoffset, pyoffset] };\n\t};\n\n\tthis.FovPortToProjection = function( fov, rightHanded /* = true */, zNear /* = 0.01 */, zFar /* = 10000.0 */ )\n\t{\n\t\trightHanded = rightHanded === undefined ? true : rightHanded;\n\t\tzNear = zNear === undefined ? 0.01 : zNear;\n\t\tzFar = zFar === undefined ? 10000.0 : zFar;\n\n\t\tvar handednessScale = rightHanded ? -1.0 : 1.0;\n\n\t\t// start with an identity matrix\n\t\tvar mobj = new THREE.Matrix4();\n\t\tvar m = mobj.elements;\n\n\t\t// and with scale/offset info for normalized device coords\n\t\tvar scaleAndOffset = this.FovToNDCScaleOffset(fov);\n\n\t\t// X result, map clip edges to [-w,+w]\n\t\tm[0*4+0] = scaleAndOffset.scale[0];\n\t\tm[0*4+1] = 0.0;\n\t\tm[0*4+2] = scaleAndOffset.offset[0] * handednessScale;\n\t\tm[0*4+3] = 0.0;\n\n\t\t// Y result, map clip edges to [-w,+w]\n\t\t// Y offset is negated because this proj matrix transforms from world coords with Y=up,\n\t\t// but the NDC scaling has Y=down (thanks D3D?)\n\t\tm[1*4+0] = 0.0;\n\t\tm[1*4+1] = scaleAndOffset.scale[1];\n\t\tm[1*4+2] = -scaleAndOffset.offset[1] * handednessScale;\n\t\tm[1*4+3] = 0.0;\n\n\t\t// Z result (up to the app)\n\t\tm[2*4+0] = 0.0;\n\t\tm[2*4+1] = 0.0;\n\t\tm[2*4+2] = zFar / (zNear - zFar) * -handednessScale;\n\t\tm[2*4+3] = (zFar * zNear) / (zNear - zFar);\n\n\t\t// W result (= Z in)\n\t\tm[3*4+0] = 0.0;\n\t\tm[3*4+1] = 0.0;\n\t\tm[3*4+2] = handednessScale;\n\t\tm[3*4+3] = 0.0;\n\n\t\tmobj.transpose();\n\n\t\treturn mobj;\n\t};\n\n\tthis.FovToProjection = function( fov, rightHanded /* = true */, zNear /* = 0.01 */, zFar /* = 10000.0 */ )\n\t{\n\t\tvar fovPort = {\n\t\t\tupTan: Math.tan(fov.upDegrees * Math.PI / 180.0),\n\t\t\tdownTan: Math.tan(fov.downDegrees * Math.PI / 180.0),\n\t\t\tleftTan: Math.tan(fov.leftDegrees * Math.PI / 180.0),\n\t\t\trightTan: Math.tan(fov.rightDegrees * Math.PI / 180.0)\n\t\t};\n\t\treturn this.FovPortToProjection(fovPort, rightHanded, zNear, zFar);\n\t};\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Effects/OculusRiftEffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/OculusRiftEffect.js",
"module-type": "library",
"text": "/**\n * @author troffmo5 / http://github.com/troffmo5\n *\n * Effect to render the scene in stereo 3d side by side with lens distortion.\n * It is written to be used with the Oculus Rift (http://www.oculusvr.com/) but\n * it works also with other HMD using the same technology\n */\n\nTHREE.OculusRiftEffect = function ( renderer, options ) {\n\t// worldFactor indicates how many units is 1 meter\n\tvar worldFactor = (options && options.worldFactor) ? options.worldFactor: 1.0;\n\n\t// Specific HMD parameters\n\tvar HMD = (options && options.HMD) ? options.HMD: {\n\t\t// Parameters from the Oculus Rift DK1\n\t\thResolution: 1280,\n\t\tvResolution: 800,\n\t\thScreenSize: 0.14976,\n\t\tvScreenSize: 0.0936,\n\t\tinterpupillaryDistance: 0.064,\n\t\tlensSeparationDistance: 0.064,\n\t\teyeToScreenDistance: 0.041,\n\t\tdistortionK : [1.0, 0.22, 0.24, 0.0],\n\t\tchromaAbParameter: [ 0.996, -0.004, 1.014, 0.0]\n\t};\n\n\t// Perspective camera\n\tvar pCamera = new THREE.PerspectiveCamera();\n\tpCamera.matrixAutoUpdate = false;\n\tpCamera.target = new THREE.Vector3();\n\n\t// Orthographic camera\n\tvar oCamera = new THREE.OrthographicCamera( -1, 1, 1, -1, 1, 1000 );\n\toCamera.position.z = 1;\n\n\t// pre-render hooks\n\tthis.preLeftRender = function() {};\n\tthis.preRightRender = function() {};\n\n\trenderer.autoClear = false;\n\tvar emptyColor = new THREE.Color(\"black\");\n\n\t// Render target\n\tvar RTParams = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\tvar renderTarget = new THREE.WebGLRenderTarget( 640, 800, RTParams );\n\tvar RTMaterial = new THREE.ShaderMaterial( {\n\t\tuniforms: {\n\t\t\t\"texid\": { type: \"t\", value: renderTarget },\n\t\t\t\"scale\": { type: \"v2\", value: new THREE.Vector2(1.0,1.0) },\n\t\t\t\"scaleIn\": { type: \"v2\", value: new THREE.Vector2(1.0,1.0) },\n\t\t\t\"lensCenter\": { type: \"v2\", value: new THREE.Vector2(0.0,0.0) },\n\t\t\t\"hmdWarpParam\": { type: \"v4\", value: new THREE.Vector4(1.0,0.0,0.0,0.0) },\n\t\t\t\"chromAbParam\": { type: \"v4\", value: new THREE.Vector4(1.0,0.0,0.0,0.0) }\n\t\t},\n\t\tvertexShader: [\n\t\t\t\"varying vec2 vUv;\",\n\t\t\t\"void main() {\",\n\t\t\t\" vUv = uv;\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"}\"\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\t\t\t\"uniform vec2 scale;\",\n\t\t\t\"uniform vec2 scaleIn;\",\n\t\t\t\"uniform vec2 lensCenter;\",\n\t\t\t\"uniform vec4 hmdWarpParam;\",\n\t\t\t'uniform vec4 chromAbParam;',\n\t\t\t\"uniform sampler2D texid;\",\n\t\t\t\"varying vec2 vUv;\",\n\t\t\t\"void main()\",\n\t\t\t\"{\",\n\t\t\t\" vec2 uv = (vUv*2.0)-1.0;\", // range from [0,1] to [-1,1]\n\t\t\t\" vec2 theta = (uv-lensCenter)*scaleIn;\",\n\t\t\t\" float rSq = theta.x*theta.x + theta.y*theta.y;\",\n\t\t\t\" vec2 rvector = theta*(hmdWarpParam.x + hmdWarpParam.y*rSq + hmdWarpParam.z*rSq*rSq + hmdWarpParam.w*rSq*rSq*rSq);\",\n\t\t\t' vec2 rBlue = rvector * (chromAbParam.z + chromAbParam.w * rSq);',\n\t\t\t\" vec2 tcBlue = (lensCenter + scale * rBlue);\",\n\t\t\t\" tcBlue = (tcBlue+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\" if (any(bvec2(clamp(tcBlue, vec2(0.0,0.0), vec2(1.0,1.0))-tcBlue))) {\",\n\t\t\t\" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\",\n\t\t\t\" return;}\",\n\t\t\t\" vec2 tcGreen = lensCenter + scale * rvector;\",\n\t\t\t\" tcGreen = (tcGreen+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\" vec2 rRed = rvector * (chromAbParam.x + chromAbParam.y * rSq);\",\n\t\t\t\" vec2 tcRed = lensCenter + scale * rRed;\",\n\t\t\t\" tcRed = (tcRed+1.0)/2.0;\", // range from [-1,1] to [0,1]\n\t\t\t\" gl_FragColor = vec4(texture2D(texid, tcRed).r, texture2D(texid, tcGreen).g, texture2D(texid, tcBlue).b, 1);\",\n\t\t\t\"}\"\n\t\t].join(\"\\n\")\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), RTMaterial );\n\n\t// Final scene\n\tvar finalScene = new THREE.Scene();\n\tfinalScene.add( oCamera );\n\tfinalScene.add( mesh );\n\n var left = {}, right = {};\n var distScale = 1.0;\n\tthis.setHMD = function(v) {\n\t\tHMD = v;\n\t\t// Compute aspect ratio and FOV\n\t\tvar aspect = HMD.hResolution / (2*HMD.vResolution);\n\n\t\t// Fov is normally computed with:\n\t\t// THREE.Math.radToDeg( 2*Math.atan2(HMD.vScreenSize,2*HMD.eyeToScreenDistance) );\n\t\t// But with lens distortion it is increased (see Oculus SDK Documentation)\n\t\tvar r = -1.0 - (4 * (HMD.hScreenSize/4 - HMD.lensSeparationDistance/2) / HMD.hScreenSize);\n\t\tdistScale = (HMD.distortionK[0] + HMD.distortionK[1] * Math.pow(r,2) + HMD.distortionK[2] * Math.pow(r,4) + HMD.distortionK[3] * Math.pow(r,6));\n\t\tvar fov = THREE.Math.radToDeg(2*Math.atan2(HMD.vScreenSize*distScale, 2*HMD.eyeToScreenDistance));\n\n\t\t// Compute camera projection matrices\n\t\tvar proj = (new THREE.Matrix4()).makePerspective( fov, aspect, 0.3, 10000 );\n\t\tvar h = 4 * (HMD.hScreenSize/4 - HMD.interpupillaryDistance/2) / HMD.hScreenSize;\n\t\tleft.proj = ((new THREE.Matrix4()).makeTranslation( h, 0.0, 0.0 )).multiply(proj);\n\t\tright.proj = ((new THREE.Matrix4()).makeTranslation( -h, 0.0, 0.0 )).multiply(proj);\n\n\t\t// Compute camera transformation matrices\n\t\tleft.tranform = (new THREE.Matrix4()).makeTranslation( -worldFactor * HMD.interpupillaryDistance/2, 0.0, 0.0 );\n\t\tright.tranform = (new THREE.Matrix4()).makeTranslation( worldFactor * HMD.interpupillaryDistance/2, 0.0, 0.0 );\n\n\t\t// Compute Viewport\n\t\tleft.viewport = [0, 0, HMD.hResolution/2, HMD.vResolution];\n\t\tright.viewport = [HMD.hResolution/2, 0, HMD.hResolution/2, HMD.vResolution];\n\n\t\t// Distortion shader parameters\n\t\tvar lensShift = 4 * (HMD.hScreenSize/4 - HMD.lensSeparationDistance/2) / HMD.hScreenSize;\n\t\tleft.lensCenter = new THREE.Vector2(lensShift, 0.0);\n\t\tright.lensCenter = new THREE.Vector2(-lensShift, 0.0);\n\n\t\tRTMaterial.uniforms['hmdWarpParam'].value = new THREE.Vector4(HMD.distortionK[0], HMD.distortionK[1], HMD.distortionK[2], HMD.distortionK[3]);\n\t\tRTMaterial.uniforms['chromAbParam'].value = new THREE.Vector4(HMD.chromaAbParameter[0], HMD.chromaAbParameter[1], HMD.chromaAbParameter[2], HMD.chromaAbParameter[3]);\n\t\tRTMaterial.uniforms['scaleIn'].value = new THREE.Vector2(1.0,1.0/aspect);\n\t\tRTMaterial.uniforms['scale'].value = new THREE.Vector2(1.0/distScale, 1.0*aspect/distScale);\n\n\t\t// Create render target\n\t\tif ( renderTarget ) renderTarget.dispose();\n\t\trenderTarget = new THREE.WebGLRenderTarget( HMD.hResolution*distScale/2, HMD.vResolution*distScale, RTParams );\n\t\tRTMaterial.uniforms[ \"texid\" ].value = renderTarget;\n\n\t}\t\n\tthis.getHMD = function() {return HMD};\n\n\tthis.setHMD(HMD);\t\n\n\tthis.setSize = function ( width, height ) {\n\t\tleft.viewport = [width/2 - HMD.hResolution/2, height/2 - HMD.vResolution/2, HMD.hResolution/2, HMD.vResolution];\n\t\tright.viewport = [width/2, height/2 - HMD.vResolution/2, HMD.hResolution/2, HMD.vResolution];\n\n\t\trenderer.setSize( width, height );\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\t\tvar cc = renderer.getClearColor().clone();\n\n\t\t// Clear\n\t\trenderer.setClearColor(emptyColor);\n\t\trenderer.clear();\n\t\trenderer.setClearColor(cc);\n\n\t\t// camera parameters\n\t\tif (camera.matrixAutoUpdate) camera.updateMatrix();\n\n\t\t// Render left\n\t\tthis.preLeftRender();\n\n\t\tpCamera.projectionMatrix.copy(left.proj);\n\n\t\tpCamera.matrix.copy(camera.matrix).multiply(left.tranform);\n\t\tpCamera.matrixWorldNeedsUpdate = true;\n\n\t\trenderer.setViewport(left.viewport[0], left.viewport[1], left.viewport[2], left.viewport[3]);\n\n\t\tRTMaterial.uniforms['lensCenter'].value = left.lensCenter;\n\t\trenderer.render( scene, pCamera, renderTarget, true );\n\n\t\trenderer.render( finalScene, oCamera );\n\n\t\t// Render right\n\t\tthis.preRightRender();\n\n\t\tpCamera.projectionMatrix.copy(right.proj);\n\n\t\tpCamera.matrix.copy(camera.matrix).multiply(right.tranform);\n\t\tpCamera.matrixWorldNeedsUpdate = true;\n\n\t\trenderer.setViewport(right.viewport[0], right.viewport[1], right.viewport[2], right.viewport[3]);\n\n\t\tRTMaterial.uniforms['lensCenter'].value = right.lensCenter;\n\n\t\trenderer.render( scene, pCamera, renderTarget, true );\n\t\trenderer.render( finalScene, oCamera );\n\n\t};\n\n\tthis.dispose = function() {\n\t\tif ( RTMaterial ) {\n\t\t\tRTMaterial.dispose();\n\t\t}\n\t\tif ( renderTarget ) {\n\t\t\trenderTarget.dispose();\n\t\t}\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Effects/ParallaxBarrierEffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/ParallaxBarrierEffect.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author marklundin / http://mark-lundin.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ParallaxBarrierEffect = function ( renderer ) {\n\n\tvar eyeRight = new THREE.Matrix4();\n\tvar eyeLeft = new THREE.Matrix4();\n\tvar focalLength = 125;\n\tvar _aspect, _near, _far, _fov;\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\t_cameraL.matrixAutoUpdate = false;\n\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\t_cameraR.matrixAutoUpdate = false;\n\n\tvar _scene = new THREE.Scene();\n\n\tvar _camera = new THREE.PerspectiveCamera( 53, 1, 1, 10000 );\n\t_camera.position.z = 2;\n\t_scene.add( _camera );\n\n\tvar _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\n\tvar _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params );\n\tvar _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params );\n\n\tvar _material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\n\t\t\t\"mapLeft\": { type: \"t\", value: _renderTargetL },\n\t\t\t\"mapRight\": { type: \"t\", value: _renderTargetR }\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvUv = vec2( uv.x, uv.y );\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform sampler2D mapLeft;\",\n\t\t\t\"uniform sampler2D mapRight;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvec2 uv = vUv;\",\n\n\t\t\t\"\tif ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {\",\n\n\t\t\t\"\t\tgl_FragColor = texture2D( mapLeft, uv );\",\n\n\t\t\t\"\t} else {\",\n\n\t\t\t\"\t\tgl_FragColor = texture2D( mapRight, uv );\",\n\n\t\t\t\"\t}\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );\n\t_scene.add( mesh );\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\t\t_renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\t\t_material.uniforms[ \"mapLeft\" ].value = _renderTargetL;\n\t\t_material.uniforms[ \"mapRight\" ].value = _renderTargetR;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\t/*\n\t * Renderer now uses an asymmetric perspective projection\n\t * (http://paulbourke.net/miscellaneous/stereographics/stereorender/).\n\t *\n\t * Each camera is offset by the eye seperation and its projection matrix is\n\t * also skewed asymetrically back to converge on the same projection plane.\n\t * Added a focal length parameter to, this is where the parallax is equal to 0.\n\t */\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tvar hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov );\n\n\t\tif ( hasCameraChanged ) {\n\n\t\t\t_aspect = camera.aspect;\n\t\t\t_near = camera.near;\n\t\t\t_far = camera.far;\n\t\t\t_fov = camera.fov;\n\n\t\t\tvar projectionMatrix = camera.projectionMatrix.clone();\n\t\t\tvar eyeSep = focalLength / 30 * 0.5;\n\t\t\tvar eyeSepOnProjection = eyeSep * _near / focalLength;\n\t\t\tvar ymax = _near * Math.tan( THREE.Math.degToRad( _fov * 0.5 ) );\n\t\t\tvar xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\teyeRight.elements[12] = eyeSep;\n\t\t\teyeLeft.elements[12] = -eyeSep;\n\n\t\t\t// for left eye\n\n\t\t\txmin = -ymax * _aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect + eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraL.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = -ymax * _aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect - eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraR.projectionMatrix.copy( projectionMatrix );\n\n\t\t}\n\n\t\t_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );\n\t\t_cameraL.position.copy( camera.position );\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\n\t\trenderer.render( scene, _cameraL, _renderTargetL, true );\n\n\t\t_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );\n\t\t_cameraR.position.copy( camera.position );\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\n\t\trenderer.render( scene, _cameraR, _renderTargetR, true );\n\n\t\t_scene.updateMatrixWorld();\n\n\t\trenderer.render( _scene, _camera );\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Effects/AnaglyphEffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/AnaglyphEffect.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author marklundin / http://mark-lundin.com/\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.AnaglyphEffect = function ( renderer, width, height ) {\n\n\tvar eyeRight = new THREE.Matrix4();\n\tvar eyeLeft = new THREE.Matrix4();\n\tvar focalLength = 125;\n\tvar _aspect, _near, _far, _fov;\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\t_cameraL.matrixAutoUpdate = false;\n\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\t_cameraR.matrixAutoUpdate = false;\n\n\tvar _camera = new THREE.OrthographicCamera( -1, 1, 1, - 1, 0, 1 );\n\n\tvar _scene = new THREE.Scene();\n\n\tvar _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat };\n\n\tif ( width === undefined ) width = 512;\n\tif ( height === undefined ) height = 512;\n\n\tvar _renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\tvar _renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\tvar _material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\n\t\t\t\"mapLeft\": { type: \"t\", value: _renderTargetL },\n\t\t\t\"mapRight\": { type: \"t\", value: _renderTargetR }\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvUv = vec2( uv.x, uv.y );\",\n\t\t\t\"\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform sampler2D mapLeft;\",\n\t\t\t\"uniform sampler2D mapRight;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\"\tvec4 colorL, colorR;\",\n\t\t\t\"\tvec2 uv = vUv;\",\n\n\t\t\t\"\tcolorL = texture2D( mapLeft, uv );\",\n\t\t\t\"\tcolorR = texture2D( mapRight, uv );\",\n\n\t\t\t\t// http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx\n\n\t\t\t\"\tgl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material );\n\t_scene.add( mesh );\n\n\tthis.setSize = function ( width, height ) {\n\n\t\tif ( _renderTargetL ) _renderTargetL.dispose();\n\t\tif ( _renderTargetR ) _renderTargetR.dispose();\n\t\t_renderTargetL = new THREE.WebGLRenderTarget( width, height, _params );\n\t\t_renderTargetR = new THREE.WebGLRenderTarget( width, height, _params );\n\n\t\t_material.uniforms[ \"mapLeft\" ].value = _renderTargetL;\n\t\t_material.uniforms[ \"mapRight\" ].value = _renderTargetR;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\t/*\n\t * Renderer now uses an asymmetric perspective projection\n\t * (http://paulbourke.net/miscellaneous/stereographics/stereorender/).\n\t *\n\t * Each camera is offset by the eye seperation and its projection matrix is\n\t * also skewed asymetrically back to converge on the same projection plane.\n\t * Added a focal length parameter to, this is where the parallax is equal to 0.\n\t */\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\n\t\tvar hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov );\n\n\t\tif ( hasCameraChanged ) {\n\n\t\t\t_aspect = camera.aspect;\n\t\t\t_near = camera.near;\n\t\t\t_far = camera.far;\n\t\t\t_fov = camera.fov;\n\n\t\t\tvar projectionMatrix = camera.projectionMatrix.clone();\n\t\t\tvar eyeSep = focalLength / 30 * 0.5;\n\t\t\tvar eyeSepOnProjection = eyeSep * _near / focalLength;\n\t\t\tvar ymax = _near * Math.tan( THREE.Math.degToRad( _fov * 0.5 ) );\n\t\t\tvar xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\teyeRight.elements[12] = eyeSep;\n\t\t\teyeLeft.elements[12] = -eyeSep;\n\n\t\t\t// for left eye\n\n\t\t\txmin = -ymax * _aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect + eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraL.projectionMatrix.copy( projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = -ymax * _aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * _aspect - eyeSepOnProjection;\n\n\t\t\tprojectionMatrix.elements[0] = 2 * _near / ( xmax - xmin );\n\t\t\tprojectionMatrix.elements[8] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\t_cameraR.projectionMatrix.copy( projectionMatrix );\n\n\t\t}\n\n\t\t_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );\n\t\t_cameraL.position.copy( camera.position );\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\n\t\trenderer.render( scene, _cameraL, _renderTargetL, true );\n\n\t\t_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );\n\t\t_cameraR.position.copy( camera.position );\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\n\t\trenderer.render( scene, _cameraR, _renderTargetR, true );\n\n\t\trenderer.render( _scene, _camera );\n\n\t};\n\n\tthis.dispose = function() {\n\t\tif ( _renderTargetL ) _renderTargetL.dispose();\n\t\tif ( _renderTargetR ) _renderTargetR.dispose();\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Effects/StereoEffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/StereoEffect.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @authod mrdoob / http://mrdoob.com/\n * @authod arodic / http://aleksandarrodic.com/\n */\n\nTHREE.StereoEffect = function ( renderer ) {\n\n\t// API\n\n\tthis.separation = 3;\n\n\t// internals\n\n\tvar _width, _height;\n\n\tvar _position = new THREE.Vector3();\n\tvar _quaternion = new THREE.Quaternion();\n\tvar _scale = new THREE.Vector3();\n\n\tvar _cameraL = new THREE.PerspectiveCamera();\n\tvar _cameraR = new THREE.PerspectiveCamera();\n\n\t// initialization\n\n\trenderer.autoClear = false;\n\n\tthis.setSize = function ( width, height ) {\n\n\t\t_width = width / 2;\n\t\t_height = height;\n\n\t\trenderer.setSize( width, height );\n\n\t};\n\n\tthis.render = function ( scene, camera ) {\n\n\t\tscene.updateMatrixWorld();\n\n\t\tif ( camera.parent === undefined ) camera.updateMatrixWorld();\n\t\n\t\tcamera.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t// left\n\n\t\t_cameraL.fov = camera.fov;\n\t\t_cameraL.aspect = 0.5 * camera.aspect;\n\t\t_cameraL.near = camera.near;\n\t\t_cameraL.far = camera.far;\n\t\t_cameraL.updateProjectionMatrix();\n\n\t\t_cameraL.position.copy( _position );\n\t\t_cameraL.quaternion.copy( _quaternion );\n\t\t_cameraL.translateX( - this.separation );\n\n\t\t// right\n\n\t\t_cameraR.near = camera.near;\n\t\t_cameraR.far = camera.far;\n\t\t_cameraR.projectionMatrix = _cameraL.projectionMatrix;\n\n\t\t_cameraR.position.copy( _position );\n\t\t_cameraR.quaternion.copy( _quaternion );\n\t\t_cameraR.translateX( this.separation );\n\n\t\t//\n\n\t\trenderer.setViewport( 0, 0, _width * 2, _height );\n\t\trenderer.clear();\n\n\t\trenderer.setViewport( 0, 0, _width, _height );\n\t\trenderer.render( scene, _cameraL );\n\n\t\trenderer.setViewport( _width, 0, _width, _height );\n\t\trenderer.render( scene, _cameraR );\n\n\t};\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Effects/AsciiEffect.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Effects/AsciiEffect.js",
"module-type": "library",
"text": "/*\n * @author zz85 / https://github.com/zz85\n *\n * Ascii generation is based on http://www.nihilogic.dk/labs/jsascii/\n * Maybe more about this later with a blog post at http://lab4games.net/zz85/blog\n *\n * 16 April 2012 - @blurspline\n */\n\nTHREE.AsciiEffect = function ( renderer, charSet, options ) {\n\n\t// its fun to create one your own!\n\n\tcharSet = ( charSet === undefined ) ? ' .:-=+*#%@' : charSet;\n\n\t// ' .,:;=|iI+hHOE#`$';\n\t// darker bolder character set from https://github.com/saw/Canvas-ASCII-Art/\n\t// ' .\\'`^\",:;Il!i~+_-?][}{1)(|/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$'.split('');\n\n\tif ( !options ) options = {};\n\n\t// Some ASCII settings\n\n\tvar bResolution = !options['resolution'] ? 0.15 : options['resolution']; // Higher for more details\n\tvar iScale = !options['scale'] ? 1 : options['scale'];\n\tvar bColor = !options['color'] ? false : options['color']; // nice but slows down rendering!\n\tvar bAlpha = !options['alpha'] ? false : options['alpha']; // Transparency\n\tvar bBlock = !options['block'] ? false : options['block']; // blocked characters. like good O dos\n\tvar bInvert = !options['invert'] ? false : options['invert']; // black is white, white is black\n\n\tvar strResolution = 'low';\n\n\tvar width, height;\n\n\tvar domElement = document.createElement('div');\n\tdomElement.style.cursor = 'default';\n\n\tvar oAscii = document.createElement(\"table\");\n\tdomElement.appendChild( oAscii );\n\n\tvar iWidth, iHeight;\n\tvar oImg;\n\n\tthis.setSize = function ( w, h ) {\n\n\t\twidth = w;\n\t\theight = h;\n\n\t\trenderer.setSize( w, h );\n\n\t\tinitAsciiSize();\n\n\t};\n\n\n\tthis.render = function ( scene, camera ) {\n\n\t\trenderer.render( scene, camera );\n\t\tasciifyImage( renderer, oAscii );\n\n\t};\n\n\tthis.domElement = domElement;\n\n\n\t// Throw in ascii library from http://www.nihilogic.dk/labs/jsascii/jsascii.js\n\n\t/*\n\t* jsAscii 0.1\n\t* Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/\n\t* MIT License [http://www.nihilogic.dk/licenses/mit-license.txt]\n\t*/\n\n\tfunction initAsciiSize() {\n\n\t\tiWidth = Math.round( width * fResolution );\n\t\tiHeight = Math.round( height * fResolution );\n\n\t\toCanvas.width = iWidth;\n\t\toCanvas.height = iHeight;\n\t\t// oCanvas.style.display = \"none\";\n\t\t// oCanvas.style.width = iWidth;\n\t\t// oCanvas.style.height = iHeight;\n\n\t\toImg = renderer.domElement;\n\n\t\tif ( oImg.style.backgroundColor ) {\n\n\t\t\toAscii.rows[0].cells[0].style.backgroundColor = oImg.style.backgroundColor;\n\t\t\toAscii.rows[0].cells[0].style.color = oImg.style.color;\n\n\t\t}\n\n\t\toAscii.cellSpacing = 0;\n\t\toAscii.cellPadding = 0;\n\n\t\tvar oStyle = oAscii.style;\n\t\toStyle.display = \"inline\";\n\t\toStyle.width = Math.round(iWidth/fResolution*iScale) + \"px\";\n\t\toStyle.height = Math.round(iHeight/fResolution*iScale) + \"px\";\n\t\toStyle.whiteSpace = \"pre\";\n\t\toStyle.margin = \"0px\";\n\t\toStyle.padding = \"0px\";\n\t\toStyle.letterSpacing = fLetterSpacing + \"px\";\n\t\toStyle.fontFamily = strFont;\n\t\toStyle.fontSize = fFontSize + \"px\";\n\t\toStyle.lineHeight = fLineHeight + \"px\";\n\t\toStyle.textAlign = \"left\";\n\t\toStyle.textDecoration = \"none\";\n\t}\n\n\n\tvar aDefaultCharList = (\" .,:;i1tfLCG08@\").split(\"\");\n\tvar aDefaultColorCharList = (\" CGO08@\").split(\"\");\n\tvar strFont = \"courier new, monospace\";\n\n\tvar oCanvasImg = renderer.domElement;\n\n\tvar oCanvas = document.createElement(\"canvas\");\n\tif (!oCanvas.getContext) {\n\t\treturn;\n\t}\n\n\tvar oCtx = oCanvas.getContext(\"2d\");\n\tif (!oCtx.getImageData) {\n\t\treturn;\n\t}\n\n\tvar aCharList = (bColor ? aDefaultColorCharList : aDefaultCharList);\n\n\tif (charSet) aCharList = charSet;\n\n\tvar fResolution = 0.5;\n\n\tswitch ( strResolution ) {\n\n\t\tcase \"low\" : \tfResolution = 0.25; break;\n\t\tcase \"medium\" : fResolution = 0.5; break;\n\t\tcase \"high\" : \tfResolution = 1; break;\n\n\t}\n\n\tif ( bResolution ) fResolution = bResolution;\n\n\t// Setup dom\n\n\tvar fFontSize = (2/fResolution)*iScale;\n\tvar fLineHeight = (2/fResolution)*iScale;\n\n\t// adjust letter-spacing for all combinations of scale and resolution to get it to fit the image width.\n\n\tvar fLetterSpacing = 0;\n\n\tif ( strResolution == \"low\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 : fLetterSpacing = -1; break;\n\t\t\tcase 2 :\n\t\t\tcase 3 : fLetterSpacing = -2.1; break;\n\t\t\tcase 4 : fLetterSpacing = -3.1; break;\n\t\t\tcase 5 : fLetterSpacing = -4.15; break;\n\t\t}\n\n\t}\n\n\tif ( strResolution == \"medium\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 : fLetterSpacing = 0; break;\n\t\t\tcase 2 : fLetterSpacing = -1; break;\n\t\t\tcase 3 : fLetterSpacing = -1.04; break;\n\t\t\tcase 4 :\n\t\t\tcase 5 : fLetterSpacing = -2.1; break;\n\t\t}\n\n\t}\n\n\tif ( strResolution == \"high\" ) {\n\n\t\tswitch (iScale) {\n\t\t\tcase 1 :\n\t\t\tcase 2 : fLetterSpacing = 0; break;\n\t\t\tcase 3 :\n\t\t\tcase 4 :\n\t\t\tcase 5 : fLetterSpacing = -1; break;\n\t\t}\n\n\t}\n\n\n\t// can't get a span or div to flow like an img element, but a table works?\n\n\n\t// convert img element to ascii\n\n\tfunction asciifyImage( canvasRenderer, oAscii ) {\n\n\t\toCtx.clearRect( 0, 0, iWidth, iHeight );\n\t\toCtx.drawImage( oCanvasImg, 0, 0, iWidth, iHeight );\n\t\tvar oImgData = oCtx.getImageData(0, 0, iWidth, iHeight).data;\n\n\t\t// Coloring loop starts now\n\t\tvar strChars = \"\";\n\n\t\t// console.time('rendering');\n\n\t\tfor (var y=0;y<iHeight;y+=2) {\n\t\t\tfor (var x=0;x<iWidth;x++) {\n\t\t\t\tvar iOffset = (y*iWidth + x) * 4;\n\n\t\t\t\tvar iRed = oImgData[iOffset];\n\t\t\t\tvar iGreen = oImgData[iOffset + 1];\n\t\t\t\tvar iBlue = oImgData[iOffset + 2];\n\t\t\t\tvar iAlpha = oImgData[iOffset + 3];\n\t\t\t\tvar iCharIdx;\n\n\t\t\t\tvar fBrightness;\n\n\t\t\t\tfBrightness = (0.3*iRed + 0.59*iGreen + 0.11*iBlue) / 255;\n\t\t\t\t// fBrightness = (0.3*iRed + 0.5*iGreen + 0.3*iBlue) / 255;\n\n\t\t\t\tif (iAlpha == 0) {\n\t\t\t\t\t// should calculate alpha instead, but quick hack :)\n\t\t\t\t\t//fBrightness *= (iAlpha / 255);\n\t\t\t\t\tfBrightness = 1;\n\n\t\t\t\t}\n\n\t\t\t\tiCharIdx = Math.floor((1-fBrightness) * (aCharList.length-1));\n\n\t\t\t\tif (bInvert) {\n\t\t\t\t\tiCharIdx = aCharList.length - iCharIdx - 1;\n\t\t\t\t}\n\n\t\t\t\t// good for debugging\n\t\t\t\t//fBrightness = Math.floor(fBrightness * 10);\n\t\t\t\t//strThisChar = fBrightness;\n\n\t\t\t\tvar strThisChar = aCharList[iCharIdx];\n\n\t\t\t\tif (strThisChar===undefined || strThisChar == \" \")\n\t\t\t\t\tstrThisChar = \" \";\n\n\t\t\t\tif (bColor) {\n\t\t\t\t\tstrChars += \"<span style='\"\n\t\t\t\t\t\t+ \"color:rgb(\"+iRed+\",\"+iGreen+\",\"+iBlue+\");\"\n\t\t\t\t\t\t+ (bBlock ? \"background-color:rgb(\"+iRed+\",\"+iGreen+\",\"+iBlue+\");\" : \"\")\n\t\t\t\t\t\t+ (bAlpha ? \"opacity:\" + (iAlpha/255) + \";\" : \"\")\n\t\t\t\t\t\t+ \"'>\" + strThisChar + \"</span>\";\n\t\t\t\t} else {\n\t\t\t\t\tstrChars += strThisChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrChars += \"<br/>\";\n\t\t}\n\n\t\toAscii.innerHTML = \"<tr><td>\" + strChars + \"</td></tr>\";\n\n\t\t// console.timeEnd('rendering');\n\n\t\t// return oAscii;\n\t}\n\n\t// end modified asciifyImage block\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/OBJExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/OBJExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.OBJExporter = function () {};\n\nTHREE.OBJExporter.prototype = {\n\n\tconstructor: THREE.OBJExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = '';\n\n\t\tfor ( var i = 0, l = geometry.vertices.length; i < l; i ++ ) {\n\n\t\t\tvar vertex = geometry.vertices[ i ];\n\t\t\toutput += 'v ' + vertex.x + ' ' + vertex.y + ' ' + vertex.z + '\\n';\n\n\t\t}\n\n\t\t// uvs\n\n\t\tfor ( var i = 0, l = geometry.faceVertexUvs[ 0 ].length; i < l; i ++ ) {\n\n\t\t\tvar vertexUvs = geometry.faceVertexUvs[ 0 ][ i ];\n\n\t\t\tfor ( var j = 0; j < vertexUvs.length; j ++ ) {\n\n\t\t\t\tvar uv = vertexUvs[ j ];\n\t\t\t\toutput += 'vt ' + uv.x + ' ' + uv.y + '\\n';\n\n\t\t\t}\n\n\t\t}\n\n\t\t// normals\n\n\t\tfor ( var i = 0, l = geometry.faces.length; i < l; i ++ ) {\n\n\t\t\tvar normals = geometry.faces[ i ].vertexNormals;\n\n\t\t\tfor ( var j = 0; j < normals.length; j ++ ) {\n\n\t\t\t\tvar normal = normals[ j ];\n\t\t\t\toutput += 'vn ' + normal.x + ' ' + normal.y + ' ' + normal.z + '\\n';\n\n\t\t\t}\n\n\t\t}\n\n\t\t// faces\n\n\t\tfor ( var i = 0, j = 1, l = geometry.faces.length; i < l; i ++, j += 3 ) {\n\n\t\t\tvar face = geometry.faces[ i ];\n\n\t\t\toutput += 'f ';\n\t\t\toutput += ( face.a + 1 ) + '/' + ( j ) + '/' + ( j ) + ' ';\n\t\t\toutput += ( face.b + 1 ) + '/' + ( j + 1 ) + '/' + ( j + 1 ) + ' ';\n\t\t\toutput += ( face.c + 1 ) + '/' + ( j + 2 ) + '/' + ( j + 2 ) + '\\n';\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/STLExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/STLExporter.js",
"module-type": "library",
"text": "/**\n * @author kovacsv / http://kovacsv.hu/\n * @author mrdoob / http://mrdoob.com/\n */\n \nTHREE.STLExporter = function () {};\n\nTHREE.STLExporter.prototype = {\n\n\tconstructor: THREE.STLExporter,\n\n\tparse: ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar normalMatrixWorld = new THREE.Matrix3();\n\n\t\treturn function ( scene ) {\n\n\t\t\tvar output = '';\n\n\t\t\toutput += 'solid exported\\n';\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( object instanceof THREE.Mesh ) {\n\n\t\t\t\t\tvar geometry = object.geometry;\n\t\t\t\t\tvar matrixWorld = object.matrixWorld;\n\n\t\t\t\t\tif ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\t\t\tvar faces = geometry.faces;\n\n\t\t\t\t\t\tnormalMatrixWorld.getNormalMatrix( matrixWorld );\n\n\t\t\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t\t\t\tvector.copy( face.normal ).applyMatrix3( normalMatrixWorld ).normalize();\n\n\t\t\t\t\t\t\toutput += '\\tfacet normal ' + vector.x + ' ' + vector.y + ' ' + vector.z + '\\n';\n\t\t\t\t\t\t\toutput += '\\t\\touter loop\\n';\n\n\t\t\t\t\t\t\tvar indices = [ face.a, face.b, face.c ];\n\n\t\t\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\t\tvector.copy( vertices[ indices[ j ] ] ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\t\t\toutput += '\\t\\t\\tvertex ' + vector.x + ' ' + vector.y + ' ' + vector.z + '\\n';\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\toutput += '\\t\\tendloop\\n';\n\t\t\t\t\t\t\toutput += '\\tendfacet\\n';\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\toutput += 'endsolid exported\\n';\n\n\t\t\treturn output;\n\n\t\t};\n\n\t}() )\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/MaterialExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/MaterialExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.MaterialExporter = function () {};\n\nTHREE.MaterialExporter.prototype = {\n\n\tconstructor: THREE.MaterialExporter,\n\n\tparse: function ( material ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.2,\n\t\t\t\ttype: 'material',\n\t\t\t\tgenerator: 'MaterialExporter'\n\t\t\t}\n\t\t};\n\n\t\toutput.uuid = material.uuid;\n\n\t\tif ( material.name !== \"\" ) output.name = material.name;\n\n\t\tif ( material instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\toutput.type = 'MeshBasicMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshLambertMaterial ) {\n\n\t\t\toutput.type = 'MeshLambertMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.ambient = material.ambient.getHex();\n\t\t\toutput.emissive = material.emissive.getHex();\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\toutput.type = 'MeshPhongMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.ambient = material.ambient.getHex();\n\t\t\toutput.emissive = material.emissive.getHex();\n\t\t\toutput.specular = material.specular.getHex();\n\t\t\toutput.shininess = material.shininess;\n\t\t\tif ( material.vertexColors !== THREE.NoColors ) output.vertexColors = material.vertexColors;\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\toutput.type = 'MeshNormalMaterial';\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\toutput.type = 'MeshDepthMaterial';\n\t\t\tif ( material.blending !== THREE.NormalBlending ) output.blending = material.blending;\n\t\t\tif ( material.side !== THREE.FrontSide ) output.side = material.side;\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\t\t\toutput.wireframe = material.wireframe;\n\n\t\t} else if ( material instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\toutput.type = 'MeshFaceMaterial';\n\t\t\toutput.materials = [];\n\n\t\t\tfor ( var i = 0, l = material.materials.length; i < l; i ++ ) {\n\n\t\t\t\toutput.materials.push( this.parse( material.materials[ i ] ) );\n\n\t\t\t}\n\n\t\t} else if ( material instanceof THREE.ShaderMaterial ) {\n\n\t\t\toutput.type = 'ShaderMaterial';\n\t\t\toutput.uniforms = material.uniforms;\n\t\t\toutput.vertexShader = material.vertexShader;\n\t\t\toutput.fragmentShader = material.fragmentShader;\n\n\t\t} else if ( material instanceof THREE.SpriteMaterial ) {\n\n\t\t\toutput.type = 'SpriteMaterial';\n\t\t\toutput.color = material.color.getHex();\n\t\t\toutput.opacity = material.opacity;\n\t\t\toutput.transparent = material.transparent;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/BufferGeometryExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/BufferGeometryExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.BufferGeometryExporter = function () {};\n\nTHREE.BufferGeometryExporter.prototype = {\n\n\tconstructor: THREE.BufferGeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometryExporter'\n\t\t\t},\n\t\t\tattributes: {\n\t\t\t}\n\t\t};\n\n\t\tvar attributes = geometry.attributes;\n\t\tvar offsets = geometry.offsets;\n\t\tvar boundingSphere = geometry.boundingSphere;\n\n\t\tfor ( var key in attributes ) {\n\n\t\t\tvar attribute = attributes[ key ];\n\n\t\t\tvar array = [], typeArray = attribute.array;\n\n\t\t\tfor ( var i = 0, l = typeArray.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ] = typeArray[ i ];\n\n\t\t\t}\n\n\t\t\toutput.attributes[ key ] = {\n\t\t\t\titemSize: attribute.itemSize,\n\t\t\t\ttype: attribute.array.constructor.name,\n\t\t\t\tarray: array\n\t\t\t}\n\n\t\t}\n\n\t\tif ( offsets.length > 0 ) {\n\n\t\t\toutput.offsets = JSON.parse( JSON.stringify( offsets ) );\n\n\t\t}\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\toutput.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t}\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/ObjectExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/ObjectExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.ObjectExporter = function () {};\n\nTHREE.ObjectExporter.prototype = {\n\n\tconstructor: THREE.ObjectExporter,\n\n\tparse: function ( object ) {\n\n\t\t// console.log( object );\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.3,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'ObjectExporter'\n\t\t\t}\n\t\t};\n\n\t\t//\n\n\t\tvar geometries = {};\n\t\tvar geometryExporter = new THREE.GeometryExporter();\n\t\tvar bufferGeometryExporter = new THREE.BufferGeometryExporter();\n\n\t\tvar parseGeometry = function ( geometry ) {\n\n\t\t\tif ( output.geometries === undefined ) {\n\n\t\t\t\toutput.geometries = [];\n\n\t\t\t}\n\n\t\t\tif ( geometries[ geometry.uuid ] === undefined ) {\n\n\t\t\t\tvar data = {};\n\n\t\t\t\tdata.uuid = geometry.uuid;\n\n\t\t\t\tif ( geometry.name !== \"\" ) data.name = geometry.name;\n\n\t\t\t\tvar handleParameters = function ( parameters ) {\n\n\t\t\t\t\tfor ( var i = 0; i < parameters.length; i ++ ) {\n\n\t\t\t\t\t\tvar parameter = parameters[ i ];\n\n\t\t\t\t\t\tif ( geometry.parameters[ parameter ] !== undefined ) {\n\n\t\t\t\t\t\t\tdata[ parameter ] = geometry.parameters[ parameter ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t\tif ( geometry instanceof THREE.PlaneGeometry ) {\n\n\t\t\t\t\tdata.type = 'PlaneGeometry';\n\t\t\t\t\thandleParameters( [ 'width', 'height', 'widthSegments', 'heightSegments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.BoxGeometry ) {\n\n\t\t\t\t\tdata.type = 'BoxGeometry';\n\t\t\t\t\thandleParameters( [ 'width', 'height', 'depth', 'widthSegments', 'heightSegments', 'depthSegments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.CircleGeometry ) {\n\n\t\t\t\t\tdata.type = 'CircleGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'segments' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.CylinderGeometry ) {\n\n\t\t\t\t\tdata.type = 'CylinderGeometry';\n\t\t\t\t\thandleParameters( [ 'radiusTop', 'radiusBottom', 'height', 'radialSegments', 'heightSegments', 'openEnded' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.SphereGeometry ) {\n\n\t\t\t\t\tdata.type = 'SphereGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'widthSegments', 'heightSegments', 'phiStart', 'phiLength', 'thetaStart', 'thetaLength' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.IcosahedronGeometry ) {\n\n\t\t\t\t\tdata.type = 'IcosahedronGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'detail' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.TorusGeometry ) {\n\n\t\t\t\t\tdata.type = 'TorusGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'arc' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.TorusKnotGeometry ) {\n\n\t\t\t\t\tdata.type = 'TorusKnotGeometry';\n\t\t\t\t\thandleParameters( [ 'radius', 'tube', 'radialSegments', 'tubularSegments', 'p', 'q', 'heightScale' ] );\n\n\t\t\t\t} else if ( geometry instanceof THREE.BufferGeometry ) {\n\n\t\t\t\t\tdata.type = 'BufferGeometry';\n\t\t\t\t\tdata.data = bufferGeometryExporter.parse( geometry );\n\n\t\t\t\t\tdelete data.data.metadata;\n\n\t\t\t\t} else if ( geometry instanceof THREE.Geometry ) {\n\n\t\t\t\t\tdata.type = 'Geometry';\n\t\t\t\t\tdata.data = geometryExporter.parse( geometry );\n\n\t\t\t\t\tdelete data.data.metadata;\n\n\t\t\t\t}\n\n\t\t\t\tgeometries[ geometry.uuid ] = data;\n\n\t\t\t\toutput.geometries.push( data );\n\n\t\t\t}\n\n\t\t\treturn geometry.uuid;\n\n\t\t};\n\n\t\t//\n\n\t\tvar materials = {};\n\t\tvar materialExporter = new THREE.MaterialExporter();\n\n\t\tvar parseMaterial = function ( material ) {\n\n\t\t\tif ( output.materials === undefined ) {\n\n\t\t\t\toutput.materials = [];\n\n\t\t\t}\n\n\t\t\tif ( materials[ material.uuid ] === undefined ) {\n\n\t\t\t\tvar data = materialExporter.parse( material );\n\n\t\t\t\tdelete data.metadata;\n\n\t\t\t\tmaterials[ material.uuid ] = data;\n\n\t\t\t\toutput.materials.push( data );\n\n\t\t\t}\n\n\t\t\treturn material.uuid;\n\n\t\t};\n\n\t\t//\n\n\t\tvar parseObject = function ( object ) {\n\n\t\t\tvar data = {};\n\n\t\t\tdata.uuid = object.uuid;\n\n\t\t\tif ( object.name !== '' ) data.name = object.name;\n\t\t\tif ( JSON.stringify( object.userData ) !== '{}' ) data.userData = object.userData;\n\t\t\tif ( object.visible !== true ) data.visible = object.visible;\n\n\t\t\tif ( object instanceof THREE.Scene ) {\n\n\t\t\t\tdata.type = 'Scene';\n\n\t\t\t} else if ( object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tdata.type = 'PerspectiveCamera';\n\t\t\t\tdata.fov = object.fov;\n\t\t\t\tdata.aspect = object.aspect;\n\t\t\t\tdata.near = object.near;\n\t\t\t\tdata.far = object.far;\n\n\t\t\t} else if ( object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tdata.type = 'OrthographicCamera';\n\t\t\t\tdata.left = object.left;\n\t\t\t\tdata.right = object.right;\n\t\t\t\tdata.top = object.top;\n\t\t\t\tdata.bottom = object.bottom;\n\t\t\t\tdata.near = object.near;\n\t\t\t\tdata.far = object.far;\n\n\t\t\t} else if ( object instanceof THREE.AmbientLight ) {\n\n\t\t\t\tdata.type = 'AmbientLight';\n\t\t\t\tdata.color = object.color.getHex();\n\n\t\t\t} else if ( object instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tdata.type = 'DirectionalLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\n\t\t\t} else if ( object instanceof THREE.PointLight ) {\n\n\t\t\t\tdata.type = 'PointLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\t\t\t\tdata.distance = object.distance;\n\n\t\t\t} else if ( object instanceof THREE.SpotLight ) {\n\n\t\t\t\tdata.type = 'SpotLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.intensity = object.intensity;\n\t\t\t\tdata.distance = object.distance;\n\t\t\t\tdata.angle = object.angle;\n\t\t\t\tdata.exponent = object.exponent;\n\n\t\t\t} else if ( object instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tdata.type = 'HemisphereLight';\n\t\t\t\tdata.color = object.color.getHex();\n\t\t\t\tdata.groundColor = object.groundColor.getHex();\n\n\t\t\t} else if ( object instanceof THREE.Mesh ) {\n\n\t\t\t\tdata.type = 'Mesh';\n\t\t\t\tdata.geometry = parseGeometry( object.geometry );\n\t\t\t\tdata.material = parseMaterial( object.material );\n\n\t\t\t} else if ( object instanceof THREE.Sprite ) {\n\n\t\t\t\tdata.type = 'Sprite';\n\t\t\t\tdata.material = parseMaterial( object.material );\n\n\t\t\t} else {\n\n\t\t\t\tdata.type = 'Object3D';\n\n\t\t\t}\n\n\t\t\tdata.matrix = object.matrix.toArray();\n\n\t\t\tif ( object.children.length > 0 ) {\n\n\t\t\t\tdata.children = [];\n\n\t\t\t\tfor ( var i = 0; i < object.children.length; i ++ ) {\n\n\t\t\t\t\tdata.children.push( parseObject( object.children[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\toutput.object = parseObject( object );\n\n\t\treturn output;\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/SceneExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/SceneExporter.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SceneExporter = function () {};\n\nTHREE.SceneExporter.prototype = {\n\n\tconstructor: THREE.SceneExporter,\n\n\tparse: function ( scene ) {\n\n\t\tvar position = Vector3String( scene.position );\n\t\tvar rotation = Vector3String( scene.rotation );\n\t\tvar scale = Vector3String( scene.scale );\n\n\t\tvar nobjects = 0;\n\t\tvar ngeometries = 0;\n\t\tvar nmaterials = 0;\n\t\tvar ntextures = 0;\n\n\t\tvar objectsArray = [];\n\t\tvar geometriesArray = [];\n\t\tvar materialsArray = [];\n\t\tvar texturesArray = [];\n\t\tvar fogsArray = [];\n\n\t\tvar geometriesMap = {};\n\t\tvar materialsMap = {};\n\t\tvar texturesMap = {};\n\n\t\t// extract objects, geometries, materials, textures\n\n\t\tvar checkTexture = function ( map ) {\n\n\t\t\tif ( ! map ) return;\n\n\t\t\tif ( ! ( map.id in texturesMap ) ) {\n\n\t\t\t\ttexturesMap[ map.id ] = true;\n\t\t\t\ttexturesArray.push( TextureString( map ) );\n\t\t\t\tntextures += 1;\n\n\t\t\t}\n\n\t\t};\n\n\t\tvar linesArray = [];\n\n\t\tfunction createObjectsList( object, pad ) {\n\n\t\t\tfor ( var i = 0; i < object.children.length; i ++ ) {\n\n\t\t\t\tvar node = object.children[ i ];\n\n\t\t\t\tif ( node instanceof THREE.Mesh ) {\n\n\t\t\t\t\tlinesArray.push( MeshString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t\tif ( ! ( node.geometry.id in geometriesMap ) ) {\n\n\t\t\t\t\t\tgeometriesMap[ node.geometry.id ] = true;\n\t\t\t\t\t\tgeometriesArray.push( GeometryString( node.geometry ) );\n\t\t\t\t\t\tngeometries += 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! ( node.material.id in materialsMap ) ) {\n\n\t\t\t\t\t\tmaterialsMap[ node.material.id ] = true;\n\t\t\t\t\t\tmaterialsArray.push( MaterialString( node.material ) );\n\t\t\t\t\t\tnmaterials += 1;\n\n\t\t\t\t\t\tcheckTexture( node.material.map );\n\t\t\t\t\t\tcheckTexture( node.material.envMap );\n\t\t\t\t\t\tcheckTexture( node.material.lightMap );\n\t\t\t\t\t\tcheckTexture( node.material.specularMap );\n\t\t\t\t\t\tcheckTexture( node.material.bumpMap );\n\t\t\t\t\t\tcheckTexture( node.material.normalMap );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( node instanceof THREE.Light ) {\n\n\t\t\t\t\tlinesArray.push( LightString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t} else if ( node instanceof THREE.Camera ) {\n\n\t\t\t\t\tlinesArray.push( CameraString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t} else if ( node instanceof THREE.Object3D ) {\n\n\t\t\t\t\tlinesArray.push( ObjectString( node, pad ) );\n\t\t\t\t\tnobjects += 1;\n\n\t\t\t\t}\n\n\t\t\t\tif ( node.children.length > 0 ) {\n\n\t\t\t\t\tlinesArray.push( PaddingString( pad + 1 ) + '\\t\\t\"children\" : {' );\n\n\t\t\t\t}\n\n\t\t\t\tcreateObjectsList( node, pad + 2 );\n\n\t\t\t\tif ( node.children.length > 0 ) {\n\n\t\t\t\t\tlinesArray.push( PaddingString( pad + 1 ) + \"\\t\\t}\" );\n\n\t\t\t\t}\n\n\t\t\t\tlinesArray.push( PaddingString( pad ) + \"\\t\\t}\" + ( i < object.children.length - 1 ? \",\\n\" : \"\" ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tcreateObjectsList( scene, 0 );\n\n\t\tvar objects = linesArray.join( \"\\n\" );\n\n\t\t// extract fog\n\n\t\tif ( scene.fog ) {\n\n\t\t\tfogsArray.push( FogString( scene.fog ) );\n\n\t\t}\n\n\t\t// generate sections\n\n\t\tvar geometries = generateMultiLineString( geometriesArray, \",\\n\\n\\t\" );\n\t\tvar materials = generateMultiLineString( materialsArray, \",\\n\\n\\t\" );\n\t\tvar textures = generateMultiLineString( texturesArray, \",\\n\\n\\t\" );\n\t\tvar fogs = generateMultiLineString( fogsArray, \",\\n\\n\\t\" );\n\n\t\t// generate defaults\n\n\t\tvar activeCamera = null;\n\n\t\tscene.traverse( function ( node ) {\n\n\t\t\tif ( node instanceof THREE.Camera && node.userData.active ) {\n\n\t\t\t\tactiveCamera = node;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tvar defcamera = LabelString( activeCamera ? getObjectName( activeCamera ) : \"\" );\n\t\tvar deffog = LabelString( scene.fog ? getFogName( scene.fog ) : \"\" );\n\n\t\t// templates\n\n\t\tfunction Vector2String( v ) {\n\n\t\t\treturn \"[\" + v.x + \",\" + v.y + \"]\";\n\n\t\t}\n\n\t\tfunction Vector3String( v ) {\n\n\t\t\treturn \"[\" + v.x + \",\" + v.y + \",\" + v.z + \"]\";\n\n\t\t}\n\n\t\tfunction ColorString( c ) {\n\n\t\t\treturn \"[\" + c.r.toFixed( 3 ) + \",\" + c.g.toFixed( 3 ) + \",\" + c.b.toFixed( 3 ) + \"]\";\n\n\t\t}\n\n\t\tfunction LabelString( s ) {\n\n\t\t\treturn '\"' + s + '\"';\n\n\t\t}\n\n\t\tfunction NumConstantString( c ) {\n\n\t\t\tvar constants = [ \"NearestFilter\", \"NearestMipMapNearestFilter\" , \"NearestMipMapLinearFilter\",\n\t\t\t\t\t\t\t \"LinearFilter\", \"LinearMipMapNearestFilter\", \"LinearMipMapLinearFilter\" ];\n\n\t\t\tfor ( var i = 0; i < constants.length; i ++ ) {\n\n\t\t\t\tif ( THREE[ constants[ i ] ] === c ) return LabelString( constants[ i ] );\n\n\t\t\t};\n\n\t\t\treturn \"\";\n\n\t\t}\n\n\t\tfunction PaddingString( n ) {\n\n\t\t\tvar output = \"\";\n\n\t\t\tfor ( var i = 0; i < n; i ++ ) output += \"\\t\";\n\n\t\t\treturn output;\n\n\t\t}\n\n\n\t\t//\n\n\t\tfunction LightString( o, n ) {\n\n\t\t\tif ( o instanceof THREE.AmbientLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"AmbientLight\",',\n\t\t\t\t'\t\"color\" : ' + o.color.getHex() + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.DirectionalLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"DirectionalLight\",',\n\t\t\t\t'\t\"color\" : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"direction\" : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"target\" : ' + LabelString( getObjectName( o.target ) ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.PointLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"PointLight\",',\n\t\t\t\t'\t\"color\" : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"distance\" : ' + o.distance + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.SpotLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"SpotLight\",',\n\t\t\t\t'\t\"color\" : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t\t'\t\"distance\" : ' + o.distance + ',',\n\t\t\t\t'\t\"angle\" : ' + o.angle + ',',\n\t\t\t\t'\t\"exponent\" : ' + o.exponent + ',',\n\t\t\t\t'\t\"target\" : ' + LabelString( getObjectName( o.target ) ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.HemisphereLight ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"HemisphereLight\",',\n\t\t\t\t'\t\"skyColor\" : ' + o.color.getHex() + ',',\n\t\t\t\t'\t\"groundColor\" : ' + o.groundColor.getHex() + ',',\n\t\t\t\t'\t\"intensity\" : ' + o.intensity + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction CameraString( o, n ) {\n\n\t\t\tif ( o instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"PerspectiveCamera\",',\n\t\t\t\t'\t\"fov\" : ' + o.fov + ',',\n\t\t\t\t'\t\"aspect\" : ' + o.aspect + ',',\n\t\t\t\t'\t\"near\" : ' + o.near + ',',\n\t\t\t\t'\t\"far\" : ' + o.far + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else if ( o instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t\t'\t\"type\" : \"OrthographicCamera\",',\n\t\t\t\t'\t\"left\" : ' + o.left + ',',\n\t\t\t\t'\t\"right\" : ' + o.right + ',',\n\t\t\t\t'\t\"top\" : ' + o.top + ',',\n\t\t\t\t'\t\"bottom\" : ' + o.bottom + ',',\n\t\t\t\t'\t\"near\" : ' + o.near + ',',\n\t\t\t\t'\t\"far\" : ' + o.far + ',',\n\t\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ( o.children.length ? ',' : '' )\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction ObjectString( o, n ) {\n\n\t\t\tvar output = [\n\n\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t'\t\"rotation\" : ' + Vector3String( o.rotation ) + ',',\n\t\t\t'\t\"scale\"\t : ' + Vector3String( o.scale ) + ',',\n\t\t\t'\t\"visible\" : ' + o.visible + ( o.children.length ? ',' : '' )\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\tfunction MeshString( o, n ) {\n\n\t\t\tvar output = [\n\n\t\t\t'\\t\\t' + LabelString( getObjectName( o ) ) + ' : {',\n\t\t\t'\t\"geometry\" : ' + LabelString( getGeometryName( o.geometry ) ) + ',',\n\t\t\t'\t\"material\" : ' + LabelString( getMaterialName( o.material ) ) + ',',\n\t\t\t'\t\"position\" : ' + Vector3String( o.position ) + ',',\n\t\t\t'\t\"rotation\" : ' + Vector3String( o.rotation ) + ',',\n\t\t\t'\t\"scale\"\t : ' + Vector3String( o.scale ) + ',',\n\t\t\t'\t\"visible\" : ' + o.visible + ( o.children.length ? ',' : '' )\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t', n );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction GeometryString( g ) {\n\n\t\t\tif ( g instanceof THREE.SphereGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"sphere\",',\n\t\t\t\t'\t\"radius\" : ' \t\t + g.radius + ',',\n\t\t\t\t'\t\"widthSegments\" : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.BoxGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"cube\",',\n\t\t\t\t'\t\"width\" : ' + g.width + ',',\n\t\t\t\t'\t\"height\" : ' + g.height + ',',\n\t\t\t\t'\t\"depth\" : ' + g.depth + ',',\n\t\t\t\t'\t\"widthSegments\" : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments + ',',\n\t\t\t\t'\t\"depthSegments\" : ' + g.depthSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.PlaneGeometry ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"plane\",',\n\t\t\t\t'\t\"width\" : ' + g.width + ',',\n\t\t\t\t'\t\"height\" : ' + g.height + ',',\n\t\t\t\t'\t\"widthSegments\" : ' + g.widthSegments + ',',\n\t\t\t\t'\t\"heightSegments\" : ' + g.heightSegments,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( g instanceof THREE.Geometry ) {\n\n\t\t\t\tif ( g.sourceType === \"ascii\" || g.sourceType === \"ctm\" || g.sourceType === \"stl\" || g.sourceType === \"vtk\" ) {\n\n\t\t\t\t\tvar output = [\n\n\t\t\t\t\t'\\t' + LabelString( getGeometryName( g ) ) + ': {',\n\t\t\t\t\t'\t\"type\" : ' + LabelString( g.sourceType ) + ',',\n\t\t\t\t\t'\t\"url\" : ' + LabelString( g.sourceFile ),\n\t\t\t\t\t'}'\n\n\t\t\t\t\t];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvar output = [];\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\tfunction MaterialString( m ) {\n\n\t\t\tif ( m instanceof THREE.MeshBasicMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshBasicMaterial\",',\n\t\t\t\t'\t\"parameters\" : {',\n\t\t\t\t'\t\t\"color\" : ' \t+ m.color.getHex() + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"reflectivity\" : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\n\t\t\t} else if ( m instanceof THREE.MeshLambertMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshLambertMaterial\",',\n\t\t\t\t'\t\"parameters\" : {',\n\t\t\t\t'\t\t\"color\" : ' \t+ m.color.getHex() + ',',\n\t\t\t\t'\t\t\"ambient\" : ' \t+ m.ambient.getHex() + ',',\n\t\t\t\t'\t\t\"emissive\" : ' + m.emissive.getHex() + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"reflectivity\" : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshPhongMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshPhongMaterial\",',\n\t\t\t\t'\t\"parameters\" : {',\n\t\t\t\t'\t\t\"color\" : ' \t+ m.color.getHex() + ',',\n\t\t\t\t'\t\t\"ambient\" : ' \t+ m.ambient.getHex() + ',',\n\t\t\t\t'\t\t\"emissive\" : ' + m.emissive.getHex() + ',',\n\t\t\t\t'\t\t\"specular\" : ' + m.specular.getHex() + ',',\n\t\t\t\t'\t\t\"shininess\" : ' + m.shininess + ',',\n\n\t\t\t\tm.map ? \t\t'\t\t\"map\" : ' + LabelString( getTextureName( m.map ) ) + ',' : '',\n\t\t\t\tm.envMap ? \t\t'\t\t\"envMap\" : ' + LabelString( getTextureName( m.envMap ) ) + ',' : '',\n\t\t\t\tm.specularMap ? '\t\t\"specularMap\" : ' + LabelString( getTextureName( m.specularMap ) ) + ',' : '',\n\t\t\t\tm.lightMap ? \t'\t\t\"lightMap\" : ' + LabelString( getTextureName( m.lightMap ) ) + ',' : '',\n\t\t\t\tm.normalMap ? \t'\t\t\"normalMap\" : ' + LabelString( getTextureName( m.normalMap ) ) + ',' : '',\n\t\t\t\tm.bumpMap ? \t'\t\t\"bumpMap\" : ' + LabelString( getTextureName( m.bumpMap ) ) + ',' : '',\n\n\t\t\t\t'\t\t\"bumpScale\" : ' + m.bumpScale + ',',\n\t\t\t\t'\t\t\"reflectivity\" : ' + m.reflectivity + ',',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshDepthMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshDepthMaterial\",',\n\t\t\t\t'\t\"parameters\" : {',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshNormalMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshNormalMaterial\",',\n\t\t\t\t'\t\"parameters\" : {',\n\t\t\t\t'\t\t\"transparent\" : ' + m.transparent + ',',\n\t\t\t\t'\t\t\"opacity\" : ' \t+ m.opacity + ',',\n\t\t\t\t'\t\t\"wireframe\" : ' + m.wireframe + ',',\n\t\t\t\t'\t\t\"wireframeLinewidth\" : ' + m.wireframeLinewidth,\n\t\t\t\t'\t}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( m instanceof THREE.MeshFaceMaterial ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getMaterialName( m ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"MeshFaceMaterial\",',\n\t\t\t\t'\t\"parameters\" : {}',\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\tfunction TextureString( t ) {\n\n\t\t\t// here would be also an option to use data URI\n\t\t\t// with embedded image from \"t.image.src\"\n\t\t\t// (that's a side effect of using FileReader to load images)\n\n\t\t\tvar output = [\n\n\t\t\t'\\t' + LabelString( getTextureName( t ) ) + ': {',\n\t\t\t'\t\"url\" : \"' + t.sourceFile + '\",',\n\t\t\t'\t\"repeat\" : ' + Vector2String( t.repeat ) + ',',\n\t\t\t'\t\"offset\" : ' + Vector2String( t.offset ) + ',',\n\t\t\t'\t\"magFilter\" : ' + NumConstantString( t.magFilter ) + ',',\n\t\t\t'\t\"minFilter\" : ' + NumConstantString( t.minFilter ) + ',',\n\t\t\t'\t\"anisotropy\" : ' + t.anisotropy,\n\t\t\t'}'\n\n\t\t\t];\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction FogString( f ) {\n\n\t\t\tif ( f instanceof THREE.Fog ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getFogName( f ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"linear\",',\n\t\t\t\t'\t\"color\" : ' + ColorString( f.color ) + ',',\n\t\t\t\t'\t\"near\" : ' + f.near + ',',\n\t\t\t\t'\t\"far\" : ' + f.far,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else if ( f instanceof THREE.FogExp2 ) {\n\n\t\t\t\tvar output = [\n\n\t\t\t\t'\\t' + LabelString( getFogName( f ) ) + ': {',\n\t\t\t\t'\t\"type\" : \"exp2\",',\n\t\t\t\t'\t\"color\" : ' + ColorString( f.color ) + ',',\n\t\t\t\t'\t\"density\" : ' + f.density,\n\t\t\t\t'}'\n\n\t\t\t\t];\n\n\t\t\t} else {\n\n\t\t\t\tvar output = [];\n\n\t\t\t}\n\n\t\t\treturn generateMultiLineString( output, '\\n\\t\\t' );\n\n\t\t}\n\n\t\t//\n\n\t\tfunction generateMultiLineString( lines, separator, padding ) {\n\n\t\t\tvar cleanLines = [];\n\n\t\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\tvar line = lines[ i ];\n\n\t\t\t\tif ( line ) {\n\n\t\t\t\t\tif ( padding ) line = PaddingString( padding ) + line;\n\t\t\t\t\tcleanLines.push( line );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn cleanLines.join( separator );\n\n\t\t}\n\n\t\tfunction getObjectName( o ) {\n\n\t\t\treturn o.name ? o.name : \"Object_\" + o.id;\n\n\t\t}\n\n\t\tfunction getGeometryName( g ) {\n\n\t\t\treturn g.name ? g.name : \"Geometry_\" + g.id;\n\n\t\t}\n\n\t\tfunction getMaterialName( m ) {\n\n\t\t\treturn m.name ? m.name : \"Material_\" + m.id;\n\n\t\t}\n\n\t\tfunction getTextureName( t ) {\n\n\t\t\treturn t.name ? t.name : \"Texture_\" + t.id;\n\n\t\t}\n\n\t\tfunction getFogName( f ) {\n\n\t\t\treturn f.name ? f.name : \"Default fog\";\n\n\t\t}\n\n\t\t//\n\n\t\tvar output = [\n\t\t\t'{',\n\t\t\t'\t\"metadata\": {',\n\t\t\t'\t\t\"formatVersion\" : 3.2,',\n\t\t\t'\t\t\"type\"\t\t: \"scene\",',\n\t\t\t'\t\t\"generatedBy\"\t: \"SceneExporter\",',\n\t\t\t'\t\t\"objects\" : ' + nobjects + ',',\n\t\t\t'\t\t\"geometries\" : ' + ngeometries + ',',\n\t\t\t'\t\t\"materials\" : ' + nmaterials + ',',\n\t\t\t'\t\t\"textures\" : ' + ntextures,\n\t\t\t'\t},',\n\t\t\t'',\n\t\t\t'\t\"urlBaseType\": \"relativeToScene\",',\n\t\t\t'',\n\n\t\t\t'\t\"objects\" :',\n\t\t\t'\t{',\n\t\t\tobjects,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"geometries\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tgeometries,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"materials\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tmaterials,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"textures\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \ttextures,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"fogs\" :',\n\t\t\t'\t{',\n\t\t\t'\\t' + \tfogs,\n\t\t\t'\t},',\n\t\t\t'',\n\n\t\t\t'\t\"transform\" :',\n\t\t\t'\t{',\n\t\t\t'\t\t\"position\" : ' + position + ',',\n\t\t\t'\t\t\"rotation\" : ' + rotation + ',',\n\t\t\t'\t\t\"scale\" : ' + scale,\n\t\t\t'\t},',\n\t\t\t'',\n\t\t\t'\t\"defaults\" :',\n\t\t\t'\t{',\n\t\t\t'\t\t\"camera\" : ' + defcamera + ',',\n\t\t\t'\t\t\"fog\" \t : ' + deffog,\n\t\t\t'\t}',\n\t\t\t'}'\n\t\t].join( '\\n' );\n\n\t\treturn JSON.parse( output );\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/HTMLExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/HTMLExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.HTMLExporter = function () {};\n\nTHREE.HTMLExporter.prototype = {\n\n\tconstructor: THREE.HTMLExporter,\n\n\tparse: function ( scene ) {\n\n\t\treturn output;\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/STLBinaryExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/STLBinaryExporter.js",
"module-type": "library",
"text": "/**\n * @author kovacsv / http://kovacsv.hu/\n * @author mrdoob / http://mrdoob.com/\n * @author mudcube / http://mudcu.be/\n */\n \nTHREE.STLBinaryExporter = function () {};\n\nTHREE.STLBinaryExporter.prototype = {\n\n\tconstructor: THREE.STLBinaryExporter,\n\n\tparse: ( function () {\n\n\t\tvar vector = new THREE.Vector3();\n\t\tvar normalMatrixWorld = new THREE.Matrix3();\n\n\t\treturn function ( scene ) {\n\n\t\t\tvar triangles = 0;\n\t\t\tscene.traverse( function ( object ) {\n\t\t\t\tif ( !(object instanceof THREE.Mesh) ) return;\n\t\t\t\ttriangles += object.geometry.faces.length;\n\t\t\t});\n\n\t\t\tvar offset = 80; // skip header\n\t\t\tvar bufferLength = triangles * 2 + triangles * 3 * 4 * 4 + 80 + 4;\n\t\t\tvar arrayBuffer = new ArrayBuffer(bufferLength);\n\t\t\tvar output = new DataView(arrayBuffer);\n\t\t\toutput.setUint32(offset, triangles, true); offset += 4;\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( !(object instanceof THREE.Mesh) ) return;\n\t\t\t\tif ( !(object.geometry instanceof THREE.Geometry )) return;\n\n\t\t\t\tvar geometry = object.geometry;\n\t\t\t\tvar matrixWorld = object.matrixWorld;\n\n\t\t\t\tvar vertices = geometry.vertices;\n\t\t\t\tvar faces = geometry.faces;\n\n\t\t\t\tnormalMatrixWorld.getNormalMatrix( matrixWorld );\n\n\t\t\t\tfor ( var i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar face = faces[ i ];\n\n\t\t\t\t\tvector.copy( face.normal ).applyMatrix3( normalMatrixWorld ).normalize();\n\n\t\t\t\t\toutput.setFloat32(offset, vector.x, true); offset += 4; // normal\n\t\t\t\t\toutput.setFloat32(offset, vector.y, true); offset += 4;\n\t\t\t\t\toutput.setFloat32(offset, vector.z, true); offset += 4;\n\n\t\t\t\t\tvar indices = [ face.a, face.b, face.c ];\n\n\t\t\t\t\tfor ( var j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\tvector.copy( vertices[ indices[ j ] ] ).applyMatrix4( matrixWorld );\n\n\t\t\t\t\t\toutput.setFloat32(offset, vector.x, true); offset += 4; // vertices\n\t\t\t\t\t\toutput.setFloat32(offset, vector.y, true); offset += 4;\n\t\t\t\t\t\toutput.setFloat32(offset, vector.z, true); offset += 4;\n\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.setUint16(offset, 0, true); offset += 2; // attribute byte count\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t} );\n\t\t\t\n\t\t\treturn output;\n\n\t\t};\n\n\t}() )\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/TypedGeometryExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/TypedGeometryExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.TypedGeometryExporter = function () {};\n\nTHREE.TypedGeometryExporter.prototype = {\n\n\tconstructor: THREE.TypedGeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'TypedGeometry',\n\t\t\t\tgenerator: 'TypedGeometryExporter'\n\t\t\t}\n\t\t};\n\n\t\tvar attributes = [ 'vertices', 'normals', 'uvs' ];\n\n\t\tfor ( var key in attributes ) {\n\n\t\t\tvar attribute = attributes[ key ];\n\t\t\t\n\t\t\tvar typedArray = geometry[ attribute ];\n\t\t\tvar array = [];\n\n\t\t\tfor ( var i = 0, l = typedArray.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ] = typedArray[ i ];\n\n\t\t\t}\n\n\t\t\toutput[ attribute ] = array;\n\n\t\t}\n\n\t\tvar boundingSphere = geometry.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\toutput.boundingSphere = {\n\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\tradius: boundingSphere.radius\n\t\t\t}\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Exporters/GeometryExporter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Exporters/GeometryExporter.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.GeometryExporter = function () {};\n\nTHREE.GeometryExporter.prototype = {\n\n\tconstructor: THREE.GeometryExporter,\n\n\tparse: function ( geometry ) {\n\n\t\tvar output = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.0,\n\t\t\t\ttype: 'geometry',\n\t\t\t\tgenerator: 'GeometryExporter'\n\t\t\t}\n\t\t};\n\n\t\tvar vertices = [];\n\n\t\tfor ( var i = 0; i < geometry.vertices.length; i ++ ) {\n\n\t\t\tvar vertex = geometry.vertices[ i ];\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tvar faces = [];\n\t\tvar normals = [];\n\t\tvar normalsHash = {};\n\t\tvar colors = [];\n\t\tvar colorsHash = {};\n\t\tvar uvs = [];\n\t\tvar uvsHash = {};\n\n\t\tfor ( var i = 0; i < geometry.faces.length; i ++ ) {\n\n\t\t\tvar face = geometry.faces[ i ];\n\n\t\t\tvar hasMaterial = false; // face.materialIndex !== undefined;\n\t\t\tvar hasFaceUv = false; // deprecated\n\t\t\tvar hasFaceVertexUv = geometry.faceVertexUvs[ 0 ][ i ] !== undefined;\n\t\t\tvar hasFaceNormal = face.normal.length() > 0;\n\t\t\tvar hasFaceVertexNormal = face.vertexNormals.length > 0;\n\t\t\tvar hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1;\n\t\t\tvar hasFaceVertexColor = face.vertexColors.length > 0;\n\n\t\t\tvar faceType = 0;\n\n\t\t\tfaceType = setBit( faceType, 0, 0 );\n\t\t\tfaceType = setBit( faceType, 1, hasMaterial );\n\t\t\tfaceType = setBit( faceType, 2, hasFaceUv );\n\t\t\tfaceType = setBit( faceType, 3, hasFaceVertexUv );\n\t\t\tfaceType = setBit( faceType, 4, hasFaceNormal );\n\t\t\tfaceType = setBit( faceType, 5, hasFaceVertexNormal );\n\t\t\tfaceType = setBit( faceType, 6, hasFaceColor );\n\t\t\tfaceType = setBit( faceType, 7, hasFaceVertexColor );\n\n\t\t\tfaces.push( faceType );\n\t\t\tfaces.push( face.a, face.b, face.c );\n\n\n\t\t\t/*\n\t\t\tif ( hasMaterial ) {\n\n\t\t\t\tfaces.push( face.materialIndex );\n\n\t\t\t}\n\t\t\t*/\n\n\t\t\tif ( hasFaceVertexUv ) {\n\n\t\t\t\tvar faceVertexUvs = geometry.faceVertexUvs[ 0 ][ i ];\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 0 ] ),\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 1 ] ),\n\t\t\t\t\tgetUvIndex( faceVertexUvs[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tif ( hasFaceNormal ) {\n\n\t\t\t\tfaces.push( getNormalIndex( face.normal ) );\n\n\t\t\t}\n\n\t\t\tif ( hasFaceVertexNormal ) {\n\n\t\t\t\tvar vertexNormals = face.vertexNormals;\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 0 ] ),\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 1 ] ),\n\t\t\t\t\tgetNormalIndex( vertexNormals[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\tif ( hasFaceColor ) {\n\n\t\t\t\tfaces.push( getColorIndex( face.color ) );\n\n\t\t\t}\n\n\t\t\tif ( hasFaceVertexColor ) {\n\n\t\t\t\tvar vertexColors = face.vertexColors;\n\n\t\t\t\tfaces.push(\n\t\t\t\t\tgetColorIndex( vertexColors[ 0 ] ),\n\t\t\t\t\tgetColorIndex( vertexColors[ 1 ] ),\n\t\t\t\t\tgetColorIndex( vertexColors[ 2 ] )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction setBit( value, position, enabled ) {\n\n\t\t\treturn enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position) );\n\n\t\t}\n\n\t\tfunction getNormalIndex( normal ) {\n\n\t\t\tvar hash = normal.x.toString() + normal.y.toString() + normal.z.toString();\n\n\t\t\tif ( normalsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn normalsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tnormalsHash[ hash ] = normals.length / 3;\n\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\treturn normalsHash[ hash ];\n\n\t\t}\n\n\t\tfunction getColorIndex( color ) {\n\n\t\t\tvar hash = color.r.toString() + color.g.toString() + color.b.toString();\n\n\t\t\tif ( colorsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn colorsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tcolorsHash[ hash ] = colors.length;\n\t\t\tcolors.push( color.getHex() );\n\n\t\t\treturn colorsHash[ hash ];\n\n\t\t}\n\n\t\tfunction getUvIndex( uv ) {\n\n\t\t\tvar hash = uv.x.toString() + uv.y.toString();\n\n\t\t\tif ( uvsHash[ hash ] !== undefined ) {\n\n\t\t\t\treturn uvsHash[ hash ];\n\n\t\t\t}\n\n\t\t\tuvsHash[ hash ] = uvs.length / 2;\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\treturn uvsHash[ hash ];\n\n\t\t}\n\n\t\toutput.vertices = vertices;\n\t\toutput.normals = normals;\n\t\tif ( colors.length > 0 ) output.colors = colors;\n\t\tif ( uvs.length > 0 ) output.uvs = [ uvs ]; // temporal backward compatibility\n\t\toutput.faces = faces;\n\n\t\t//\n\n\t\treturn output;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/BloomPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/BloomPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {\n\n\tstrength = ( strength !== undefined ) ? strength : 1;\n\tkernelSize = ( kernelSize !== undefined ) ? kernelSize : 25;\n\tsigma = ( sigma !== undefined ) ? sigma : 4.0;\n\tresolution = ( resolution !== undefined ) ? resolution : 256;\n\n\t// render targets\n\n\tvar pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };\n\n\tthis.renderTargetX = new THREE.WebGLRenderTarget( resolution, resolution, pars );\n\tthis.renderTargetY = new THREE.WebGLRenderTarget( resolution, resolution, pars );\n\n\t// copy material\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.BloomPass relies on THREE.CopyShader\" );\n\n\tvar copyShader = THREE.CopyShader;\n\n\tthis.copyUniforms = THREE.UniformsUtils.clone( copyShader.uniforms );\n\n\tthis.copyUniforms[ \"opacity\" ].value = strength;\n\n\tthis.materialCopy = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.copyUniforms,\n\t\tvertexShader: copyShader.vertexShader,\n\t\tfragmentShader: copyShader.fragmentShader,\n\t\tblending: THREE.AdditiveBlending,\n\t\ttransparent: true\n\n\t} );\n\n\t// convolution material\n\n\tif ( THREE.ConvolutionShader === undefined )\n\t\tconsole.error( \"THREE.BloomPass relies on THREE.ConvolutionShader\" );\n\n\tvar convolutionShader = THREE.ConvolutionShader;\n\n\tthis.convolutionUniforms = THREE.UniformsUtils.clone( convolutionShader.uniforms );\n\n\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurx;\n\tthis.convolutionUniforms[ \"cKernel\" ].value = THREE.ConvolutionShader.buildKernel( sigma );\n\n\tthis.materialConvolution = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.convolutionUniforms,\n\t\tvertexShader: convolutionShader.vertexShader,\n\t\tfragmentShader: convolutionShader.fragmentShader,\n\t\tdefines: {\n\t\t\t\"KERNEL_SIZE_FLOAT\": kernelSize.toFixed( 1 ),\n\t\t\t\"KERNEL_SIZE_INT\": kernelSize.toFixed( 0 )\n\t\t}\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.BloomPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {\n\n\t\tif ( maskActive ) renderer.context.disable( renderer.context.STENCIL_TEST );\n\n\t\t// Render quad with blured scene into texture (convolution pass 1)\n\n\t\tthis.quad.material = this.materialConvolution;\n\n\t\tthis.convolutionUniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurX;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetX, true );\n\n\n\t\t// Render quad with blured scene into texture (convolution pass 2)\n\n\t\tthis.convolutionUniforms[ \"tDiffuse\" ].value = this.renderTargetX;\n\t\tthis.convolutionUniforms[ \"uImageIncrement\" ].value = THREE.BloomPass.blurY;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetY, true );\n\n\t\t// Render original scene with superimposed blur to texture\n\n\t\tthis.quad.material = this.materialCopy;\n\n\t\tthis.copyUniforms[ \"tDiffuse\" ].value = this.renderTargetY;\n\n\t\tif ( maskActive ) renderer.context.enable( renderer.context.STENCIL_TEST );\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\n\t}\n\n};\n\nTHREE.BloomPass.blurX = new THREE.Vector2( 0.001953125, 0.0 );\nTHREE.BloomPass.blurY = new THREE.Vector2( 0.0, 0.001953125 );\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/ShaderPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/ShaderPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function ( shader, textureID ) {\n\n\tthis.textureID = ( textureID !== undefined ) ? textureID : \"tDiffuse\";\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.renderToScreen = false;\n\n\tthis.enabled = true;\n\tthis.needsSwap = true;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.ShaderPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tif ( this.uniforms[ this.textureID ] ) {\n\n\t\t\tthis.uniforms[ this.textureID ].value = readBuffer;\n\n\t\t}\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n\t\t}\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/SavePass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/SavePass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SavePass = function ( renderTarget ) {\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.SavePass relies on THREE.CopyShader\" );\n\n\tvar shader = THREE.CopyShader;\n\n\tthis.textureID = \"tDiffuse\";\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.renderTarget = renderTarget;\n\n\tif ( this.renderTarget === undefined ) {\n\n\t\tthis.renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };\n\t\tthis.renderTarget = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, this.renderTargetParameters );\n\n\t}\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.clear = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.SavePass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tif ( this.uniforms[ this.textureID ] ) {\n\n\t\t\tthis.uniforms[ this.textureID ].value = readBuffer;\n\n\t\t}\n\n\t\tthis.quad.material = this.material;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTarget, this.clear );\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/DotScreenPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/DotScreenPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.DotScreenPass = function ( center, angle, scale ) {\n\n\tif ( THREE.DotScreenShader === undefined )\n\t\tconsole.error( \"THREE.DotScreenPass relies on THREE.DotScreenShader\" );\n\n\tvar shader = THREE.DotScreenShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tif ( center !== undefined ) this.uniforms[ \"center\" ].value.copy( center );\n\tif ( angle !== undefined ) this.uniforms[ \"angle\"].value = angle;\n\tif ( scale !== undefined ) this.uniforms[ \"scale\"].value = scale;\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.DotScreenPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ \"tSize\" ].value.set( readBuffer.width, readBuffer.height );\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\n\t\t}\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/GlitchPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/GlitchPass.js",
"module-type": "library",
"text": "/**\n \n */\n\nTHREE.GlitchPass = function ( dt_size ) {\n\n\tif ( THREE.DigitalGlitch === undefined ) console.error( \"THREE.GlitchPass relies on THREE.DigitalGlitch\" );\n\t\n\tvar shader = THREE.DigitalGlitch;\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tif(dt_size==undefined) dt_size=64;\n\t\n\t\n\tthis.uniforms[ \"tDisp\"].value=this.generateHeightmap(dt_size);\n\t\n\n\tthis.material = new THREE.ShaderMaterial({\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\t});\n\n\tconsole.log(this.material);\n\t\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\t\n\tthis.goWild=false;\n\tthis.curF=0;\n\tthis.generateTrigger();\n\t\n};\n\nTHREE.GlitchPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) \n\t{\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ 'seed' ].value=Math.random();//default seeding\n\t\tthis.uniforms[ 'byp' ].value=0;\n\t\t\n\t\tif(this.curF % this.randX ==0 || this.goWild==true)\n\t\t{\n\t\t\tthis.uniforms[ 'amount' ].value=Math.random()/30;\n\t\t\tthis.uniforms[ 'angle' ].value=THREE.Math.randFloat(-Math.PI,Math.PI);\n\t\t\tthis.uniforms[ 'seed_x' ].value=THREE.Math.randFloat(-1,1);\n\t\t\tthis.uniforms[ 'seed_y' ].value=THREE.Math.randFloat(-1,1);\n\t\t\tthis.uniforms[ 'distortion_x' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'distortion_y' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.curF=0;\n\t\t\tthis.generateTrigger();\n\t\t}\n\t\telse if(this.curF % this.randX <this.randX/5)\n\t\t{\n\t\t\tthis.uniforms[ 'amount' ].value=Math.random()/90;\n\t\t\tthis.uniforms[ 'angle' ].value=THREE.Math.randFloat(-Math.PI,Math.PI);\n\t\t\tthis.uniforms[ 'distortion_x' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'distortion_y' ].value=THREE.Math.randFloat(0,1);\n\t\t\tthis.uniforms[ 'seed_x' ].value=THREE.Math.randFloat(-0.3,0.3);\n\t\t\tthis.uniforms[ 'seed_y' ].value=THREE.Math.randFloat(-0.3,0.3);\n\t\t}\n\t\telse if(this.goWild==false)\n\t\t{\n\t\t\tthis.uniforms[ 'byp' ].value=1;\n\t\t}\n\t\tthis.curF++;\n\t\t\n\t\tthis.quad.material = this.material;\n\t\tif ( this.renderToScreen ) \n\t\t{\n\t\t\trenderer.render( this.scene, this.camera );\n\t\t} \n\t\telse \n\t\t{\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\t\t}\n\t},\n\tgenerateTrigger:function()\n\t{\n\t\tthis.randX=THREE.Math.randInt(120,240);\n\t},\n\tgenerateHeightmap:function(dt_size)\n\t{\n\t\tvar data_arr = new Float32Array( dt_size*dt_size * 3 );\n\t\tconsole.log(dt_size);\n\t\tvar length=dt_size*dt_size;\n\t\t\n\t\tfor ( var i = 0; i < length; i++) \n\t\t{\n\t\t\tvar val=THREE.Math.randFloat(0,1);\n\t\t\tdata_arr[ i*3 + 0 ] = val;\n\t\t\tdata_arr[ i*3 + 1 ] = val;\n\t\t\tdata_arr[ i*3 + 2 ] = val;\n\t\t}\n\t\t\n\t\tvar texture = new THREE.DataTexture( data_arr, dt_size, dt_size, THREE.RGBFormat, THREE.FloatType );\n\t\tconsole.log(texture);\n\t\tconsole.log(dt_size);\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\t\treturn texture;\n\t}\n};"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/EffectComposer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/EffectComposer.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function ( renderer, renderTarget ) {\n\n\tthis.renderer = renderer;\n\n\tif ( renderTarget === undefined ) {\n\n\t\tvar width = window.innerWidth || 1;\n\t\tvar height = window.innerHeight || 1;\n\t\tvar parameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };\n\n\t\trenderTarget = new THREE.WebGLRenderTarget( width, height, parameters );\n\n\t}\n\n\tthis.renderTarget1 = renderTarget;\n\tthis.renderTarget2 = renderTarget.clone();\n\n\tthis.writeBuffer = this.renderTarget1;\n\tthis.readBuffer = this.renderTarget2;\n\n\tthis.passes = [];\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.EffectComposer relies on THREE.CopyShader\" );\n\n\tthis.copyPass = new THREE.ShaderPass( THREE.CopyShader );\n\n};\n\nTHREE.EffectComposer.prototype = {\n\n\tswapBuffers: function() {\n\n\t\tvar tmp = this.readBuffer;\n\t\tthis.readBuffer = this.writeBuffer;\n\t\tthis.writeBuffer = tmp;\n\n\t},\n\n\taddPass: function ( pass ) {\n\n\t\tthis.passes.push( pass );\n\n\t},\n\n\tinsertPass: function ( pass, index ) {\n\n\t\tthis.passes.splice( index, 0, pass );\n\n\t},\n\n\trender: function ( delta ) {\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t\tvar maskActive = false;\n\n\t\tvar pass, i, il = this.passes.length;\n\n\t\tfor ( i = 0; i < il; i ++ ) {\n\n\t\t\tpass = this.passes[ i ];\n\n\t\t\tif ( !pass.enabled ) continue;\n\n\t\t\tpass.render( this.renderer, this.writeBuffer, this.readBuffer, delta, maskActive );\n\n\t\t\tif ( pass.needsSwap ) {\n\n\t\t\t\tif ( maskActive ) {\n\n\t\t\t\t\tvar context = this.renderer.context;\n\n\t\t\t\t\tcontext.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );\n\n\t\t\t\t\tthis.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, delta );\n\n\t\t\t\t\tcontext.stencilFunc( context.EQUAL, 1, 0xffffffff );\n\n\t\t\t\t}\n\n\t\t\t\tthis.swapBuffers();\n\n\t\t\t}\n\n\t\t\tif ( pass instanceof THREE.MaskPass ) {\n\n\t\t\t\tmaskActive = true;\n\n\t\t\t} else if ( pass instanceof THREE.ClearMaskPass ) {\n\n\t\t\t\tmaskActive = false;\n\n\t\t\t}\n\n\t\t}\n\n\t},\n\n\treset: function ( renderTarget ) {\n\n\t\tif ( renderTarget === undefined ) {\n\n\t\t\trenderTarget = this.renderTarget1.clone();\n\n\t\t\trenderTarget.width = window.innerWidth;\n\t\t\trenderTarget.height = window.innerHeight;\n\n\t\t}\n\n\t\tthis.renderTarget1 = renderTarget;\n\t\tthis.renderTarget2 = renderTarget.clone();\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t},\n\n\tsetSize: function ( width, height ) {\n\n\t\tvar renderTarget = this.renderTarget1.clone();\n\n\t\trenderTarget.width = width;\n\t\trenderTarget.height = height;\n\n\t\tthis.reset( renderTarget );\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/FilmPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/FilmPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function ( noiseIntensity, scanlinesIntensity, scanlinesCount, grayscale ) {\n\n\tif ( THREE.FilmShader === undefined )\n\t\tconsole.error( \"THREE.FilmPass relies on THREE.FilmShader\" );\n\n\tvar shader = THREE.FilmShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tif ( grayscale !== undefined )\tthis.uniforms.grayscale.value = grayscale;\n\tif ( noiseIntensity !== undefined ) this.uniforms.nIntensity.value = noiseIntensity;\n\tif ( scanlinesIntensity !== undefined ) this.uniforms.sIntensity.value = scanlinesIntensity;\n\tif ( scanlinesCount !== undefined ) this.uniforms.sCount.value = scanlinesCount;\n\n\tthis.enabled = true;\n\tthis.renderToScreen = false;\n\tthis.needsSwap = true;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.FilmPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.uniforms[ \"tDiffuse\" ].value = readBuffer;\n\t\tthis.uniforms[ \"time\" ].value += delta;\n\n\t\tthis.quad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene, this.camera );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene, this.camera, writeBuffer, false );\n\n\t\t}\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/RenderPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/RenderPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tthis.overrideMaterial = overrideMaterial;\n\n\tthis.clearColor = clearColor;\n\tthis.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;\n\n\tthis.oldClearColor = new THREE.Color();\n\tthis.oldClearAlpha = 1;\n\n\tthis.enabled = true;\n\tthis.clear = true;\n\tthis.needsSwap = false;\n\n};\n\nTHREE.RenderPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.scene.overrideMaterial = this.overrideMaterial;\n\n\t\tif ( this.clearColor ) {\n\n\t\t\tthis.oldClearColor.copy( renderer.getClearColor() );\n\t\t\tthis.oldClearAlpha = renderer.getClearAlpha();\n\n\t\t\trenderer.setClearColor( this.clearColor, this.clearAlpha );\n\n\t\t}\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\n\t\tif ( this.clearColor ) {\n\n\t\t\trenderer.setClearColor( this.oldClearColor, this.oldClearAlpha );\n\n\t\t}\n\n\t\tthis.scene.overrideMaterial = null;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/BokehPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/BokehPass.js",
"module-type": "library",
"text": "/**\n * Depth-of-field post-process with bokeh shader\n */\n\n\nTHREE.BokehPass = function ( scene, camera, params ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tvar focus = ( params.focus !== undefined ) ? params.focus : 1.0;\n\tvar aspect = ( params.aspect !== undefined ) ? params.aspect : camera.aspect;\n\tvar aperture = ( params.aperture !== undefined ) ? params.aperture : 0.025;\n\tvar maxblur = ( params.maxblur !== undefined ) ? params.maxblur : 1.0;\n\n\t// render targets\n\n\tvar width = params.width || window.innerWidth || 1;\n\tvar height = params.height || window.innerHeight || 1;\n\n\tthis.renderTargetColor = new THREE.WebGLRenderTarget( width, height, {\n\t\tminFilter: THREE.LinearFilter,\n\t\tmagFilter: THREE.LinearFilter,\n\t\tformat: THREE.RGBFormat\n\t} );\n\n\tthis.renderTargetDepth = this.renderTargetColor.clone();\n\n\t// depth material\n\n\tthis.materialDepth = new THREE.MeshDepthMaterial();\n\n\t// bokeh material\n\n\tif ( THREE.BokehShader === undefined ) {\n\t\tconsole.error( \"THREE.BokehPass relies on THREE.BokehShader\" );\n\t}\n\t\n\tvar bokehShader = THREE.BokehShader;\n\tvar bokehUniforms = THREE.UniformsUtils.clone( bokehShader.uniforms );\n\n\tbokehUniforms[ \"tDepth\" ].value = this.renderTargetDepth;\n\n\tbokehUniforms[ \"focus\" ].value = focus;\n\tbokehUniforms[ \"aspect\" ].value = aspect;\n\tbokehUniforms[ \"aperture\" ].value = aperture;\n\tbokehUniforms[ \"maxblur\" ].value = maxblur;\n\n\tthis.materialBokeh = new THREE.ShaderMaterial({\n\t\tuniforms: bokehUniforms,\n\t\tvertexShader: bokehShader.vertexShader,\n\t\tfragmentShader: bokehShader.fragmentShader\n\t});\n\n\tthis.uniforms = bokehUniforms;\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\tthis.renderToScreen = false;\n\tthis.clear = false;\n\n\tthis.camera2 = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene2 = new THREE.Scene();\n\n\tthis.quad2 = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene2.add( this.quad2 );\n\n};\n\nTHREE.BokehPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {\n\n\t\tthis.quad2.material = this.materialBokeh;\n\n\t\t// Render depth into texture\n\n\t\tthis.scene.overrideMaterial = this.materialDepth;\n\n\t\trenderer.render( this.scene, this.camera, this.renderTargetDepth, true );\n\n\t\t// Render bokeh composite\n\n\t\tthis.uniforms[ \"tColor\" ].value = readBuffer;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.render( this.scene2, this.camera2 );\n\n\t\t} else {\n\n\t\t\trenderer.render( this.scene2, this.camera2, writeBuffer, this.clear );\n\n\t\t}\n\n\t\tthis.scene.overrideMaterial = null;\n\n\t}\n\n};\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/MaskPass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/MaskPass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tthis.scene = scene;\n\tthis.camera = camera;\n\n\tthis.enabled = true;\n\tthis.clear = true;\n\tthis.needsSwap = false;\n\n\tthis.inverse = false;\n\n};\n\nTHREE.MaskPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tvar context = renderer.context;\n\n\t\t// don't update color or depth\n\n\t\tcontext.colorMask( false, false, false, false );\n\t\tcontext.depthMask( false );\n\n\t\t// set up stencil\n\n\t\tvar writeValue, clearValue;\n\n\t\tif ( this.inverse ) {\n\n\t\t\twriteValue = 0;\n\t\t\tclearValue = 1;\n\n\t\t} else {\n\n\t\t\twriteValue = 1;\n\t\t\tclearValue = 0;\n\n\t\t}\n\n\t\tcontext.enable( context.STENCIL_TEST );\n\t\tcontext.stencilOp( context.REPLACE, context.REPLACE, context.REPLACE );\n\t\tcontext.stencilFunc( context.ALWAYS, writeValue, 0xffffffff );\n\t\tcontext.clearStencil( clearValue );\n\n\t\t// draw into the stencil buffer\n\n\t\trenderer.render( this.scene, this.camera, readBuffer, this.clear );\n\t\trenderer.render( this.scene, this.camera, writeBuffer, this.clear );\n\n\t\t// re-enable update of color and depth\n\n\t\tcontext.colorMask( true, true, true, true );\n\t\tcontext.depthMask( true );\n\n\t\t// only render where stencil is set to 1\n\n\t\tcontext.stencilFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1\n\t\tcontext.stencilOp( context.KEEP, context.KEEP, context.KEEP );\n\n\t}\n\n};\n\n\nTHREE.ClearMaskPass = function () {\n\n\tthis.enabled = true;\n\n};\n\nTHREE.ClearMaskPass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tvar context = renderer.context;\n\n\t\tcontext.disable( context.STENCIL_TEST );\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Postprocessing/TexturePass.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Postprocessing/TexturePass.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TexturePass = function ( texture, opacity ) {\n\n\tif ( THREE.CopyShader === undefined )\n\t\tconsole.error( \"THREE.TexturePass relies on THREE.CopyShader\" );\n\n\tvar shader = THREE.CopyShader;\n\n\tthis.uniforms = THREE.UniformsUtils.clone( shader.uniforms );\n\n\tthis.uniforms[ \"opacity\" ].value = ( opacity !== undefined ) ? opacity : 1.0;\n\tthis.uniforms[ \"tDiffuse\" ].value = texture;\n\n\tthis.material = new THREE.ShaderMaterial( {\n\n\t\tuniforms: this.uniforms,\n\t\tvertexShader: shader.vertexShader,\n\t\tfragmentShader: shader.fragmentShader\n\n\t} );\n\n\tthis.enabled = true;\n\tthis.needsSwap = false;\n\n\n\tthis.camera = new THREE.OrthographicCamera( -1, 1, 1, -1, 0, 1 );\n\tthis.scene = new THREE.Scene();\n\n\tthis.quad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), null );\n\tthis.scene.add( this.quad );\n\n};\n\nTHREE.TexturePass.prototype = {\n\n\trender: function ( renderer, writeBuffer, readBuffer, delta ) {\n\n\t\tthis.quad.material = this.material;\n\n\t\trenderer.render( this.scene, this.camera, readBuffer );\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/ShaderToon.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ShaderToon.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * ShaderToon currently contains:\n *\n *\ttoon1\n *\ttoon2\n *\thatching\n *\tdotted\n */\n\nTHREE.ShaderToon = {\n\n'toon1' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\": { type: \"c\", value: new THREE.Color( 0xffffff ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\t\t\"varying vec3 vRefract;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec3 worldNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\",\n\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\"vec3 I = worldPosition.xyz - cameraPosition;\",\n\t\t\t\"vRefract = refract( normalize( I ), worldNormal, 1.02 );\",\n\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"varying vec3 vRefract;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"float intensity = smoothstep( - 0.5, 1.0, pow( length(lightWeighting), 20.0 ) );\",\n\t\t\t\"intensity += length(lightWeighting) * 0.2;\",\n\n\t\t\t\"float cameraWeighting = dot( normalize( vNormal ), vRefract );\",\n\t\t\t\"intensity += pow( 1.0 - length( cameraWeighting ), 6.0 );\",\n\t\t\t\"intensity = intensity * 0.2 + 0.3;\",\n\n\t\t\t\"if ( intensity < 0.50 ) {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 2.0 * intensity * uBaseColor, 1.0 );\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 1.0 - 2.0 * ( 1.0 - intensity ) * ( 1.0 - uBaseColor ), 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'toon2' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x808080 ) },\n\t\t\"uLineColor2\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor3\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor4\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float camera = max( dot( normalize( vNormal ), vec3( 0.0, 0.0, 1.0 ) ), 0.4);\",\n\t\t\t\"float light = max( dot( normalize( vNormal ), uDirLightPos ), 0.0);\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(uAmbientLightColor + uDirLightColor * light) < 1.00 ) {\",\n\n\t\t\t\t\"gl_FragColor *= vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(uAmbientLightColor + uDirLightColor * camera) < 0.50 ) {\",\n\n\t\t\t\t\"gl_FragColor *= vec4( uLineColor2, 1.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'hatching' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\": { type: \"c\", value: new THREE.Color( 0xffffff ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor2\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor3\": { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\"uLineColor4\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(lightWeighting) < 1.00 ) {\",\n\n\t\t\t\t\"if ( mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.75 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor2, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.50 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor3, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.3465 ) {\",\n\n\t\t\t\t\"if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor4, 1.0 );\",\n\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n},\n\n'dotted' : {\n\n\tuniforms: {\n\n\t\t\"uDirLightPos\":\t{ type: \"v3\", value: new THREE.Vector3() },\n\t\t\"uDirLightColor\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\n\t\t\"uAmbientLightColor\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\n\t\t\"uBaseColor\": { type: \"c\", value: new THREE.Color( 0xffffff ) },\n\t\t\"uLineColor1\": { type: \"c\", value: new THREE.Color( 0x000000 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 uBaseColor;\",\n\t\t\"uniform vec3 uLineColor1;\",\n\t\t\"uniform vec3 uLineColor2;\",\n\t\t\"uniform vec3 uLineColor3;\",\n\t\t\"uniform vec3 uLineColor4;\",\n\n\t\t\"uniform vec3 uDirLightPos;\",\n\t\t\"uniform vec3 uDirLightColor;\",\n\n\t\t\"uniform vec3 uAmbientLightColor;\",\n\n\t\t\"varying vec3 vNormal;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float directionalLightWeighting = max( dot( normalize(vNormal), uDirLightPos ), 0.0);\",\n\t\t\t\"vec3 lightWeighting = uAmbientLightColor + uDirLightColor * directionalLightWeighting;\",\n\n\t\t\t\"gl_FragColor = vec4( uBaseColor, 1.0 );\",\n\n\t\t\t\"if ( length(lightWeighting) < 1.00 ) {\",\n\n\t\t\t\t\"if ( ( mod(gl_FragCoord.x, 4.001) + mod(gl_FragCoord.y, 4.0) ) > 6.00 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\t\"if ( length(lightWeighting) < 0.50 ) {\",\n\n\t\t\t\t\"if ( ( mod(gl_FragCoord.x + 2.0, 4.001) + mod(gl_FragCoord.y + 2.0, 4.0) ) > 6.00 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( uLineColor1, 1.0 );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/MarchingCubes.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/MarchingCubes.js",
"module-type": "library",
"text": "/**\r\n * @author alteredq / http://alteredqualia.com/\r\n *\r\n * Port of greggman's ThreeD version of marching cubes to Three.js\r\n * http://webglsamples.googlecode.com/hg/blob/blob.html\r\n */\r\n\r\nTHREE.MarchingCubes = function ( resolution, material, enableUvs, enableColors ) {\r\n\r\n\tTHREE.ImmediateRenderObject.call( this );\r\n\r\n\tthis.material = material;\r\n\r\n\tthis.enableUvs = enableUvs !== undefined ? enableUvs : false;\r\n\tthis.enableColors = enableColors !== undefined ? enableColors : false;\r\n\r\n\t// functions have to be object properties\r\n\t// prototype functions kill performance\r\n\t// (tested and it was 4x slower !!!)\r\n\r\n\tthis.init = function( resolution ) {\r\n\r\n\t\tthis.resolution = resolution;\r\n\r\n\t\t// parameters\r\n\r\n\t\tthis.isolation = 80.0;\r\n\r\n\t\t// size of field, 32 is pushing it in Javascript :)\r\n\r\n\t\tthis.size = resolution;\r\n\t\tthis.size2 = this.size * this.size;\r\n\t\tthis.size3 = this.size2 * this.size;\r\n\t\tthis.halfsize = this.size / 2.0;\r\n\r\n\t\t// deltas\r\n\r\n\t\tthis.delta = 2.0 / this.size;\r\n\t\tthis.yd = this.size;\r\n\t\tthis.zd = this.size2;\r\n\r\n\t\tthis.field = new Float32Array( this.size3 );\r\n\t\tthis.normal_cache = new Float32Array( this.size3 * 3 );\r\n\r\n\t\t// temp buffers used in polygonize\r\n\r\n\t\tthis.vlist = new Float32Array( 12 * 3 );\r\n\t\tthis.nlist = new Float32Array( 12 * 3 );\r\n\r\n\t\tthis.firstDraw = true;\r\n\r\n\t\t// immediate render mode simulator\r\n\r\n\t\tthis.maxCount = 4096; // TODO: find the fastest size for this buffer\r\n\t\tthis.count = 0;\r\n\r\n\t\tthis.hasPositions = false;\r\n\t\tthis.hasNormals = false;\r\n\t\tthis.hasColors = false;\r\n\t\tthis.hasUvs = false;\r\n\r\n\t\tthis.positionArray = new Float32Array( this.maxCount * 3 );\r\n\t\tthis.normalArray = new Float32Array( this.maxCount * 3 );\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tthis.uvArray = new Float32Array( this.maxCount * 2 );\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.colorArray = new Float32Array( this.maxCount * 3 );\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t///////////////////////\r\n\t// Polygonization\r\n\t///////////////////////\r\n\r\n\tthis.lerp = function( a, b, t ) { return a + ( b - a ) * t; };\r\n\r\n\tthis.VIntX = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t = x + mu * this.delta;\r\n\t\tpout[ offset + 1 ] = y;\r\n\t\tpout[ offset + 2 ] = z;\r\n\r\n\t\tnout[ offset ] \t = this.lerp( nc[ q ], nc[ q + 3 ], mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q + 4 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q + 5 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.VIntY = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t = x;\r\n\t\tpout[ offset + 1 ] = y + mu * this.delta;\r\n\t\tpout[ offset + 2 ] = z;\r\n\r\n\t\tvar q2 = q + this.yd * 3;\r\n\r\n\t\tnout[ offset ] \t = this.lerp( nc[ q ], nc[ q2 ], mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.VIntZ = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) {\r\n\r\n\t\tvar mu = ( isol - valp1 ) / ( valp2 - valp1 ),\r\n\t\tnc = this.normal_cache;\r\n\r\n\t\tpout[ offset ] \t = x;\r\n\t\tpout[ offset + 1 ] = y;\r\n\t\tpout[ offset + 2 ] = z + mu * this.delta;\r\n\r\n\t\tvar q2 = q + this.zd * 3;\r\n\r\n\t\tnout[ offset ] \t = this.lerp( nc[ q ], nc[ q2 ], mu );\r\n\t\tnout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu );\r\n\t\tnout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu );\r\n\r\n\t};\r\n\r\n\tthis.compNorm = function( q ) {\r\n\r\n\t\tvar q3 = q * 3;\r\n\r\n\t\tif ( this.normal_cache[ q3 ] === 0.0 ) {\r\n\r\n\t\t\tthis.normal_cache[ q3 ] = this.field[ q - 1 ] \t - this.field[ q + 1 ];\r\n\t\t\tthis.normal_cache[ q3 + 1 ] = this.field[ q - this.yd ] - this.field[ q + this.yd ];\r\n\t\t\tthis.normal_cache[ q3 + 2 ] = this.field[ q - this.zd ] - this.field[ q + this.zd ];\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t// Returns total number of triangles. Fills triangles.\r\n\t// (this is where most of time is spent - it's inner work of O(n3) loop )\r\n\r\n\tthis.polygonize = function( fx, fy, fz, q, isol, renderCallback ) {\r\n\r\n\t\t// cache indices\r\n\t\tvar q1 = q + 1,\r\n\t\t\tqy = q + this.yd,\r\n\t\t\tqz = q + this.zd,\r\n\t\t\tq1y = q1 + this.yd,\r\n\t\t\tq1z = q1 + this.zd,\r\n\t\t\tqyz = q + this.yd + this.zd,\r\n\t\t\tq1yz = q1 + this.yd + this.zd;\r\n\r\n\t\tvar cubeindex = 0,\r\n\t\t\tfield0 = this.field[ q ],\r\n\t\t\tfield1 = this.field[ q1 ],\r\n\t\t\tfield2 = this.field[ qy ],\r\n\t\t\tfield3 = this.field[ q1y ],\r\n\t\t\tfield4 = this.field[ qz ],\r\n\t\t\tfield5 = this.field[ q1z ],\r\n\t\t\tfield6 = this.field[ qyz ],\r\n\t\t\tfield7 = this.field[ q1yz ];\r\n\r\n\t\tif ( field0 < isol ) cubeindex |= 1;\r\n\t\tif ( field1 < isol ) cubeindex |= 2;\r\n\t\tif ( field2 < isol ) cubeindex |= 8;\r\n\t\tif ( field3 < isol ) cubeindex |= 4;\r\n\t\tif ( field4 < isol ) cubeindex |= 16;\r\n\t\tif ( field5 < isol ) cubeindex |= 32;\r\n\t\tif ( field6 < isol ) cubeindex |= 128;\r\n\t\tif ( field7 < isol ) cubeindex |= 64;\r\n\r\n\t\t// if cube is entirely in/out of the surface - bail, nothing to draw\r\n\r\n\t\tvar bits = THREE.edgeTable[ cubeindex ];\r\n\t\tif ( bits === 0 ) return 0;\r\n\r\n\t\tvar d = this.delta,\r\n\t\t\tfx2 = fx + d,\r\n\t\t\tfy2 = fy + d,\r\n\t\t\tfz2 = fz + d;\r\n\r\n\t\t// top of the cube\r\n\r\n\t\tif ( bits & 1 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.VIntX( q * 3, this.vlist, this.nlist, 0, isol, fx, fy, fz, field0, field1 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 2 ) {\r\n\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.VIntY( q1 * 3, this.vlist, this.nlist, 3, isol, fx2, fy, fz, field1, field3 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 4 ) {\r\n\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.VIntX( qy * 3, this.vlist, this.nlist, 6, isol, fx, fy2, fz, field2, field3 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 8 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.VIntY( q * 3, this.vlist, this.nlist, 9, isol, fx, fy, fz, field0, field2 );\r\n\r\n\t\t};\r\n\r\n\t\t// bottom of the cube\r\n\r\n\t\tif ( bits & 16 ) {\r\n\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.VIntX( qz * 3, this.vlist, this.nlist, 12, isol, fx, fy, fz2, field4, field5 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 32 ) {\r\n\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntY( q1z * 3, this.vlist, this.nlist, 15, isol, fx2, fy, fz2, field5, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 64 ) {\r\n\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntX( qyz * 3, this.vlist, this.nlist, 18, isol, fx, fy2, fz2, field6, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 128 ) {\r\n\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.VIntY( qz * 3, this.vlist, this.nlist, 21, isol, fx, fy, fz2, field4, field6 );\r\n\r\n\t\t};\r\n\r\n\t\t// vertical lines of the cube\r\n\r\n\t\tif ( bits & 256 ) {\r\n\r\n\t\t\tthis.compNorm( q );\r\n\t\t\tthis.compNorm( qz );\r\n\t\t\tthis.VIntZ( q * 3, this.vlist, this.nlist, 24, isol, fx, fy, fz, field0, field4 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 512 ) {\r\n\r\n\t\t\tthis.compNorm( q1 );\r\n\t\t\tthis.compNorm( q1z );\r\n\t\t\tthis.VIntZ( q1 * 3, this.vlist, this.nlist, 27, isol, fx2, fy, fz, field1, field5 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 1024 ) {\r\n\r\n\t\t\tthis.compNorm( q1y );\r\n\t\t\tthis.compNorm( q1yz );\r\n\t\t\tthis.VIntZ( q1y * 3, this.vlist, this.nlist, 30, isol, fx2, fy2, fz, field3, field7 );\r\n\r\n\t\t};\r\n\r\n\t\tif ( bits & 2048 ) {\r\n\r\n\t\t\tthis.compNorm( qy );\r\n\t\t\tthis.compNorm( qyz );\r\n\t\t\tthis.VIntZ( qy * 3, this.vlist, this.nlist, 33, isol, fx, fy2, fz, field2, field6 );\r\n\r\n\t\t};\r\n\r\n\t\tcubeindex <<= 4; // re-purpose cubeindex into an offset into triTable\r\n\r\n\t\tvar o1, o2, o3, numtris = 0, i = 0;\r\n\r\n\t\t// here is where triangles are created\r\n\r\n\t\twhile ( THREE.triTable[ cubeindex + i ] != -1 ) {\r\n\r\n\t\t\to1 = cubeindex + i;\r\n\t\t\to2 = o1 + 1;\r\n\t\t\to3 = o1 + 2;\r\n\r\n\t\t\tthis.posnormtriv( this.vlist, this.nlist,\r\n\t\t\t\t\t\t\t 3 * THREE.triTable[ o1 ],\r\n\t\t\t\t\t\t\t 3 * THREE.triTable[ o2 ],\r\n\t\t\t\t\t\t\t 3 * THREE.triTable[ o3 ],\r\n\t\t\t\t\t\t\t renderCallback );\r\n\r\n\t\t\ti += 3;\r\n\t\t\tnumtris ++;\r\n\r\n\t\t}\r\n\r\n\t\treturn numtris;\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Immediate render mode simulator\r\n\t/////////////////////////////////////\r\n\r\n\tthis.posnormtriv = function( pos, norm, o1, o2, o3, renderCallback ) {\r\n\r\n\t\tvar c = this.count * 3;\r\n\r\n\t\t// positions\r\n\r\n\t\tthis.positionArray[ c ] \t= pos[ o1 ];\r\n\t\tthis.positionArray[ c + 1 ] = pos[ o1 + 1 ];\r\n\t\tthis.positionArray[ c + 2 ] = pos[ o1 + 2 ];\r\n\r\n\t\tthis.positionArray[ c + 3 ] = pos[ o2 ];\r\n\t\tthis.positionArray[ c + 4 ] = pos[ o2 + 1 ];\r\n\t\tthis.positionArray[ c + 5 ] = pos[ o2 + 2 ];\r\n\r\n\t\tthis.positionArray[ c + 6 ] = pos[ o3 ];\r\n\t\tthis.positionArray[ c + 7 ] = pos[ o3 + 1 ];\r\n\t\tthis.positionArray[ c + 8 ] = pos[ o3 + 2 ];\r\n\r\n\t\t// normals\r\n\r\n\t\tthis.normalArray[ c ] \t = norm[ o1 ];\r\n\t\tthis.normalArray[ c + 1 ] = norm[ o1 + 1 ];\r\n\t\tthis.normalArray[ c + 2 ] = norm[ o1 + 2 ];\r\n\r\n\t\tthis.normalArray[ c + 3 ] = norm[ o2 ];\r\n\t\tthis.normalArray[ c + 4 ] = norm[ o2 + 1 ];\r\n\t\tthis.normalArray[ c + 5 ] = norm[ o2 + 2 ];\r\n\r\n\t\tthis.normalArray[ c + 6 ] = norm[ o3 ];\r\n\t\tthis.normalArray[ c + 7 ] = norm[ o3 + 1 ];\r\n\t\tthis.normalArray[ c + 8 ] = norm[ o3 + 2 ];\r\n\r\n\t\t// uvs\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tvar d = this.count * 2;\r\n\r\n\t\t\tthis.uvArray[ d ] \t = pos[ o1 ];\r\n\t\t\tthis.uvArray[ d + 1 ] = pos[ o1 + 2 ];\r\n\r\n\t\t\tthis.uvArray[ d + 2 ] = pos[ o2 ];\r\n\t\t\tthis.uvArray[ d + 3 ] = pos[ o2 + 2 ];\r\n\r\n\t\t\tthis.uvArray[ d + 4 ] = pos[ o3 ];\r\n\t\t\tthis.uvArray[ d + 5 ] = pos[ o3 + 2 ];\r\n\r\n\t\t}\r\n\r\n\t\t// colors\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.colorArray[ c ] \t = pos[ o1 ];\r\n\t\t\tthis.colorArray[ c + 1 ] = pos[ o1 + 1 ];\r\n\t\t\tthis.colorArray[ c + 2 ] = pos[ o1 + 2 ];\r\n\r\n\t\t\tthis.colorArray[ c + 3 ] = pos[ o2 ];\r\n\t\t\tthis.colorArray[ c + 4 ] = pos[ o2 + 1 ];\r\n\t\t\tthis.colorArray[ c + 5 ] = pos[ o2 + 2 ];\r\n\r\n\t\t\tthis.colorArray[ c + 6 ] = pos[ o3 ];\r\n\t\t\tthis.colorArray[ c + 7 ] = pos[ o3 + 1 ];\r\n\t\t\tthis.colorArray[ c + 8 ] = pos[ o3 + 2 ];\r\n\r\n\t\t}\r\n\r\n\t\tthis.count += 3;\r\n\r\n\t\tif ( this.count >= this.maxCount - 3 ) {\r\n\r\n\t\t\tthis.hasPositions = true;\r\n\t\t\tthis.hasNormals = true;\r\n\r\n\t\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\t\tthis.hasUvs = true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( this.enableColors ) {\r\n\r\n\t\t\t\tthis.hasColors = true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\trenderCallback( this );\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.begin = function( ) {\r\n\r\n\t\tthis.count = 0;\r\n\r\n\t\tthis.hasPositions = false;\r\n\t\tthis.hasNormals = false;\r\n\t\tthis.hasUvs = false;\r\n\t\tthis.hasColors = false;\r\n\r\n\t};\r\n\r\n\tthis.end = function( renderCallback ) {\r\n\r\n\t\tif ( this.count === 0 )\r\n\t\t\treturn;\r\n\r\n\t\tfor ( var i = this.count * 3; i < this.positionArray.length; i ++ )\r\n\t\t\tthis.positionArray[ i ] = 0.0;\r\n\r\n\t\tthis.hasPositions = true;\r\n\t\tthis.hasNormals = true;\r\n\r\n\t\tif ( this.enableUvs ) {\r\n\r\n\t\t\tthis.hasUvs = true;\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.enableColors ) {\r\n\r\n\t\t\tthis.hasColors = true;\r\n\r\n\t\t}\r\n\r\n\t\trenderCallback( this );\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Metaballs\r\n\t/////////////////////////////////////\r\n\r\n\t// Adds a reciprocal ball (nice and blobby) that, to be fast, fades to zero after\r\n\t// a fixed distance, determined by strength and subtract.\r\n\r\n\tthis.addBall = function( ballx, bally, ballz, strength, subtract ) {\r\n\r\n\t\t// Let's solve the equation to find the radius:\r\n\t\t// 1.0 / (0.000001 + radius^2) * strength - subtract = 0\r\n\t\t// strength / (radius^2) = subtract\r\n\t\t// strength = subtract * radius^2\r\n\t\t// radius^2 = strength / subtract\r\n\t\t// radius = sqrt(strength / subtract)\r\n\r\n\t\tvar radius = this.size * Math.sqrt( strength / subtract ),\r\n\t\t\tzs = ballz * this.size,\r\n\t\t\tys = bally * this.size,\r\n\t\t\txs = ballx * this.size;\r\n\r\n\t\tvar min_z = Math.floor( zs - radius ); if ( min_z < 1 ) min_z = 1;\r\n\t\tvar max_z = Math.floor( zs + radius ); if ( max_z > this.size - 1 ) max_z = this.size - 1;\r\n\t\tvar min_y = Math.floor( ys - radius ); if ( min_y < 1 ) min_y = 1;\r\n\t\tvar max_y = Math.floor( ys + radius ); if ( max_y > this.size - 1 ) max_y = this.size - 1;\r\n\t\tvar min_x = Math.floor( xs - radius ); if ( min_x < 1 ) min_x = 1;\r\n\t\tvar max_x = Math.floor( xs + radius ); if ( max_x > this.size - 1 ) max_x = this.size - 1;\r\n\r\n\r\n\t\t// Don't polygonize in the outer layer because normals aren't\r\n\t\t// well-defined there.\r\n\r\n\t\tvar x, y, z, y_offset, z_offset, fx, fy, fz, fz2, fy2, val;\r\n\r\n\t\tfor ( z = min_z; z < max_z; z++ ) {\r\n\r\n\t\t\tz_offset = this.size2 * z,\r\n\t\t\tfz = z / this.size - ballz,\r\n\t\t\tfz2 = fz * fz;\r\n\r\n\t\t\tfor ( y = min_y; y < max_y; y++ ) {\r\n\r\n\t\t\t\ty_offset = z_offset + this.size * y;\r\n\t\t\t\tfy = y / this.size - bally;\r\n\t\t\t\tfy2 = fy * fy;\r\n\r\n\t\t\t\tfor ( x = min_x; x < max_x; x++ ) {\r\n\r\n\t\t\t\t\tfx = x / this.size - ballx;\r\n\t\t\t\t\tval = strength / ( 0.000001 + fx*fx + fy2 + fz2 ) - subtract;\r\n\t\t\t\t\tif ( val > 0.0 ) this.field[ y_offset + x ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneX = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, xx, val, xdiv, cxy,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( x = 0; x < dist; x ++ ) {\r\n\r\n\t\t\txdiv = x / size;\r\n\t\t\txx = xdiv * xdiv;\r\n\t\t\tval = strength / ( 0.0001 + xx ) - subtract;\r\n\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tfor ( y = 0; y < size; y ++ ) {\r\n\r\n\t\t\t\t\tcxy = x + y * yd;\r\n\r\n\t\t\t\t\tfor ( z = 0; z < size; z ++ ) {\r\n\r\n\t\t\t\t\t\tfield[ zd * z + cxy ] += val;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneY = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, yy, val, ydiv, cy, cxy,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( y = 0; y < dist; y ++ ) {\r\n\r\n\t\t\tydiv = y / size;\r\n\t\t\tyy = ydiv * ydiv;\r\n\t\t\tval = strength / ( 0.0001 + yy ) - subtract;\r\n\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tcy = y * yd;\r\n\r\n\t\t\t\tfor ( x = 0; x < size; x ++ ) {\r\n\r\n\t\t\t\t\tcxy = cy + x;\r\n\r\n\t\t\t\t\tfor ( z = 0; z < size; z ++ )\r\n\t\t\t\t\t\tfield[ zd * z + cxy ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.addPlaneZ = function( strength, subtract ) {\r\n\r\n\t\tvar x, y, z, zz, val, zdiv, cz, cyz,\r\n\r\n\t\t\t// cache attribute lookups\r\n\t\t\tsize = this.size,\r\n\t\t\tyd = this.yd,\r\n\t\t\tzd = this.zd,\r\n\t\t\tfield = this.field,\r\n\r\n\t\t\tdist = size * Math.sqrt( strength / subtract );\r\n\r\n\t\tif ( dist > size ) dist = size;\r\n\r\n\t\tfor ( z = 0; z < dist; z ++ ) {\r\n\r\n\t\t\tzdiv = z / size;\r\n\t\t\tzz = zdiv * zdiv;\r\n\t\t\tval = strength / ( 0.0001 + zz ) - subtract;\r\n\t\t\tif ( val > 0.0 ) {\r\n\r\n\t\t\t\tcz = zd * z;\r\n\r\n\t\t\t\tfor ( y = 0; y < size; y ++ ) {\r\n\r\n\t\t\t\t\tcyz = cz + y * yd;\r\n\r\n\t\t\t\t\tfor ( x = 0; x < size; x ++ )\r\n\t\t\t\t\t\tfield[ cyz + x ] += val;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t/////////////////////////////////////\r\n\t// Updates\r\n\t/////////////////////////////////////\r\n\r\n\tthis.reset = function() {\r\n\r\n\t\tvar i;\r\n\r\n\t\t// wipe the normal cache\r\n\r\n\t\tfor ( i = 0; i < this.size3; i ++ ) {\r\n\r\n\t\t\tthis.normal_cache[ i * 3 ] = 0.0;\r\n\t\t\tthis.field[ i ] = 0.0;\r\n\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tthis.render = function( renderCallback ) {\r\n\r\n\t\tthis.begin();\r\n\r\n\t\t// Triangulate. Yeah, this is slow.\r\n\r\n\t\tvar q, x, y, z, fx, fy, fz, y_offset, z_offset, smin2 = this.size - 2;\r\n\r\n\t\tfor ( z = 1; z < smin2; z ++ ) {\r\n\r\n\t\t\tz_offset = this.size2 * z;\r\n\t\t\tfz = ( z - this.halfsize ) / this.halfsize; //+ 1\r\n\r\n\t\t\tfor ( y = 1; y < smin2; y ++ ) {\r\n\r\n\t\t\t\ty_offset = z_offset + this.size * y;\r\n\t\t\t\tfy = ( y - this.halfsize ) / this.halfsize; //+ 1\r\n\r\n\t\t\t\tfor ( x = 1; x < smin2; x ++ ) {\r\n\r\n\t\t\t\t\tfx = ( x - this.halfsize ) / this.halfsize; //+ 1\r\n\t\t\t\t\tq = y_offset + x;\r\n\r\n\t\t\t\t\tthis.polygonize( fx, fy, fz, q, this.isolation, renderCallback );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tthis.end( renderCallback );\r\n\r\n\t};\r\n\r\n\tthis.generateGeometry = function() {\r\n\r\n\t\tvar start = 0, geo = new THREE.Geometry();\r\n\t\tvar normals = [];\r\n\r\n\t\tvar geo_callback = function( object ) {\r\n\r\n\t\t\tvar i, x, y, z, vertex, normal,\r\n\t\t\t\tface, a, b, c, na, nb, nc, nfaces;\r\n\r\n\r\n\t\t\tfor ( i = 0; i < object.count; i ++ ) {\r\n\r\n\t\t\t\ta = i * 3;\r\n\t\t\t\tb = a + 1;\r\n\t\t\t\tc = a + 2;\r\n\r\n\t\t\t\tx = object.positionArray[ a ];\r\n\t\t\t\ty = object.positionArray[ b ];\r\n\t\t\t\tz = object.positionArray[ c ];\r\n\t\t\t\tvertex = new THREE.Vector3( x, y, z );\r\n\r\n\t\t\t\tx = object.normalArray[ a ];\r\n\t\t\t\ty = object.normalArray[ b ];\r\n\t\t\t\tz = object.normalArray[ c ];\r\n\t\t\t\tnormal = new THREE.Vector3( x, y, z );\r\n\t\t\t\tnormal.normalize();\r\n\r\n\t\t\t\tgeo.vertices.push( vertex );\r\n\t\t\t\tnormals.push( normal );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tnfaces = object.count / 3;\r\n\r\n\t\t\tfor ( i = 0; i < nfaces; i ++ ) {\r\n\r\n\t\t\t\ta = ( start + i ) * 3;\r\n\t\t\t\tb = a + 1;\r\n\t\t\t\tc = a + 2;\r\n\r\n\t\t\t\tna = normals[ a ];\r\n\t\t\t\tnb = normals[ b ];\r\n\t\t\t\tnc = normals[ c ];\r\n\r\n\t\t\t\tface = new THREE.Face3( a, b, c, [ na, nb, nc ] );\r\n\r\n\t\t\t\tgeo.faces.push( face );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tstart += nfaces;\r\n\t\t\tobject.count = 0;\r\n\r\n\t\t};\r\n\r\n\t\tthis.render( geo_callback );\r\n\r\n\t\t// console.log( \"generated \" + geo.faces.length + \" triangles\" );\r\n\r\n\t\treturn geo;\r\n\r\n\t};\r\n\r\n\tthis.init( resolution );\r\n\r\n};\r\n\r\nTHREE.MarchingCubes.prototype = Object.create( THREE.ImmediateRenderObject.prototype );\r\n\r\n\r\n/////////////////////////////////////\r\n// Marching cubes lookup tables\r\n/////////////////////////////////////\r\n\r\n// These tables are straight from Paul Bourke's page:\r\n// http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/\r\n// who in turn got them from Cory Gene Bloyd.\r\n\r\nTHREE.edgeTable = new Int32Array([\r\n0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,\r\n0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,\r\n0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,\r\n0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,\r\n0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,\r\n0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,\r\n0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,\r\n0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,\r\n0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,\r\n0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,\r\n0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,\r\n0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,\r\n0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,\r\n0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,\r\n0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,\r\n0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,\r\n0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,\r\n0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,\r\n0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,\r\n0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,\r\n0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,\r\n0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,\r\n0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,\r\n0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,\r\n0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,\r\n0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,\r\n0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,\r\n0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,\r\n0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,\r\n0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,\r\n0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,\r\n0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0])\r\n\r\nTHREE.triTable = new Int32Array([\r\n-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1,\r\n3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1,\r\n3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1,\r\n3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1,\r\n9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1,\r\n2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1,\r\n8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1,\r\n4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1,\r\n3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1,\r\n1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1,\r\n4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1,\r\n4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1,\r\n5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1,\r\n2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1,\r\n9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1,\r\n0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1,\r\n2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1,\r\n10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1,\r\n5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1,\r\n5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1,\r\n9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1,\r\n1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1,\r\n10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1,\r\n8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1,\r\n2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1,\r\n7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1,\r\n2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1,\r\n11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1,\r\n5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1,\r\n11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1,\r\n11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1,\r\n9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1,\r\n2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1,\r\n6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1,\r\n3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1,\r\n6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1,\r\n10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1,\r\n6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1,\r\n8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1,\r\n7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1,\r\n3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1,\r\n5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1,\r\n0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1,\r\n9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1,\r\n8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1,\r\n5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1,\r\n0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1,\r\n6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1,\r\n10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1,\r\n10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1,\r\n8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1,\r\n1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1,\r\n0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1,\r\n10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1,\r\n3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1,\r\n6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1,\r\n9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1,\r\n8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1,\r\n3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1,\r\n6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1,\r\n0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1,\r\n10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1,\r\n10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1,\r\n2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1,\r\n7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1,\r\n7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1,\r\n2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1,\r\n1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1,\r\n11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1,\r\n8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1,\r\n0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1,\r\n7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1,\r\n10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1,\r\n2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1,\r\n6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1,\r\n7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1,\r\n2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1,\r\n1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1,\r\n10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1,\r\n10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1,\r\n0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1,\r\n7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1,\r\n6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1,\r\n8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1,\r\n6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1,\r\n4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1,\r\n10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1,\r\n8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1,\r\n0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1,\r\n1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1,\r\n8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1,\r\n10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1,\r\n4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1,\r\n10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1,\r\n5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1,\r\n11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1,\r\n9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1,\r\n6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1,\r\n7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1,\r\n3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1,\r\n7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1,\r\n3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1,\r\n6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1,\r\n9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1,\r\n1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1,\r\n4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1,\r\n7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1,\r\n6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1,\r\n3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1,\r\n0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1,\r\n6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1,\r\n0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1,\r\n11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1,\r\n6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1,\r\n5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1,\r\n9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1,\r\n1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1,\r\n1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1,\r\n10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1,\r\n0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1,\r\n5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1,\r\n10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1,\r\n11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1,\r\n9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1,\r\n7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1,\r\n2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1,\r\n8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1,\r\n9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1,\r\n9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1,\r\n1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1,\r\n9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1,\r\n9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1,\r\n5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1,\r\n0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1,\r\n10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1,\r\n2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1,\r\n0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1,\r\n0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1,\r\n9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1,\r\n5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1,\r\n3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1,\r\n5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1,\r\n8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1,\r\n9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1,\r\n0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1,\r\n1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1,\r\n3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1,\r\n4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1,\r\n9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1,\r\n11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1,\r\n11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1,\r\n2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1,\r\n9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1,\r\n3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1,\r\n1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1,\r\n4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1,\r\n4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1,\r\n0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1,\r\n3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1,\r\n3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1,\r\n0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1,\r\n9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1,\r\n1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\r\n-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]);\r\n"
},
"$:/plugins/rboue/Three.js/Lib/Car.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Car.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.Car = function () {\n\n\tvar scope = this;\n\n\t// car geometry manual parameters\n\n\tthis.modelScale = 1;\n\n\tthis.backWheelOffset = 2;\n\n\tthis.autoWheelGeometry = true;\n\n\t// car geometry parameters automatically set from wheel mesh\n\t// \t- assumes wheel mesh is front left wheel in proper global\n\t// position with respect to body mesh\n\t//\t- other wheels are mirrored against car root\n\t//\t- if necessary back wheels can be offset manually\n\n\tthis.wheelOffset = new THREE.Vector3();\n\n\tthis.wheelDiameter = 1;\n\n\t// car \"feel\" parameters\n\n\tthis.MAX_SPEED = 2200;\n\tthis.MAX_REVERSE_SPEED = -1500;\n\n\tthis.MAX_WHEEL_ROTATION = 0.6;\n\n\tthis.FRONT_ACCELERATION = 1250;\n\tthis.BACK_ACCELERATION = 1500;\n\n\tthis.WHEEL_ANGULAR_ACCELERATION = 1.5;\n\n\tthis.FRONT_DECCELERATION = 750;\n\tthis.WHEEL_ANGULAR_DECCELERATION = 1.0;\n\n\tthis.STEERING_RADIUS_RATIO = 0.0023;\n\n\tthis.MAX_TILT_SIDES = 0.05;\n\tthis.MAX_TILT_FRONTBACK = 0.015;\n\n\t// internal control variables\n\n\tthis.speed = 0;\n\tthis.acceleration = 0;\n\n\tthis.wheelOrientation = 0;\n\tthis.carOrientation = 0;\n\n\t// car rigging\n\n\tthis.root = new THREE.Object3D();\n\n\tthis.frontLeftWheelRoot = new THREE.Object3D();\n\tthis.frontRightWheelRoot = new THREE.Object3D();\n\n\tthis.bodyMesh = null;\n\n\tthis.frontLeftWheelMesh = null;\n\tthis.frontRightWheelMesh = null;\n\n\tthis.backLeftWheelMesh = null;\n\tthis.backRightWheelMesh = null;\n\n\tthis.bodyGeometry = null;\n\tthis.wheelGeometry = null;\n\n\tthis.bodyMaterials = null;\n\tthis.wheelMaterials = null;\n\n\t// internal helper variables\n\n\tthis.loaded = false;\n\n\tthis.meshes = [];\n\n\t// API\n\n\tthis.enableShadows = function ( enable ) {\n\n\t\tfor ( var i = 0; i < this.meshes.length; i ++ ) {\n\n\t\t\tthis.meshes[ i ].castShadow = enable;\n\t\t\tthis.meshes[ i ].receiveShadow = enable;\n\n\t\t}\n\n\t};\n\n\tthis.setVisible = function ( enable ) {\n\n\t\tfor ( var i = 0; i < this.meshes.length; i ++ ) {\n\n\t\t\tthis.meshes[ i ].visible = enable;\n\t\t\tthis.meshes[ i ].visible = enable;\n\n\t\t}\n\n\t};\n\n\tthis.loadPartsJSON = function ( bodyURL, wheelURL ) {\n\n\t\tvar loader = new THREE.JSONLoader();\n\n\t\tloader.load( bodyURL, function( geometry, materials ) { createBody( geometry, materials ) } );\n\t\tloader.load( wheelURL, function( geometry, materials ) { createWheels( geometry, materials ) } );\n\n\t};\n\n\tthis.loadPartsBinary = function ( bodyURL, wheelURL ) {\n\n\t\tvar loader = new THREE.BinaryLoader();\n\n\t\tloader.load( bodyURL, function( geometry, materials ) { createBody( geometry, materials ) } );\n\t\tloader.load( wheelURL, function( geometry, materials ) { createWheels( geometry, materials ) } );\n\n\t};\n\n\tthis.updateCarModel = function ( delta, controls ) {\n\n\t\t// speed and wheels based on controls\n\n\t\tif ( controls.moveForward ) {\n\n\t\t\tthis.speed = THREE.Math.clamp( this.speed + delta * this.FRONT_ACCELERATION, this.MAX_REVERSE_SPEED, this.MAX_SPEED );\n\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration + delta, -1, 1 );\n\n\t\t}\n\n\t\tif ( controls.moveBackward ) {\n\n\n\t\t\tthis.speed = THREE.Math.clamp( this.speed - delta * this.BACK_ACCELERATION, this.MAX_REVERSE_SPEED, this.MAX_SPEED );\n\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration - delta, -1, 1 );\n\n\t\t}\n\n\t\tif ( controls.moveLeft ) {\n\n\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_ACCELERATION, - this.MAX_WHEEL_ROTATION, this.MAX_WHEEL_ROTATION );\n\n\t\t}\n\n\t\tif ( controls.moveRight ) {\n\n\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_ACCELERATION, - this.MAX_WHEEL_ROTATION, this.MAX_WHEEL_ROTATION );\n\n\t\t}\n\n\t\t// speed decay\n\n\t\tif ( ! ( controls.moveForward || controls.moveBackward ) ) {\n\n\t\t\tif ( this.speed > 0 ) {\n\n\t\t\t\tvar k = exponentialEaseOut( this.speed / this.MAX_SPEED );\n\n\t\t\t\tthis.speed = THREE.Math.clamp( this.speed - k * delta * this.FRONT_DECCELERATION, 0, this.MAX_SPEED );\n\t\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration - k * delta, 0, 1 );\n\n\t\t\t} else {\n\n\t\t\t\tvar k = exponentialEaseOut( this.speed / this.MAX_REVERSE_SPEED );\n\n\t\t\t\tthis.speed = THREE.Math.clamp( this.speed + k * delta * this.BACK_ACCELERATION, this.MAX_REVERSE_SPEED, 0 );\n\t\t\t\tthis.acceleration = THREE.Math.clamp( this.acceleration + k * delta, -1, 0 );\n\n\t\t\t}\n\n\n\t\t}\n\n\t\t// steering decay\n\n\t\tif ( ! ( controls.moveLeft || controls.moveRight ) ) {\n\n\t\t\tif ( this.wheelOrientation > 0 ) {\n\n\t\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation - delta * this.WHEEL_ANGULAR_DECCELERATION, 0, this.MAX_WHEEL_ROTATION );\n\n\t\t\t} else {\n\n\t\t\t\tthis.wheelOrientation = THREE.Math.clamp( this.wheelOrientation + delta * this.WHEEL_ANGULAR_DECCELERATION, - this.MAX_WHEEL_ROTATION, 0 );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// car update\n\n\t\tvar forwardDelta = this.speed * delta;\n\n\t\tthis.carOrientation += ( forwardDelta * this.STEERING_RADIUS_RATIO )* this.wheelOrientation;\n\n\t\t// displacement\n\n\t\tthis.root.position.x += Math.sin( this.carOrientation ) * forwardDelta;\n\t\tthis.root.position.z += Math.cos( this.carOrientation ) * forwardDelta;\n\n\t\t// steering\n\n\t\tthis.root.rotation.y = this.carOrientation;\n\n\t\t// tilt\n\n\t\tif ( this.loaded ) {\n\n\t\t\tthis.bodyMesh.rotation.z = this.MAX_TILT_SIDES * this.wheelOrientation * ( this.speed / this.MAX_SPEED );\n\t\t\tthis.bodyMesh.rotation.x = - this.MAX_TILT_FRONTBACK * this.acceleration;\n\n\t\t}\n\n\t\t// wheels rolling\n\n\t\tvar angularSpeedRatio = 1 / ( this.modelScale * ( this.wheelDiameter / 2 ) );\n\n\t\tvar wheelDelta = forwardDelta * angularSpeedRatio;\n\n\t\tif ( this.loaded ) {\n\n\t\t\tthis.frontLeftWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.frontRightWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.backLeftWheelMesh.rotation.x += wheelDelta;\n\t\t\tthis.backRightWheelMesh.rotation.x += wheelDelta;\n\n\t\t}\n\n\t\t// front wheels steering\n\n\t\tthis.frontLeftWheelRoot.rotation.y = this.wheelOrientation;\n\t\tthis.frontRightWheelRoot.rotation.y = this.wheelOrientation;\n\n\t};\n\n\t// internal helper methods\n\n\tfunction createBody ( geometry, materials ) {\n\n\t\tscope.bodyGeometry = geometry;\n\t\tscope.bodyMaterials = materials;\n\n\t\tcreateCar();\n\n\t};\n\n\tfunction createWheels ( geometry, materials ) {\n\n\t\tscope.wheelGeometry = geometry;\n\t\tscope.wheelMaterials = materials;\n\n\t\tcreateCar();\n\n\t};\n\n\tfunction createCar () {\n\n\t\tif ( scope.bodyGeometry && scope.wheelGeometry ) {\n\n\t\t\t// compute wheel geometry parameters\n\n\t\t\tif ( scope.autoWheelGeometry ) {\n\n\t\t\t\tscope.wheelGeometry.computeBoundingBox();\n\n\t\t\t\tvar bb = scope.wheelGeometry.boundingBox;\n\n\t\t\t\tscope.wheelOffset.addVectors( bb.min, bb.max );\n\t\t\t\tscope.wheelOffset.multiplyScalar( 0.5 );\n\n\t\t\t\tscope.wheelDiameter = bb.max.y - bb.min.y;\n\n\t\t\t\tscope.wheelGeometry.center();\n\n\t\t\t}\n\n\t\t\t// rig the car\n\n\t\t\tvar s = scope.modelScale,\n\t\t\t\tdelta = new THREE.Vector3();\n\n\t\t\tvar bodyFaceMaterial = new THREE.MeshFaceMaterial( scope.bodyMaterials );\n\t\t\tvar wheelFaceMaterial = new THREE.MeshFaceMaterial( scope.wheelMaterials );\n\n\t\t\t// body\n\n\t\t\tscope.bodyMesh = new THREE.Mesh( scope.bodyGeometry, bodyFaceMaterial );\n\t\t\tscope.bodyMesh.scale.set( s, s, s );\n\n\t\t\tscope.root.add( scope.bodyMesh );\n\n\t\t\t// front left wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, s ) );\n\n\t\t\tscope.frontLeftWheelRoot.position.add( delta );\n\n\t\t\tscope.frontLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\t\t\tscope.frontLeftWheelMesh.scale.set( s, s, s );\n\n\t\t\tscope.frontLeftWheelRoot.add( scope.frontLeftWheelMesh );\n\t\t\tscope.root.add( scope.frontLeftWheelRoot );\n\n\t\t\t// front right wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, s ) );\n\n\t\t\tscope.frontRightWheelRoot.position.add( delta );\n\n\t\t\tscope.frontRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.frontRightWheelMesh.scale.set( s, s, s );\n\t\t\tscope.frontRightWheelMesh.rotation.z = Math.PI;\n\n\t\t\tscope.frontRightWheelRoot.add( scope.frontRightWheelMesh );\n\t\t\tscope.root.add( scope.frontRightWheelRoot );\n\n\t\t\t// back left wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, -s ) );\n\t\t\tdelta.z -= scope.backWheelOffset;\n\n\t\t\tscope.backLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.backLeftWheelMesh.position.add( delta );\n\t\t\tscope.backLeftWheelMesh.scale.set( s, s, s );\n\n\t\t\tscope.root.add( scope.backLeftWheelMesh );\n\n\t\t\t// back right wheel\n\n\t\t\tdelta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, -s ) );\n\t\t\tdelta.z -= scope.backWheelOffset;\n\n\t\t\tscope.backRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );\n\n\t\t\tscope.backRightWheelMesh.position.add( delta );\n\t\t\tscope.backRightWheelMesh.scale.set( s, s, s );\n\t\t\tscope.backRightWheelMesh.rotation.z = Math.PI;\n\n\t\t\tscope.root.add( scope.backRightWheelMesh );\n\n\t\t\t// cache meshes\n\n\t\t\tscope.meshes = [ scope.bodyMesh, scope.frontLeftWheelMesh, scope.frontRightWheelMesh, scope.backLeftWheelMesh, scope.backRightWheelMesh ];\n\n\t\t\t// callback\n\n\t\t\tscope.loaded = true;\n\n\t\t\tif ( scope.callback ) {\n\n\t\t\t\tscope.callback( scope );\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tfunction quadraticEaseOut( k ) { return - k * ( k - 2 ); }\n\tfunction cubicEaseOut( k ) { return --k * k * k + 1; }\n\tfunction circularEaseOut( k ) { return Math.sqrt( 1 - --k * k ); }\n\tfunction sinusoidalEaseOut( k ) { return Math.sin( k * Math.PI / 2 ); }\n\tfunction exponentialEaseOut( k ) { return k === 1 ? 1 : - Math.pow( 2, - 10 * k ) + 1; }\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/ShaderSkin.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ShaderSkin.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n */\n\n\nTHREE.ShaderSkin = {\n\n\t/* ------------------------------------------------------------------------------------------\n\t//\tSimple skin shader\n\t//\t\t- per-pixel Blinn-Phong diffuse term mixed with half-Lambert wrap-around term (per color component)\n\t//\t\t- physically based specular term (Kelemen/Szirmay-Kalos specular reflectance)\n\t//\n\t//\t\t- diffuse map\n\t//\t\t- bump map\n\t//\t\t- specular map\n\t//\t\t- point, directional and hemisphere lights (use with \"lights: true\" material option)\n\t//\t\t- fog (use with \"fog: true\" material option)\n\t//\t\t- shadow maps\n\t//\n\t// ------------------------------------------------------------------------------------------ */\n\n\t'skinSimple' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\n\t\t\t\"enableBump\"\t: { type: \"i\", value: 0 },\n\t\t\t\"enableSpecular\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse\"\t: { type: \"t\", value: null },\n\t\t\t\"tBeckmann\"\t: { type: \"t\", value: null },\n\n\t\t\t\"diffuse\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"opacity\": \t { type: \"f\", value: 1 },\n\n\t\t\t\"uRoughness\": \t \t\t{ type: \"f\", value: 0.15 },\n\t\t\t\"uSpecularBrightness\": \t{ type: \"f\", value: 0.75 },\n\n\t\t\t\"bumpMap\"\t: { type: \"t\", value: null },\n\t\t\t\"bumpScale\" : { type: \"f\", value: 1 },\n\n\t\t\t\"specularMap\" : { type: \"t\", value: null },\n\n\t\t\t\"offsetRepeat\" : { type: \"v4\", value: new THREE.Vector4( 0, 0, 1, 1 ) },\n\n\t\t\t\"uWrapRGB\":\t{ type: \"v3\", value: new THREE.Vector3( 0.75, 0.375, 0.1875 ) }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"#define USE_BUMPMAP\",\n\t\t\t\"#extension GL_OES_standard_derivatives : enable\",\n\n\t\t\t\"uniform bool enableBump;\",\n\t\t\t\"uniform bool enableSpecular;\",\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform float uRoughness;\",\n\t\t\t\"uniform float uSpecularBrightness;\",\n\n\t\t\t\"uniform vec3 uWrapRGB;\",\n\n\t\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\t\"uniform sampler2D tBeckmann;\",\n\n\t\t\t\"uniform sampler2D specularMap;\",\n\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"bumpmap_pars_fragment\" ],\n\n\t\t\t// Fresnel term\n\n\t\t\t\"float fresnelReflectance( vec3 H, vec3 V, float F0 ) {\",\n\n\t\t\t\t\"float base = 1.0 - dot( V, H );\",\n\t\t\t\t\"float exponential = pow( base, 5.0 );\",\n\n\t\t\t\t\"return exponential + F0 * ( 1.0 - exponential );\",\n\n\t\t\t\"}\",\n\n\t\t\t// Kelemen/Szirmay-Kalos specular BRDF\n\n\t\t\t\"float KS_Skin_Specular( vec3 N,\", \t\t// Bumped surface normal\n\t\t\t\t\t\t\t\t\t\"vec3 L,\", \t\t// Points to light\n\t\t\t\t\t\t\t\t\t\"vec3 V,\", \t\t// Points to eye\n\t\t\t\t\t\t\t\t\t\"float m,\", \t// Roughness\n\t\t\t\t\t\t\t\t\t\"float rho_s\", \t// Specular brightness\n\t\t\t\t\t\t\t\t\t\") {\",\n\n\t\t\t\t\"float result = 0.0;\",\n\t\t\t\t\"float ndotl = dot( N, L );\",\n\n\t\t\t\t\"if( ndotl > 0.0 ) {\",\n\n\t\t\t\t\t\"vec3 h = L + V;\", // Unnormalized half-way vector\n\t\t\t\t\t\"vec3 H = normalize( h );\",\n\n\t\t\t\t\t\"float ndoth = dot( N, H );\",\n\n\t\t\t\t\t\"float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );\",\n\n\t\t\t\t\t\"float F = fresnelReflectance( H, V, 0.028 );\",\n\t\t\t\t\t\"float frSpec = max( PH * F / dot( h, h ), 0.0 );\",\n\n\t\t\t\t\t\"result = ndotl * rho_s * frSpec;\", // BRDF * dot(N,L) * rho_s\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"return result;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( vec3( 1.0 ), opacity );\",\n\n\t\t\t\t\"vec4 colDiffuse = texture2D( tDiffuse, vUv );\",\n\t\t\t\t\"colDiffuse.rgb *= colDiffuse.rgb;\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * colDiffuse;\",\n\n\t\t\t\t\"vec3 normal = normalize( vNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t\"float specularStrength;\",\n\n\t\t\t\t\"if ( enableSpecular ) {\",\n\n\t\t\t\t\t\"vec4 texelSpecular = texture2D( specularMap, vUv );\",\n\t\t\t\t\t\"specularStrength = texelSpecular.r;\",\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"specularStrength = 1.0;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"if ( enableBump ) normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"vec3 specularTotal = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 pointTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz + vViewPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"float pointDiffuseWeightFull = max( dot( normal, lVector ), 0.0 );\",\n\t\t\t\t\t\t\"float pointDiffuseWeightHalf = max( 0.5 * dot( normal, lVector ) + 0.5, 0.0 );\",\n\t\t\t\t\t\t\"vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), uWrapRGB );\",\n\n\t\t\t\t\t\t\"float pointSpecularWeight = KS_Skin_Specular( normal, lVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"pointTotal += lDistance * diffuse * pointLightColor[ i ] * pointDiffuseWeight;\",\n\t\t\t\t\t\t\"specularTotal += lDistance * specular * pointLightColor[ i ] * pointSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 dirTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dirDiffuseWeightFull = max( dot( normal, dirVector ), 0.0 );\",\n\t\t\t\t\t\t\"float dirDiffuseWeightHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\",\n\t\t\t\t\t\t\"vec3 dirDiffuseWeight = mix( vec3 ( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), uWrapRGB );\",\n\n\t\t\t\t\t\t\"float dirSpecularWeight = KS_Skin_Specular( normal, dirVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"dirTotal \t += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\",\n\t\t\t\t\t\t\"specularTotal += specular * directionalLightColor[ i ] * dirSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// hemisphere lights\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 hemiTotal = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dotProduct = dot( normal, lVector );\",\n\t\t\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\t\t\"hemiTotal += diffuse * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\",\n\n\t\t\t\t\t\t// specular (sky light)\n\n\t\t\t\t\t\t\"float hemiSpecularWeight = 0.0;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += KS_Skin_Specular( normal, lVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t// specular (ground light)\n\n\t\t\t\t\t\t\"vec3 lVectorGround = -lVector;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += KS_Skin_Specular( normal, lVectorGround, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\t\"specularTotal += specular * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight ) * hemiSpecularWeight * specularStrength;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec3 totalLight = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += dirTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += pointTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += hemiTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalLight + ambientLightColor * ambient ) + specularTotal;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"linear_to_gamma_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"uniform vec4 offsetRepeat;\",\n\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t\"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\",\n\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\"}\"\n\n\t\t].join( \"\\n\" )\n\n\t},\n\n\t/* ------------------------------------------------------------------------------------------\n\t//\tSkin shader\n\t//\t\t- Blinn-Phong diffuse term (using normal + diffuse maps)\n\t//\t\t- subsurface scattering approximation by four blur layers\n\t//\t\t- physically based specular term (Kelemen/Szirmay-Kalos specular reflectance)\n\t//\n\t//\t\t- point and directional lights (use with \"lights: true\" material option)\n\t//\n\t//\t\t- based on Nvidia Advanced Skin Rendering GDC 2007 presentation\n\t//\t\t and GPU Gems 3 Chapter 14. Advanced Techniques for Realistic Real-Time Skin Rendering\n\t//\n\t//\t\t\thttp://developer.download.nvidia.com/presentations/2007/gdc/Advanced_Skin.pdf\n\t//\t\t\thttp://http.developer.nvidia.com/GPUGems3/gpugems3_ch14.html\n\t// ------------------------------------------------------------------------------------------ */\n\n\t'skin' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\n\t\t\t{\n\n\t\t\t\"passID\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse\"\t: { type: \"t\", value: null },\n\t\t\t\"tNormal\"\t: { type: \"t\", value: null },\n\n\t\t\t\"tBlur1\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur2\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur3\"\t: { type: \"t\", value: null },\n\t\t\t\"tBlur4\"\t: { type: \"t\", value: null },\n\n\t\t\t\"tBeckmann\"\t: { type: \"t\", value: null },\n\n\t\t\t\"uNormalScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"diffuse\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"opacity\": \t { type: \"f\", value: 1 },\n\n\t\t\t\"uRoughness\": \t \t\t{ type: \"f\", value: 0.15 },\n\t\t\t\"uSpecularBrightness\": \t{ type: \"f\", value: 0.75 }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform float uRoughness;\",\n\t\t\t\"uniform float uSpecularBrightness;\",\n\n\t\t\t\"uniform int passID;\",\n\n\t\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\t\"uniform sampler2D tNormal;\",\n\n\t\t\t\"uniform sampler2D tBlur1;\",\n\t\t\t\"uniform sampler2D tBlur2;\",\n\t\t\t\"uniform sampler2D tBlur3;\",\n\t\t\t\"uniform sampler2D tBlur4;\",\n\n\t\t\t\"uniform sampler2D tBeckmann;\",\n\n\t\t\t\"uniform float uNormalScale;\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\n\t\t\t\"float fresnelReflectance( vec3 H, vec3 V, float F0 ) {\",\n\n\t\t\t\t\"float base = 1.0 - dot( V, H );\",\n\t\t\t\t\"float exponential = pow( base, 5.0 );\",\n\n\t\t\t\t\"return exponential + F0 * ( 1.0 - exponential );\",\n\n\t\t\t\"}\",\n\n\t\t\t// Kelemen/Szirmay-Kalos specular BRDF\n\n\t\t\t\"float KS_Skin_Specular( vec3 N,\", \t\t// Bumped surface normal\n\t\t\t\t\t\t\t\t\t\"vec3 L,\", \t\t// Points to light\n\t\t\t\t\t\t\t\t\t\"vec3 V,\", \t\t// Points to eye\n\t\t\t\t\t\t\t\t\t\"float m,\", \t// Roughness\n\t\t\t\t\t\t\t\t\t\"float rho_s\", \t// Specular brightness\n\t\t\t\t\t\t\t\t\t\") {\",\n\n\t\t\t\t\"float result = 0.0;\",\n\t\t\t\t\"float ndotl = dot( N, L );\",\n\n\t\t\t\t\"if( ndotl > 0.0 ) {\",\n\n\t\t\t\t\t\"vec3 h = L + V;\", // Unnormalized half-way vector\n\t\t\t\t\t\"vec3 H = normalize( h );\",\n\n\t\t\t\t\t\"float ndoth = dot( N, H );\",\n\n\t\t\t\t\t\"float PH = pow( 2.0 * texture2D( tBeckmann, vec2( ndoth, m ) ).x, 10.0 );\",\n\t\t\t\t\t\"float F = fresnelReflectance( H, V, 0.028 );\",\n\t\t\t\t\t\"float frSpec = max( PH * F / dot( h, h ), 0.0 );\",\n\n\t\t\t\t\t\"result = ndotl * rho_s * frSpec;\", // BRDF * dot(N,L) * rho_s\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"return result;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( 1.0 );\",\n\n\t\t\t\t\"vec4 mColor = vec4( diffuse, opacity );\",\n\t\t\t\t\"vec4 mSpecular = vec4( specular, opacity );\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"normalTex.xy *= uNormalScale;\",\n\t\t\t\t\"normalTex = normalize( normalTex );\",\n\n\t\t\t\t\"vec4 colDiffuse = texture2D( tDiffuse, vUv );\",\n\t\t\t\t\"colDiffuse *= colDiffuse;\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * colDiffuse;\",\n\n\t\t\t\t\"mat3 tsb = mat3( vTangent, vBinormal, vNormal );\",\n\t\t\t\t\"vec3 finalNormal = tsb * normalTex;\",\n\n\t\t\t\t\"vec3 normal = normalize( finalNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"vec3 specularTotal = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec4 pointTotal = vec4( vec3( 0.0 ), 1.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec3 pointVector = normalize( vPointLight[ i ].xyz );\",\n\t\t\t\t\t\t\"float pointDistance = vPointLight[ i ].w;\",\n\n\t\t\t\t\t\t\"float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"pointTotal += pointDistance * vec4( pointLightColor[ i ], 1.0 ) * ( mColor * pointDiffuseWeight );\",\n\n\t\t\t\t\t\t\"if ( passID == 1 )\",\n\t\t\t\t\t\t\t\"specularTotal += pointDistance * mSpecular.xyz * pointLightColor[ i ] * KS_Skin_Specular( normal, pointVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec4 dirTotal = vec4( vec3( 0.0 ), 1.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t\"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"dirTotal += vec4( directionalLightColor[ i ], 1.0 ) * ( mColor * dirDiffuseWeight );\",\n\n\t\t\t\t\t\t\"if ( passID == 1 )\",\n\t\t\t\t\t\t\t\"specularTotal += mSpecular.xyz * directionalLightColor[ i ] * KS_Skin_Specular( normal, dirVector, viewPosition, uRoughness, uSpecularBrightness );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec4 totalLight = vec4( vec3( 0.0 ), opacity );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += dirTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\t\t\t\t\t\"totalLight += pointTotal;\",\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor = gl_FragColor * totalLight;\",\n\n\t\t\t\t\"if ( passID == 0 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = vec4( sqrt( gl_FragColor.xyz ), gl_FragColor.w );\",\n\n\t\t\t\t\"} else if ( passID == 1 ) {\",\n\n\t\t\t\t\t//\"#define VERSION1\",\n\n\t\t\t\t\t\"#ifdef VERSION1\",\n\n\t\t\t\t\t\t\"vec3 nonblurColor = sqrt( gl_FragColor.xyz );\",\n\n\t\t\t\t\t\"#else\",\n\n\t\t\t\t\t\t\"vec3 nonblurColor = gl_FragColor.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"vec3 blur1Color = texture2D( tBlur1, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur2Color = texture2D( tBlur2, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur3Color = texture2D( tBlur3, vUv ).xyz;\",\n\t\t\t\t\t\"vec3 blur4Color = texture2D( tBlur4, vUv ).xyz;\",\n\n\n\t\t\t\t\t//\"gl_FragColor = vec4( blur1Color, gl_FragColor.w );\",\n\n\t\t\t\t\t//\"gl_FragColor = vec4( vec3( 0.22, 0.5, 0.7 ) * nonblurColor + vec3( 0.2, 0.5, 0.3 ) * blur1Color + vec3( 0.58, 0.0, 0.0 ) * blur2Color, gl_FragColor.w );\",\n\n\t\t\t\t\t//\"gl_FragColor = vec4( vec3( 0.25, 0.6, 0.8 ) * nonblurColor + vec3( 0.15, 0.25, 0.2 ) * blur1Color + vec3( 0.15, 0.15, 0.0 ) * blur2Color + vec3( 0.45, 0.0, 0.0 ) * blur3Color, gl_FragColor.w );\",\n\n\n\t\t\t\t\t\"gl_FragColor = vec4( vec3( 0.22, 0.437, 0.635 ) * nonblurColor + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.101, 0.355, 0.365 ) * blur1Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.119, 0.208, 0.0 ) * blur2Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.114, 0.0, 0.0 ) * blur3Color + \",\n\t\t\t\t\t\t\t\t\t\t \"vec3( 0.444, 0.0, 0.0 ) * blur4Color\",\n\t\t\t\t\t\t\t\t\t\t \", gl_FragColor.w );\",\n\n\t\t\t\t\t\"gl_FragColor.xyz *= pow( colDiffuse.xyz, vec3( 0.5 ) );\",\n\n\t\t\t\t\t\"gl_FragColor.xyz += ambientLightColor * ambient * colDiffuse.xyz + specularTotal;\",\n\n\t\t\t\t\t\"#ifndef VERSION1\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = sqrt( gl_FragColor.xyz );\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz - mvPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vPointLight[ i ] = vec4( lVector, lDistance );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// displacement mapping\n\n\t\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\t\"vec3 dv = texture2D( tDisplacement, uv ).xyz;\",\n\t\t\t\t\t\"float df = uDisplacementScale * dv.x + uDisplacementBias;\",\n\t\t\t\t\t\"vec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\",\n\t\t\t\t\t\"gl_Position = projectionMatrix * displacedPosition;\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShaderUV: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\t\"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz - mvPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vPointLight[ i ] = vec4( lVector, lDistance );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_Position = vec4( uv.x * 2.0 - 1.0, uv.y * 2.0 - 1.0, 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t/* ------------------------------------------------------------------------------------------\n\t// Beckmann distribution function\n\t//\t- to be used in specular term of skin shader\n\t//\t- render a screen-aligned quad to precompute a 512 x 512 texture\n\t//\n\t//\t\t- from http://developer.nvidia.com/node/171\n\t ------------------------------------------------------------------------------------------ */\n\n\t\"beckmann\" : {\n\n\t\tuniforms: {},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"float PHBeckmann( float ndoth, float m ) {\",\n\n\t\t\t\t\"float alpha = acos( ndoth );\",\n\t\t\t\t\"float ta = tan( alpha );\",\n\n\t\t\t\t\"float val = 1.0 / ( m * m * pow( ndoth, 4.0 ) ) * exp( -( ta * ta ) / ( m * m ) );\",\n\t\t\t\t\"return val;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float KSTextureCompute( vec2 tex ) {\",\n\n\t\t\t\t// Scale the value to fit within [0,1] invert upon lookup.\n\n\t\t\t\t\"return 0.5 * pow( PHBeckmann( tex.x, tex.y ), 0.1 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"float x = KSTextureCompute( vUv );\",\n\n\t\t\t\t\"gl_FragColor = vec4( x, x, x, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/ParametricGeometries.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ParametricGeometries.js",
"module-type": "library",
"text": "/*\n * @author zz85\n *\n * Experimenting of primitive geometry creation using Surface Parametric equations\n *\n */\n\n\nTHREE.ParametricGeometries = {\n\n\tklein: function (v, u) {\n\t\tu *= Math.PI;\n\t\tv *= 2 * Math.PI;\n\n\t\tu = u * 2;\n\t\tvar x, y, z;\n\t\tif (u < Math.PI) {\n\t\t\tx = 3 * Math.cos(u) * (1 + Math.sin(u)) + (2 * (1 - Math.cos(u) / 2)) * Math.cos(u) * Math.cos(v);\n\t\t\tz = -8 * Math.sin(u) - 2 * (1 - Math.cos(u) / 2) * Math.sin(u) * Math.cos(v);\n\t\t} else {\n\t\t\tx = 3 * Math.cos(u) * (1 + Math.sin(u)) + (2 * (1 - Math.cos(u) / 2)) * Math.cos(v + Math.PI);\n\t\t\tz = -8 * Math.sin(u);\n\t\t}\n\n\t\ty = -2 * (1 - Math.cos(u) / 2) * Math.sin(v);\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t},\n\n\tplane: function (width, height) {\n\n\t\treturn function(u, v) {\n\t\t\tvar x = u * width;\n\t\t\tvar y = 0;\n\t\t\tvar z = v * height;\n\n\t\t\treturn new THREE.Vector3(x, y, z);\n\t\t};\n\t},\n\n\tmobius: function(u, t) {\n\n\t\t// flat mobius strip\n\t\t// http://www.wolframalpha.com/input/?i=M%C3%B6bius+strip+parametric+equations&lk=1&a=ClashPrefs_*Surface.MoebiusStrip.SurfaceProperty.ParametricEquations-\n\t\tu = u - 0.5;\n\t\tvar v = 2 * Math.PI * t;\n\n\t\tvar x, y, z;\n\n\t\tvar a = 2;\n\t\tx = Math.cos(v) * (a + u * Math.cos(v/2));\n\t\ty = Math.sin(v) * (a + u * Math.cos(v/2));\n\t\tz = u * Math.sin(v/2);\n\t\treturn new THREE.Vector3(x, y, z);\n\n\t},\n\n\tmobius3d: function(u, t) {\n\n\t\t// volumetric mobius strip\n\t\tu *= Math.PI;\n\t\tt *= 2 * Math.PI;\n\n\t\tu = u * 2;\n\t\tvar phi = u / 2;\n\t\tvar major = 2.25, a = 0.125, b = 0.65;\n\t\tvar x, y, z;\n\t\tx = a * Math.cos(t) * Math.cos(phi) - b * Math.sin(t) * Math.sin(phi);\n\t\tz = a * Math.cos(t) * Math.sin(phi) + b * Math.sin(t) * Math.cos(phi);\n\t\ty = (major + x) * Math.sin(u);\n\t\tx = (major + x) * Math.cos(u);\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n};\n\n\n/*********************************************\n *\n * Parametric Replacement for TubeGeometry\n *\n *********************************************/\n\nTHREE.ParametricGeometries.TubeGeometry = function(path, segments, radius, segmentsRadius, closed, debug) {\n\n\tthis.path = path;\n\tthis.segments = segments || 64;\n\tthis.radius = radius || 1;\n\tthis.segmentsRadius = segmentsRadius || 8;\n\tthis.closed = closed || false;\n\tif (debug) this.debug = new THREE.Object3D();\n\n\n\tvar scope = this,\n\n\t\ttangent, normal, binormal,\n\n\t\tnumpoints = this.segments + 1,\n\n\t\tx, y, z, tx, ty, tz, u, v,\n\n\t\tcx, cy, pos, pos2 = new THREE.Vector3(),\n\t\ti, j, ip, jp, a, b, c, d, uva, uvb, uvc, uvd;\n\n\tvar frames = new THREE.TubeGeometry.FrenetFrames(path, segments, closed),\n\t\ttangents = frames.tangents,\n\t\tnormals = frames.normals,\n\t\tbinormals = frames.binormals;\n\n\t\t// proxy internals\n\t\tthis.tangents = tangents;\n\t\tthis.normals = normals;\n\t\tthis.binormals = binormals;\n\n\n\n\tvar ParametricTube = function(u, v) {\n\t\tv *= 2 * Math.PI;\n\n\t\ti = u * (numpoints - 1);\n\t\ti = Math.floor(i);\n\n\t\tpos = path.getPointAt(u);\n\n\t\ttangent = tangents[i];\n\t\tnormal = normals[i];\n\t\tbinormal = binormals[i];\n\n\t\tif (scope.debug) {\n\n\t\t\tscope.debug.add(new THREE.ArrowHelper(tangent, pos, radius, 0x0000ff));\n\t\t\tscope.debug.add(new THREE.ArrowHelper(normal, pos, radius, 0xff0000));\n\t\t\tscope.debug.add(new THREE.ArrowHelper(binormal, pos, radius, 0x00ff00));\n\n\t\t}\n\n\t\tcx = -scope.radius * Math.cos(v); // TODO: Hack: Negating it so it faces outside.\n\t\tcy = scope.radius * Math.sin(v);\n\n\t\tpos2.copy(pos);\n\t\tpos2.x += cx * normal.x + cy * binormal.x;\n\t\tpos2.y += cx * normal.y + cy * binormal.y;\n\t\tpos2.z += cx * normal.z + cy * binormal.z;\n\n\t\treturn pos2.clone();\n\t};\n\n\tTHREE.ParametricGeometry.call(this, ParametricTube, segments, segmentsRadius);\n\n};\n\nTHREE.ParametricGeometries.TubeGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n *\n * Parametric Replacement for TorusKnotGeometry\n *\n *********************************************/\nTHREE.ParametricGeometries.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) {\n\n\tvar scope = this;\n\n\tthis.radius = radius || 200;\n\tthis.tube = tube || 40;\n\tthis.segmentsR = segmentsR || 64;\n\tthis.segmentsT = segmentsT || 8;\n\tthis.p = p || 2;\n\tthis.q = q || 3;\n\tthis.heightScale = heightScale || 1;\n\n\n\tvar TorusKnotCurve = THREE.Curve.create(\n\n\t\tfunction() {\n\t\t},\n\n\t\tfunction(t) {\n\n\t\t\tt *= Math.PI * 2;\n\n\t\t\tvar r = 0.5;\n\n\t\t\tvar tx = (1 + r * Math.cos(q * t)) * Math.cos(p * t),\n\t\t\t\tty = (1 + r * Math.cos(q * t)) * Math.sin(p * t),\n\t\t\t\ttz = r * Math.sin(q * t);\n\n\t\t\treturn new THREE.Vector3(tx, ty * heightScale, tz).multiplyScalar(radius);\n\n\t\t}\n\n\t);\n\tvar segments = segmentsR;\n\tvar radiusSegments = segmentsT;\n\tvar extrudePath = new TorusKnotCurve();\n\n\tTHREE.ParametricGeometries.TubeGeometry.call( this, extrudePath, segments, tube, radiusSegments, true, false );\n\n\n};\n\nTHREE.ParametricGeometries.TorusKnotGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n *\n * Parametric Replacement for SphereGeometry\n *\n *********************************************/\nTHREE.ParametricGeometries.SphereGeometry = function(size, u, v) {\n\n\tfunction sphere(u, v) {\n\t\tu *= Math.PI;\n\t\tv *= 2 * Math.PI;\n\n\t\tvar x = size * Math.sin(u) * Math.cos(v);\n\t\tvar y = size * Math.sin(u) * Math.sin(v);\n\t\tvar z = size * Math.cos(u);\n\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n\tTHREE.ParametricGeometry.call(this, sphere, u, v, !true);\n\n};\n\nTHREE.ParametricGeometries.SphereGeometry.prototype = Object.create( THREE.Geometry.prototype );\n\n\n /*********************************************\n *\n * Parametric Replacement for PlaneGeometry\n *\n *********************************************/\n\nTHREE.ParametricGeometries.PlaneGeometry = function(width, depth, segmentsWidth, segmentsDepth) {\n\n\tfunction plane(u, v) {\n\n\t\tvar x = u * width;\n\t\tvar y = 0;\n\t\tvar z = v * depth;\n\n\t\treturn new THREE.Vector3(x, y, z);\n\t}\n\n\tTHREE.ParametricGeometry.call(this, plane, segmentsWidth, segmentsDepth);\n\n};\n\nTHREE.ParametricGeometries.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Ocean.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Ocean.js",
"module-type": "library",
"text": "THREE.Ocean = function (renderer, camera, scene, options) {\n\t// flag used to trigger parameter changes\n\tthis.changed = true;\n\tthis.initial = true;\n\t\n\t// Assign required parameters as object properties\n\tthis.oceanCamera = new THREE.OrthographicCamera(); //camera.clone();\n\tthis.oceanCamera.position.z = 1;\n\tthis.renderer = renderer;\n\tthis.renderer.clearColor( 0xffffff );\n\t\n\tthis.scene = new THREE.Scene();\n\t\n\t// Enable necessary extensions\n\tthis.renderer.context.getExtension('OES_texture_float');\n\tthis.renderer.context.getExtension('OES_texture_float_linear');\n\t\n\t// Assign optional parameters as variables and object properties\n\tfunction optionalParameter(value, defaultValue) {\n\t\treturn value !== undefined ? value : defaultValue;\n\t};\n\toptions = options || {};\n\tthis.clearColor = optionalParameter(options.CLEAR_COLOR, [1.0, 1.0, 1.0, 0.0]);\n\tthis.geometryOrigin = optionalParameter(options.GEOMETRY_ORIGIN, [-1000.0, -1000.0]);\n\tthis.sunDirectionX = optionalParameter(options.SUN_DIRECTION[0], -1.0);\n\tthis.sunDirectionY = optionalParameter(options.SUN_DIRECTION[1], 1.0);\n\tthis.sunDirectionZ = optionalParameter(options.SUN_DIRECTION[2], 1.0);\n\tthis.oceanColor = optionalParameter(options.OCEAN_COLOR, new THREE.Vector3(0.004, 0.016, 0.047));\n\tthis.skyColor = optionalParameter(options.SKY_COLOR, new THREE.Vector3(3.2, 9.6, 12.8));\n\tthis.exposure = optionalParameter(options.EXPOSURE, 0.35);\n\tthis.geometryResolution = optionalParameter(options.GEOMETRY_RESOLUTION, 32);\n\tthis.geometrySize = optionalParameter(options.GEOMETRY_SIZE, 2000);\n\tthis.resolution = optionalParameter(options.RESOLUTION, 64);\n\tthis.floatSize = optionalParameter(options.SIZE_OF_FLOAT, 4);\n\tthis.windX = optionalParameter(options.INITIAL_WIND[0], 10.0),\n\tthis.windY = optionalParameter(options.INITIAL_WIND[1], 10.0),\n\tthis.size = optionalParameter(options.INITIAL_SIZE, 250.0),\n\tthis.choppiness = optionalParameter(options.INITIAL_CHOPPINESS, 1.5);\n\t\n\t// \n\tthis.matrixNeedsUpdate = false;\n\t\n\t// Setup framebuffer pipeline\n\tvar LinearClampParams = {\n\t\tminFilter: THREE.LinearFilter,\n\t\tmagFilter: THREE.LinearFilter,\n\t\twrapS: THREE.ClampToEdgeWrapping,\n\t\twrapT: THREE.ClampToEdgeWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha: false,\n\t\ttype: THREE.FloatType\n\t};\n\tvar NearestClampParams = {\n\t\tminFilter: THREE.NearestFilter,\n\t\tmagFilter: THREE.NearestFilter,\n\t\twrapS: THREE.ClampToEdgeWrapping,\n\t\twrapT: THREE.ClampToEdgeWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha:false,\n\t\ttype: THREE.FloatType\n\t};\n\tvar NearestRepeatParams = {\n\t\tminFilter: THREE.NearestFilter,\n\t\tmagFilter: THREE.NearestFilter,\n\t\twrapS: THREE.RepeatWrapping,\n\t\twrapT: THREE.RepeatWrapping,\n\t\tformat: THREE.RGBAFormat,\n\t\tstencilBuffer: false,\n\t\tdepthBuffer: false,\n\t\tpremultiplyAlpha: false,\n\t\ttype: THREE.FloatType\n\t};\n\tthis.initialSpectrumFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestRepeatParams);\n\tthis.spectrumFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pingPhaseFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pongPhaseFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pingTransformFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.pongTransformFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, NearestClampParams);\n\tthis.displacementMapFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, LinearClampParams);\n\tthis.normalMapFramebuffer = new THREE.WebGLRenderTarget(this.resolution, this.resolution, LinearClampParams);\n\t\n\t// Define shaders and constant uniforms\n\t////////////////////////////////////////\n\t\n\t// 0 - The vertex shader used in all of the simulation steps\n\tvar fullscreeenVertexShader = THREE.ShaderLib[\"ocean_sim_vertex\"];\n\t\t\n\t// 1 - Horizontal wave vertices used for FFT\n\tvar oceanHorizontalShader = THREE.ShaderLib[\"ocean_subtransform\"];\n\tvar oceanHorizontalUniforms = THREE.UniformsUtils.clone(oceanHorizontalShader.uniforms);\n\tthis.materialOceanHorizontal = new THREE.ShaderMaterial({\n\t\tuniforms: oceanHorizontalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: \"#define HORIZONTAL \\n\" + oceanHorizontalShader.fragmentShader\n\t});\n\tthis.materialOceanHorizontal.uniforms.u_transformSize = { type: \"f\", value: this.resolution };\n\tthis.materialOceanHorizontal.uniforms.u_subtransformSize = { type: \"f\", value: null };\n\tthis.materialOceanHorizontal.uniforms.u_input = { type: \"t\", value: null };\n\tthis.materialOceanHorizontal.depthTest = false;\n\t\n\t// 2 - Vertical wave vertices used for FFT\n\tvar oceanVerticalShader = THREE.ShaderLib[\"ocean_subtransform\"];\n\tvar oceanVerticalUniforms = THREE.UniformsUtils.clone(oceanVerticalShader.uniforms);\n\tthis.materialOceanVertical = new THREE.ShaderMaterial({\n\t\tuniforms: oceanVerticalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: oceanVerticalShader.fragmentShader\n\t});\n\tthis.materialOceanVertical.uniforms.u_transformSize = { type: \"f\", value: this.resolution };\n\tthis.materialOceanVertical.uniforms.u_subtransformSize = { type: \"f\", value: null };\n\tthis.materialOceanVertical.uniforms.u_input = { type: \"t\", value: null };\n\tthis.materialOceanVertical.depthTest = false;\n\t\n\t// 3 - Initial spectrum used to generate height map\n\tvar initialSpectrumShader = THREE.ShaderLib[\"ocean_initial_spectrum\"];\n\tvar initialSpectrumUniforms = THREE.UniformsUtils.clone(initialSpectrumShader.uniforms);\n\tthis.materialInitialSpectrum = new THREE.ShaderMaterial({\n\t\tuniforms: initialSpectrumUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader:initialSpectrumShader.fragmentShader\n\t});\n\tthis.materialInitialSpectrum.uniforms.u_wind = { type: \"v2\", value: new THREE.Vector2() };\n\tthis.materialInitialSpectrum.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialInitialSpectrum.depthTest = false;\n\t\n\t// 4 - Phases used to animate heightmap\n\tvar phaseShader = THREE.ShaderLib[\"ocean_phase\"];\n\tvar phaseUniforms = THREE.UniformsUtils.clone(phaseShader.uniforms);\n\tthis.materialPhase = new THREE.ShaderMaterial({\n\t\tuniforms: phaseUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: phaseShader.fragmentShader\n\t});\n\tthis.materialPhase.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialPhase.depthTest = false;\n\t\n\t// 5 - Shader used to update spectrum\n\tvar spectrumShader = THREE.ShaderLib[\"ocean_spectrum\"];\n\tvar spectrumUniforms = THREE.UniformsUtils.clone(spectrumShader.uniforms);\n\tthis.materialSpectrum = new THREE.ShaderMaterial({\n\t\tuniforms: spectrumUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: spectrumShader.fragmentShader\n\t});\n\tthis.materialSpectrum.uniforms.u_initialSpectrum = { type: \"t\", value: null };\n\tthis.materialSpectrum.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialSpectrum.depthTest = false;\n\n\t// 6 - Shader used to update spectrum normals\n\tvar normalShader = THREE.ShaderLib[\"ocean_normals\"];\n\tvar normalUniforms = THREE.UniformsUtils.clone(normalShader.uniforms);\n\tthis.materialNormal = new THREE.ShaderMaterial({\n\t\tuniforms: normalUniforms,\n\t\tvertexShader: fullscreeenVertexShader.vertexShader,\n\t\tfragmentShader: normalShader.fragmentShader\n\t});\n\tthis.materialNormal.uniforms.u_displacementMap = { type: \"t\", value: null };\n\tthis.materialNormal.uniforms.u_resolution = { type: \"f\", value: this.resolution };\n\tthis.materialNormal.depthTest = false;\n\n\t// 7 - Shader used to update normals\n\tvar oceanShader = THREE.ShaderLib[\"ocean_main\"];\n\tvar oceanUniforms = THREE.UniformsUtils.clone(oceanShader.uniforms);\n\tvar oceanAttributes = THREE.UniformsUtils.clone(oceanShader.attributes);\n\tthis.materialOcean = new THREE.ShaderMaterial({\n\t\tattributes: oceanAttributes,\n\t\tuniforms: oceanUniforms,\n\t\tvertexShader: oceanShader.vertexShader,\n\t\tfragmentShader: oceanShader.fragmentShader\n\t});\n\t// this.materialOcean.wireframe = true;\n\tthis.materialOcean.uniforms.u_geometrySize = { type: \"f\", value: this.resolution };\n\tthis.materialOcean.uniforms.u_displacementMap = { type: \"t\", value: this.displacementMapFramebuffer };\n\tthis.materialOcean.uniforms.u_normalMap = { type: \"t\", value: this.normalMapFramebuffer }; \n\tthis.materialOcean.uniforms.u_oceanColor = { type: \"v3\", value: this.oceanColor }; \n\tthis.materialOcean.uniforms.u_skyColor = { type: \"v3\", value: this.skyColor };\n\tthis.materialOcean.uniforms.u_sunDirection = { type: \"v3\", value: new THREE.Vector3( this.sunDirectionX, this.sunDirectionY, this.sunDirectionZ ) };\n\tthis.materialOcean.uniforms.u_exposure = { type: \"f\", value: this.exposure };\n\n\t// Disable blending to prevent default premultiplied alpha values\n\tthis.materialOceanHorizontal.blending = 0;\n\tthis.materialOceanVertical.blending = 0;\n\tthis.materialInitialSpectrum.blending = 0;\n\tthis.materialPhase.blending = 0;\n\tthis.materialSpectrum.blending = 0;\n\tthis.materialNormal.blending = 0;\n\tthis.materialOcean.blending = 0;\n\n\t// Create the simulation plane\n\tthis.screenQuad = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ) );\n\tthis.scene.add(this.screenQuad);\n\n\t// Initialise spectrum data\n\tthis.generateSeedPhaseTexture();\n\n\t// Generate the ocean mesh\n\tthis.generateMesh();\n};\n\nTHREE.Ocean.prototype.generateMesh = function () {\n\n\tvar geometry = new THREE.PlaneGeometry( this.geometrySize, this.geometrySize, this.geometryResolution, this.geometryResolution );\n\n\tgeometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );\n\n\tthis.oceanMesh = new THREE.Mesh( geometry, this.materialOcean );\n};\n\nTHREE.Ocean.prototype.render = function () {\n\tthis.scene.overrideMaterial = null;\n\t\n\tif (this.changed)\n\t\tthis.renderInitialSpectrum();\n\t\n\tthis.renderWavePhase();\n\tthis.renderSpectrum();\n\tthis.renderSpectrumFFT();\n\tthis.renderNormalMap();\n\tthis.scene.overrideMaterial = null;\n};\n\nTHREE.Ocean.prototype.generateSeedPhaseTexture = function() {\n\t// Setup the seed texture\n\tthis.pingPhase = true;\n\tvar phaseArray = new window.Float32Array(this.resolution * this.resolution * 4);\n\tfor (var i = 0; i < this.resolution; i++) {\n\t\tfor (var j = 0; j < this.resolution; j++) {\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4] = Math.random() * 2.0 * Math.PI;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 1] = 0.0;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 2] = 0.0;\n\t\t\tphaseArray[i * this.resolution * 4 + j * 4 + 3] = 0.0;\n\t\t}\n\t}\n\t\n\tthis.pingPhaseTexture = new THREE.DataTexture(phaseArray, this.resolution, this.resolution, THREE.RGBAFormat);\n\tthis.pingPhaseTexture.minFilter = THREE.NearestFilter;\n\tthis.pingPhaseTexture.magFilter = THREE.NearestFilter;\n\tthis.pingPhaseTexture.wrapS = THREE.ClampToEdgeWrapping;\n\tthis.pingPhaseTexture.wrapT = THREE.ClampToEdgeWrapping;\n\tthis.pingPhaseTexture.type = THREE.FloatType;\n\tthis.pingPhaseTexture.needsUpdate = true;\n};\n\nTHREE.Ocean.prototype.renderInitialSpectrum = function () {\n\tthis.scene.overrideMaterial = this.materialInitialSpectrum;\n\tthis.materialInitialSpectrum.uniforms.u_wind.value.set( this.windX, this.windY );\n\tthis.materialInitialSpectrum.uniforms.u_size.value = this.size;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.initialSpectrumFramebuffer, true);\n};\n\nTHREE.Ocean.prototype.renderWavePhase = function () {\n\tthis.scene.overrideMaterial = this.materialPhase;\n\tthis.screenQuad.material = this.materialPhase;\n\tif (this.initial) {\n\t\tthis.materialPhase.uniforms.u_phases.value = this.pingPhaseTexture;\n\t\tthis.initial = false;\n\t}else {\n\t\tthis.materialPhase.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer : this.pongPhaseFramebuffer;\n\t}\n\tthis.materialPhase.uniforms.u_deltaTime.value = this.deltaTime;\n\tthis.materialPhase.uniforms.u_size.value = this.size;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.pingPhase ? this.pongPhaseFramebuffer : this.pingPhaseFramebuffer);\n\tthis.pingPhase = !this.pingPhase;\n};\n\nTHREE.Ocean.prototype.renderSpectrum = function () {\n\tthis.scene.overrideMaterial = this.materialSpectrum;\n\tthis.materialSpectrum.uniforms.u_initialSpectrum.value = this.initialSpectrumFramebuffer;\n\tthis.materialSpectrum.uniforms.u_phases.value = this.pingPhase ? this.pingPhaseFramebuffer : this.pongPhaseFramebuffer;\n\tthis.materialSpectrum.uniforms.u_choppiness.value = this.choppiness ;\n\tthis.materialSpectrum.uniforms.u_size.value = this.size ;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.spectrumFramebuffer);\n};\n\nTHREE.Ocean.prototype.renderSpectrumFFT = function() {\n\t// GPU FFT using Stockham formulation\n\tvar iterations = Math.log( this.resolution ) / Math.log(2); // log2\n\t\n\tthis.scene.overrideMaterial = this.materialOceanHorizontal;\n\n\tfor (var i = 0; i < iterations; i++) {\n\t\tif (i === 0) {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.spectrumFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t} \n\t\telse if (i % 2 === 1) {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.pingTransformFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pongTransformFramebuffer);\n\t\t}\n\t\telse {\n\t\t\tthis.materialOceanHorizontal.uniforms.u_input.value = this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanHorizontal.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t}\n\t}\n\tthis.scene.overrideMaterial = this.materialOceanVertical;\n\tfor (var i = iterations; i < iterations*2; i++) {\n\t\tif (i === iterations * 2 - 1) {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = (iterations % 2 === 0) ? this.pingTransformFramebuffer : this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.displacementMapFramebuffer);\n\t\t}\n\t\telse if (i % 2 === 1) {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = this.pingTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pongTransformFramebuffer);\n\t\t}\n\t\telse {\n\t\t\tthis.materialOceanVertical.uniforms.u_input.value = this.pongTransformFramebuffer;\n\t\t\tthis.materialOceanVertical.uniforms.u_subtransformSize.value = Math.pow(2, (i % (iterations)) + 1);\n\t\t\tthis.renderer.render(this.scene, this.oceanCamera, this.pingTransformFramebuffer);\n\t\t}\n\t}\n};\n\nTHREE.Ocean.prototype.renderNormalMap = function () {\n\tthis.scene.overrideMaterial = this.materialNormal;\n\tif (this.changed) this.materialNormal.uniforms.u_size.value = this.size;\n\tthis.materialNormal.uniforms.u_displacementMap.value = this.displacementMapFramebuffer;\n\tthis.renderer.render(this.scene, this.oceanCamera, this.normalMapFramebuffer, true);\n};"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BlendShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BlendShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Blend two textures\n */\n\nTHREE.BlendShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse1\": { type: \"t\", value: null },\n\t\t\"tDiffuse2\": { type: \"t\", value: null },\n\t\t\"mixRatio\": { type: \"f\", value: 0.5 },\n\t\t\"opacity\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\t\t\"uniform float mixRatio;\",\n\n\t\t\"uniform sampler2D tDiffuse1;\",\n\t\t\"uniform sampler2D tDiffuse2;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel1 = texture2D( tDiffuse1, vUv );\",\n\t\t\t\"vec4 texel2 = texture2D( tDiffuse2, vUv );\",\n\t\t\t\"gl_FragColor = opacity * mix( texel1, texel2, mixRatio );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/RGBShiftShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/RGBShiftShader.js",
"module-type": "library",
"text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * RGB Shift Shader\n * Shifts red and blue channels from center in opposite directions\n * Ported from http://kriss.cx/tom/2009/05/rgb-shift/\n * by Tom Butterworth / http://kriss.cx/tom/\n *\n * amount: shift distance (1 is width of input)\n * angle: shift angle in radians\n */\n\nTHREE.RGBShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"amount\": { type: \"f\", value: 0.005 },\n\t\t\"angle\": { type: \"f\", value: 0.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float amount;\",\n\t\t\"uniform float angle;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 offset = amount * vec2( cos(angle), sin(angle));\",\n\t\t\t\"vec4 cr = texture2D(tDiffuse, vUv + offset);\",\n\t\t\t\"vec4 cga = texture2D(tDiffuse, vUv);\",\n\t\t\t\"vec4 cb = texture2D(tDiffuse, vUv - offset);\",\n\t\t\t\"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/OceanShaders.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/OceanShaders.js",
"module-type": "library",
"text": "// Author: Aleksandr Albert\n// Website: www.routter.co.tt\n\n// Description: A deep water ocean shader set\n// based on an implementation of a Tessendorf Waves\n// originally presented by David Li ( www.david.li/waves )\n\n// The general method is to apply shaders to simulation Framebuffers\n// and then sample these framebuffers when rendering the ocean mesh\n\n// The set uses 7 shaders:\n\n// -- Simulation shaders\n// [1] ocean_sim_vertex -> Vertex shader used to set up a 2x2 simulation plane centered at (0,0)\n// [2] ocean_subtransform -> Fragment shader used to subtransform the mesh (generates the displacement map)\n// [3] ocean_initial_spectrum -> Fragment shader used to set intitial wave frequency at a texel coordinate\n// [4] ocean_phase -> Fragment shader used to set wave phase at a texel coordinate\n// [5] ocean_spectrum -> Fragment shader used to set current wave frequency at a texel coordinate\n// [6] ocean_normal -> Fragment shader used to set face normals at a texel coordinate\n\n// -- Rendering Shader\n// [7] ocean_main -> Vertex and Fragment shader used to create the final render\n\n\nTHREE.ShaderLib['ocean_sim_vertex'] = {\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tvertexShader: [\n\t\t'varying vec2 vUV;',\n\n\t\t'void main (void) {',\n\t\t\t'vUV = position.xy * 0.5 + 0.5;',\n\t\t\t'gl_Position = vec4(position, 1.0 );',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_subtransform'] = {\n\tuniforms: {\n\t\t\"u_input\": { type: \"t\", value: null },\n\t\t\"u_transformSize\": { type: \"f\", value: 512.0 },\n\t\t\"u_subtransformSize\": { type: \"f\", value: 250.0 }\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t//GPU FFT using a Stockham formulation\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\n\t\t'uniform sampler2D u_input;',\n\t\t'uniform float u_transformSize;',\n\t\t'uniform float u_subtransformSize;',\n\n\t\t'varying vec2 vUV;',\n\t\t\n\t\t'vec2 multiplyComplex (vec2 a, vec2 b) {',\n\t\t\t'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'#ifdef HORIZONTAL',\n\t\t\t'float index = vUV.x * u_transformSize - 0.5;',\n\t\t\t'#else',\n\t\t\t'float index = vUV.y * u_transformSize - 0.5;',\n\t\t\t'#endif',\n\n\t\t\t'float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);',\n\n\t\t\t//transform two complex sequences simultaneously\n\t\t\t'#ifdef HORIZONTAL',\n\t\t\t'vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',\n\t\t\t'vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',\n\t\t\t'#else',\n\t\t\t'vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;',\n\t\t\t'vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;',\n\t\t\t'#endif',\n\n\t\t\t'float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);',\n\t\t\t'vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));',\n\n\t\t\t'vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);',\n\t\t\t'vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);',\n\n\t\t\t'gl_FragColor = vec4(outputA, outputB);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_initial_spectrum'] = {\n\tuniforms: {\n\t\t\"u_wind\": { type: \"v2\", value: new THREE.Vector2(10.0, 10.0) },\n\t\t\"u_resolution\": { type: \"f\", value: 512.0 },\n\t\t\"u_size\": { type: \"f\", value: 250.0 },\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\t\t'const float CM = 0.23;',\n\n\t\t'uniform vec2 u_wind;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\t\t\n\t\t'float square (float x) {',\n\t\t\t'return x * x;',\n\t\t'}',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + square(k / KM)));',\n\t\t'}',\n\n\t\t'float tanh (float x) {',\n\t\t\t'return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t\n\t\t\t'vec2 K = (2.0 * PI * vec2(n, m)) / u_size;',\n\t\t\t'float k = length(K);',\n\t\t\t\n\t\t\t'float l_wind = length(u_wind);',\n\n\t\t\t'float Omega = 0.84;',\n\t\t\t'float kp = G * square(Omega / l_wind);',\n\n\t\t\t'float c = omega(k) / k;',\n\t\t\t'float cp = omega(kp) / kp;',\n\n\t\t\t'float Lpm = exp(-1.25 * square(kp / k));',\n\t\t\t'float gamma = 1.7;',\n\t\t\t'float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));',\n\t\t\t'float Gamma = exp(-square(sqrt(k / kp) - 1.0) / 2.0 * square(sigma));',\n\t\t\t'float Jp = pow(gamma, Gamma);',\n\t\t\t'float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));',\n\t\t\t'float alphap = 0.006 * sqrt(Omega);',\n\t\t\t'float Bl = 0.5 * alphap * cp / c * Fp;',\n\n\t\t\t'float z0 = 0.000037 * square(l_wind) / G * pow(l_wind / cp, 0.9);',\n\t\t\t'float uStar = 0.41 * l_wind / log(10.0 / z0);',\n\t\t\t'float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));',\n\t\t\t'float Fm = exp(-0.25 * square(k / KM - 1.0));',\n\t\t\t'float Bh = 0.5 * alpham * CM / c * Fm * Lpm;',\n\n\t\t\t'float a0 = log(2.0) / 4.0;',\n\t\t\t'float am = 0.13 * uStar / CM;',\n\t\t\t'float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));',\n\n\t\t\t'float cosPhi = dot(normalize(u_wind), normalize(K));',\n\n\t\t\t'float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));',\n\n\t\t\t'float dk = 2.0 * PI / u_size;',\n\t\t\t'float h = sqrt(S / 2.0) * dk;',\n\n\t\t\t'if (K.x == 0.0 && K.y == 0.0) {',\n\t\t\t\t'h = 0.0;', //no DC term\n\t\t\t'}',\n\t\t\t'gl_FragColor = vec4(h, 0.0, 0.0, 0.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_phase'] = {\n\tuniforms: {\n\t\t\"u_phases\": { type: \"t\", value: null },\n\t\t\"u_deltaTime\": { type: \"f\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform sampler2D u_phases;',\n\t\t'uniform float u_deltaTime;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + k * k / KM * KM));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'float deltaTime = 1.0 / 60.0;',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',\n\n\t\t\t'float phase = texture2D(u_phases, vUV).r;',\n\t\t\t'float deltaPhase = omega(length(waveVector)) * u_deltaTime;',\n\t\t\t'phase = mod(phase + deltaPhase, 2.0 * PI);',\n\t\t\n\t\t\t'gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_spectrum'] = {\n\tuniforms: {\n\t\t\"u_size\": { type: \"f\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_choppiness\": { type: \"f\", value: null },\n\t\t\"u_phases\": { type: \"t\", value: null },\n\t\t\"u_initialSpectrum\": { type: \"t\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'const float PI = 3.14159265359;',\n\t\t'const float G = 9.81;',\n\t\t'const float KM = 370.0;',\n\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform float u_size;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_choppiness;',\n\t\t'uniform sampler2D u_phases;',\n\t\t'uniform sampler2D u_initialSpectrum;',\n\n\t\t'vec2 multiplyComplex (vec2 a, vec2 b) {',\n\t\t\t'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',\n\t\t'}',\n\n\t\t'vec2 multiplyByI (vec2 z) {',\n\t\t\t'return vec2(-z[1], z[0]);',\n\t\t'}',\n\n\t\t'float omega (float k) {',\n\t\t\t'return sqrt(G * k * (1.0 + k * k / KM * KM));',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec2 coordinates = gl_FragCoord.xy - 0.5;',\n\t\t\t'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',\n\t\t\t'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',\n\t\t\t'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',\n\n\t\t\t'float phase = texture2D(u_phases, vUV).r;',\n\t\t\t'vec2 phaseVector = vec2(cos(phase), sin(phase));',\n\n\t\t\t'vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;',\n\t\t\t'vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;',\n\t\t\t'h0Star.y *= -1.0;',\n\n\t\t\t'vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));',\n\n\t\t\t'vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;',\n\t\t\t'vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;',\n\n\t\t\t//no DC term\n\t\t\t'if (waveVector.x == 0.0 && waveVector.y == 0.0) {',\n\t\t\t\t'h = vec2(0.0);',\n\t\t\t\t'hX = vec2(0.0);',\n\t\t\t\t'hZ = vec2(0.0);',\n\t\t\t'}',\n\t\t\n\t\t\t'gl_FragColor = vec4(hX + multiplyByI(h), hZ);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_normals'] = {\n\tuniforms: {\n\t\t\"u_displacementMap\": { type: \"t\", value: null },\n\t\t\"u_resolution\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'varying vec2 vUV;',\n\t\t\n\t\t'uniform sampler2D u_displacementMap;',\n\t\t'uniform float u_resolution;',\n\t\t'uniform float u_size;',\n\n\t\t'void main (void) {',\n\t\t\t'float texel = 1.0 / u_resolution;',\n\t\t\t'float texelSize = u_size / u_resolution;',\n\n\t\t\t'vec3 center = texture2D(u_displacementMap, vUV).rgb;',\n\t\t\t'vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;',\n\t\t\t'vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;',\n\t\t\t'vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;',\n\t\t\t'vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;',\n\n\t\t\t'vec3 topRight = cross(right, top);',\n\t\t\t'vec3 topLeft = cross(top, left);',\n\t\t\t'vec3 bottomLeft = cross(left, bottom);',\n\t\t\t'vec3 bottomRight = cross(bottom, right);',\n\t\t\n\t\t\t'gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);',\n\t\t'}'\n\t].join('\\n')\n};\nTHREE.ShaderLib['ocean_main'] = {\n\tuniforms: {\n\t\t\"u_displacementMap\": { type: \"t\", value: null },\n\t\t\"u_normalMap\": { type: \"t\", value: null },\n\t\t\"u_geometrySize\": { type: \"f\", value: null },\n\t\t\"u_size\": { type: \"f\", value: null },\n\t\t\"u_projectionMatrix\": { type: \"m4\", value: null },\n\t\t\"u_viewMatrix\": { type: \"m4\", value: null },\n\t\t\"u_cameraPosition\": { type: \"v3\", value: null },\n\t\t\"u_skyColor\": { type: \"v3\", value: null },\n\t\t\"u_oceanColor\": { type: \"v3\", value: null },\n\t\t\"u_sunDirection\": { type: \"v3\", value: null },\n\t\t\"u_exposure\": { type: \"f\", value: null },\n\t},\n\tvarying: {\n\t\t\"vPos\": { type: \"v3\" },\n\t\t\"vUV\": { type: \"v2\" }\n\t},\n\tvertexShader: [\n\t\t'precision highp float;',\n\t\t\n\t\t'varying vec3 vPos;',\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform mat4 u_projectionMatrix;',\n\t\t'uniform mat4 u_viewMatrix;',\n\t\t'uniform float u_size;',\n\t\t'uniform float u_geometrySize;',\n\t\t'uniform sampler2D u_displacementMap;',\n\n\t\t'void main (void) {',\n\t\t\t'vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);',\n\t\t\t'vPos = newPos;',\n\t\t\t'vUV = uv;',\n\t\t\t'gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);',\n\t\t'}'\n\t].join('\\n'),\n\tfragmentShader: [\n\t\t'precision highp float;',\n\n\t\t'varying vec3 vPos;',\n\t\t'varying vec2 vUV;',\n\n\t\t'uniform sampler2D u_displacementMap;',\n\t\t'uniform sampler2D u_normalMap;',\n\t\t'uniform vec3 u_cameraPosition;',\n\t\t'uniform vec3 u_oceanColor;',\n\t\t'uniform vec3 u_skyColor;',\n\t\t'uniform vec3 u_sunDirection;',\n\t\t'uniform float u_exposure;',\n\n\t\t'vec3 hdr (vec3 color, float exposure) {',\n\t\t\t'return 1.0 - exp(-color * exposure);',\n\t\t'}',\n\n\t\t'void main (void) {',\n\t\t\t'vec3 normal = texture2D(u_normalMap, vUV).rgb;',\n\n\t\t\t'vec3 view = normalize(u_cameraPosition - vPos);',\n\t\t\t'float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);',\n\t\t\t'vec3 sky = fresnel * u_skyColor;',\n\n\t\t\t'float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);',\n\t\t\t'vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;',\n\n\t\t\t'vec3 color = sky + water;',\n\n\t\t\t'gl_FragColor = vec4(hdr(color, u_exposure), 1.0);',\n\t\t'}'\n\t].join('\\n')\n};"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader2.js",
"module-type": "library",
"text": "/**\n * @author zz85 / https://github.com/zz85 | twitter.com/blurspline\n *\n * Depth-of-field shader with bokeh\n * ported from GLSL shader by Martins Upitis\n * http://blenderartists.org/forum/showthread.php?237488-GLSL-depth-of-field-with-bokeh-v2-4-(update)\n *\n * Requires #define RINGS and SAMPLES integers\n */\n\n\n\nTHREE.BokehShader = {\n\n\tuniforms: {\n\n\t\t\"textureWidth\": { type: \"f\", value: 1.0 },\n\t\t\"textureHeight\": { type: \"f\", value: 1.0 },\n\n\t\t\"focalDepth\": { type: \"f\", value: 1.0 },\n\t\t\"focalLength\": { type: \"f\", value: 24.0 },\n\t\t\"fstop\": { type: \"f\", value: 0.9 },\n\n\t\t\"tColor\": { type: \"t\", value: null },\n\t\t\"tDepth\": { type: \"t\", value: null },\n\n\t\t\"maxblur\": { type: \"f\", value: 1.0 },\n\n\t\t\"showFocus\": { type: \"i\", value: 0 },\n\t\t\"manualdof\": { type: \"i\", value: 0 },\n\t\t\"vignetting\": { type: \"i\", value: 0 },\n\t\t\"depthblur\": { type: \"i\", value: 0 },\n\n\t\t\"threshold\": { type: \"f\", value: 0.5 },\n\t\t\"gain\": { type: \"f\", value: 2.0 },\n\t\t\"bias\": { type: \"f\", value: 0.5 },\n\t\t\"fringe\": { type: \"f\", value: 0.7 },\n\n\t\t\"znear\": { type: \"f\", value: 0.1 },\n\t\t\"zfar\": { type: \"f\", value: 100 },\n\n\t\t\"noise\": { type: \"i\", value: 1 },\n\t\t\"dithering\": { type: \"f\", value: 0.0001 },\n\t\t\"pentagon\": { type: \"i\", value: 0 },\n\n\t\t\"shaderFocus\": { type: \"i\", value: 1 },\n\t\t\"focusCoords\": { type: \"v2\", value: new THREE.Vector2()},\n\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\t\t\"uniform float textureWidth;\",\n\t\t\"uniform float textureHeight;\",\n\n\t\t\"const float PI = 3.14159265;\",\n\n\t\t\"float width = textureWidth; //texture width\",\n\t\t\"float height = textureHeight; //texture height\",\n\n\t\t\"vec2 texel = vec2(1.0/width,1.0/height);\",\n\n\t\t\"uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below\",\n\t\t\"uniform float focalLength; //focal length in mm\",\n\t\t\"uniform float fstop; //f-stop value\",\n\t\t\"uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)\",\n\n\t\t\"/*\",\n\t\t\"make sure that these two values are the same for your camera, otherwise distances will be wrong.\",\n\t\t\"*/\",\n\n\t\t\"uniform float znear; // camera clipping start\",\n\t\t\"uniform float zfar; // camera clipping end\",\n\n\t\t\"//------------------------------------------\",\n\t\t\"//user variables\",\n\n\t\t\"const int samples = SAMPLES; //samples on the first ring\",\n\t\t\"const int rings = RINGS; //ring count\",\n\n\t\t\"const int maxringsamples = rings * samples;\",\n\n\t\t\"uniform bool manualdof; // manual dof calculation\",\n\t\t\"float ndofstart = 1.0; // near dof blur start\",\n\t\t\"float ndofdist = 2.0; // near dof blur falloff distance\",\n\t\t\"float fdofstart = 1.0; // far dof blur start\",\n\t\t\"float fdofdist = 3.0; // far dof blur falloff distance\",\n\n\t\t\"float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)\",\n\n\t\t\"uniform bool vignetting; // use optical lens vignetting\",\n\n\t\t\"float vignout = 1.3; // vignetting outer border\",\n\t\t\"float vignin = 0.0; // vignetting inner border\",\n\t\t\"float vignfade = 22.0; // f-stops till vignete fades\",\n\n\t\t\"uniform bool shaderFocus;\",\n\n\t\t\"bool autofocus = shaderFocus;\",\n\t\t\"//use autofocus in shader - use with focusCoords\",\n\t\t\"// disable if you use external focalDepth value\",\n\n\t\t\"uniform vec2 focusCoords;\",\n\t\t\"// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)\",\n\t\t\"// if center of screen use vec2(0.5, 0.5);\",\n\n\t\t\"uniform float maxblur;\",\n\t\t\"//clamp value of max blur (0.0 = no blur, 1.0 default)\",\n\n\t\t\"uniform float threshold; // highlight threshold;\",\n\t\t\"uniform float gain; // highlight gain;\",\n\n\t\t\"uniform float bias; // bokeh edge bias\",\n\t\t\"uniform float fringe; // bokeh chromatic aberration / fringing\",\n\n\t\t\"uniform bool noise; //use noise instead of pattern for sample dithering\",\n\n\t\t\"uniform float dithering;\",\n\t\t\"float namount = dithering; //dither amount\",\n\n\t\t\"uniform bool depthblur; // blur the depth buffer\",\n\t\t\"float dbsize = 1.25; // depth blur size\",\n\n\t\t\"/*\",\n\t\t\"next part is experimental\",\n\t\t\"not looking good with small sample and ring count\",\n\t\t\"looks okay starting from samples = 4, rings = 4\",\n\t\t\"*/\",\n\n\t\t\"uniform bool pentagon; //use pentagon as bokeh shape?\",\n\t\t\"float feather = 0.4; //pentagon shape feather\",\n\n\t\t\"//------------------------------------------\",\n\n\t\t\"float penta(vec2 coords) {\",\n\t\t\t\"//pentagonal shape\",\n\t\t\t\"float scale = float(rings) - 1.3;\",\n\t\t\t\"vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);\",\n\t\t\t\"vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);\",\n\t\t\t\"vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);\",\n\t\t\t\"vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);\",\n\t\t\t\"vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);\",\n\t\t\t\"vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);\",\n\n\t\t\t\"vec4 one = vec4( 1.0 );\",\n\n\t\t\t\"vec4 P = vec4((coords),vec2(scale, scale));\",\n\n\t\t\t\"vec4 dist = vec4(0.0);\",\n\t\t\t\"float inorout = -4.0;\",\n\n\t\t\t\"dist.x = dot( P, HS0 );\",\n\t\t\t\"dist.y = dot( P, HS1 );\",\n\t\t\t\"dist.z = dot( P, HS2 );\",\n\t\t\t\"dist.w = dot( P, HS3 );\",\n\n\t\t\t\"dist = smoothstep( -feather, feather, dist );\",\n\n\t\t\t\"inorout += dot( dist, one );\",\n\n\t\t\t\"dist.x = dot( P, HS4 );\",\n\t\t\t\"dist.y = HS5.w - abs( P.z );\",\n\n\t\t\t\"dist = smoothstep( -feather, feather, dist );\",\n\t\t\t\"inorout += dist.x;\",\n\n\t\t\t\"return clamp( inorout, 0.0, 1.0 );\",\n\t\t\"}\",\n\n\t\t\"float bdepth(vec2 coords) {\",\n\t\t\t\"// Depth buffer blur\",\n\t\t\t\"float d = 0.0;\",\n\t\t\t\"float kernel[9];\",\n\t\t\t\"vec2 offset[9];\",\n\n\t\t\t\"vec2 wh = vec2(texel.x, texel.y) * dbsize;\",\n\n\t\t\t\"offset[0] = vec2(-wh.x,-wh.y);\",\n\t\t\t\"offset[1] = vec2( 0.0, -wh.y);\",\n\t\t\t\"offset[2] = vec2( wh.x -wh.y);\",\n\n\t\t\t\"offset[3] = vec2(-wh.x, 0.0);\",\n\t\t\t\"offset[4] = vec2( 0.0, 0.0);\",\n\t\t\t\"offset[5] = vec2( wh.x, 0.0);\",\n\n\t\t\t\"offset[6] = vec2(-wh.x, wh.y);\",\n\t\t\t\"offset[7] = vec2( 0.0, wh.y);\",\n\t\t\t\"offset[8] = vec2( wh.x, wh.y);\",\n\n\t\t\t\"kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;\",\n\t\t\t\"kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;\",\n\t\t\t\"kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;\",\n\n\n\t\t\t\"for( int i=0; i<9; i++ ) {\",\n\t\t\t\t\"float tmp = texture2D(tDepth, coords + offset[i]).r;\",\n\t\t\t\t\"d += tmp * kernel[i];\",\n\t\t\t\"}\",\n\n\t\t\t\"return d;\",\n\t\t\"}\",\n\n\n\t\t\"vec3 color(vec2 coords,float blur) {\",\n\t\t\t\"//processing the sample\",\n\n\t\t\t\"vec3 col = vec3(0.0);\",\n\n\t\t\t\"col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;\",\n\t\t\t\"col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;\",\n\t\t\t\"col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;\",\n\n\t\t\t\"vec3 lumcoeff = vec3(0.299,0.587,0.114);\",\n\t\t\t\"float lum = dot(col.rgb, lumcoeff);\",\n\t\t\t\"float thresh = max((lum-threshold)*gain, 0.0);\",\n\t\t\t\"return col+mix(vec3(0.0),col,thresh*blur);\",\n\t\t\"}\",\n\n\t\t\"vec2 rand(vec2 coord) {\",\n\t\t\t\"// generating noise / pattern texture for dithering\",\n\n\t\t\t\"float noiseX = ((fract(1.0-coord.s*(width/2.0))*0.25)+(fract(coord.t*(height/2.0))*0.75))*2.0-1.0;\",\n\t\t\t\"float noiseY = ((fract(1.0-coord.s*(width/2.0))*0.75)+(fract(coord.t*(height/2.0))*0.25))*2.0-1.0;\",\n\n\t\t\t\"if (noise) {\",\n\t\t\t\t\"noiseX = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233))) * 43758.5453),0.0,1.0)*2.0-1.0;\",\n\t\t\t\t\"noiseY = clamp(fract(sin(dot(coord ,vec2(12.9898,78.233)*2.0)) * 43758.5453),0.0,1.0)*2.0-1.0;\",\n\t\t\t\"}\",\n\n\t\t\t\"return vec2(noiseX,noiseY);\",\n\t\t\"}\",\n\n\t\t\"vec3 debugFocus(vec3 col, float blur, float depth) {\",\n\t\t\t\"float edge = 0.002*depth; //distance based edge smoothing\",\n\t\t\t\"float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);\",\n\t\t\t\"float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);\",\n\n\t\t\t\"col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);\",\n\t\t\t\"col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);\",\n\n\t\t\t\"return col;\",\n\t\t\"}\",\n\n\t\t\"float linearize(float depth) {\",\n\t\t\t\"return -zfar * znear / (depth * (zfar - znear) - zfar);\",\n\t\t\"}\",\n\n\n\t\t\"float vignette() {\",\n\t\t\t\"float dist = distance(vUv.xy, vec2(0.5,0.5));\",\n\t\t\t\"dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);\",\n\t\t\t\"return clamp(dist,0.0,1.0);\",\n\t\t\"}\",\n\n\t\t\"float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {\",\n\t\t\t\"float rings2 = float(rings);\",\n\t\t\t\"float step = PI*2.0 / float(ringsamples);\",\n\t\t\t\"float pw = cos(j*step)*i;\",\n\t\t\t\"float ph = sin(j*step)*i;\",\n\t\t\t\"float p = 1.0;\",\n\t\t\t\"if (pentagon) {\",\n\t\t\t\t\"p = penta(vec2(pw,ph));\",\n\t\t\t\"}\",\n\t\t\t\"col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;\",\n\t\t\t\"return 1.0 * mix(1.0, i /rings2, bias) * p;\",\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\t\t\t\"//scene depth calculation\",\n\n\t\t\t\"float depth = linearize(texture2D(tDepth,vUv.xy).x);\",\n\n\t\t\t\"// Blur depth?\",\n\t\t\t\"if (depthblur) {\",\n\t\t\t\t\"depth = linearize(bdepth(vUv.xy));\",\n\t\t\t\"}\",\n\n\t\t\t\"//focal plane calculation\",\n\n\t\t\t\"float fDepth = focalDepth;\",\n\n\t\t\t\"if (autofocus) {\",\n\n\t\t\t\t\"fDepth = linearize(texture2D(tDepth,focusCoords).x);\",\n\n\t\t\t\"}\",\n\n\t\t\t\"// dof blur factor calculation\",\n\n\t\t\t\"float blur = 0.0;\",\n\n\t\t\t\"if (manualdof) {\",\n\t\t\t\t\"float a = depth-fDepth; // Focal plane\",\n\t\t\t\t\"float b = (a-fdofstart)/fdofdist; // Far DoF\",\n\t\t\t\t\"float c = (-a-ndofstart)/ndofdist; // Near Dof\",\n\t\t\t\t\"blur = (a>0.0) ? b : c;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"float f = focalLength; // focal length in mm\",\n\t\t\t\t\"float d = fDepth*1000.0; // focal plane in mm\",\n\t\t\t\t\"float o = depth*1000.0; // depth in mm\",\n\n\t\t\t\t\"float a = (o*f)/(o-f);\",\n\t\t\t\t\"float b = (d*f)/(d-f);\",\n\t\t\t\t\"float c = (d-f)/(d*fstop*CoC);\",\n\n\t\t\t\t\"blur = abs(a-b)*c;\",\n\t\t\t\"}\",\n\n\t\t\t\"blur = clamp(blur,0.0,1.0);\",\n\n\t\t\t\"// calculation of pattern for dithering\",\n\n\t\t\t\"vec2 noise = rand(vUv.xy)*namount*blur;\",\n\n\t\t\t\"// getting blur x and y step factor\",\n\n\t\t\t\"float w = (1.0/width)*blur*maxblur+noise.x;\",\n\t\t\t\"float h = (1.0/height)*blur*maxblur+noise.y;\",\n\n\t\t\t\"// calculation of final color\",\n\n\t\t\t\"vec3 col = vec3(0.0);\",\n\n\t\t\t\"if(blur < 0.05) {\",\n\t\t\t\t\"//some optimization thingy\",\n\t\t\t\t\"col = texture2D(tColor, vUv.xy).rgb;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"col = texture2D(tColor, vUv.xy).rgb;\",\n\t\t\t\t\"float s = 1.0;\",\n\t\t\t\t\"int ringsamples;\",\n\n\t\t\t\t\"for (int i = 1; i <= rings; i++) {\",\n\t\t\t\t\t\"/*unboxstart*/\",\n\t\t\t\t\t\"ringsamples = i * samples;\",\n\n\t\t\t\t\t\"for (int j = 0 ; j < maxringsamples ; j++) {\",\n\t\t\t\t\t\t\"if (j >= ringsamples) break;\",\n\t\t\t\t\t\t\"s += gather(float(i), float(j), ringsamples, col, w, h, blur);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"/*unboxend*/\",\n\t\t\t\t\"}\",\n\n\t\t\t\t\"col /= s; //divide by sample count\",\n\t\t\t\"}\",\n\n\t\t\t\"if (showFocus) {\",\n\t\t\t\t\"col = debugFocus(col, blur, depth);\",\n\t\t\t\"}\",\n\n\t\t\t\"if (vignetting) {\",\n\t\t\t\t\"col *= vignette();\",\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor.rgb = col;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\t\t\"} \"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader.js",
"module-type": "library",
"text": "/**\n * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n *\n * Edge Detection Shader using Frei-Chen filter\n * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n *\n * aspect: vec2 of (1/width, 1/height)\n */\n\nTHREE.EdgeShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"aspect\": { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform vec2 aspect;\",\n\n\t\t\"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\",\n\n\n\t\t\"mat3 G[9];\",\n\n\t\t// hard coded matrix values!!!! as suggested in https://github.com/neilmendoza/ofxPostProcessing/blob/master/src/EdgePass.cpp#L45\n\n\t\t\"const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );\",\n\t\t\"const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );\",\n\t\t\"const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );\",\n\t\t\"const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );\",\n\t\t\"const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );\",\n\t\t\"const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );\",\n\t\t\"const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );\",\n\t\t\"const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );\",\n\t\t\"const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );\",\n\n\t\t\"void main(void)\",\n\t\t\"{\",\n\n\t\t\t\"G[0] = g0,\",\n\t\t\t\"G[1] = g1,\",\n\t\t\t\"G[2] = g2,\",\n\t\t\t\"G[3] = g3,\",\n\t\t\t\"G[4] = g4,\",\n\t\t\t\"G[5] = g5,\",\n\t\t\t\"G[6] = g6,\",\n\t\t\t\"G[7] = g7,\",\n\t\t\t\"G[8] = g8;\",\n\n\t\t\t\"mat3 I;\",\n\t\t\t\"float cnv[9];\",\n\t\t\t\"vec3 sample;\",\n\n\t\t\t/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n\t\t\t\"for (float i=0.0; i<3.0; i++) {\",\n\t\t\t\t\"for (float j=0.0; j<3.0; j++) {\",\n\t\t\t\t\t\"sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\",\n\t\t\t\t\t\"I[int(i)][int(j)] = length(sample);\",\n\t\t\t\t\"}\",\n\t\t\t\"}\",\n\n\t\t\t/* calculate the convolution values for all the masks */\n\t\t\t\"for (int i=0; i<9; i++) {\",\n\t\t\t\t\"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\",\n\t\t\t\t\"cnv[i] = dp3 * dp3;\",\n\t\t\t\"}\",\n\n\t\t\t\"float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);\",\n\t\t\t\"float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);\",\n\n\t\t\t\"gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);\",\n\t\t\"}\",\n\n\t].join(\"\\n\")\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/EdgeShader2.js",
"module-type": "library",
"text": "/**\n * @author zz85 / https://github.com/zz85 | https://www.lab4games.net/zz85/blog\n *\n * Edge Detection Shader using Sobel filter\n * Based on http://rastergrid.com/blog/2011/01/frei-chen-edge-detector\n *\n * aspect: vec2 of (1/width, 1/height)\n */\n\nTHREE.EdgeShader2 = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"aspect\": { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\t\t\"uniform vec2 aspect;\",\n\n\n\t\t\"vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);\",\n\n\t\t\"mat3 G[2];\",\n\n\t\t\"const mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\",\n\t\t\"const mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\",\n\n\n\t\t\"void main(void)\",\n\t\t\"{\",\n\t\t\t\"mat3 I;\",\n\t\t\t\"float cnv[2];\",\n\t\t\t\"vec3 sample;\",\n\n\t\t\t\"G[0] = g0;\",\n\t\t\t\"G[1] = g1;\",\n\n\t\t\t/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */\n\t\t\t\"for (float i=0.0; i<3.0; i++)\",\n\t\t\t\"for (float j=0.0; j<3.0; j++) {\",\n\t\t\t\t\"sample = texture2D( tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;\",\n\t\t\t\t\"I[int(i)][int(j)] = length(sample);\",\n\t\t\t\"}\",\n\n\t\t\t/* calculate the convolution values for all the masks */\n\t\t\t\"for (int i=0; i<2; i++) {\",\n\t\t\t\t\"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\",\n\t\t\t\t\"cnv[i] = dp3 * dp3; \",\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));\",\n\t\t\"} \",\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/ConvolutionShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/ConvolutionShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Convolution shader\n * ported from o3d sample to WebGL / GLSL\n * http://o3d.googlecode.com/svn/trunk/samples/convolution.html\n */\n\nTHREE.ConvolutionShader = {\n\n\tdefines: {\n\n\t\t\"KERNEL_SIZE_FLOAT\": \"25.0\",\n\t\t\"KERNEL_SIZE_INT\": \"25\",\n\n\t},\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"uImageIncrement\": { type: \"v2\", value: new THREE.Vector2( 0.001953125, 0.0 ) },\n\t\t\"cKernel\": { type: \"fv1\", value: [] }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"uniform vec2 uImageIncrement;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float cKernel[ KERNEL_SIZE_INT ];\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec2 uImageIncrement;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 imageCoord = vUv;\",\n\t\t\t\"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\",\n\n\t\t\t\"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {\",\n\n\t\t\t\t\"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];\",\n\t\t\t\t\"imageCoord += uImageIncrement;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\n\t].join(\"\\n\"),\n\n\tbuildKernel: function ( sigma ) {\n\n\t\t// We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.\n\n\t\tfunction gauss( x, sigma ) {\n\n\t\t\treturn Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );\n\n\t\t}\n\n\t\tvar i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;\n\n\t\tif ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;\n\t\thalfWidth = ( kernelSize - 1 ) * 0.5;\n\n\t\tvalues = new Array( kernelSize );\n\t\tsum = 0.0;\n\t\tfor ( i = 0; i < kernelSize; ++i ) {\n\n\t\t\tvalues[ i ] = gauss( i - halfWidth, sigma );\n\t\t\tsum += values[ i ];\n\n\t\t}\n\n\t\t// normalize the kernel\n\n\t\tfor ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum;\n\n\t\treturn values;\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/UnpackDepthRGBAShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/UnpackDepthRGBAShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Unpack RGBA depth shader\n * - show RGBA encoded depth as monochrome color\n */\n\nTHREE.UnpackDepthRGBAShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t// RGBA depth\n\n\t\t\"float unpackDepth( const in vec4 rgba_depth ) {\",\n\n\t\t\t\"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\",\n\t\t\t\"float depth = dot( rgba_depth, bit_shift );\",\n\t\t\t\"return depth;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );\",\n\t\t\t\"gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BokehShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Depth-of-field shader with bokeh\n * ported from GLSL shader by Martins Upitis\n * http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html\n */\n\nTHREE.BokehShader = {\n\n\tuniforms: {\n\n\t\t\"tColor\": { type: \"t\", value: null },\n\t\t\"tDepth\": { type: \"t\", value: null },\n\t\t\"focus\": { type: \"f\", value: 1.0 },\n\t\t\"aspect\": { type: \"f\", value: 1.0 },\n\t\t\"aperture\": { type: \"f\", value: 0.025 },\n\t\t\"maxblur\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"uniform float maxblur;\", // max blur amount\n\t\t\"uniform float aperture;\", // aperture - bigger values for shallower depth of field\n\n\t\t\"uniform float focus;\",\n\t\t\"uniform float aspect;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 aspectcorrect = vec2( 1.0, aspect );\",\n\n\t\t\t\"vec4 depth1 = texture2D( tDepth, vUv );\",\n\n\t\t\t\"float factor = depth1.x - focus;\",\n\n\t\t\t\"vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );\",\n\n\t\t\t\"vec2 dofblur9 = dofblur * 0.9;\",\n\t\t\t\"vec2 dofblur7 = dofblur * 0.7;\",\n\t\t\t\"vec2 dofblur4 = dofblur * 0.4;\",\n\n\t\t\t\"vec4 col = vec4( 0.0 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );\",\n\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );\",\n\t\t\t\"col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );\",\n\n\t\t\t\"gl_FragColor = col / 41.0;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalTiltShiftShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalTiltShiftShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n * - \"r\" parameter control where \"focused\" horizontal line lies\n */\n\nTHREE.HorizontalTiltShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"h\": { type: \"f\", value: 1.0 / 512.0 },\n\t\t\"r\": { type: \"f\", value: 0.35 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float h;\",\n\t\t\"uniform float r;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"float hh = h * abs( r - vUv.y );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BrightnessContrastShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BrightnessContrastShader.js",
"module-type": "library",
"text": "/**\n * @author tapio / http://tapio.github.com/\n *\n * Brightness and contrast adjustment\n * https://github.com/evanw/glfx.js\n * brightness: -1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white)\n * contrast: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nTHREE.BrightnessContrastShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"brightness\": { type: \"f\", value: 0 },\n\t\t\"contrast\": { type: \"f\", value: 0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float brightness;\",\n\t\t\"uniform float contrast;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"gl_FragColor.rgb += brightness;\",\n\n\t\t\t\"if (contrast > 0.0) {\",\n\t\t\t\t\"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\",\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/DigitalGlitch.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/DigitalGlitch.js",
"module-type": "library",
"text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * RGB Shift Shader\n * Shifts red and blue channels from center in opposite directions\n * Ported from http://kriss.cx/tom/2009/05/rgb-shift/\n * by Tom Butterworth / http://kriss.cx/tom/\n *\n * amount: shift distance (1 is width of input)\n * angle: shift angle in radians\n */\n\nTHREE.DigitalGlitch = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\":\t\t{ type: \"t\", value: null },//diffuse texture\n\t\t\"tDisp\":\t\t{ type: \"t\", value: null },//displacement texture for digital glitch squares\n\t\t\"byp\":\t\t\t{ type: \"i\", value: 0 },//apply the glitch ?\n\t\t\"amount\":\t\t{ type: \"f\", value: 0.08 },\n\t\t\"angle\":\t\t{ type: \"f\", value: 0.02 },\n\t\t\"seed\":\t\t\t{ type: \"f\", value: 0.02 },\n\t\t\"seed_x\":\t\t{ type: \"f\", value: 0.02 },//-1,1\n\t\t\"seed_y\":\t\t{ type: \"f\", value: 0.02 },//-1,1\n\t\t\"distortion_x\":\t{ type: \"f\", value: 0.5 },\n\t\t\"distortion_y\":\t{ type: \"f\", value: 0.6 },\n\t\t\"col_s\":\t\t{ type: \"f\", value: 0.05 }\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\t\t\"void main() {\",\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\"}\"\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\t\t\"uniform int byp;\",//should we apply the glitch ?\n\t\t\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform sampler2D tDisp;\",\n\t\t\n\t\t\"uniform float amount;\",\n\t\t\"uniform float angle;\",\n\t\t\"uniform float seed;\",\n\t\t\"uniform float seed_x;\",\n\t\t\"uniform float seed_y;\",\n\t\t\"uniform float distortion_x;\",\n\t\t\"uniform float distortion_y;\",\n\t\t\"uniform float col_s;\",\n\t\t\t\n\t\t\"varying vec2 vUv;\",\n\t\t\n\t\t\n\t\t\"float rand(vec2 co){\",\n\t\t\t\"return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\",\n\t\t\"}\",\n\t\t\t\t\n\t\t\"void main() {\",\n\t\t\t\"if(byp<1) {\",\n\t\t\t\t\"vec2 p = vUv;\",\n\t\t\t\t\"float xs = floor(gl_FragCoord.x / 0.5);\",\n\t\t\t\t\"float ys = floor(gl_FragCoord.y / 0.5);\",\n\t\t\t\t//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch\n\t\t\t\t\"vec4 normal = texture2D (tDisp, p*seed*seed);\",\n\t\t\t\t\"if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {\",\n\t\t\t\t\t\"if(seed_x>0.){\",\n\t\t\t\t\t\t\"p.y = 1. - (p.y + distortion_y);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"else {\",\n\t\t\t\t\t\t\"p.y = distortion_y;\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\"}\",\n\t\t\t\t\"if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {\",\n\t\t\t\t\t\"if(seed_y>0.){\",\n\t\t\t\t\t\t\"p.x=distortion_x;\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\t\"else {\",\n\t\t\t\t\t\t\"p.x = 1. - (p.x + distortion_x);\",\n\t\t\t\t\t\"}\",\n\t\t\t\t\"}\",\n\t\t\t\t\"p.x+=normal.x*seed_x*(seed/5.);\",\n\t\t\t\t\"p.y+=normal.y*seed_y*(seed/5.);\",\n\t\t\t\t//base from RGB shift shader\n\t\t\t\t\"vec2 offset = amount * vec2( cos(angle), sin(angle));\",\n\t\t\t\t\"vec4 cr = texture2D(tDiffuse, p + offset);\",\n\t\t\t\t\"vec4 cga = texture2D(tDiffuse, p);\",\n\t\t\t\t\"vec4 cb = texture2D(tDiffuse, p - offset);\",\n\t\t\t\t\"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);\",\n\t\t\t\t//add noise\n\t\t\t\t\"vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);\",\n\t\t\t\t\"gl_FragColor = gl_FragColor+ snow;\",\n\t\t\t\"}\",\n\t\t\t\"else {\",\n\t\t\t\t\"gl_FragColor=texture2D (tDiffuse, vUv);\",\n\t\t\t\"}\",\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/KaleidoShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/KaleidoShader.js",
"module-type": "library",
"text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * Kaleidoscope Shader\n * Radial reflection around center point\n * Ported from: http://pixelshaders.com/editor/\n * by Toby Schachman / http://tobyschachman.com/\n *\n * sides: number of reflections\n * angle: initial angle in radians\n */\n\nTHREE.KaleidoShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"sides\": { type: \"f\", value: 6.0 },\n\t\t\"angle\": { type: \"f\", value: 0.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float sides;\",\n\t\t\"uniform float angle;\",\n\t\t\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 p = vUv - 0.5;\",\n\t\t\t\"float r = length(p);\",\n\t\t\t\"float a = atan(p.y, p.x) + angle;\",\n\t\t\t\"float tau = 2. * 3.1416 ;\",\n\t\t\t\"a = mod(a, tau/sides);\",\n\t\t\t\"a = abs(a - tau/sides/2.) ;\",\n\t\t\t\"p = r * vec2(cos(a), sin(a));\",\n\t\t\t\"vec4 color = texture2D(tDiffuse, p + 0.5);\",\n\t\t\t\"gl_FragColor = color;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/VerticalBlurShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalBlurShader.js",
"module-type": "library",
"text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Two pass Gaussian blur filter (horizontal and vertical blur shaders)\n * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/\n * and used in http://www.cake23.de/traveling-wavefronts-lit-up.html\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n */\n\nTHREE.VerticalBlurShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"v\": { type: \"f\", value: 1.0 / 512.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float v;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/NormalMapShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/NormalMapShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from heightmap\n */\n\nTHREE.NormalMapShader = {\n\n\tuniforms: {\n\n\t\t\"heightMap\": { type: \"t\", value: null },\n\t\t\"resolution\": { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t\t\"scale\": { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\t\t\"height\": { type: \"f\", value: 0.05 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float height;\",\n\t\t\"uniform vec2 resolution;\",\n\t\t\"uniform sampler2D heightMap;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"float val = texture2D( heightMap, vUv ).x;\",\n\n\t\t\t\"float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;\",\n\t\t\t\"float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;\",\n\n\t\t\t\"gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/ColorifyShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/ColorifyShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Colorify shader\n */\n\nTHREE.ColorifyShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"color\": { type: \"c\", value: new THREE.Color( 0xffffff ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec3 color;\",\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\t\t\t\"float v = dot( texel.xyz, luma );\",\n\n\t\t\t\"gl_FragColor = vec4( v * color, texel.w );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/TechnicolorShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/TechnicolorShader.js",
"module-type": "library",
"text": "/**\n * @author flimshaw / http://charliehoey.com\n *\n * Technicolor Shader\n * Simulates the look of the two-strip technicolor process popular in early 20th century films.\n * More historical info here: http://www.widescreenmuseum.com/oldcolor/technicolor1.htm\n * Demo here: http://charliehoey.com/technicolor_shader/shader_test.html\n */\n\nTHREE.TechnicolorShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );\",\n\t\t\t\"vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);\",\n\n\t\t\t\"gl_FragColor = newTex;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/DotScreenShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/DotScreenShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Dot screen shader\n * based on glfx.js sepia shader\n * https://github.com/evanw/glfx.js\n */\n\nTHREE.DotScreenShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"tSize\": { type: \"v2\", value: new THREE.Vector2( 256, 256 ) },\n\t\t\"center\": { type: \"v2\", value: new THREE.Vector2( 0.5, 0.5 ) },\n\t\t\"angle\": { type: \"f\", value: 1.57 },\n\t\t\"scale\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform vec2 center;\",\n\t\t\"uniform float angle;\",\n\t\t\"uniform float scale;\",\n\t\t\"uniform vec2 tSize;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"float pattern() {\",\n\n\t\t\t\"float s = sin( angle ), c = cos( angle );\",\n\n\t\t\t\"vec2 tex = vUv * tSize - center;\",\n\t\t\t\"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;\",\n\n\t\t\t\"return ( sin( point.x ) * sin( point.y ) ) * 4.0;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"float average = ( color.r + color.g + color.b ) / 3.0;\",\n\n\t\t\t\"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/LuminosityShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/LuminosityShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Luminosity\n * http://en.wikipedia.org/wiki/Luminosity\n */\n\nTHREE.LuminosityShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\n\t\t\t\"float v = dot( texel.xyz, luma );\",\n\n\t\t\t\"gl_FragColor = vec4( v, v, v, texel.w );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalBlurShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/HorizontalBlurShader.js",
"module-type": "library",
"text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Two pass Gaussian blur filter (horizontal and vertical blur shaders)\n * - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/\n * and used in http://www.cake23.de/traveling-wavefronts-lit-up.html\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n */\n\nTHREE.HorizontalBlurShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"h\": { type: \"f\", value: 1.0 / 512.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float h;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/FilmShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/FilmShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Film grain & scanlines shader\n *\n * - ported from HLSL to WebGL / GLSL\n * http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html\n *\n * Screen Space Static Postprocessor\n *\n * Produces an analogue noise overlay similar to a film grain / TV static\n *\n * Original implementation and noise algorithm\n * Pat 'Hawthorne' Shearon\n *\n * Optimized scanlines + noise version with intensity scaling\n * Georg 'Leviathan' Steinrohder\n *\n * This version is provided under a Creative Commons Attribution 3.0 License\n * http://creativecommons.org/licenses/by/3.0/\n */\n\nTHREE.FilmShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"time\": { type: \"f\", value: 0.0 },\n\t\t\"nIntensity\": { type: \"f\", value: 0.5 },\n\t\t\"sIntensity\": { type: \"f\", value: 0.05 },\n\t\t\"sCount\": { type: \"f\", value: 4096 },\n\t\t\"grayscale\": { type: \"i\", value: 1 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t// control parameter\n\t\t\"uniform float time;\",\n\n\t\t\"uniform bool grayscale;\",\n\n\t\t// noise effect intensity value (0 = no effect, 1 = full effect)\n\t\t\"uniform float nIntensity;\",\n\n\t\t// scanlines effect intensity value (0 = no effect, 1 = full effect)\n\t\t\"uniform float sIntensity;\",\n\n\t\t// scanlines effect count value (0 = no effect, 4096 = full effect)\n\t\t\"uniform float sCount;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t// sample the source\n\t\t\t\"vec4 cTextureScreen = texture2D( tDiffuse, vUv );\",\n\n\t\t\t// make some noise\n\t\t\t\"float x = vUv.x * vUv.y * time * 1000.0;\",\n\t\t\t\"x = mod( x, 13.0 ) * mod( x, 123.0 );\",\n\t\t\t\"float dx = mod( x, 0.01 );\",\n\n\t\t\t// add noise\n\t\t\t\"vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );\",\n\n\t\t\t// get us a sine and cosine\n\t\t\t\"vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );\",\n\n\t\t\t// add scanlines\n\t\t\t\"cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;\",\n\n\t\t\t// interpolate between source and result by intensity\n\t\t\t\"cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );\",\n\n\t\t\t// convert to grayscale if desired\n\t\t\t\"if( grayscale ) {\",\n\n\t\t\t\t\"cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = vec4( cResult, cTextureScreen.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/FresnelShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/FresnelShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Based on Nvidia Cg tutorial\n */\n\nTHREE.FresnelShader = {\n\n\tuniforms: {\n\n\t\t\"mRefractionRatio\": { type: \"f\", value: 1.02 },\n\t\t\"mFresnelBias\": { type: \"f\", value: 0.1 },\n\t\t\"mFresnelPower\": { type: \"f\", value: 2.0 },\n\t\t\"mFresnelScale\": { type: \"f\", value: 1.0 },\n\t\t\"tCube\": { type: \"t\", value: null }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"uniform float mRefractionRatio;\",\n\t\t\"uniform float mFresnelBias;\",\n\t\t\"uniform float mFresnelScale;\",\n\t\t\"uniform float mFresnelPower;\",\n\n\t\t\"varying vec3 vReflect;\",\n\t\t\"varying vec3 vRefract[3];\",\n\t\t\"varying float vReflectionFactor;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\",\n\n\t\t\t\"vec3 I = worldPosition.xyz - cameraPosition;\",\n\n\t\t\t\"vReflect = reflect( I, worldNormal );\",\n\t\t\t\"vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );\",\n\t\t\t\"vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );\",\n\t\t\t\"vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );\",\n\t\t\t\"vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );\",\n\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform samplerCube tCube;\",\n\n\t\t\"varying vec3 vReflect;\",\n\t\t\"varying vec3 vRefract[3];\",\n\t\t\"varying float vReflectionFactor;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\",\n\t\t\t\"vec4 refractedColor = vec4( 1.0 );\",\n\n\t\t\t\"refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\",\n\t\t\t\"refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\",\n\t\t\t\"refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\",\n\n\t\t\t\"gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/MirrorShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/MirrorShader.js",
"module-type": "library",
"text": "/**\n * @author felixturner / http://airtight.cc/\n *\n * Mirror Shader\n * Copies half the input to the other half\n *\n * side: side of input to mirror (0 = left, 1 = right, 2 = top, 3 = bottom)\n */\n\nTHREE.MirrorShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"side\": { type: \"i\", value: 1 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform int side;\",\n\t\t\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 p = vUv;\",\n\t\t\t\"if (side == 0){\",\n\t\t\t\t\"if (p.x > 0.5) p.x = 1.0 - p.x;\",\n\t\t\t\"}else if (side == 1){\",\n\t\t\t\t\"if (p.x < 0.5) p.x = 1.0 - p.x;\",\n\t\t\t\"}else if (side == 2){\",\n\t\t\t\t\"if (p.y < 0.5) p.y = 1.0 - p.y;\",\n\t\t\t\"}else if (side == 3){\",\n\t\t\t\t\"if (p.y > 0.5) p.y = 1.0 - p.y;\",\n\t\t\t\"} \",\n\t\t\t\"vec4 color = texture2D(tDiffuse, p);\",\n\t\t\t\"gl_FragColor = color;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/DOFMipMapShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/DOFMipMapShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Depth-of-field shader using mipmaps\n * - from Matt Handley @applmak\n * - requires power-of-2 sized render target with enabled mipmaps\n */\n\nTHREE.DOFMipMapShader = {\n\n\tuniforms: {\n\n\t\t\"tColor\": { type: \"t\", value: null },\n\t\t\"tDepth\": { type: \"t\", value: null },\n\t\t\"focus\": { type: \"f\", value: 1.0 },\n\t\t\"maxblur\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float focus;\",\n\t\t\"uniform float maxblur;\",\n\n\t\t\"uniform sampler2D tColor;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 depth = texture2D( tDepth, vUv );\",\n\n\t\t\t\"float factor = depth.x - focus;\",\n\n\t\t\t\"vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );\",\n\n\t\t\t\"gl_FragColor = col;\",\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/HueSaturationShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/HueSaturationShader.js",
"module-type": "library",
"text": "/**\n * @author tapio / http://tapio.github.com/\n *\n * Hue and saturation adjustment\n * https://github.com/evanw/glfx.js\n * hue: -1 to 1 (-1 is 180 degrees in the negative direction, 0 is no change, etc.\n * saturation: -1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast)\n */\n\nTHREE.HueSaturationShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"hue\": { type: \"f\", value: 0 },\n\t\t\"saturation\": { type: \"f\", value: 0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float hue;\",\n\t\t\"uniform float saturation;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\n\t\t\t// hue\n\t\t\t\"float angle = hue * 3.14159265;\",\n\t\t\t\"float s = sin(angle), c = cos(angle);\",\n\t\t\t\"vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\",\n\t\t\t\"float len = length(gl_FragColor.rgb);\",\n\t\t\t\"gl_FragColor.rgb = vec3(\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.xyz),\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.zxy),\",\n\t\t\t\t\"dot(gl_FragColor.rgb, weights.yzx)\",\n\t\t\t\");\",\n\n\t\t\t// saturation\n\t\t\t\"float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\",\n\t\t\t\"if (saturation > 0.0) {\",\n\t\t\t\t\"gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\",\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\",\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/FXAAShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/FXAAShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author davidedc / http://www.sketchpatch.net/\n *\n * NVIDIA FXAA by Timothy Lottes\n * http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html\n * - WebGL port by @supereggbert\n * http://www.glge.org/demos/fxaa/\n */\n\nTHREE.FXAAShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"resolution\": { type: \"v2\", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec2 resolution;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"#define FXAA_REDUCE_MIN (1.0/128.0)\",\n\t\t\"#define FXAA_REDUCE_MUL (1.0/8.0)\",\n\t\t\"#define FXAA_SPAN_MAX 8.0\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;\",\n\t\t\t\"vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );\",\n\t\t\t\"vec3 rgbM = rgbaM.xyz;\",\n\t\t\t\"vec3 luma = vec3( 0.299, 0.587, 0.114 );\",\n\n\t\t\t\"float lumaNW = dot( rgbNW, luma );\",\n\t\t\t\"float lumaNE = dot( rgbNE, luma );\",\n\t\t\t\"float lumaSW = dot( rgbSW, luma );\",\n\t\t\t\"float lumaSE = dot( rgbSE, luma );\",\n\t\t\t\"float lumaM = dot( rgbM, luma );\",\n\t\t\t\"float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\",\n\t\t\t\"float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\",\n\n\t\t\t\"vec2 dir;\",\n\t\t\t\"dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\",\n\t\t\t\"dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\",\n\n\t\t\t\"float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\",\n\n\t\t\t\"float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\",\n\t\t\t\"dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\",\n\t\t\t\t \"max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\",\n\t\t\t\t\t\t\"dir * rcpDirMin)) * resolution;\",\n\t\t\t\"vec4 rgbA = (1.0/2.0) * (\",\n \t\"texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (1.0/3.0 - 0.5)) +\",\n\t\t\t\"texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (2.0/3.0 - 0.5)));\",\n \t\t\"vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\",\n\t\t\t\"texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (0.0/3.0 - 0.5)) +\",\n \t\t\"texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (3.0/3.0 - 0.5)));\",\n \t\t\"float lumaB = dot(rgbB, vec4(luma, 0.0));\",\n\n\t\t\t\"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {\",\n\n\t\t\t\t\"gl_FragColor = rgbA;\",\n\n\t\t\t\"} else {\",\n\t\t\t\t\"gl_FragColor = rgbB;\",\n\n\t\t\t\"}\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BasicShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BasicShader.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://www.mrdoob.com\n *\n * Simple test shader\n */\n\nTHREE.BasicShader = {\n\n\tuniforms: {},\n\n\tvertexShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/FocusShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/FocusShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Focus shader\n * based on PaintEffect postprocess from ro.me\n * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n */\n\nTHREE.FocusShader = {\n\n\tuniforms : {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"screenWidth\": { type: \"f\", value: 1024 },\n\t\t\"screenHeight\": { type: \"f\", value: 1024 },\n\t\t\"sampleDistance\": { type: \"f\", value: 0.94 },\n\t\t\"waveFactor\": { type: \"f\", value: 0.00125 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float screenWidth;\",\n\t\t\"uniform float screenHeight;\",\n\t\t\"uniform float sampleDistance;\",\n\t\t\"uniform float waveFactor;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color, org, tmp, add;\",\n\t\t\t\"float sample_dist, f;\",\n\t\t\t\"vec2 vin;\",\n\t\t\t\"vec2 uv = vUv;\",\n\n\t\t\t\"add = color = org = texture2D( tDiffuse, uv );\",\n\n\t\t\t\"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );\",\n\t\t\t\"sample_dist = dot( vin, vin ) * 2.0;\",\n\n\t\t\t\"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;\",\n\n\t\t\t\"vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );\",\n\t\t\t\"if( tmp.b < color.b ) color = tmp;\",\n\n\t\t\t\"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );\",\n\t\t\t\"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );\",\n\n\t\t\t\"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );\",\n\n\t\t\"}\"\n\n\n\t].join(\"\\n\")\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/VerticalTiltShiftShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/VerticalTiltShiftShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position\n *\n * - 9 samples per pass\n * - standard deviation 2.7\n * - \"h\" and \"v\" parameters should be set to \"1 / width\" and \"1 / height\"\n * - \"r\" parameter control where \"focused\" horizontal line lies\n */\n\nTHREE.VerticalTiltShiftShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"v\": { type: \"f\", value: 1.0 / 512.0 },\n\t\t\"r\": { type: \"f\", value: 0.35 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform float v;\",\n\t\t\"uniform float r;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 sum = vec4( 0.0 );\",\n\n\t\t\t\"float vv = v * abs( r - vUv.y );\",\n\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;\",\n\t\t\t\"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;\",\n\n\t\t\t\"gl_FragColor = sum;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/SepiaShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/SepiaShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Sepia tone shader\n * based on glfx.js sepia shader\n * https://github.com/evanw/glfx.js\n */\n\nTHREE.SepiaShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"amount\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float amount;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\t\t\t\"vec3 c = color.rgb;\",\n\n\t\t\t\"color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );\",\n\t\t\t\"color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );\",\n\t\t\t\"color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );\",\n\n\t\t\t\"gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/CopyShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/CopyShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Full-screen textured quad shader\n */\n\nTHREE.CopyShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\t\t\t\"gl_FragColor = opacity * texel;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/ColorCorrectionShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/ColorCorrectionShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Color correction\n */\n\nTHREE.ColorCorrectionShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"powRGB\": { type: \"v3\", value: new THREE.Vector3( 2, 2, 2 ) },\n\t\t\"mulRGB\": { type: \"v3\", value: new THREE.Vector3( 1, 1, 1 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform vec3 powRGB;\",\n\t\t\"uniform vec3 mulRGB;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"gl_FragColor = texture2D( tDiffuse, vUv );\",\n\t\t\t\"gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/SSAOShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/SSAOShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Screen-space ambient occlusion shader\n * - ported from\n * SSAO GLSL shader v1.2\n * assembled by Martins Upitis (martinsh) (http://devlog-martinsh.blogspot.com)\n * original technique is made by ArKano22 (http://www.gamedev.net/topic/550699-ssao-no-halo-artifacts/)\n * - modifications\n * - modified to use RGBA packed depth texture (use clear color 1,1,1,1 for depth pass)\n * - refactoring and optimizations\n */\n\nTHREE.SSAOShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"tDepth\": { type: \"t\", value: null },\n\t\t\"size\": { type: \"v2\", value: new THREE.Vector2( 512, 512 ) },\n\t\t\"cameraNear\": { type: \"f\", value: 1 },\n\t\t\"cameraFar\": { type: \"f\", value: 100 },\n\t\t\"onlyAO\": { type: \"i\", value: 0 },\n\t\t\"aoClamp\": { type: \"f\", value: 0.5 },\n\t\t\"lumInfluence\": { type: \"f\", value: 0.5 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float cameraNear;\",\n\t\t\"uniform float cameraFar;\",\n\n\t\t\"uniform bool onlyAO;\", // use only ambient occlusion pass?\n\n\t\t\"uniform vec2 size;\", // texture width, height\n\t\t\"uniform float aoClamp;\", // depth clamp - reduces haloing at screen edges\n\n\t\t\"uniform float lumInfluence;\", // how much luminance affects occlusion\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\t\t\"uniform sampler2D tDepth;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t// \"#define PI 3.14159265\",\n\t\t\"#define DL 2.399963229728653\", // PI * ( 3.0 - sqrt( 5.0 ) )\n\t\t\"#define EULER 2.718281828459045\",\n\n\t\t// helpers\n\n\t\t\"float width = size.x;\", // texture width\n\t\t\"float height = size.y;\", // texture height\n\n\t\t\"float cameraFarPlusNear = cameraFar + cameraNear;\",\n\t\t\"float cameraFarMinusNear = cameraFar - cameraNear;\",\n\t\t\"float cameraCoef = 2.0 * cameraNear;\",\n\n\t\t// user variables\n\n\t\t\"const int samples = 8;\", // ao sample count\n\t\t\"const float radius = 5.0;\", // ao radius\n\n\t\t\"const bool useNoise = false;\", // use noise instead of pattern for sample dithering\n\t\t\"const float noiseAmount = 0.0003;\", // dithering amount\n\n\t\t\"const float diffArea = 0.4;\", // self-shadowing reduction\n\t\t\"const float gDisplace = 0.4;\", // gauss bell center\n\n\n\t\t// RGBA depth\n\n\t\t\"float unpackDepth( const in vec4 rgba_depth ) {\",\n\n\t\t\t\"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\",\n\t\t\t\"float depth = dot( rgba_depth, bit_shift );\",\n\t\t\t\"return depth;\",\n\n\t\t\"}\",\n\n\t\t// generating noise / pattern texture for dithering\n\n\t\t\"vec2 rand( const vec2 coord ) {\",\n\n\t\t\t\"vec2 noise;\",\n\n\t\t\t\"if ( useNoise ) {\",\n\n\t\t\t\t\"float nx = dot ( coord, vec2( 12.9898, 78.233 ) );\",\n\t\t\t\t\"float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );\",\n\n\t\t\t\t\"noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );\",\n\t\t\t\t\"float gg = fract( coord.t * ( height / 2.0 ) );\",\n\n\t\t\t\t\"noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"return ( noise * 2.0 - 1.0 ) * noiseAmount;\",\n\n\t\t\"}\",\n\n\t\t\"float readDepth( const in vec2 coord ) {\",\n\n\t\t\t// \"return ( 2.0 * cameraNear ) / ( cameraFar + cameraNear - unpackDepth( texture2D( tDepth, coord ) ) * ( cameraFar - cameraNear ) );\",\n\t\t\t\"return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );\",\n\n\n\t\t\"}\",\n\n\t\t\"float compareDepths( const in float depth1, const in float depth2, inout int far ) {\",\n\n\t\t\t\"float garea = 2.0;\", // gauss bell width\n\t\t\t\"float diff = ( depth1 - depth2 ) * 100.0;\", // depth difference (0-100)\n\n\t\t\t// reduce left bell width to avoid self-shadowing\n\n\t\t\t\"if ( diff < gDisplace ) {\",\n\n\t\t\t\t\"garea = diffArea;\",\n\n\t\t\t\"} else {\",\n\n\t\t\t\t\"far = 1;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float dd = diff - gDisplace;\",\n\t\t\t\"float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );\",\n\t\t\t\"return gauss;\",\n\n\t\t\"}\",\n\n\t\t\"float calcAO( float depth, float dw, float dh ) {\",\n\n\t\t\t\"float dd = radius - depth * radius;\",\n\t\t\t\"vec2 vv = vec2( dw, dh );\",\n\n\t\t\t\"vec2 coord1 = vUv + dd * vv;\",\n\t\t\t\"vec2 coord2 = vUv - dd * vv;\",\n\n\t\t\t\"float temp1 = 0.0;\",\n\t\t\t\"float temp2 = 0.0;\",\n\n\t\t\t\"int far = 0;\",\n\t\t\t\"temp1 = compareDepths( depth, readDepth( coord1 ), far );\",\n\n\t\t\t// DEPTH EXTRAPOLATION\n\n\t\t\t\"if ( far > 0 ) {\",\n\n\t\t\t\t\"temp2 = compareDepths( readDepth( coord2 ), depth, far );\",\n\t\t\t\t\"temp1 += ( 1.0 - temp1 ) * temp2;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"return temp1;\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec2 noise = rand( vUv );\",\n\t\t\t\"float depth = readDepth( vUv );\",\n\n\t\t\t\"float tt = clamp( depth, aoClamp, 1.0 );\",\n\n\t\t\t\"float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );\",\n\t\t\t\"float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );\",\n\n\t\t\t\"float ao = 0.0;\",\n\n\t\t\t\"float dz = 1.0 / float( samples );\",\n\t\t\t\"float z = 1.0 - dz / 2.0;\",\n\t\t\t\"float l = 0.0;\",\n\n\t\t\t\"for ( int i = 0; i <= samples; i ++ ) {\",\n\n\t\t\t\t\"float r = sqrt( 1.0 - z );\",\n\n\t\t\t\t\"float pw = cos( l ) * r;\",\n\t\t\t\t\"float ph = sin( l ) * r;\",\n\t\t\t\t\"ao += calcAO( depth, pw * w, ph * h );\",\n\t\t\t\t\"z = z - dz;\",\n\t\t\t\t\"l = l + DL;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"ao /= float( samples );\",\n\t\t\t\"ao = 1.0 - ao;\",\n\n\t\t\t\"vec3 color = texture2D( tDiffuse, vUv ).rgb;\",\n\n\t\t\t\"vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );\",\n\t\t\t\"float lum = dot( color.rgb, lumcoeff );\",\n\t\t\t\"vec3 luminance = vec3( lum );\",\n\n\t\t\t\"vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\", // mix( color * ao, white, luminance )\n\n\t\t\t\"if ( onlyAO ) {\",\n\n\t\t\t\t\"final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );\", // ambient occlusion only\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = vec4( final, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/VignetteShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/VignetteShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Vignette shader\n * based on PaintEffect postprocess from ro.me\n * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js\n */\n\nTHREE.VignetteShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"offset\": { type: \"f\", value: 1.0 },\n\t\t\"darkness\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float offset;\",\n\t\t\"uniform float darkness;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t// Eskil's vignette\n\n\t\t\t\"vec4 texel = texture2D( tDiffuse, vUv );\",\n\t\t\t\"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );\",\n\t\t\t\"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );\",\n\n\t\t\t/*\n\t\t\t// alternative version from glfx.js\n\t\t\t// this one makes more \"dusty\" look (as opposed to \"burned\")\n\n\t\t\t\"vec4 color = texture2D( tDiffuse, vUv );\",\n\t\t\t\"float dist = distance( vUv, vec2( 0.5 ) );\",\n\t\t\t\"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );\",\n\t\t\t\"gl_FragColor = color;\",\n\t\t\t*/\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/TriangleBlurShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/TriangleBlurShader.js",
"module-type": "library",
"text": "/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * Triangle blur shader\n * based on glfx.js triangle blur shader\n * https://github.com/evanw/glfx.js\n *\n * A basic blur filter, which convolves the image with a\n * pyramid filter. The pyramid filter is separable and is applied as two\n * perpendicular triangle filters.\n */\n\nTHREE.TriangleBlurShader = {\n\n\tuniforms : {\n\n\t\t\"texture\": { type: \"t\", value: null },\n\t\t\"delta\": { type: \"v2\", value:new THREE.Vector2( 1, 1 ) }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"#define ITERATIONS 10.0\",\n\n\t\t\"uniform sampler2D texture;\",\n\t\t\"uniform vec2 delta;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"float random( vec3 scale, float seed ) {\",\n\n\t\t\t// use the fragment position for a different seed per-pixel\n\n\t\t\t\"return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );\",\n\n\t\t\"}\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 color = vec4( 0.0 );\",\n\n\t\t\t\"float total = 0.0;\",\n\n\t\t\t// randomize the lookup values to hide the fixed number of samples\n\n\t\t\t\"float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );\",\n\n\t\t\t\"for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {\",\n\n\t\t\t\t\"float percent = ( t + offset - 0.5 ) / ITERATIONS;\",\n\t\t\t\t\"float weight = 1.0 - abs( percent );\",\n\n\t\t\t\t\"color += texture2D( texture, vUv + delta * percent ) * weight;\",\n\t\t\t\t\"total += weight;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"gl_FragColor = color / total;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Shaders/BleachBypassShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Shaders/BleachBypassShader.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass]\n * - based on Nvidia example\n * http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass\n */\n\nTHREE.BleachBypassShader = {\n\n\tuniforms: {\n\n\t\t\"tDiffuse\": { type: \"t\", value: null },\n\t\t\"opacity\": { type: \"f\", value: 1.0 }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vUv = uv;\",\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\t\t\"uniform float opacity;\",\n\n\t\t\"uniform sampler2D tDiffuse;\",\n\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 base = texture2D( tDiffuse, vUv );\",\n\n\t\t\t\"vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );\",\n\t\t\t\"float lum = dot( lumCoeff, base.rgb );\",\n\t\t\t\"vec3 blend = vec3( lum );\",\n\n\t\t\t\"float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );\",\n\n\t\t\t\"vec3 result1 = 2.0 * base.rgb * blend;\",\n\t\t\t\"vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );\",\n\n\t\t\t\"vec3 newColor = mix( result1, result2, L );\",\n\n\t\t\t\"float A2 = opacity * base.a;\",\n\t\t\t\"vec3 mixRGB = A2 * newColor.rgb;\",\n\t\t\t\"mixRGB += ( ( 1.0 - A2 ) * base.rgb );\",\n\n\t\t\t\"gl_FragColor = vec4( mixRGB, base.a );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\")\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/BlendCharacterGui.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/BlendCharacterGui.js",
"module-type": "library",
"text": "/**\n * @author Michael Guerrero / http://realitymeltdown.com\n */\n\nfunction BlendCharacterGui(animations) {\n\n\tvar controls = {\n\n\t\tgui: null,\n\t\t\"Lock Camera\": false,\n\t\t\"Show Model\": true,\n\t\t\"Show Skeleton\": false,\n\t\t\"Time Scale\": 1.0,\n\t\t\"Step Size\": 0.016,\n\t\t\"Crossfade Time\": 3.5,\n\t\t\"idle\": 0.33,\n\t\t\"walk\": 0.33,\n\t\t\"run\": 0.33\n\n\t};\n\n\tvar animations = animations;\n\n\tthis.showModel = function() {\n\n\t\treturn controls['Show Model'];\n\n\t};\n\n\tthis.showSkeleton = function() {\n\n\t\treturn controls['Show Skeleton'];\n\n\t};\n\n\tthis.getTimeScale = function() {\n\n\t\treturn controls['Time Scale'];\n\n\t};\n\n\tthis.update = function() {\n\n\t\tcontrols[ 'idle'] = animations[ 'idle' ].weight;\n\t\tcontrols[ 'walk'] = animations[ 'walk' ].weight;\n\t\tcontrols[ 'run'] = animations[ 'run' ].weight;\n\n\t};\n\n\tvar init = function() {\n\n\t\tcontrols.gui = new dat.GUI();\n\n\t\tvar settings = controls.gui.addFolder( 'Settings' );\n\t\tvar playback = controls.gui.addFolder( 'Playback' );\n\t\tvar blending = controls.gui.addFolder( 'Blend Tuning' );\n\n\t\tsettings.add( controls, \"Lock Camera\" ).onChange( controls.lockCameraChanged );\n\t\tsettings.add( controls, \"Show Model\" ).onChange( controls.showModelChanged );\n\t\tsettings.add( controls, \"Show Skeleton\" ).onChange( controls.showSkeletonChanged );\n\t\tsettings.add( controls, \"Time Scale\", 0, 1, 0.01 );\n\t\tsettings.add( controls, \"Step Size\", 0.01, 0.1, 0.01 );\n\t\tsettings.add( controls, \"Crossfade Time\", 0.1, 6.0, 0.05 );\n\n\t\t// These controls execute functions\n\t\tplayback.add( controls, \"start\" );\n\t\tplayback.add( controls, \"pause\" );\n\t\tplayback.add( controls, \"step\" );\n\t\tplayback.add( controls, \"idle to walk\" );\n\t\tplayback.add( controls, \"walk to run\" );\n\t\tplayback.add( controls, \"warp walk to run\" );\n\n\t\tblending.add( controls, \"idle\", 0, 1, 0.01).listen().onChange( controls.weight );\n\t\tblending.add( controls, \"walk\", 0, 1, 0.01).listen().onChange( controls.weight );\n\t\tblending.add( controls, \"run\", 0, 1, 0.01).listen().onChange( controls.weight );\n\n\t\tsettings.open();\n\t\tplayback.open();\n\t\tblending.open();\n\n\t}\n\n\tvar getAnimationData = function() {\n\n\t\treturn {\n\n\t\t\tdetail: {\n\n\t\t\t\tanims: [ \"idle\", \"walk\", \"run\" ],\n\n\t\t\t\tweights: [ controls['idle'],\n\t\t\t\t\t\t controls['walk'],\n\t\t\t\t\t\t controls['run'] ]\n\t\t\t}\n\n\t\t};\n\t}\n\n\tcontrols.start = function() {\n\n\t\tvar startEvent = new CustomEvent( 'start-animation', getAnimationData() );\n\t\twindow.dispatchEvent(startEvent);\n\n\t};\n\n\tcontrols.stop = function() {\n\n\t\tvar stopEvent = new CustomEvent( 'stop-animation' );\n\t\twindow.dispatchEvent( stopEvent );\n\n\t};\n\n\tcontrols.pause = function() {\n\n\t\tvar pauseEvent = new CustomEvent( 'pause-animation' );\n\t\twindow.dispatchEvent( pauseEvent );\n\n\t};\n\n\tcontrols.step = function() {\n\n\t\tvar stepData = { detail: { stepSize: controls['Step Size'] } };\n\t\twindow.dispatchEvent( new CustomEvent('step-animation', stepData ));\n\n\t};\n\n\tcontrols.weight = function() {\n\n\t\t// renormalize\n\t\tvar sum = controls['idle'] + controls['walk'] + controls['run'];\n\t\tcontrols['idle'] /= sum;\n\t\tcontrols['walk'] /= sum;\n\t\tcontrols['run'] /= sum;\n\n\t\tvar weightEvent = new CustomEvent( 'weight-animation', getAnimationData() );\n\t\twindow.dispatchEvent(weightEvent);\n\t};\n\n\tcontrols.crossfade = function( from, to ) {\n\n\t\tvar fadeData = getAnimationData();\n\t\tfadeData.detail.from = from;\n\t\tfadeData.detail.to = to;\n\t\tfadeData.detail.time = controls[ \"Crossfade Time\" ];\n\n\t\twindow.dispatchEvent( new CustomEvent( 'crossfade', fadeData ) );\n\t}\n\n\tcontrols.warp = function( from, to ) {\n\n\t\tvar warpData = getAnimationData();\n\t\twarpData.detail.from = 'walk';\n\t\twarpData.detail.to = 'run';\n\t\twarpData.detail.time = controls[ \"Crossfade Time\" ];\n\n\t\twindow.dispatchEvent( new CustomEvent( 'warp', warpData ) );\n\t}\n\n\tcontrols['idle to walk'] = function() {\n\n\t\tcontrols.crossfade( 'idle', 'walk' );\n\n\t};\n\n\tcontrols['walk to run'] = function() {\n\n\t\tcontrols.crossfade( 'walk', 'run' );\n\n\t};\n\n\tcontrols['warp walk to run'] = function() {\n\n\t\tcontrols.warp( 'walk', 'run' );\n\n\t};\n\n\tcontrols.lockCameraChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldLock: controls['Lock Camera']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-lock-camera', data ) );\n\t}\n\n\tcontrols.showSkeletonChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldShow: controls['Show Skeleton']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-show-skeleton', data ) );\n\t}\n\n\n\tcontrols.showModelChanged = function() {\n\n\t\tvar data = {\n\t\t\tdetail: {\n\t\t\t\tshouldShow: controls['Show Model']\n\t\t\t}\n\t\t}\n\n\t\twindow.dispatchEvent( new CustomEvent( 'toggle-show-model', data ) );\n\t}\n\n\n\tinit.call(this);\n\n}"
},
"$:/plugins/rboue/Three.js/Lib/Curves/NURBSCurve.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSCurve.js",
"module-type": "library",
"text": "/**\n * @author renej\n * NURBS curve object\n *\n * Derives from Curve, overriding getPoint and getTangent.\n *\n * Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS curve\n **************************************************************/\n\nTHREE.NURBSCurve = function ( degree, knots /* array of reals */, controlPoints /* array of Vector(2|3|4) */) {\n\n\tthis.degree = degree;\n\tthis.knots = knots;\n\tthis.controlPoints = [];\n\tfor (var i = 0; i < controlPoints.length; ++i) { // ensure Vector4 for control points\n\t\tvar point = controlPoints[i];\n\t\tthis.controlPoints[i] = new THREE.Vector4(point.x, point.y, point.z, point.w);\n\t}\n\n};\n\n\nTHREE.NURBSCurve.prototype = Object.create( THREE.Curve.prototype );\n\n\nTHREE.NURBSCurve.prototype.getPoint = function ( t ) {\n\n\tvar u = this.knots[0] + t * (this.knots[this.knots.length - 1] - this.knots[0]); // linear mapping t->u\n\n\t// following results in (wx, wy, wz, w) homogeneous point\n\tvar hpoint = THREE.NURBSUtils.calcBSplinePoint(this.degree, this.knots, this.controlPoints, u);\n\n\tif (hpoint.w != 1.0) { // project to 3D space: (wx, wy, wz, w) -> (x, y, z, 1)\n\t\thpoint.divideScalar(hpoint.w);\n\t}\n\n\treturn new THREE.Vector3(hpoint.x, hpoint.y, hpoint.z);\n};\n\n\nTHREE.NURBSCurve.prototype.getTangent = function ( t ) {\n\n\tvar u = this.knots[0] + t * (this.knots[this.knots.length - 1] - this.knots[0]);\n\tvar ders = THREE.NURBSUtils.calcNURBSDerivatives(this.degree, this.knots, this.controlPoints, u, 1);\n\tvar tangent = ders[1].clone();\n\ttangent.normalize();\n\n\treturn tangent;\n};\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Curves/NURBSSurface.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSSurface.js",
"module-type": "library",
"text": "/**\n * @author renej\n * NURBS surface object\n *\n * Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS surface\n **************************************************************/\n\nTHREE.NURBSSurface = function ( degree1, degree2, knots1, knots2 /* arrays of reals */, controlPoints /* array^2 of Vector(2|3|4) */) {\n\n\tthis.degree1 = degree1;\n\tthis.degree2 = degree2;\n\tthis.knots1 = knots1;\n\tthis.knots2 = knots2;\n\tthis.controlPoints = [];\n\n\tvar len1 = knots1.length - degree1 - 1;\n\tvar len2 = knots2.length - degree2 - 1;\n\n\t// ensure Vector4 for control points\n\tfor (var i = 0; i < len1; ++i) {\n\t\tthis.controlPoints[i] = []\n\t\tfor (var j = 0; j < len2; ++j) {\n\t\t\tvar point = controlPoints[i][j];\n\t\t\tthis.controlPoints[i][j] = new THREE.Vector4(point.x, point.y, point.z, point.w);\n\t\t}\n\t}\n};\n\n\nTHREE.NURBSSurface.prototype = {\n\n\tconstructor: THREE.NURBSSurface,\n\n\tgetPoint: function ( t1, t2 ) {\n\n\t\tvar u = this.knots1[0] + t1 * (this.knots1[this.knots1.length - 1] - this.knots1[0]); // linear mapping t1->u\n\t\tvar v = this.knots2[0] + t2 * (this.knots2[this.knots2.length - 1] - this.knots2[0]); // linear mapping t2->u\n\n\t\treturn THREE.NURBSUtils.calcSurfacePoint(this.degree1, this.degree2, this.knots1, this.knots2, this.controlPoints, u, v);\n\t}\n};\n\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Curves/NURBSUtils.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Curves/NURBSUtils.js",
"module-type": "library",
"text": "/**\n * @author renej\n * NURBS utils\n *\n * See NURBSCurve and NURBSSurface.\n *\n **/\n\n\n/**************************************************************\n *\tNURBS Utils\n **************************************************************/\n\nTHREE.NURBSUtils = {\n\n\t/*\n\tFinds knot vector span.\n\n\tp : degree\n\tu : parametric value\n\tU : knot vector\n\t\n\treturns the span\n\t*/\n\tfindSpan: function( p, u, U ) {\n\t\tvar n = U.length - p - 1;\n\n\t\tif (u >= U[n]) {\n\t\t\treturn n - 1;\n\t\t}\n\n\t\tif (u <= U[p]) {\n\t\t\treturn p;\n\t\t}\n\n\t\tvar low = p;\n\t\tvar high = n;\n\t\tvar mid = Math.floor((low + high) / 2);\n\n\t\twhile (u < U[mid] || u >= U[mid + 1]) {\n\t\t \n\t\t\tif (u < U[mid]) {\n\t\t\t\thigh = mid;\n\t\t\t} else {\n\t\t\t\tlow = mid;\n\t\t\t}\n\n\t\t\tmid = Math.floor((low + high) / 2);\n\t\t}\n\n\t\treturn mid;\n\t},\n \n\t\t\n\t/*\n\tCalculate basis functions. See The NURBS Book, page 70, algorithm A2.2\n \n\tspan : span in which u lies\n\tu : parametric point\n\tp : degree\n\tU : knot vector\n\t\n\treturns array[p+1] with basis functions values.\n\t*/\n\tcalcBasisFunctions: function( span, u, p, U ) {\n\t\tvar N = [];\n\t\tvar left = [];\n\t\tvar right = [];\n\t\tN[0] = 1.0;\n\n\t\tfor (var j = 1; j <= p; ++j) {\n\t \n\t\t\tleft[j] = u - U[span + 1 - j];\n\t\t\tright[j] = U[span + j] - u;\n\n\t\t\tvar saved = 0.0;\n\n\t\t\tfor (var r = 0; r < j; ++r) {\n\n\t\t\t\tvar rv = right[r + 1];\n\t\t\t\tvar lv = left[j - r];\n\t\t\t\tvar temp = N[r] / (rv + lv);\n\t\t\t\tN[r] = saved + rv * temp;\n\t\t\t\tsaved = lv * temp;\n\t\t\t }\n\n\t\t\t N[j] = saved;\n\t\t }\n\n\t\t return N;\n\t},\n\n\n\t/*\n\tCalculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.\n \n\tp : degree of B-Spline\n\tU : knot vector\n\tP : control points (x, y, z, w)\n\tu : parametric point\n\n\treturns point for given u\n\t*/\n\tcalcBSplinePoint: function( p, U, P, u ) {\n\t\tvar span = this.findSpan(p, u, U);\n\t\tvar N = this.calcBasisFunctions(span, u, p, U);\n\t\tvar C = new THREE.Vector4(0, 0, 0, 0);\n\n\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\tvar point = P[span - p + j];\n\t\t\tvar Nj = N[j];\n\t\t\tvar wNj = point.w * Nj;\n\t\t\tC.x += point.x * wNj;\n\t\t\tC.y += point.y * wNj;\n\t\t\tC.z += point.z * wNj;\n\t\t\tC.w += point.w * Nj;\n\t\t}\n\n\t\treturn C;\n\t},\n\n\n\t/*\n\tCalculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.\n\n\tspan : span in which u lies\n\tu : parametric point\n\tp : degree\n\tn : number of derivatives to calculate\n\tU : knot vector\n\n\treturns array[n+1][p+1] with basis functions derivatives\n\t*/\n\tcalcBasisFunctionDerivatives: function( span, u, p, n, U ) {\n\n\t\tvar zeroArr = [];\n\t\tfor (var i = 0; i <= p; ++i)\n\t\t\tzeroArr[i] = 0.0;\n\n\t\tvar ders = [];\n\t\tfor (var i = 0; i <= n; ++i)\n\t\t\tders[i] = zeroArr.slice(0);\n\n\t\tvar ndu = [];\n\t\tfor (var i = 0; i <= p; ++i)\n\t\t\tndu[i] = zeroArr.slice(0);\n\n\t\tndu[0][0] = 1.0;\n\n\t\tvar left = zeroArr.slice(0);\n\t\tvar right = zeroArr.slice(0);\n\n\t\tfor (var j = 1; j <= p; ++j) {\n\t\t\tleft[j] = u - U[span + 1 - j];\n\t\t\tright[j] = U[span + j] - u;\n\n\t\t\tvar saved = 0.0;\n\n\t\t\tfor (var r = 0; r < j; ++r) {\n\t\t\t\tvar rv = right[r + 1];\n\t\t\t\tvar lv = left[j - r];\n\t\t\t\tndu[j][r] = rv + lv;\n\n\t\t\t\tvar temp = ndu[r][j - 1] / ndu[j][r];\n\t\t\t\tndu[r][j] = saved + rv * temp;\n\t\t\t\tsaved = lv * temp;\n\t\t\t}\n\n\t\t\tndu[j][j] = saved;\n\t\t}\n\n\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\tders[0][j] = ndu[j][p];\n\t\t}\n\n\t\tfor (var r = 0; r <= p; ++r) {\n\t\t\tvar s1 = 0;\n\t\t\tvar s2 = 1;\n\n\t\t\tvar a = [];\n\t\t\tfor (var i = 0; i <= p; ++i) {\n\t\t\t\ta[i] = zeroArr.slice(0);\n\t\t\t}\n\t\t\ta[0][0] = 1.0;\n\n\t\t\tfor (var k = 1; k <= n; ++k) {\n\t\t\t\tvar d = 0.0;\n\t\t\t\tvar rk = r - k;\n\t\t\t\tvar pk = p - k;\n\n\t\t\t\tif (r >= k) {\n\t\t\t\t\ta[s2][0] = a[s1][0] / ndu[pk + 1][rk];\n\t\t\t\t\td = a[s2][0] * ndu[rk][pk];\n\t\t\t\t}\n\n\t\t\t\tvar j1 = (rk >= -1) ? 1 : -rk;\n\t\t\t\tvar j2 = (r - 1 <= pk) ? k - 1 : p - r;\n\n\t\t\t\tfor (var j = j1; j <= j2; ++j) {\n\t\t\t\t\ta[s2][j] = (a[s1][j] - a[s1][j - 1]) / ndu[pk + 1][rk + j];\n\t\t\t\t\td += a[s2][j] * ndu[rk + j][pk];\n\t\t\t\t}\n\n\t\t\t\tif (r <= pk) {\n\t\t\t\t\ta[s2][k] = -a[s1][k - 1] / ndu[pk + 1][r];\n\t\t\t\t\td += a[s2][k] * ndu[r][pk];\n\t\t\t\t}\n\n\t\t\t\tders[k][r] = d;\n\n\t\t\t\tvar j = s1;\n\t\t\t\ts1 = s2;\n\t\t\t\ts2 = j;\n\t\t\t}\n\t\t}\n\n\t\tvar r = p;\n\n\t\tfor (var k = 1; k <= n; ++k) {\n\t\t\tfor (var j = 0; j <= p; ++j) {\n\t\t\t\tders[k][j] *= r;\n\t\t\t}\n\t\t\tr *= p - k;\n\t\t}\n\n\t\treturn ders;\n\t},\n\n\n \t/*\n\tCalculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.\n\n\tp : degree\n\tU : knot vector\n\tP : control points\n\tu : Parametric points\n\tnd : number of derivatives\n\n\treturns array[d+1] with derivatives\n\t*/\n\tcalcBSplineDerivatives: function( p, U, P, u, nd ) {\n\t\tvar du = nd < p ? nd : p;\n\t\tvar CK = [];\n\t\tvar span = this.findSpan(p, u, U);\n\t\tvar nders = this.calcBasisFunctionDerivatives(span, u, p, du, U);\n\t\tvar Pw = [];\n\n\t\tfor (var i = 0; i < P.length; ++i) {\n\t\t\tvar point = P[i].clone();\n\t\t\tvar w = point.w;\n\n\t\t\tpoint.x *= w;\n\t\t\tpoint.y *= w;\n\t\t\tpoint.z *= w;\n\n\t\t\tPw[i] = point;\n\t\t}\n\t\tfor (var k = 0; k <= du; ++k) {\n\t\t\tvar point = Pw[span - p].clone().multiplyScalar(nders[k][0]);\n\n\t\t\tfor (var j = 1; j <= p; ++j) {\n\t\t\t\tpoint.add(Pw[span - p + j].clone().multiplyScalar(nders[k][j]));\n\t\t\t}\n\n\t\t\tCK[k] = point;\n\t\t}\n\n\t\tfor (var k = du + 1; k <= nd + 1; ++k) {\n\t\t\tCK[k] = new THREE.Vector4(0, 0, 0);\n\t\t}\n\n\t\treturn CK;\n\t},\n\n\n\t/*\n\tCalculate \"K over I\"\n\n\treturns k!/(i!(k-i)!)\n\t*/\n\tcalcKoverI: function( k, i ) {\n\t\tvar nom = 1;\n\n\t\tfor (var j = 2; j <= k; ++j) {\n\t\t\tnom *= j;\n\t\t}\n\n\t\tvar denom = 1;\n\n\t\tfor (var j = 2; j <= i; ++j) {\n\t\t\tdenom *= j;\n\t\t}\n\n\t\tfor (var j = 2; j <= k - i; ++j) {\n\t\t\tdenom *= j;\n\t\t}\n\n\t\treturn nom / denom;\n\t},\n\n\n\t/*\n\tCalculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.\n\n\tPders : result of function calcBSplineDerivatives\n\n\treturns array with derivatives for rational curve.\n\t*/\n\tcalcRationalCurveDerivatives: function ( Pders ) {\n\t\tvar nd = Pders.length;\n\t\tvar Aders = [];\n\t\tvar wders = [];\n\n\t\tfor (var i = 0; i < nd; ++i) {\n\t\t\tvar point = Pders[i];\n\t\t\tAders[i] = new THREE.Vector3(point.x, point.y, point.z);\n\t\t\twders[i] = point.w;\n\t\t}\n\n\t\tvar CK = [];\n\n\t\tfor (var k = 0; k < nd; ++k) {\n\t\t\tvar v = Aders[k].clone();\n\n\t\t\tfor (var i = 1; i <= k; ++i) {\n\t\t\t\tv.sub(CK[k - i].clone().multiplyScalar(this.calcKoverI(k,i) * wders[i]));\n\t\t\t}\n\n\t\t\tCK[k] = v.divideScalar(wders[0]);\n\t\t}\n\n\t\treturn CK;\n\t},\n\n\n\t/*\n\tCalculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.\n\n\tp : degree\n\tU : knot vector\n\tP : control points in homogeneous space\n\tu : parametric points\n\tnd : number of derivatives\n\n\treturns array with derivatives.\n\t*/\n\tcalcNURBSDerivatives: function( p, U, P, u, nd ) {\n\t\tvar Pders = this.calcBSplineDerivatives(p, U, P, u, nd);\n\t\treturn this.calcRationalCurveDerivatives(Pders);\n\t},\n\n\n\t/*\n\tCalculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.\n \n\tp1, p2 : degrees of B-Spline surface\n\tU1, U2 : knot vectors\n\tP : control points (x, y, z, w)\n\tu, v : parametric values\n\n\treturns point for given (u, v)\n\t*/\n\tcalcSurfacePoint: function( p, q, U, V, P, u, v ) {\n\t\tvar uspan = this.findSpan(p, u, U);\n\t\tvar vspan = this.findSpan(q, v, V);\n\t\tvar Nu = this.calcBasisFunctions(uspan, u, p, U);\n\t\tvar Nv = this.calcBasisFunctions(vspan, v, q, V);\n\t\tvar temp = [];\n\n\t\tfor (var l = 0; l <= q; ++l) {\n\t\t\ttemp[l] = new THREE.Vector4(0, 0, 0, 0);\n\t\t\tfor (var k = 0; k <= p; ++k) {\n\t\t\t\tvar point = P[uspan - p + k][vspan - q + l].clone();\n\t\t\t\tvar w = point.w;\n\t\t\t\tpoint.x *= w;\n\t\t\t\tpoint.y *= w;\n\t\t\t\tpoint.z *= w;\n\t\t\t\ttemp[l].add(point.multiplyScalar(Nu[k]));\n\t\t\t}\n\t\t}\n\n\t\tvar Sw = new THREE.Vector4(0, 0, 0, 0);\n\t\tfor (var l = 0; l <= q; ++l) {\n\t\t\tSw.add(temp[l].multiplyScalar(Nv[l]));\n\t\t}\n\n\t\tSw.divideScalar(Sw.w);\n\t\treturn new THREE.Vector3(Sw.x, Sw.y, Sw.z);\n\t}\n\n};\n\n\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Geometries/ConvexGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Geometries/ConvexGeometry.js",
"module-type": "library",
"text": "/**\n * @author qiao / https://github.com/qiao\n * @fileoverview This is a convex hull generator using the incremental method. \n * The complexity is O(n^2) where n is the number of vertices.\n * O(nlogn) algorithms do exist, but they are much more complicated.\n *\n * Benchmark: \n *\n * Platform: CPU: P7350 @2.00GHz Engine: V8\n *\n * Num Vertices\tTime(ms)\n *\n * 10 1\n * 20 3\n * 30 19\n * 40 48\n * 50 107\n */\n\nTHREE.ConvexGeometry = function( vertices ) {\n\n\tTHREE.Geometry.call( this );\n\n\tvar faces = [ [ 0, 1, 2 ], [ 0, 2, 1 ] ]; \n\n\tfor ( var i = 3; i < vertices.length; i++ ) {\n\n\t\taddPoint( i );\n\n\t}\n\n\n\tfunction addPoint( vertexId ) {\n\n\t\tvar vertex = vertices[ vertexId ].clone();\n\n\t\tvar mag = vertex.length();\n\t\tvertex.x += mag * randomOffset();\n\t\tvertex.y += mag * randomOffset();\n\t\tvertex.z += mag * randomOffset();\n\n\t\tvar hole = [];\n\n\t\tfor ( var f = 0; f < faces.length; ) {\n\n\t\t\tvar face = faces[ f ];\n\n\t\t\t// for each face, if the vertex can see it,\n\t\t\t// then we try to add the face's edges into the hole.\n\t\t\tif ( visible( face, vertex ) ) {\n\n\t\t\t\tfor ( var e = 0; e < 3; e++ ) {\n\n\t\t\t\t\tvar edge = [ face[ e ], face[ ( e + 1 ) % 3 ] ];\n\t\t\t\t\tvar boundary = true;\n\n\t\t\t\t\t// remove duplicated edges.\n\t\t\t\t\tfor ( var h = 0; h < hole.length; h++ ) {\n\n\t\t\t\t\t\tif ( equalEdge( hole[ h ], edge ) ) {\n\n\t\t\t\t\t\t\thole[ h ] = hole[ hole.length - 1 ];\n\t\t\t\t\t\t\thole.pop();\n\t\t\t\t\t\t\tboundary = false;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( boundary ) {\n\n\t\t\t\t\t\thole.push( edge );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// remove faces[ f ]\n\t\t\t\tfaces[ f ] = faces[ faces.length - 1 ];\n\t\t\t\tfaces.pop();\n\n\t\t\t} else { // not visible\n\n\t\t\t\tf++;\n\n\t\t\t}\n\t\t}\n\n\t\t// construct the new faces formed by the edges of the hole and the vertex\n\t\tfor ( var h = 0; h < hole.length; h++ ) {\n\n\t\t\tfaces.push( [ \n\t\t\t\thole[ h ][ 0 ],\n\t\t\t\thole[ h ][ 1 ],\n\t\t\t\tvertexId\n\t\t\t] );\n\n\t\t}\n\t}\n\n\t/**\n\t * Whether the face is visible from the vertex\n\t */\n\tfunction visible( face, vertex ) {\n\n\t\tvar va = vertices[ face[ 0 ] ];\n\t\tvar vb = vertices[ face[ 1 ] ];\n\t\tvar vc = vertices[ face[ 2 ] ];\n\n\t\tvar n = normal( va, vb, vc );\n\n\t\t// distance from face to origin\n\t\tvar dist = n.dot( va );\n\n\t\treturn n.dot( vertex ) >= dist; \n\n\t}\n\n\t/**\n\t * Face normal\n\t */\n\tfunction normal( va, vb, vc ) {\n\n\t\tvar cb = new THREE.Vector3();\n\t\tvar ab = new THREE.Vector3();\n\n\t\tcb.subVectors( vc, vb );\n\t\tab.subVectors( va, vb );\n\t\tcb.cross( ab );\n\n\t\tcb.normalize();\n\n\t\treturn cb;\n\n\t}\n\n\t/**\n\t * Detect whether two edges are equal.\n\t * Note that when constructing the convex hull, two same edges can only\n\t * be of the negative direction.\n\t */\n\tfunction equalEdge( ea, eb ) {\n\n\t\treturn ea[ 0 ] === eb[ 1 ] && ea[ 1 ] === eb[ 0 ]; \n\n\t}\n\n\t/**\n\t * Create a random offset between -1e-6 and 1e-6.\n\t */\n\tfunction randomOffset() {\n\n\t\treturn ( Math.random() - 0.5 ) * 2 * 1e-6;\n\n\t}\n\n\n\t/**\n\t * XXX: Not sure if this is the correct approach. Need someone to review.\n\t */\n\tfunction vertexUv( vertex ) {\n\n\t\tvar mag = vertex.length();\n\t\treturn new THREE.Vector2( vertex.x / mag, vertex.y / mag );\n\n\t}\n\n\t// Push vertices into `this.vertices`, skipping those inside the hull\n\tvar id = 0;\n\tvar newId = new Array( vertices.length ); // map from old vertex id to new id\n\n\tfor ( var i = 0; i < faces.length; i++ ) {\n\n\t\t var face = faces[ i ];\n\n\t\t for ( var j = 0; j < 3; j++ ) {\n\n\t\t\t\tif ( newId[ face[ j ] ] === undefined ) {\n\n\t\t\t\t\t\tnewId[ face[ j ] ] = id++;\n\t\t\t\t\t\tthis.vertices.push( vertices[ face[ j ] ] );\n\n\t\t\t\t}\n\n\t\t\t\tface[ j ] = newId[ face[ j ] ];\n\n\t\t }\n\n\t}\n\n\t// Convert faces into instances of THREE.Face3\n\tfor ( var i = 0; i < faces.length; i++ ) {\n\n\t\tthis.faces.push( new THREE.Face3( \n\t\t\t\tfaces[ i ][ 0 ],\n\t\t\t\tfaces[ i ][ 1 ],\n\t\t\t\tfaces[ i ][ 2 ]\n\t\t) );\n\n\t}\n\n\t// Compute UVs\n\tfor ( var i = 0; i < this.faces.length; i++ ) {\n\n\t\tvar face = this.faces[ i ];\n\n\t\tthis.faceVertexUvs[ 0 ].push( [\n\t\t\tvertexUv( this.vertices[ face.a ] ),\n\t\t\tvertexUv( this.vertices[ face.b ] ),\n\t\t\tvertexUv( this.vertices[ face.c ])\n\t\t] );\n\n\t}\n\n\tthis.computeFaceNormals();\n\tthis.computeVertexNormals();\n\n};\n\nTHREE.ConvexGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Geometries/hilbert2D.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert2D.js",
"module-type": "library",
"text": "/**\n * Hilbert Curve: Generates 2D-Coordinates in a very fast way.\n *\n * @author Dylan Grafmyre\n *\n * Based on work by:\n * @author Thomas Diewald\n * @link http://www.openprocessing.org/sketch/15493\n *\n * @param center Center of Hilbert curve.\n * @param size Total width of Hilbert curve.\n * @param iterations Number of subdivisions.\n * @param v0 Corner index -X, -Z.\n * @param v1 Corner index -X, +Z.\n * @param v2 Corner index +X, +Z.\n * @param v3 Corner index +X, -Z.\n */\nfunction hilbert2D (center, size, iterations, v0, v1, v2, v3) {\n\t// Default Vars\n\tvar center = undefined !== center ? center : new THREE.Vector3(0, 0, 0),\n\t\tsize = undefined !== size ? size : 10,\n\t\thalf = size / 2,\n\t\titerations = undefined !== iterations ? iterations : 1,\n\t\tv0 = undefined !== v0 ? v0 : 0,\n\t\tv1 = undefined !== v1 ? v1 : 1,\n\t\tv2 = undefined !== v2 ? v2 : 2,\n\t\tv3 = undefined !== v3 ? v3 : 3\n\t;\n\n\tvar vec_s = [\n\t\tnew THREE.Vector3( center.x - half, center.y, center.z - half ),\n\t\tnew THREE.Vector3( center.x - half, center.y, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y, center.z - half )\n\t];\n\n\tvar vec = [\n\t\tvec_s[ v0 ],\n\t\tvec_s[ v1 ],\n\t\tvec_s[ v2 ],\n\t\tvec_s[ v3 ]\n\t];\n\n\t// Recurse iterations\n\tif (0 <= --iterations) {\n\t\tvar tmp = [];\n\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 0 ], half, iterations, v0, v3, v2, v1 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 1 ], half, iterations, v0, v1, v2, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 2 ], half, iterations, v0, v1, v2, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert2D ( vec[ 3 ], half, iterations, v2, v1, v0, v3 ) );\n\n\t\t// Return recursive call\n\t\treturn tmp;\n\t}\n\n\t// Return complete Hilbert Curve.\n\treturn vec;\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Geometries/hilbert3D.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Geometries/hilbert3D.js",
"module-type": "library",
"text": "/**\n * Hilbert Curve: Generates 2D-Coordinates in a very fast way.\n *\n * @author Dylan Grafmyre\n *\n * Based on work by:\n * @author Thomas Diewald\n * @link http://www.openprocessing.org/visuals/?visualID=15599\n *\n * Based on `examples/canvas_lines_colors.html`:\n * @author OpenShift guest\n * @link https://github.com/mrdoob/three.js/blob/8413a860aa95ed29c79cbb7f857c97d7880d260f/examples/canvas_lines_colors.html\n * @see Line 149 - 186\n *\n * @param center Center of Hilbert curve.\n * @param size Total width of Hilbert curve.\n * @param iterations Number of subdivisions.\n * @param v0 Corner index -X, +Y, -Z.\n * @param v1 Corner index -X, +Y, +Z.\n * @param v2 Corner index -X, -Y, +Z.\n * @param v3 Corner index -X, -Y, -Z.\n * @param v4 Corner index +X, -Y, -Z.\n * @param v5 Corner index +X, -Y, +Z.\n * @param v6 Corner index +X, +Y, +Z.\n * @param v7 Corner index +X, +Y, -Z.\n */\nfunction hilbert3D(center, size, iterations, v0, v1, v2, v3, v4, v5, v6, v7) {\n\t// Default Vars\n\tvar center = undefined !== center ? center : new THREE.Vector3(0, 0, 0),\n\t\tsize = undefined !== size ? size : 10,\n\t\thalf = size / 2,\n\t\titerations = undefined !== iterations ? iterations : 1,\n\t\tv0 = undefined !== v0 ? v0 : 0,\n\t\tv1 = undefined !== v1 ? v1 : 1,\n\t\tv2 = undefined !== v2 ? v2 : 2,\n\t\tv3 = undefined !== v3 ? v3 : 3,\n\t\tv4 = undefined !== v4 ? v4 : 4,\n\t\tv5 = undefined !== v5 ? v5 : 5,\n\t\tv6 = undefined !== v6 ? v6 : 6,\n\t\tv7 = undefined !== v7 ? v7 : 7\n\t;\n\n\tvar vec_s = [\n\t\tnew THREE.Vector3( center.x - half, center.y + half, center.z - half ),\n\t\tnew THREE.Vector3( center.x - half, center.y + half, center.z + half ),\n\t\tnew THREE.Vector3( center.x - half, center.y - half, center.z + half ),\n\t\tnew THREE.Vector3( center.x - half, center.y - half, center.z - half ),\n\t\tnew THREE.Vector3( center.x + half, center.y - half, center.z - half ),\n\t\tnew THREE.Vector3( center.x + half, center.y - half, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y + half, center.z + half ),\n\t\tnew THREE.Vector3( center.x + half, center.y + half, center.z - half )\n\t];\n\n\tvar vec = [\n\t\tvec_s[ v0 ],\n\t\tvec_s[ v1 ],\n\t\tvec_s[ v2 ],\n\t\tvec_s[ v3 ],\n\t\tvec_s[ v4 ],\n\t\tvec_s[ v5 ],\n\t\tvec_s[ v6 ],\n\t\tvec_s[ v7 ]\n\t];\n\n\t// Recurse iterations\n\tif( --iterations >= 0 ) {\n\t\tvar tmp = [];\n\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 0 ], half, iterations, v0, v3, v4, v7, v6, v5, v2, v1 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 1 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 2 ], half, iterations, v0, v7, v6, v1, v2, v5, v4, v3 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 3 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 4 ], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 5 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 6 ], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7 ) );\n\t\tArray.prototype.push.apply( tmp, hilbert3D ( vec[ 7 ], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7 ) );\n\n\t\t// Return recursive call\n\t\treturn tmp;\n\t}\n\n\t// Return complete Hilbert Curve.\n\treturn vec;\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/PRNG.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/PRNG.js",
"module-type": "library",
"text": "// Park-Miller-Carta Pseudo-Random Number Generator\n// https://github.com/pnitsch/BitmapData.js/blob/master/js/BitmapData.js\n\nvar PRNG = function () {\n\n\tthis.seed = 1;\n\tthis.next = function() { return (this.gen() / 2147483647); };\n\tthis.nextRange = function(min, max)\t{ return min + ((max - min) * this.next()) };\n\tthis.gen = function() { return this.seed = (this.seed * 16807) % 2147483647; };\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/AudioObject.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/AudioObject.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n * AudioObject\n *\n *\t- 3d spatialized sound with Doppler-shift effect\n *\n *\t- uses Audio API (currently supported in WebKit-based browsers)\n *\t\thttps://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html\n *\n *\t- based on Doppler effect demo from Chromium\n * \t\thttp://chromium.googlecode.com/svn/trunk/samples/audio/doppler.html\n *\n * - parameters\n *\n *\t\t- listener\n *\t\t\tdopplerFactor\t// A constant used to determine the amount of pitch shift to use when rendering a doppler effect.\n *\t\t\tspeedOfSound\t// The speed of sound used for calculating doppler shift. The default value is 343.3 meters / second.\n *\n *\t\t- panner\n *\t\t\trefDistance\t\t// A reference distance for reducing volume as source move further from the listener.\n *\t\t\tmaxDistance\t\t// The maximum distance between source and listener, after which the volume will not be reduced any further.\n *\t\t\trolloffFactor\t// Describes how quickly the volume is reduced as source moves away from listener.\n * \t\t\tconeInnerAngle\t// An angle inside of which there will be no volume reduction.\n *\t\t\tconeOuterAngle \t// An angle outside of which the volume will be reduced to a constant value of coneOuterGain.\n *\t\t\tconeOuterGain\t// Amount of volume reduction outside of the coneOuterAngle.\n */\n\nTHREE.AudioObject = function ( url, volume, playbackRate, loop ) {\n\n\tTHREE.Object3D.call( this );\n\n\tif ( playbackRate === undefined ) playbackRate = 1;\n\tif ( volume === undefined ) volume = 1;\n\tif ( loop === undefined ) loop = true;\n\n\tif ( ! this.context ) {\n\n\t\ttry {\n\n\t\t\tTHREE.AudioObject.prototype.context = new webkitAudioContext();\n\n\t\t} catch( error ) {\n\n\t\t\tconsole.warn( \"THREE.AudioObject: webkitAudioContext not found\" );\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\n\tthis.directionalSource = false;\n\n\tthis.listener = this.context.listener;\n\tthis.panner = this.context.createPanner();\n\tthis.source = this.context.createBufferSource();\n\n\tthis.masterGainNode = this.context.createGainNode();\n\tthis.dryGainNode = this.context.createGainNode();\n\n\t// Setup initial gains\n\n\tthis.masterGainNode.gain.value = volume;\n\tthis.dryGainNode.gain.value = 3.0;\n\n\t// Connect dry mix\n\n\tthis.source.connect( this.panner );\n\tthis.panner.connect( this.dryGainNode );\n\tthis.dryGainNode.connect( this.masterGainNode );\n\n\t// Connect master gain\n\n\tthis.masterGainNode.connect( this.context.destination );\n\n\t// Set source parameters and load sound\n\n\tthis.source.playbackRate.value = playbackRate;\n\tthis.source.loop = loop;\n\n\tloadBufferAndPlay( url );\n\n\t// private properties\n\n\tvar soundPosition = new THREE.Vector3(),\n\tcameraPosition = new THREE.Vector3(),\n\toldSoundPosition = new THREE.Vector3(),\n\toldCameraPosition = new THREE.Vector3(),\n\n\tsoundDelta = new THREE.Vector3(),\n\tcameraDelta = new THREE.Vector3(),\n\n\tsoundFront = new THREE.Vector3(),\n\tcameraFront = new THREE.Vector3(),\n\tsoundUp = new THREE.Vector3(),\n\tcameraUp = new THREE.Vector3();\n\n\tvar _this = this;\n\n\t// API\n\n\tthis.setVolume = function ( volume ) {\n\n\t\tthis.masterGainNode.gain.value = volume;\n\n\t};\n\n\tthis.update = function ( camera ) {\n\n\t\toldSoundPosition.copy( soundPosition );\n\t\toldCameraPosition.copy( cameraPosition );\n\n\t\tsoundPosition.setFromMatrixPosition( this.matrixWorld );\n\t\tcameraPosition.setFromMatrixPosition( camera.matrixWorld );\n\n\t\tsoundDelta.subVectors( soundPosition, oldSoundPosition );\n\t\tcameraDelta.subVectors( cameraPosition, oldCameraPosition );\n\n\t\tcameraUp.copy( camera.up );\n\n\t\tcameraFront.set( 0, 0, -1 );\n\t\tcameraFront.transformDirection( camera.matrixWorld );\n\n\t\tthis.listener.setPosition( cameraPosition.x, cameraPosition.y, cameraPosition.z );\n\t\tthis.listener.setVelocity( cameraDelta.x, cameraDelta.y, cameraDelta.z );\n\t\tthis.listener.setOrientation( cameraFront.x, cameraFront.y, cameraFront.z, cameraUp.x, cameraUp.y, cameraUp.z );\n\n\t\tthis.panner.setPosition( soundPosition.x, soundPosition.y, soundPosition.z );\n\t\tthis.panner.setVelocity( soundDelta.x, soundDelta.y, soundDelta.z );\n\n\t\tif ( this.directionalSource ) {\n\n\t\t\tsoundFront.set( 0, 0, -1 );\n\t\t\tsoundFront.transformDirection( this.matrixWorld );\n\n\t\t\tsoundUp.copy( this.up );\n\t\t\tthis.panner.setOrientation( soundFront.x, soundFront.y, soundFront.z, soundUp.x, soundUp.y, soundUp.z );\n\n\t\t}\n\n\n\t};\n\n\tfunction loadBufferAndPlay( url ) {\n\n\t\t// Load asynchronously\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open( \"GET\", url, true );\n\t\trequest.responseType = \"arraybuffer\";\n\n\t\trequest.onload = function() {\n\n\t\t\t_this.source.buffer = _this.context.createBuffer( request.response, true );\n\t\t\t_this.source.noteOn( 0 );\n\n\t\t}\n\n\t\trequest.send();\n\n\t}\n\n};\n\nTHREE.AudioObject.prototype = Object.create( THREE.Object3D.prototype );\n\nTHREE.AudioObject.prototype.context = null;\nTHREE.AudioObject.prototype.type = null;\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Math/Lut.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Math/Lut.js",
"module-type": "library",
"text": "/**\n * @author daron1337 / http://daron1337.github.io/\n */\n\nTHREE.Lut = function ( colormap, numberofcolors ) {\n\n\tthis.lut = new Array();\n\tthis.map = THREE.ColorMapKeywords[ colormap ];\n\tthis.n = numberofcolors;\n\tthis.mapname = colormap;\n\n\tvar step = 1.0 / this.n;\n\n\tfor ( var i = 0; i <= 1; i += step ) {\n\n\t\tfor ( var j = 0; j < this.map.length - 1; j ++ ) {\n\n\t\t\tif ( i >= this.map[ j ][ 0 ] && i < this.map[ j + 1 ][ 0 ] ) {\n\n\t\t\t\tvar min = this.map[ j ][ 0 ];\n\t\t\t\tvar max = this.map[ j + 1 ][ 0 ];\n\n\t\t\t\tvar color = new THREE.Color( 0xffffff );\n\t\t\t\tvar minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );\n\t\t\t\tvar maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j + 1 ][ 1 ] );\n\n\t\t\t\tcolor = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );\n\n\t\t\t\tthis.lut.push(color);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn this.set( this );\n\n};\n\nTHREE.Lut.prototype = {\n\n\tconstructor: THREE.Lut,\n\n\tlut: [], map: [], mapname: 'rainbow' , n: 256, minV: 0, maxV: 1, legend: null,\n\n\tset: function ( value ) {\n\n\t\tif ( value instanceof THREE.Lut ) {\n\n\t\t\tthis.copy( value );\n\n\t\t}\n\n\t\treturn this;\n\n\t},\n\n\tsetMin: function ( min ) {\n\n\t\tthis.minV = min;\n\n\t\treturn this;\n\n\t},\n\n\tsetMax: function ( max ) {\n\n\t\tthis.maxV = max;\n\n\t\treturn this;\n\n\t},\n\n\tchangeNumberOfColors: function ( numberofcolors ) {\n\n\t\tthis.n = numberofcolors;\n\n\t\treturn new THREE.Lut( this.mapname, this.n );\n\n\t},\n\n\tchangeColorMap: function ( colormap ) {\n\n\t\tthis.mapname = colormap;\n\n\t\treturn new THREE.Lut( this.mapname, this.n );\n\n\t},\n\n\tcopy: function ( lut ) {\n\n\t\tthis.lut = lut.lut;\n\t\tthis.mapname = lut.mapname;\n\t\tthis.map = lut.map;\n\t\tthis.n = lut.n;\n\t\tthis.minV = lut.minV;\n\t\tthis.maxV = lut.maxV;\n\n\t\treturn this;\n\n\t},\n\n\tgetColor: function ( alpha ) {\n\n\t\tif ( alpha <= this.minV ) {\n\n\t\t\talpha = this.minV;\n\n\t\t} else if ( alpha >= this.maxV ) {\n\n\t\t\talpha = this.maxV;\n\n\t\t}\n\n\t\talpha = ( alpha - this.minV ) / ( this.maxV - this.minV );\n\n\t\tvar colorPosition = Math.round ( alpha * this.n );\n\t\tcolorPosition == this.n ? colorPosition -= 1 : colorPosition;\n\n\t\treturn this.lut[ colorPosition ];\n\n\t},\n\n\taddColorMap: function ( colormapName, arrayOfColors ) {\n\n\t\tTHREE.ColorMapKeywords[ colormapName ] = arrayOfColors;\n\n\t},\n\n\tsetLegendOn: function ( parameters ) {\n\n\t\tif ( parameters === undefined ) { parameters = {}; }\n\n\t\tthis.legend = {};\n\n\t\tthis.legend.layout = parameters.hasOwnProperty( 'layout' ) ? parameters[ 'layout' ] : 'vertical';\n\n\t\tthis.legend.position = parameters.hasOwnProperty( 'position' ) ? parameters[ 'position' ] : { 'x': 21.5, 'y': 8, 'z': 5 };\n\n\t\tthis.legend.dimensions = parameters.hasOwnProperty( 'dimensions' ) ? parameters[ 'dimensions' ] : { 'width': 0.5, 'height': 3 };\n\n\t\tthis.legend.canvas = document.createElement( 'canvas' );\n\n\t\tthis.legend.canvas.setAttribute( 'id', 'legend' );\n\t\tthis.legend.canvas.setAttribute( 'hidden', true );\n\n\t\tdocument.body.appendChild( this.legend.canvas );\n\n\t\tthis.legend.ctx = this.legend.canvas.getContext( '2d' );\n\n\t\tthis.legend.canvas.setAttribute( 'width', 1 );\n\t\tthis.legend.canvas.setAttribute( 'height', this.n );\n\n\t\tthis.legend.texture = new THREE.Texture( this.legend.canvas );\n\n\t\timageData = this.legend.ctx.getImageData( 0, 0, 1, this.n );\n\n\t\tdata = imageData.data;\n\t\tlen = data.length;\n\n\t\tthis.map = THREE.ColorMapKeywords[ this.mapname ];\n\n\t\tvar k = 0;\n\n\t\tvar step = 1.0 / this.n;\n\n\t\tfor ( var i = 1; i >= 0; i-=step ) {\n\n\t\t\tfor ( var j = this.map.length - 1; j >= 0; j-- ) {\n\n\t\t\t\tif ( i < this.map[ j ][ 0 ] && i >= this.map[ j - 1 ][ 0 ] ) {\n\n\t\t\t\t\tvar min = this.map[ j - 1 ][ 0 ];\n\t\t\t\t\tvar max = this.map[ j ][ 0 ];\n\t\t\t\t\tvar color = new THREE.Color( 0xffffff );\n\t\t\t\t\tvar minColor = new THREE.Color( 0xffffff ).setHex( this.map[ j - 1][ 1 ] );\n\t\t\t\t\tvar maxColor = new THREE.Color( 0xffffff ).setHex( this.map[ j ][ 1 ] );\n\t\t\t\t\tcolor = minColor.lerp( maxColor, ( i - min ) / ( max - min ) );\n\n\t\t\t\t\tdata[ k * 4 ] = Math.round( color.r * 255 );\n\t\t\t\t\tdata[ k * 4 + 1 ] = Math.round( color.g * 255 );\n\t\t\t\t\tdata[ k * 4 + 2 ] = Math.round( color.b * 255 );\n\t\t\t\t\tdata[ k * 4 + 3 ] = 255;\n\n\t\t\t\t\tk+=1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.legend.ctx.putImageData( imageData, 0, 0 );\n\t\tthis.legend.texture.needsUpdate = true;\n\n\t\tthis.legend.legendGeometry = new THREE.PlaneGeometry( this.legend.dimensions.width , this.legend.dimensions.height );\n\t\tthis.legend.legendMaterial = new THREE.MeshBasicMaterial( { map : this.legend.texture, side : THREE.DoubleSide } );\n\n\t\tthis.legend.mesh = new THREE.Mesh( this.legend.legendGeometry, this.legend.legendMaterial );\n\n\t\tif ( this.legend.layout == 'horizontal') {\n\n\t\t\tthis.legend.mesh.rotation.z = - 90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\tthis.legend.mesh.position.copy( this.legend.position );\n\n\t\treturn this.legend.mesh;\n\n\t},\n\n\tsetLegendOff: function () {\n\n\t\tthis.legend = null;\n\n\t\treturn this.legend;\n\n\t},\n\n\tsetLegendLayout: function ( layout ) {\n\n\t\tif ( ! this.legend ) { return false; }\n\n\t\tif ( this.legend.layout == layout ) { return false; }\n\n\t\tif ( layout != 'horizontal' && layout != 'vertical' ) { return false; }\n\n\t\tthis.layout = layout;\n\n\t\tif ( layout == 'horizontal' ) {\n\n\t\t\tthis.legend.mesh.rotation.z = 90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\tif ( layout == 'vertical' ) {\n\n\t\t\tthis.legend.mesh.rotation.z = -90 * ( Math.PI / 180 );\n\n\t\t}\n\n\t\treturn this.legend.mesh;\n\n\t},\n\n\tsetLegendPosition: function ( position ) {\n\n\t\tthis.legend.position = new THREE.Vector3( position.x, position.y, position.z );\n\n\t\treturn this.legend;\n\n\t},\n\n\tsetLegendLabels: function ( parameters, callback ) {\n\n\t\tif ( ! this.legend ) { return false; }\n\n\t\tif ( typeof parameters === 'function') { callback = parameters; }\n\n\t\tif ( parameters === undefined ) { parameters = {}; }\n\n\t\tthis.legend.labels = {};\n\n\t\tthis.legend.labels.fontsize = parameters.hasOwnProperty( 'fontsize' ) ? parameters[ 'fontsize' ] : 24;\n\n\t\tthis.legend.labels.fontface = parameters.hasOwnProperty( 'fontface' ) ? parameters[ 'fontface' ] : 'Arial';\n\n\t\tthis.legend.labels.title = parameters.hasOwnProperty( 'title' ) ? parameters[ 'title' ] : '';\n\n\t\tthis.legend.labels.um = parameters.hasOwnProperty( 'um' ) ? ' [ '+ parameters[ 'um' ] + ' ]': '';\n\n\t\tthis.legend.labels.ticks = parameters.hasOwnProperty( 'ticks' ) ? parameters[ 'ticks' ] : 0;\n\n\t\tthis.legend.labels.decimal = parameters.hasOwnProperty( 'decimal' ) ? parameters[ 'decimal' ] : 2;\n\n\t\tthis.legend.labels.notation = parameters.hasOwnProperty( 'notation' ) ? parameters[ 'notation' ] : 'standard';\n\n\t\tvar backgroundColor = { r: 255, g: 100, b: 100, a: 0.8 };\n\t\tvar borderColor = { r: 255, g: 0, b: 0, a: 1.0 };\n\t\tvar borderThickness = 4;\n\n\t\tvar canvasTitle = document.createElement( 'canvas' );\n\t\tvar contextTitle = canvasTitle.getContext( '2d' );\n\n\t\tcontextTitle.font = 'Normal ' + this.legend.labels.fontsize * 1.2 + 'px ' + this.legend.labels.fontface;\n\n\t\tvar metrics = contextTitle.measureText( this.legend.labels.title.toString() + this.legend.labels.um.toString() );\n\t\tvar textWidth = metrics.width;\n\n\t\tcontextTitle.fillStyle = 'rgba(' + backgroundColor.r + ',' + backgroundColor.g + ',' + backgroundColor.b + ',' + backgroundColor.a + ')';\n\n\t\tcontextTitle.strokeStyle = 'rgba(' + borderColor.r + ',' + borderColor.g + ',' + borderColor.b + ',' + borderColor.a + ')';\n\n\t\tcontextTitle.lineWidth = borderThickness;\n\n\t\tcontextTitle.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n\t\tcontextTitle.fillText( this.legend.labels.title.toString() + this.legend.labels.um.toString(), borderThickness, this.legend.labels.fontsize + borderThickness );\n\n\t\tvar txtTitle = new THREE.Texture( canvasTitle );\n\n\t\ttxtTitle.needsUpdate = true;\n\n\t\tvar spriteMaterialTitle = new THREE.SpriteMaterial( { map: txtTitle, useScreenCoordinates: false } );\n\n\t\tvar spriteTitle = new THREE.Sprite( spriteMaterialTitle );\n\n\t\tspriteTitle.scale.set( 2, 1, 1.0 );\n\n\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\tspriteTitle.position.set( this.legend.position.x + this.legend.dimensions.width, this.legend.position.y + ( this.legend.dimensions.height * 0.45 ), this.legend.position.z );\n\n\t\t}\n\n\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\tspriteTitle.position.set( this.legend.position.x * 1.015, this.legend.position.y + ( this.legend.dimensions.height * 0.03 ), this.legend.position.z );\n\n\t\t}\n\n\t\tif ( this.legend.labels.ticks > 0 ) {\n\n\t\t\tvar ticks = {};\n\t\t\tvar lines = {};\n\n\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\tvar topPositionY = this.legend.position.y + ( this.legend.dimensions.height * 0.36 );\n\t\t\t\tvar bottomPositionY = this.legend.position.y - ( this.legend.dimensions.height * 0.61 );\n\n\t\t\t}\n\n\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\tvar topPositionX = this.legend.position.x + ( this.legend.dimensions.height * 0.75 );\n\t\t\t\tvar bottomPositionX = this.legend.position.x - ( this.legend.dimensions.width * 1.2 ) ;\n\n\t\t\t}\n\n\t\t\tfor ( var i = 0; i < this.legend.labels.ticks; i++ ) {\n\n\t\t\t\tvar value = ( this.maxV - this.minV ) / ( this.legend.labels.ticks - 1 ) * i ;\n\n\t\t\t\tif ( callback ) {\n\n\t\t\t\t\tvalue = callback ( value );\n\n\t\t\t\t}\n\n\t\t\t\telse {\n\n\t\t\t\t\tif ( this.legend.labels.notation == 'scientific' ) {\n\n\t\t\t\t\t\tvalue = value.toExponential( this.legend.labels.decimal );\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tvalue = value.toFixed( this.legend.labels.decimal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar canvasTick = document.createElement( 'canvas' );\n\t\t\t\tvar contextTick = canvasTick.getContext( '2d' );\n\n\t\t\t\tcontextTick.font = 'Normal ' + this.legend.labels.fontsize + 'px ' + this.legend.labels.fontface;\n\n\t\t\t\tvar metrics = contextTick.measureText( value.toString() );\n\t\t\t\tvar textWidth = metrics.width;\n\n\t\t\t\tcontextTick.fillStyle = 'rgba(' + backgroundColor.r + ',' + backgroundColor.g + ',' + backgroundColor.b + ',' + backgroundColor.a + ')';\n\n\t\t\t\tcontextTick.strokeStyle = 'rgba(' + borderColor.r + ',' + borderColor.g + ',' + borderColor.b + ',' + borderColor.a + ')';\n\n\t\t\t\tcontextTick.lineWidth = borderThickness;\n\n\t\t\t\tcontextTick.fillStyle = 'rgba( 0, 0, 0, 1.0 )';\n\n\t\t\t\tcontextTick.fillText( value.toString(), borderThickness, this.legend.labels.fontsize + borderThickness );\n\n\t\t\t\tvar txtTick = new THREE.Texture( canvasTick );\n\n\t\t\t\ttxtTick.needsUpdate = true;\n\n\t\t\t\tvar spriteMaterialTick = new THREE.SpriteMaterial( { map: txtTick, useScreenCoordinates: false } );\n\n\t\t\t\tvar spriteTick = new THREE.Sprite( spriteMaterialTick );\n\n\t\t\t\tspriteTick.scale.set( 2, 1, 1.0 );\n\n\t\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\t\tvar position = bottomPositionY + ( topPositionY - bottomPositionY ) * ( value / ( this.maxV - this.minV ) );\n\n\t\t\t\t\tspriteTick.position.set( this.legend.position.x + ( this.legend.dimensions.width * 2.7 ), position, this.legend.position.z );\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\t\tvar position = bottomPositionX + ( topPositionX - bottomPositionX ) * ( value / ( this.maxV - this.minV ) );\n\n\t\t\t\t\tif ( this.legend.labels.ticks > 5 ) {\n\n\t\t\t\t\t\tif ( i % 2 === 0 ) { var offset = 1.7; }\n\n\t\t\t\t\t\telse { var offset = 2.1; }\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse { var offset = 1.7; }\n\n\t\t\t\t\tspriteTick.position.set( position, this.legend.position.y - this.legend.dimensions.width * offset, this.legend.position.z );\n\n\t\t\t\t}\n\n\t\t\t\tvar material = new THREE.LineBasicMaterial( { color: 0x000000, linewidth: 2 } );\n\n\t\t\t\tvar geometry = new THREE.Geometry();\n\n\n\t\t\t\tif ( this.legend.layout == 'vertical' ) {\n\n\t\t\t\t\tvar linePosition = ( this.legend.position.y - ( this.legend.dimensions.height * 0.5 ) + 0.01 ) + ( this.legend.dimensions.height ) * ( value / ( this.maxV - this.minV ) * 0.99 );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( this.legend.position.x + this.legend.dimensions.width * 0.55, linePosition , this.legend.position.z ) );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( this.legend.position.x + this.legend.dimensions.width * 0.7, linePosition, this.legend.position.z ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.legend.layout == 'horizontal' ) {\n\n\t\t\t\t\tvar linePosition = ( this.legend.position.x - ( this.legend.dimensions.height * 0.5 ) + 0.01 ) + ( this.legend.dimensions.height ) * ( value / ( this.maxV - this.minV ) * 0.99 );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( linePosition, this.legend.position.y - this.legend.dimensions.width * 0.55, this.legend.position.z ) );\n\n\t\t\t\t\tgeometry.vertices.push( new THREE.Vector3( linePosition, this.legend.position.y - this.legend.dimensions.width * 0.7, this.legend.position.z ) );\n\n\t\t\t\t}\n\n\t\t\t\tvar line = new THREE.Line( geometry, material );\n\n\t\t\t\tlines[ i ] = line;\n\t\t\t\tticks[ i ] = spriteTick;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn { 'title': spriteTitle, 'ticks': ticks, 'lines': lines };\n\n\t}\n\n};\n\n\nTHREE.ColorMapKeywords = {\n\n \"rainbow\": [ [ 0.0, '0x0000FF' ], [ 0.2, '0x00FFFF' ], [ 0.5, '0x00FF00' ], [ 0.8, '0xFFFF00'], [1.0, '0xFF0000' ] ],\n \"cooltowarm\": [ [ 0.0, '0x3C4EC2' ], [ 0.2, '0x9BBCFF' ], [ 0.5, '0xDCDCDC' ], [ 0.8, '0xF6A385'], [1.0, '0xB40426' ] ],\n \"blackbody\" : [ [ 0.0, '0x000000' ], [ 0.2, '0x780000' ], [ 0.5, '0xE63200' ], [ 0.8, '0xFFFF00'], [1.0, '0xFFFFFF' ] ],\n \"grayscale\" : [ [ 0.0, '0x000000' ], [ 0.2, '0x404040' ], [ 0.5, '0x7F7F80' ], [ 0.8, '0xBFBFBF'], [1.0, '0xFFFFFF' ] ]\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Math/ColorConverter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Math/ColorConverter.js",
"module-type": "library",
"text": "/**\n * @author bhouston / http://exocortex.com/\n * @author zz85 / http://github.com/zz85\n */\n\nTHREE.ColorConverter = {\n\n\tsetHSV: function ( color, h, s, v ) {\n\n\t\t// https://gist.github.com/xpansive/1337890#file-index-js\n\t\treturn color.setHSL( h, ( s * v ) / ( ( h = ( 2 - s ) * v ) < 1 ? h : ( 2 - h ) ), h * 0.5 );\n\n\t},\n\n\tgetHSV: function( color ) {\n\n\t\tvar hsl = color.getHSL();\n\n\t\t// based on https://gist.github.com/xpansive/1337890#file-index-js\n\t\thsl.s *= ( hsl.l < 0.5 ) ? hsl.l : ( 1 - hsl.l );\n\n\t\treturn {\n\t\t\th: hsl.h,\n\t\t\ts: 2 * hsl.s / ( hsl.l + hsl.s ),\n\t\t\tv: hsl.l + hsl.s\n\t\t};\n\t},\n\n\t// where c, m, y, k is between 0 and 1\n\t\n\tsetCMYK: function ( color, c, m, y, k ) {\n\n\t\tvar r = ( 1 - c ) * ( 1 - k );\n\t\tvar g = ( 1 - m ) * ( 1 - k );\n\t\tvar b = ( 1 - y ) * ( 1 - k );\n\n\t\treturn color.setRGB( r, g, b );\n\n\t},\n\n\tgetCMYK: function ( color ) {\n\n\t\tvar r = color.r;\n\t\tvar g = color.g;\n\t\tvar b = color.b;\n\t\tvar k = 1 - Math.max(r, g, b);\n\t\tvar c = ( 1 - r - k ) / ( 1 - k );\n\t\tvar m = ( 1 - g - k ) / ( 1 - k );\n\t\tvar y = ( 1 - b - k ) / ( 1 - k );\n\n\t\treturn {\n\t\t\tc: c, m: m, y: y, k: k\n\t\t};\n\n\t}\n\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Modifiers/TessellateModifier.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Modifiers/TessellateModifier.js",
"module-type": "library",
"text": "/**\n * Break faces with edges longer than maxEdgeLength\n * - not recursive\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TessellateModifier = function ( maxEdgeLength ) {\n\n\tthis.maxEdgeLength = maxEdgeLength;\n\n};\n\nTHREE.TessellateModifier.prototype.modify = function ( geometry ) {\n\n\tvar i, il, face,\n\ta, b, c, d,\n\tva, vb, vc, vd,\n\tdab, dbc, dac, dcd, dad,\n\tm, m1, m2,\n\tvm, vm1, vm2,\n\tvnm, vnm1, vnm2,\n\tvcm, vcm1, vcm2,\n\ttriA, triB,\n\tquadA, quadB,\n\tedge;\n\n\tvar faces = [];\n\tvar faceVertexUvs = [];\n\tvar maxEdgeLength = this.maxEdgeLength;\n\n\tfor ( i = 0, il = geometry.faceVertexUvs.length; i < il; i ++ ) {\n\n\t\tfaceVertexUvs[ i ] = [];\n\n\t}\n\n\tfor ( i = 0, il = geometry.faces.length; i < il; i ++ ) {\n\n\t\tface = geometry.faces[ i ];\n\n\t\tif ( face instanceof THREE.Face3 ) {\n\n\t\t\ta = face.a;\n\t\t\tb = face.b;\n\t\t\tc = face.c;\n\n\t\t\tva = geometry.vertices[ a ];\n\t\t\tvb = geometry.vertices[ b ];\n\t\t\tvc = geometry.vertices[ c ];\n\n\t\t\tdab = va.distanceTo( vb );\n\t\t\tdbc = vb.distanceTo( vc );\n\t\t\tdac = va.distanceTo( vc );\n\n\t\t\tif ( dab > maxEdgeLength || dbc > maxEdgeLength || dac > maxEdgeLength ) {\n\n\t\t\t\tm = geometry.vertices.length;\n\n\t\t\t\ttriA = face.clone();\n\t\t\t\ttriB = face.clone();\n\n\t\t\t\tif ( dab >= dbc && dab >= dac ) {\n\n\t\t\t\t\tvm = va.clone();\n\t\t\t\t\tvm.lerp( vb, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = m;\n\t\t\t\t\ttriA.c = c;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = b;\n\t\t\t\t\ttriB.c = c;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 1 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 1 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 1 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 1 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 0;\n\n\t\t\t\t} else if ( dbc >= dab && dbc >= dac ) {\n\n\t\t\t\t\tvm = vb.clone();\n\t\t\t\t\tvm.lerp( vc, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = b;\n\t\t\t\t\ttriA.c = m;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = c;\n\t\t\t\t\ttriB.c = a;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 1 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 2 ].copy( vnm );\n\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 1 ].copy( face.vertexNormals[ 2 ] );\n\t\t\t\t\t\ttriB.vertexNormals[ 2 ].copy( face.vertexNormals[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 1 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 2 ].copy( vcm );\n\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 1 ].copy( face.vertexColors[ 2 ] );\n\t\t\t\t\t\ttriB.vertexColors[ 2 ].copy( face.vertexColors[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 1;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvm = va.clone();\n\t\t\t\t\tvm.lerp( vc, 0.5 );\n\n\t\t\t\t\ttriA.a = a;\n\t\t\t\t\ttriA.b = b;\n\t\t\t\t\ttriA.c = m;\n\n\t\t\t\t\ttriB.a = m;\n\t\t\t\t\ttriB.b = b;\n\t\t\t\t\ttriB.c = c;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 3 ) {\n\n\t\t\t\t\t\tvnm = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexNormals[ 2 ].copy( vnm );\n\t\t\t\t\t\ttriB.vertexNormals[ 0 ].copy( vnm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 3 ) {\n\n\t\t\t\t\t\tvcm = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\ttriA.vertexColors[ 2 ].copy( vcm );\n\t\t\t\t\t\ttriB.vertexColors[ 0 ].copy( vcm );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 2;\n\n\t\t\t\t}\n\n\t\t\t\tfaces.push( triA, triB );\n\t\t\t\tgeometry.vertices.push( vm );\n\n\t\t\t\tvar j, jl, uvs, uvA, uvB, uvC, uvM, uvsTriA, uvsTriB;\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tif ( geometry.faceVertexUvs[ j ].length ) {\n\n\t\t\t\t\t\tuvs = geometry.faceVertexUvs[ j ][ i ];\n\n\t\t\t\t\t\tuvA = uvs[ 0 ];\n\t\t\t\t\t\tuvB = uvs[ 1 ];\n\t\t\t\t\t\tuvC = uvs[ 2 ];\n\n\t\t\t\t\t\t// AB\n\n\t\t\t\t\t\tif ( edge === 0 ) {\n\n\t\t\t\t\t\t\tuvM = uvA.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvB, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvM.clone(), uvC.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];\n\n\t\t\t\t\t\t// BC\n\n\t\t\t\t\t\t} else if ( edge === 1 ) {\n\n\t\t\t\t\t\t\tuvM = uvB.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvC.clone(), uvA.clone() ];\n\n\t\t\t\t\t\t// AC\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuvM = uvA.clone();\n\t\t\t\t\t\t\tuvM.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];\n\t\t\t\t\t\t\tuvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfaceVertexUvs[ j ].push( uvsTriA, uvsTriB );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tfaces.push( face );\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tfaceVertexUvs[ j ].push( geometry.faceVertexUvs[ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\ta = face.a;\n\t\t\tb = face.b;\n\t\t\tc = face.c;\n\t\t\td = face.d;\n\n\t\t\tva = geometry.vertices[ a ];\n\t\t\tvb = geometry.vertices[ b ];\n\t\t\tvc = geometry.vertices[ c ];\n\t\t\tvd = geometry.vertices[ d ];\n\n\t\t\tdab = va.distanceTo( vb );\n\t\t\tdbc = vb.distanceTo( vc );\n\t\t\tdcd = vc.distanceTo( vd );\n\t\t\tdad = va.distanceTo( vd );\n\n\t\t\tif ( dab > maxEdgeLength || dbc > maxEdgeLength || dcd > maxEdgeLength || dad > maxEdgeLength ) {\n\n\t\t\t\tm1 = geometry.vertices.length;\n\t\t\t\tm2 = geometry.vertices.length + 1;\n\n\t\t\t\tquadA = face.clone();\n\t\t\t\tquadB = face.clone();\n\n\t\t\t\tif ( ( dab >= dbc && dab >= dcd && dab >= dad ) || ( dcd >= dbc && dcd >= dab && dcd >= dad ) ) {\n\n\t\t\t\t\tvm1 = va.clone();\n\t\t\t\t\tvm1.lerp( vb, 0.5 );\n\n\t\t\t\t\tvm2 = vc.clone();\n\t\t\t\t\tvm2.lerp( vd, 0.5 );\n\n\t\t\t\t\tquadA.a = a;\n\t\t\t\t\tquadA.b = m1;\n\t\t\t\t\tquadA.c = m2;\n\t\t\t\t\tquadA.d = d;\n\n\t\t\t\t\tquadB.a = m1;\n\t\t\t\t\tquadB.b = b;\n\t\t\t\t\tquadB.c = c;\n\t\t\t\t\tquadB.d = m2;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 4 ) {\n\n\t\t\t\t\t\tvnm1 = face.vertexNormals[ 0 ].clone();\n\t\t\t\t\t\tvnm1.lerp( face.vertexNormals[ 1 ], 0.5 );\n\n\t\t\t\t\t\tvnm2 = face.vertexNormals[ 2 ].clone();\n\t\t\t\t\t\tvnm2.lerp( face.vertexNormals[ 3 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexNormals[ 1 ].copy( vnm1 );\n\t\t\t\t\t\tquadA.vertexNormals[ 2 ].copy( vnm2 );\n\n\t\t\t\t\t\tquadB.vertexNormals[ 0 ].copy( vnm1 );\n\t\t\t\t\t\tquadB.vertexNormals[ 3 ].copy( vnm2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 4 ) {\n\n\t\t\t\t\t\tvcm1 = face.vertexColors[ 0 ].clone();\n\t\t\t\t\t\tvcm1.lerp( face.vertexColors[ 1 ], 0.5 );\n\n\t\t\t\t\t\tvcm2 = face.vertexColors[ 2 ].clone();\n\t\t\t\t\t\tvcm2.lerp( face.vertexColors[ 3 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexColors[ 1 ].copy( vcm1 );\n\t\t\t\t\t\tquadA.vertexColors[ 2 ].copy( vcm2 );\n\n\t\t\t\t\t\tquadB.vertexColors[ 0 ].copy( vcm1 );\n\t\t\t\t\t\tquadB.vertexColors[ 3 ].copy( vcm2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tvm1 = vb.clone();\n\t\t\t\t\tvm1.lerp( vc, 0.5 );\n\n\t\t\t\t\tvm2 = vd.clone();\n\t\t\t\t\tvm2.lerp( va, 0.5 );\n\n\t\t\t\t\tquadA.a = a;\n\t\t\t\t\tquadA.b = b;\n\t\t\t\t\tquadA.c = m1;\n\t\t\t\t\tquadA.d = m2;\n\n\t\t\t\t\tquadB.a = m2;\n\t\t\t\t\tquadB.b = m1;\n\t\t\t\t\tquadB.c = c;\n\t\t\t\t\tquadB.d = d;\n\n\t\t\t\t\tif ( face.vertexNormals.length === 4 ) {\n\n\t\t\t\t\t\tvnm1 = face.vertexNormals[ 1 ].clone();\n\t\t\t\t\t\tvnm1.lerp( face.vertexNormals[ 2 ], 0.5 );\n\n\t\t\t\t\t\tvnm2 = face.vertexNormals[ 3 ].clone();\n\t\t\t\t\t\tvnm2.lerp( face.vertexNormals[ 0 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexNormals[ 2 ].copy( vnm1 );\n\t\t\t\t\t\tquadA.vertexNormals[ 3 ].copy( vnm2 );\n\n\t\t\t\t\t\tquadB.vertexNormals[ 0 ].copy( vnm2 );\n\t\t\t\t\t\tquadB.vertexNormals[ 1 ].copy( vnm1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( face.vertexColors.length === 4 ) {\n\n\t\t\t\t\t\tvcm1 = face.vertexColors[ 1 ].clone();\n\t\t\t\t\t\tvcm1.lerp( face.vertexColors[ 2 ], 0.5 );\n\n\t\t\t\t\t\tvcm2 = face.vertexColors[ 3 ].clone();\n\t\t\t\t\t\tvcm2.lerp( face.vertexColors[ 0 ], 0.5 );\n\n\t\t\t\t\t\tquadA.vertexColors[ 2 ].copy( vcm1 );\n\t\t\t\t\t\tquadA.vertexColors[ 3 ].copy( vcm2 );\n\n\t\t\t\t\t\tquadB.vertexColors[ 0 ].copy( vcm2 );\n\t\t\t\t\t\tquadB.vertexColors[ 1 ].copy( vcm1 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tedge = 1;\n\n\t\t\t\t}\n\n\t\t\t\tfaces.push( quadA, quadB );\n\t\t\t\tgeometry.vertices.push( vm1, vm2 );\n\n\t\t\t\tvar j, jl, uvs, uvA, uvB, uvC, uvD, uvM1, uvM2, uvsQuadA, uvsQuadB;\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tif ( geometry.faceVertexUvs[ j ].length ) {\n\n\t\t\t\t\t\tuvs = geometry.faceVertexUvs[ j ][ i ];\n\n\t\t\t\t\t\tuvA = uvs[ 0 ];\n\t\t\t\t\t\tuvB = uvs[ 1 ];\n\t\t\t\t\t\tuvC = uvs[ 2 ];\n\t\t\t\t\t\tuvD = uvs[ 3 ];\n\n\t\t\t\t\t\t// AB + CD\n\n\t\t\t\t\t\tif ( edge === 0 ) {\n\n\t\t\t\t\t\t\tuvM1 = uvA.clone();\n\t\t\t\t\t\t\tuvM1.lerp( uvB, 0.5 );\n\n\t\t\t\t\t\t\tuvM2 = uvC.clone();\n\t\t\t\t\t\t\tuvM2.lerp( uvD, 0.5 );\n\n\t\t\t\t\t\t\tuvsQuadA = [ uvA.clone(), uvM1.clone(), uvM2.clone(), uvD.clone() ];\n\t\t\t\t\t\t\tuvsQuadB = [ uvM1.clone(), uvB.clone(), uvC.clone(), uvM2.clone() ];\n\n\t\t\t\t\t\t// BC + AD\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tuvM1 = uvB.clone();\n\t\t\t\t\t\t\tuvM1.lerp( uvC, 0.5 );\n\n\t\t\t\t\t\t\tuvM2 = uvD.clone();\n\t\t\t\t\t\t\tuvM2.lerp( uvA, 0.5 );\n\n\t\t\t\t\t\t\tuvsQuadA = [ uvA.clone(), uvB.clone(), uvM1.clone(), uvM2.clone() ];\n\t\t\t\t\t\t\tuvsQuadB = [ uvM2.clone(), uvM1.clone(), uvC.clone(), uvD.clone() ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfaceVertexUvs[ j ].push( uvsQuadA, uvsQuadB );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tfaces.push( face );\n\n\t\t\t\tfor ( j = 0, jl = geometry.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\t\t\tfaceVertexUvs[ j ].push( geometry.faceVertexUvs[ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tgeometry.faces = faces;\n\tgeometry.faceVertexUvs = faceVertexUvs;\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Modifiers/ExplodeModifier.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Modifiers/ExplodeModifier.js",
"module-type": "library",
"text": "/**\n * Make all faces use unique vertices\n * so that each face can be separated from others\n *\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ExplodeModifier = function () {\n\n};\n\nTHREE.ExplodeModifier.prototype.modify = function ( geometry ) {\n\n\tvar vertices = [];\n\n\tfor ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {\n\n\t\tvar n = vertices.length;\n\n\t\tvar face = geometry.faces[ i ];\n\n\t\tvar a = face.a;\n\t\tvar b = face.b;\n\t\tvar c = face.c;\n\n\t\tvar va = geometry.vertices[ a ];\n\t\tvar vb = geometry.vertices[ b ];\n\t\tvar vc = geometry.vertices[ c ];\n\n\t\tvertices.push( va.clone() );\n\t\tvertices.push( vb.clone() );\n\t\tvertices.push( vc.clone() );\n\n\t\tface.a = n;\n\t\tface.b = n + 1;\n\t\tface.c = n + 2;\n\n\t}\n\n\tgeometry.vertices = vertices;\n\tdelete geometry.__tmpVertices;\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/Modifiers/SubdivisionModifier.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Modifiers/SubdivisionModifier.js",
"module-type": "library",
"text": "/*\r\n *\t@author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog \r\n *\r\n *\tSubdivision Geometry Modifier \r\n *\t\tusing Loop Subdivision Scheme\r\n *\r\n *\tReferences:\r\n *\t\thttp://graphics.stanford.edu/~mdfisher/subdivision.html\r\n *\t\thttp://www.holmes3d.net/graphics/subdivision/\r\n *\t\thttp://www.cs.rutgers.edu/~decarlo/readings/subdiv-sg00c.pdf\r\n *\r\n *\tKnown Issues:\r\n *\t\t- currently doesn't handle UVs\r\n *\t\t- currently doesn't handle \"Sharp Edges\"\r\n *\r\n */\r\n\r\nTHREE.SubdivisionModifier = function ( subdivisions ) {\r\n\r\n\tthis.subdivisions = (subdivisions === undefined ) ? 1 : subdivisions;\r\n\r\n};\r\n\r\n// Applies the \"modify\" pattern\r\nTHREE.SubdivisionModifier.prototype.modify = function ( geometry ) {\r\n\r\n\tvar repeats = this.subdivisions;\r\n\r\n\twhile ( repeats-- > 0 ) {\r\n\t\tthis.smooth( geometry );\r\n\t}\r\n\r\n\tdelete geometry.__tmpVertices;\r\n\r\n\tgeometry.computeFaceNormals();\r\n\tgeometry.computeVertexNormals();\r\n\r\n};\r\n\r\n(function() {\r\n\r\n\t// Some constants\r\n\tvar WARNINGS = !true; // Set to true for development\r\n\tvar ABC = [ 'a', 'b', 'c' ];\r\n\t\r\n\r\n\tfunction getEdge( a, b, map ) {\r\n\r\n\t\tvar vertexIndexA = Math.min( a, b );\r\n\t\tvar vertexIndexB = Math.max( a, b );\r\n\r\n\t\tvar key = vertexIndexA + \"_\" + vertexIndexB;\r\n\r\n\t\treturn map[ key ];\r\n\r\n\t}\r\n\r\n\r\n\tfunction processEdge( a, b, vertices, map, face, metaVertices ) {\r\n\r\n\t\tvar vertexIndexA = Math.min( a, b );\r\n\t\tvar vertexIndexB = Math.max( a, b );\r\n\r\n\t\tvar key = vertexIndexA + \"_\" + vertexIndexB;\r\n\r\n\t\tvar edge;\r\n\r\n\t\tif ( key in map ) {\r\n\r\n\t\t\tedge = map[ key ];\r\n\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tvar vertexA = vertices[ vertexIndexA ];\r\n\t\t\tvar vertexB = vertices[ vertexIndexB ];\r\n\r\n\t\t\tedge = {\r\n\r\n\t\t\t\ta: vertexA, // pointer reference\r\n\t\t\t\tb: vertexB,\r\n\t\t\t\tnewEdge: null,\r\n\t\t\t\t// aIndex: a, // numbered reference\r\n\t\t\t\t// bIndex: b,\r\n\t\t\t\tfaces: [] // pointers to face\r\n\r\n\t\t\t};\r\n\r\n\t\t\tmap[ key ] = edge;\r\n\r\n\t\t}\r\n\r\n\t\tedge.faces.push( face );\r\n\r\n\t\tmetaVertices[ a ].edges.push( edge );\r\n\t\tmetaVertices[ b ].edges.push( edge );\r\n\t\t\r\n\r\n\t}\r\n\r\n\tfunction generateLookups( vertices, faces, metaVertices, edges ) {\r\n\r\n\t\tvar i, il, face, edge;\r\n\r\n\t\tfor ( i = 0, il = vertices.length; i < il; i++ ) {\r\n\t\t\tmetaVertices[ i ] = { edges: [] };\r\n\t\t}\r\n\t\t\r\n\t\tfor ( i = 0, il = faces.length; i < il; i++ ) {\r\n\t\t\tface = faces[ i ];\r\n\r\n\t\t\tprocessEdge( face.a, face.b, vertices, edges, face, metaVertices );\r\n\t\t\tprocessEdge( face.b, face.c, vertices, edges, face, metaVertices );\r\n\t\t\tprocessEdge( face.c, face.a, vertices, edges, face, metaVertices );\r\n\r\n\t\t}\r\n\t}\r\n\r\n\tfunction newFace( newFaces, a, b, c ) {\r\n\r\n\t\tnewFaces.push( new THREE.Face3( a, b, c ) );\r\n\r\n\t}\r\n\r\n\r\n\t/////////////////////////////\r\n\r\n\t// Performs one iteration of Subdivision\r\n\tTHREE.SubdivisionModifier.prototype.smooth = function ( geometry ) {\r\n\r\n\t\tvar tmp = new THREE.Vector3();\r\n\r\n\t\tvar oldVertices, oldFaces;\r\n\t\tvar newVertices, newFaces; // newUVs = [];\r\n\r\n\t\tvar n, l, i, il, j, k;\r\n\t\tvar metaVertices, sourceEdges;\r\n\r\n\t\t// new stuff.\r\n\t\tvar sourceEdges, newEdgeVertices, newSourceVertices\r\n\r\n\t\toldVertices = geometry.vertices; // { x, y, z}\r\n\t\toldFaces = geometry.faces; // { a: oldVertex1, b: oldVertex2, c: oldVertex3 }\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t * Step 0: Preprocess Geometry to Generate edges Lookup\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tmetaVertices = new Array( oldVertices.length );\r\n\t\tsourceEdges = {}; // Edge => { oldVertex1, oldVertex2, faces[] }\r\n\r\n\t\tgenerateLookups(oldVertices, oldFaces, metaVertices, sourceEdges);\r\n\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 1. \r\n\t\t *\tFor each edge, create a new Edge Vertex,\r\n\t\t *\tthen position it.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tnewEdgeVertices = [];\r\n\t\tvar other, currentEdge, newEdge, face;\r\n\t\tvar edgeVertexWeight, adjacentVertexWeight, connectedFaces;\r\n\r\n\t\tfor ( i in sourceEdges ) {\r\n\r\n\t\t\tcurrentEdge = sourceEdges[ i ];\r\n\t\t\tnewEdge = new THREE.Vector3();\r\n\r\n\t\t\tedgeVertexWeight = 3 / 8;\r\n\t\t\tadjacentVertexWeight = 1 / 8;\r\n\r\n\t\t\tconnectedFaces = currentEdge.faces.length;\r\n\r\n\t\t\t// check how many linked faces. 2 should be correct.\r\n\t\t\tif ( connectedFaces != 2 ) {\r\n\r\n\t\t\t\t// if length is not 2, handle condition\r\n\t\t\t\tedgeVertexWeight = 0.5;\r\n\t\t\t\tadjacentVertexWeight = 0;\r\n\r\n\t\t\t\tif ( connectedFaces != 1 ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (WARNINGS) console.warn('Subdivision Modifier: Number of connected faces != 2, is: ', connectedFaces, currentEdge);\r\n\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tnewEdge.addVectors( currentEdge.a, currentEdge.b ).multiplyScalar( edgeVertexWeight );\r\n\r\n\t\t\ttmp.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( j = 0; j < connectedFaces; j++ ) {\r\n\r\n\t\t\t\tface = currentEdge.faces[ j ];\r\n\t\t\t\t\r\n\t\t\t\tfor ( k = 0; k < 3; k++ ) {\r\n\r\n\t\t\t\t\tother = oldVertices[ face[ ABC[k] ] ];\r\n\t\t\t\t\tif (other !== currentEdge.a && other !== currentEdge.b ) break;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttmp.add( other );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttmp.multiplyScalar( adjacentVertexWeight );\r\n\t\t\tnewEdge.add( tmp );\r\n\r\n\t\t\tcurrentEdge.newEdge = newEdgeVertices.length;\r\n\t\t\tnewEdgeVertices.push(newEdge);\r\n\r\n\t\t\t// console.log(currentEdge, newEdge);\r\n\t\t}\r\n\r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 2. \r\n\t\t *\tReposition each source vertices.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tvar beta, sourceVertexWeight, connectingVertexWeight;\r\n\t\tvar connectingEdge, connectingEdges, oldVertex, newSourceVertex;\r\n\t\tnewSourceVertices = [];\r\n\r\n\t\tfor ( i = 0, il = oldVertices.length; i < il; i++ ) {\r\n\r\n\t\t\toldVertex = oldVertices[ i ];\r\n\r\n\t\t\t// find all connecting edges (using lookupTable)\r\n\t\t\tconnectingEdges = metaVertices[ i ].edges;\r\n\t\t\tn = connectingEdges.length;\r\n\t\t\tbeta;\r\n\r\n\t\t\tif ( n == 3 ) {\r\n\r\n\t\t\t\tbeta = 3 / 16;\r\n\r\n\t\t\t} else if ( n > 3 ) {\r\n\r\n\t\t\t\tbeta = 3 / ( 8 * n ); // Warren's modified formula\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Loop's original beta formula\r\n\t\t\t// beta = 1 / n * ( 5/8 - Math.pow( 3/8 + 1/4 * Math.cos( 2 * Math. PI / n ), 2) );\r\n\r\n\t\t\tsourceVertexWeight = 1 - n * beta;\r\n\t\t\tconnectingVertexWeight = beta;\r\n\r\n\t\t\tif ( n <= 2 ) {\r\n\t\t\t\t\r\n\t\t\t\t// crease and boundary rules\r\n\t\t\t\t// console.warn('crease and boundary rules');\r\n\r\n\t\t\t\tif ( n == 2 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('2 connecting edges', connectingEdges);\r\n\t\t\t\t\tsourceVertexWeight = 3 / 4;\r\n\t\t\t\t\tconnectingVertexWeight = 1 / 8;\r\n\r\n\t\t\t\t\t// sourceVertexWeight = 1;\r\n\t\t\t\t\t// connectingVertexWeight = 0;\r\n\r\n\t\t\t\t} else if ( n == 1 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('only 1 connecting edge');\r\n\r\n\t\t\t\t} else if ( n == 0 ) {\r\n\r\n\t\t\t\t\tif (WARNINGS) console.warn('0 connecting edges');\r\n\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\tnewSourceVertex = oldVertex.clone().multiplyScalar( sourceVertexWeight );\r\n\r\n\t\t\ttmp.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( j=0; j < n; j++ ) {\r\n\r\n\t\t\t\tconnectingEdge = connectingEdges[ j ];\r\n\t\t\t\tother = connectingEdge.a !== oldVertex ? connectingEdge.a : connectingEdge.b;\r\n\t\t\t\ttmp.add( other );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttmp.multiplyScalar( connectingVertexWeight );\r\n\t\t\tnewSourceVertex.add( tmp );\r\n\t\t\t\r\n\t\t\tnewSourceVertices.push( newSourceVertex );\r\n\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t \r\n\t\t/******************************************************\r\n\t\t *\r\n\t\t *\tStep 3. \r\n\t\t *\tGenerate Faces between source vertecies\r\n\t\t *\tand edge vertices.\r\n\t\t *\r\n\t\t *******************************************************/\r\n\r\n\t\tnewVertices = newSourceVertices.concat( newEdgeVertices );\r\n\t\tvar sl = newSourceVertices.length, edge1, edge2, edge3;\r\n\t\tnewFaces = [];\r\n\r\n\t\tfor ( i = 0, il = oldFaces.length; i < il; i++ ) {\r\n\r\n\t\t\tface = oldFaces[ i ];\r\n\r\n\t\t\t// find the 3 new edges vertex of each old face\r\n\r\n\t\t\tedge1 = getEdge( face.a, face.b, sourceEdges ).newEdge + sl;\r\n\t\t\tedge2 = getEdge( face.b, face.c, sourceEdges ).newEdge + sl;\r\n\t\t\tedge3 = getEdge( face.c, face.a, sourceEdges ).newEdge + sl;\r\n\r\n\t\t\t// create 4 faces.\r\n\r\n\t\t\tnewFace( newFaces, edge1, edge2, edge3 );\r\n\t\t\tnewFace( newFaces, face.a, edge1, edge3 );\r\n\t\t\tnewFace( newFaces, face.b, edge2, edge1 );\r\n\t\t\tnewFace( newFaces, face.c, edge3, edge2 );\r\n\r\n\t\t}\r\n\r\n\t\t// Overwrite old arrays\r\n\t\tgeometry.vertices = newVertices;\r\n\t\tgeometry.faces = newFaces;\r\n\r\n\t\t// console.log('done');\r\n\r\n\t};\r\n\r\n\r\n})();"
},
"$:/plugins/rboue/Three.js/Lib/BlendCharacter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/BlendCharacter.js",
"module-type": "library",
"text": "/**\n * @author Michael Guerrero / http://realitymeltdown.com\n */\n\nTHREE.BlendCharacter = function () {\n\n\tthis.animations = {};\n\tthis.weightSchedule = [];\n\tthis.warpSchedule = [];\n\n\tthis.load = function ( url, onLoad ) {\n\n\t\tvar scope = this;\n\n\t\tvar loader = new THREE.JSONLoader();\n\t\tloader.load( url, function( geometry, materials ) {\n\n\t\t\tvar originalMaterial = materials[ 0 ];\n\t\t\toriginalMaterial.skinning = true;\n\n\t\t\tTHREE.SkinnedMesh.call( scope, geometry, originalMaterial );\n\n\t\t\t// Create the animations\n\n\t\t\tfor ( var i = 0; i < geometry.animations.length; ++i ) {\n\n\t\t\t\tvar animName = geometry.animations[ i ].name;\n\t\t\t\tscope.animations[ animName ] = new THREE.Animation( scope, geometry.animations[ i ] );\n\n\t\t\t}\n\n\t\t\t// Create the debug visualization\n\n\t\t\tscope.skeletonHelper = new THREE.SkeletonHelper( scope );\n\t\t\tscope.skeletonHelper.material.linewidth = 3;\n\t\t\tscope.add( scope.skeletonHelper );\n\n\t\t\tscope.showSkeleton( false );\n\n\t\t\t// Loading is complete, fire the callback\n\t\t\tif ( onLoad !== undefined ) onLoad();\n\n\t\t} );\n\n\t};\n\n\tthis.update = function( dt ) {\n\n\t\tfor ( var i = this.weightSchedule.length - 1; i >= 0; --i ) {\n\n\t\t\tvar data = this.weightSchedule[ i ];\n\t\t\tdata.timeElapsed += dt;\n\n\t\t\t// If the transition is complete, remove it from the schedule\n\n\t\t\tif ( data.timeElapsed > data.duration ) {\n\n\t\t\t\tdata.anim.weight = data.endWeight;\n\t\t\t\tthis.weightSchedule.splice( i, 1 );\n\n\t\t\t\t// If we've faded out completely, stop the animation\n\n\t\t\t\tif ( data.anim.weight == 0 ) {\n\n\t\t\t\t\tdata.anim.stop( 0 );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// interpolate the weight for the current time\n\n\t\t\t\tdata.anim.weight = data.startWeight + (data.endWeight - data.startWeight) * data.timeElapsed / data.duration;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.updateWarps( dt );\n\t\tthis.skeletonHelper.update();\n\n\t};\n\n\tthis.updateWarps = function( dt ) {\n\n\t\t// Warping modifies the time scale over time to make 2 animations of different\n\t\t// lengths match. This is useful for smoothing out transitions that get out of\n\t\t// phase such as between a walk and run cycle\n\n\t\tfor ( var i = this.warpSchedule.length - 1; i >= 0; --i ) {\n\n\t\t\tvar data = this.warpSchedule[ i ];\n\t\t\tdata.timeElapsed += dt;\n\n\t\t\tif ( data.timeElapsed > data.duration ) {\n\n\t\t\t\tdata.to.weight = 1;\n\t\t\t\tdata.to.timeScale = 1;\n\t\t\t\tdata.from.weight = 0;\n\t\t\t\tdata.from.timeScale = 1;\n\t\t\t\tdata.from.stop( 0 );\n\n\t\t\t\tthis.warpSchedule.splice( i, 1 );\n\n\t\t\t} else {\n\n\t\t\t\tvar alpha = data.timeElapsed / data.duration;\n\n\t\t\t\tvar fromLength = data.from.data.length;\n\t\t\t\tvar toLength = data.to.data.length;\n\n\t\t\t\tvar fromToRatio = fromLength / toLength;\n\t\t\t\tvar toFromRatio = toLength / fromLength;\n\n\t\t\t\t// scale from each time proportionally to the other animation\n\n\t\t\t\tdata.from.timeScale = ( 1 - alpha ) + fromToRatio * alpha;\n\t\t\t\tdata.to.timeScale = alpha + toFromRatio * ( 1 - alpha );\n\n\t\t\t\tdata.from.weight = 1 - alpha;\n\t\t\t\tdata.to.weight = alpha;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tthis.play = function(animName, weight) {\n\n\t\tthis.animations[ animName ].play( 0, weight );\n\n\t};\n\n\tthis.crossfade = function( fromAnimName, toAnimName, duration ) {\n\n\t\tvar fromAnim = this.animations[ fromAnimName ];\n\t\tvar toAnim = this.animations[ toAnimName ];\n\n\t\tfromAnim.play( 0, 1 );\n\t\ttoAnim.play( 0, 0 );\n\n\t\tthis.weightSchedule.push( {\n\n\t\t\tanim: fromAnim,\n\t\t\tstartWeight: 1,\n\t\t\tendWeight: 0,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t\tthis.weightSchedule.push( {\n\n\t\t\tanim: toAnim,\n\t\t\tstartWeight: 0,\n\t\t\tendWeight: 1,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t};\n\n\tthis.warp = function( fromAnimName, toAnimName, duration ) {\n\n\t\tvar fromAnim = this.animations[ fromAnimName ];\n\t\tvar toAnim = this.animations[ toAnimName ];\n\n\t\tfromAnim.play( 0, 1 );\n\t\ttoAnim.play( 0, 0 );\n\n\t\tthis.warpSchedule.push( {\n\n\t\t\tfrom: fromAnim,\n\t\t\tto: toAnim,\n\t\t\ttimeElapsed: 0,\n\t\t\tduration: duration\n\n\t\t} );\n\n\t};\n\n\tthis.applyWeight = function(animName, weight) {\n\n\t\tthis.animations[ animName ].weight = weight;\n\n\t};\n\n\tthis.pauseAll = function() {\n\n\t\tfor ( var a in this.animations ) {\n\n\t\t\tif ( this.animations[ a ].isPlaying ) {\n\n\t\t\t\tthis.animations[ a ].stop();\n\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\tthis.unPauseAll = function() {\n\n\tfor ( var a in this.animations ) {\n\n\t if ( this.animations[ a ].isPlaying && this.animations[ a ].isPaused ) {\n\n\t\tthis.animations[ a ].pause();\n\n\t }\n\n\t}\n\n };\n\n\n\tthis.stopAll = function() {\n\n\t\tfor ( a in this.animations ) {\n\n\t\t\tif ( this.animations[ a ].isPlaying ) {\n\t\t\t\tthis.animations[ a ].stop(0);\n\t\t\t}\n\n\t\t\tthis.animations[ a ].weight = 0;\n\n\t\t}\n\n\t\tthis.weightSchedule.length = 0;\n\t\tthis.warpSchedule.length = 0;\n\n\t}\n\n\tthis.showSkeleton = function( boolean ) {\n\n\t\tthis.skeletonHelper.visible = boolean;\n\n\t}\n\n\tthis.showModel = function( boolean ) {\n\n\t\tthis.visible = boolean;\n\n\t}\n\n};\n\n\nTHREE.BlendCharacter.prototype = Object.create( THREE.SkinnedMesh.prototype );\n\nTHREE.BlendCharacter.prototype.getForward = function() {\n\n\tvar forward = new THREE.Vector3();\n\n\treturn function() {\n\n\t\t// pull the character's forward basis vector out of the matrix\n\t\tforward.set(\n\t\t\t-this.matrix.elements[ 8 ],\n\t\t\t-this.matrix.elements[ 9 ],\n\t\t\t-this.matrix.elements[ 10 ]\n\t\t);\n\n\t\treturn forward;\n\t}\n}\n\n"
},
"$:/plugins/rboue/Three.js/Lib/SkyShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/SkyShader.js",
"module-type": "library",
"text": "/**\n * @author zz85 / https://github.com/zz85\n * \n * Based on \"A Practical Analytic Model for Daylight\" \n * aka The Preetham Model, the de facto standard analytic skydome model\n * http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf\n * \n * First implemented by Simon Wallner\n * http://www.simonwallner.at/projects/atmospheric-scattering\n * \n * Improved by Martin Upitis\n * http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR\n * \n * Three.js integration by zz85 http://twitter.com/blurspline\n*/\n\nTHREE.ShaderLib['sky'] = {\n\n\tuniforms: {\n\n\t\tluminance:\t { type: \"f\", value:1 },\n\t\tturbidity:\t { type: \"f\", value:2 },\n\t\treileigh:\t { type: \"f\", value:1 },\n\t\tmieCoefficient:\t { type: \"f\", value:0.005 },\n\t\tmieDirectionalG: { type: \"f\", value:0.8 },\n\t\tsunPosition: \t { type: \"v3\", value: new THREE.Vector3() }\n\n\t},\n\n\tvertexShader: [\n\n\t\t\"varying vec3 vWorldPosition;\",\n\t\t\"varying vec2 vUv;\",\n\n\t\t\"void main() {\",\n\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\"vWorldPosition = worldPosition.xyz;\",\n\t\t\t\"vUv = uv;\",\n\n\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\"}\",\n\n\t].join(\"\\n\"),\n\n\tfragmentShader: [\n\n\n\t\t\"uniform sampler2D skySampler;\",\n\t\t\"uniform vec3 sunPosition;\",\n\t\t\"varying vec3 vWorldPosition;\",\n\t\t\"varying vec2 vUv;\",\n\n\n\t\t\"vec3 cameraPos = vec3(0., 0., 0.);\",\n\t\t\"// uniform sampler2D sDiffuse;\",\n\t\t\"// const float turbidity = 10.0; //\",\n\t\t\"// const float reileigh = 2.; //\",\n\t\t\"// const float luminance = 1.0; //\",\n\t\t\"// const float mieCoefficient = 0.005;\",\n\t\t\"// const float mieDirectionalG = 0.8;\",\n\n\t\t\"uniform float luminance;\",\n\t\t\"uniform float turbidity;\",\n\t\t\"uniform float reileigh;\",\n\t\t\"uniform float mieCoefficient;\",\n\t\t\"uniform float mieDirectionalG;\",\n\n\n\t\t\"vec3 sunDirection = normalize(sunPosition);\",\n\t\t\"float reileighCoefficient = reileigh;\",\n\n\t\t\"// constants for atmospheric scattering\",\n\t\t\"const float e = 2.71828182845904523536028747135266249775724709369995957;\",\n\t\t\"const float pi = 3.141592653589793238462643383279502884197169;\",\n\n\t\t\"const float n = 1.0003; // refractive index of air\",\n\t\t\"const float N = 2.545E25; // number of molecules per unit volume for air at\",\n\t\t\t\t\t\t\t\t\"// 288.15K and 1013mb (sea level -45 celsius)\",\n\t\t\"const float pn = 0.035;\t// depolatization factor for standard air\",\n\n\t\t\"// wavelength of used primaries, according to preetham\",\n\t\t\"const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);\",\n\n\t\t\"// mie stuff\",\n\t\t\"// K coefficient for the primaries\",\n\t\t\"const vec3 K = vec3(0.686, 0.678, 0.666);\",\n\t\t\"const float v = 4.0;\",\n\n\t\t\"// optical length at zenith for molecules\",\n\t\t\"const float rayleighZenithLength = 8.4E3;\",\n\t\t\"const float mieZenithLength = 1.25E3;\",\n\t\t\"const vec3 up = vec3(0.0, 1.0, 0.0);\",\n\n\t\t\"const float EE = 1000.0;\",\n\t\t\"const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\",\n\t\t\"// 66 arc seconds -> degrees, and the cosine of that\",\n\n\t\t\"// earth shadow hack\",\n\t\t\"const float cutoffAngle = pi/1.95;\",\n\t\t\"const float steepness = 1.5;\",\n\n\n\t\t\"vec3 totalRayleigh(vec3 lambda)\",\n\t\t\"{\",\n\t\t\t\"return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));\",\n\t\t\"}\",\n\n\t\t\"float rayleighPhase(float cosTheta)\",\n\t\t\"{\t \",\n\t\t\t\"return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"//\treturn (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"//\treturn (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));\",\n\t\t\"}\",\n\n\t\t\"vec3 totalMie(vec3 lambda, vec3 K, float T)\",\n\t\t\"{\",\n\t\t\t\"float c = (0.2 * T ) * 10E-18;\",\n\t\t\t\"return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;\",\n\t\t\"}\",\n\n\t\t\"float hgPhase(float cosTheta, float g)\",\n\t\t\"{\",\n\t\t\t\"return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));\",\n\t\t\"}\",\n\n\t\t\"float sunIntensity(float zenithAngleCos)\",\n\t\t\"{\",\n\t\t\t\"return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));\",\n\t\t\"}\",\n\n\t\t\"// float logLuminance(vec3 c)\",\n\t\t\"// {\",\n\t\t\"// \treturn log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);\",\n\t\t\"// }\",\n\n\t\t\"// Filmic ToneMapping http://filmicgames.com/archives/75\",\n\t\t\"float A = 0.15;\",\n\t\t\"float B = 0.50;\",\n\t\t\"float C = 0.10;\",\n\t\t\"float D = 0.20;\",\n\t\t\"float E = 0.02;\",\n\t\t\"float F = 0.30;\",\n\t\t\"float W = 1000.0;\",\n\n\t\t\"vec3 Uncharted2Tonemap(vec3 x)\",\n\t\t\"{\",\n\t\t \"return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\",\n\t\t\"}\",\n\n\n\t\t\"void main() \",\n\t\t\"{\",\n\t\t\t\"float sunfade = 1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);\",\n\n\t\t\t\"// luminance = 1.0 ;// vWorldPosition.y / 450000. + 0.5; //sunPosition.y / 450000. * 1. + 0.5;\",\n\n\t\t\t \"// gl_FragColor = vec4(sunfade, sunfade, sunfade, 1.0);\",\n\t\t\t\n\t\t\t\"reileighCoefficient = reileighCoefficient - (1.0* (1.0-sunfade));\",\n\t\t\t\n\t\t\t\"float sunE = sunIntensity(dot(sunDirection, up));\",\n\n\t\t\t\"// extinction (absorbtion + out scattering) \",\n\t\t\t\"// rayleigh coefficients\",\n\t\t\t\"vec3 betaR = totalRayleigh(lambda) * reileighCoefficient;\",\n\n\t\t\t\"// mie coefficients\",\n\t\t\t\"vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;\",\n\n\t\t\t\"// optical length\",\n\t\t\t\"// cutoff angle at 90 to avoid singularity in next formula.\",\n\t\t\t\"float zenithAngle = acos(max(0.0, dot(up, normalize(vWorldPosition - cameraPos))));\",\n\t\t\t\"float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));\",\n\t\t\t\"float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));\",\n\n\n\n\t\t\t\"// combined extinction factor\t\",\n\t\t\t\"vec3 Fex = exp(-(betaR * sR + betaM * sM));\",\n\n\t\t\t\"// in scattering\",\n\t\t\t\"float cosTheta = dot(normalize(vWorldPosition - cameraPos), sunDirection);\",\n\n\t\t\t\"float rPhase = rayleighPhase(cosTheta*0.5+0.5);\",\n\t\t\t\"vec3 betaRTheta = betaR * rPhase;\",\n\n\t\t\t\"float mPhase = hgPhase(cosTheta, mieDirectionalG);\",\n\t\t\t\"vec3 betaMTheta = betaM * mPhase;\",\n\n\n\t\t\t\"vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));\",\n\t\t\t\"Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up, sunDirection),5.0),0.0,1.0));\",\n\n\t\t\t\"//nightsky\",\n\t\t\t\"vec3 direction = normalize(vWorldPosition - cameraPos);\",\n\t\t\t\"float theta = acos(direction.y); // elevation --> y-axis, [-pi/2, pi/2]\",\n\t\t\t\"float phi = atan(direction.z, direction.x); // azimuth --> x-axis [-pi/2, pi/2]\",\n\t\t\t\"vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);\",\n\t\t\t\"// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;\",\n\t\t\t\"vec3 L0 = vec3(0.1) * Fex;\",\n\t\t\t\n\t\t\t\"// composition + solar disc\",\n\t\t\t\"//if (cosTheta > sunAngularDiameterCos)\",\n\t\t\t\"float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);\",\n\t\t\t\"// if (normalize(vWorldPosition - cameraPos).y>0.0)\",\n\t\t\t\"L0 += (sunE * 19000.0 * Fex)*sundisk;\",\n\n\n\t\t\t\"vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));\",\n\t\t\t\n\t\t\t\"vec3 texColor = (Lin+L0); \",\n\t\t\t\"texColor *= 0.04 ;\",\n\t\t\t\"texColor += vec3(0.0,0.001,0.0025)*0.3;\",\n\t\t\t\n\t\t\t\"float g_fMaxLuminance = 1.0;\",\n\t\t\t\"float fLumScaled = 0.1 / luminance; \",\n\t\t\t\"float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); \",\n\n\t\t\t\"float ExposureBias = fLumCompressed;\",\n\t\t \n\t\t\t\"vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);\",\n\t\t\t\"vec3 color = curr*whiteScale;\",\n\n\t\t\t\"vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));\",\n\n\t\t\t\n\t\t\t\"gl_FragColor.rgb = retColor;\",\n\t\t\t\t\n\t\t\t\"gl_FragColor.a = 1.0;\",\n\t\t\"}\",\n\n\t].join(\"\\n\")\n\n};\n\nTHREE.Sky = function () {\n\n\tvar skyShader = THREE.ShaderLib[ \"sky\" ];\n\tvar skyUniforms = THREE.UniformsUtils.clone( skyShader.uniforms );\n\n\tvar skyMat = new THREE.ShaderMaterial( { \n\t\tfragmentShader: skyShader.fragmentShader, \n\t\tvertexShader: skyShader.vertexShader, \n\t\tuniforms: skyUniforms,\n\t\tside: THREE.BackSide\n\t} );\n\n\tvar skyGeo = new THREE.SphereGeometry( 450000, 32, 15 );\n\tvar skyMesh = new THREE.Mesh( skyGeo, skyMat );\n\n\n\t// Expose variables\n\tthis.mesh = skyMesh;\n\tthis.uniforms = skyUniforms;\n\n\n};\n\n"
},
"$:/plugins/rboue/Three.js/Lib/SimulationRenderer.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/SimulationRenderer.js",
"module-type": "library",
"text": "/**\n * @author zz85 https://github.com/zz85 / http://www.lab4games.net/zz85/blog\n *\n * Bird Simulation Render\n *\n * \tA simple scene rendering a quad of the following shaders\n *\t1. Pass-thru Shader,\n *\t2. Bird Position Update Shader,\n *\t3. Bird Velocity Update Shader\n *\n */\n\nfunction SimulationRenderer(WIDTH, renderer) {\n\n\tWIDTH = WIDTH || 4;\n\tvar camera = new THREE.Camera();\n\tcamera.position.z = 1;\n\n\t// Init RTT stuff\n\tgl = renderer.getContext();\n\n\tif( !gl.getExtension( \"OES_texture_float\" )) {\n\t\talert( \"No OES_texture_float support for float textures!\" );\n\t\treturn;\n\t}\n\n\tif( gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) == 0) {\n\t\talert( \"No support for vertex shader textures!\" );\n\t\treturn;\n\t}\n\n\tvar scene = new THREE.Scene();\n\n\tvar uniforms = {\n\t\ttime: { type: \"f\", value: 1.0 },\n\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\ttexture: { type: \"t\", value: null }\n\t};\n\n\tvar passThruShader = new THREE.ShaderMaterial( {\n\t\tuniforms: uniforms,\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShader' ).textContent\n\t} );\n\n\tvar mesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), passThruShader );\n\n\tvar positionShader = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\t\t\ttime: { type: \"f\", value: 1.0 },\n\t\t\tdelta: { type: \"f\", value: 0.0 },\n\t\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\t\ttexturePosition: { type: \"t\", value: null },\n\t\t\ttextureVelocity: { type: \"t\", value: null },\n\t\t},\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShaderPosition' ).textContent\n\n\t} );\n\n\tthis.positionShader = positionShader;\n\n\tvar velocityShader = new THREE.ShaderMaterial( {\n\n\t\tuniforms: {\n\t\t\ttime: { type: \"f\", value: 1.0 },\n\t\t\tdelta: { type: \"f\", value: 0.0 },\n\t\t\tresolution: { type: \"v2\", value: new THREE.Vector2( WIDTH, WIDTH ) },\n\t\t\ttexturePosition: { type: \"t\", value: null },\n\t\t\ttextureVelocity: { type: \"t\", value: null },\n\t\t\ttesting: { type: \"f\", value: 1.0 },\n\t\t\tseperationDistance: { type: \"f\", value: 1.0 },\n\t\t\talignmentDistance: { type: \"f\", value: 1.0 },\n\t\t\tcohesionDistance: { type: \"f\", value: 1.0 },\n\t\t\tfreedomFactor: { type: \"f\", value: 1.0 },\n\t\t\tpredator: { type: \"v3\", value: new THREE.Vector3() }\n\t\t},\n\t\tdefines: {\n\t\t\tWIDTH: WIDTH.toFixed(2)\n\t\t},\n\t\tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n\t\tfragmentShader: document.getElementById( 'fragmentShaderVelocity' ).textContent\n\n\t} );\n\n\tthis.velocityUniforms = velocityShader.uniforms;\n\n\tscene.add( mesh );\n\n\tvar flipflop = true;\n\tvar rtPosition1, rtPosition2, rtVelocity1, rtVelocity2;\n\n\tfunction init() {\n\t\tvar dtPosition = generatePositionTexture();\n\t\tvar dtVelocity = generateVelocityTexture();\n\n\t\trtPosition1 = getRenderTarget( THREE.RGBAFormat );\n\t\trtPosition2 = rtPosition1.clone();\n\t\trtVelocity1 = getRenderTarget( THREE.RGBFormat );\n\t\trtVelocity2 = rtVelocity1.clone();\n\n\t\tsimulator.renderTexture(dtPosition, rtPosition1);\n\t\tsimulator.renderTexture(rtPosition1, rtPosition2);\n\n\t\tsimulator.renderTexture(dtVelocity, rtVelocity1);\n\t\tsimulator.renderTexture(rtVelocity1, rtVelocity2);\n\n\t\tsimulator.velocityUniforms.testing.value = 10;\n\t}\n\n\tthis.init = init;\n\n\tfunction getRenderTarget( type ) {\n\t\tvar renderTarget = new THREE.WebGLRenderTarget(WIDTH, WIDTH, {\n\t\t\twrapS: THREE.RepeatWrapping,\n\t\t\twrapT: THREE.RepeatWrapping,\n\t\t\tminFilter: THREE.NearestFilter,\n\t\t\tmagFilter: THREE.NearestFilter,\n\t\t\tformat: type,\n\t\t\ttype: THREE.FloatType,\n\t\t\tstencilBuffer: false\n\t\t});\n\n\t\treturn renderTarget;\n\t}\n\n\t// Takes a texture, and render out as another texture\n\tthis.renderTexture = function ( input, output ) {\n\t\tmesh.material = passThruShader;\n\t\tuniforms.texture.value = input;\n\t\trenderer.render( scene, camera, output );\n\t}\n\n\n\tthis.renderPosition = function(position, velocity, output, delta) {\n\t\tmesh.material = positionShader;\n\t\tpositionShader.uniforms.texturePosition.value = position;\n\t\tpositionShader.uniforms.textureVelocity.value = velocity;\n\t\tpositionShader.uniforms.time.value = performance.now();\n\t\tpositionShader.uniforms.delta.value = delta;\n\t\trenderer.render( scene, camera, output );\n\t\tthis.currentPosition = output;\n\t}\n\n\tthis.renderVelocity = function(position, velocity, output, delta) {\n\t\tmesh.material = velocityShader;\n\t\tvelocityShader.uniforms.texturePosition.value = position;\n\t\tvelocityShader.uniforms.textureVelocity.value = velocity;\n\t\tvelocityShader.uniforms.time.value = performance.now();\n\t\tvelocityShader.uniforms.delta.value = delta;\n\t\trenderer.render( scene, camera, output );\n\t\tthis.currentVelocity = output;\n\t}\n\n\tthis.simulate = function( delta ) {\n\n\t\tif (flipflop) {\n\n\t\t\tsimulator.renderVelocity( rtPosition1, rtVelocity1, rtVelocity2, delta );\n\t\t\tsimulator.renderPosition( rtPosition1, rtVelocity2, rtPosition2, delta );\n\n\t\t} else {\n\n\t\t\tsimulator.renderVelocity( rtPosition2, rtVelocity2, rtVelocity1, delta );\n\t\t\tsimulator.renderPosition( rtPosition2, rtVelocity1, rtPosition1, delta );\n\n\t\t}\n\n\t\tflipflop = !flipflop;\n\n\t}\n\n\tfunction generatePositionTexture() {\n\n\t\tvar a = new Float32Array( PARTICLES * 4 );\n\n\t\tfor ( var k = 0, kl = a.length; k < kl; k += 4 ) {\n\n\t\t\tvar x = Math.random() * BOUNDS - BOUNDS_HALF;\n\t\t\tvar y = Math.random() * BOUNDS - BOUNDS_HALF;\n\t\t\tvar z = Math.random() * BOUNDS - BOUNDS_HALF;\n\n\t\t\ta[ k + 0 ] = x;\n\t\t\ta[ k + 1 ] = y;\n\t\t\ta[ k + 2 ] = z;\n\t\t\ta[ k + 3 ] = 1;\n\n\t\t}\n\n\t\tvar texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBAFormat, THREE.FloatType );\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\n\t\treturn texture;\n\n\t}\n\n\tfunction generateVelocityTexture() {\n\n\t\tvar a = new Float32Array( PARTICLES * 3 );\n\n\t\tfor ( var k = 0, kl = a.length; k < kl; k += 3 ) {\n\n\t\t\tvar x = Math.random() - 0.5;\n\t\t\tvar y = Math.random() - 0.5;\n\t\t\tvar z = Math.random() - 0.5;\n\n\t\t\ta[ k + 0 ] = x * 10;\n\t\t\ta[ k + 1 ] = y * 10;\n\t\t\ta[ k + 2 ] = z * 10;\n\n\t\t}\n\n\t\tvar texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBFormat, THREE.FloatType );\n\t\ttexture.minFilter = THREE.NearestFilter;\n\t\ttexture.magFilter = THREE.NearestFilter;\n\t\ttexture.needsUpdate = true;\n\t\ttexture.flipY = false;\n\n\t\treturn texture;\n\n\t}\n\n}"
},
"$:/plugins/rboue/Three.js/Lib/ImprovedNoise.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ImprovedNoise.js",
"module-type": "library",
"text": "// http://mrl.nyu.edu/~perlin/noise/\n\nvar ImprovedNoise = function () {\n\n\tvar p = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,\n\t\t 23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,\n\t\t 174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,\n\t\t 133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,\n\t\t 89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,\n\t\t 202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,\n\t\t 248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,\n\t\t 178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,\n\t\t 14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,\n\t\t 93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];\n\n\tfor (var i=0; i < 256 ; i++) {\n\n\t\tp[256+i] = p[i];\n\n\t}\n\n\tfunction fade(t) {\n\n\t\treturn t * t * t * (t * (t * 6 - 15) + 10);\n\n\t}\n\n\tfunction lerp(t, a, b) {\n\n\t\treturn a + t * (b - a);\n\n\t}\n\n\tfunction grad(hash, x, y, z) {\n\n\t\tvar h = hash & 15;\n\t\tvar u = h < 8 ? x : y, v = h < 4 ? y : h == 12 || h == 14 ? x : z;\n\t\treturn ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);\n\n\t}\n\n\treturn {\n\n\t\tnoise: function (x, y, z) {\n\n\t\t\tvar floorX = ~~x, floorY = ~~y, floorZ = ~~z;\n\n\t\t\tvar X = floorX & 255, Y = floorY & 255, Z = floorZ & 255;\n\n\t\t\tx -= floorX;\n\t\t\ty -= floorY;\n\t\t\tz -= floorZ;\n\n\t\t\tvar xMinus1 = x -1, yMinus1 = y - 1, zMinus1 = z - 1;\n\n\t\t\tvar u = fade(x), v = fade(y), w = fade(z);\n\n\t\t\tvar A = p[X]+Y, AA = p[A]+Z, AB = p[A+1]+Z, B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;\n\n\t\t\treturn lerp(w, lerp(v, lerp(u, grad(p[AA], x, y, z), \n\t\t\t\t\t\t\tgrad(p[BA], xMinus1, y, z)),\n\t\t\t\t\t\tlerp(u, grad(p[AB], x, yMinus1, z),\n\t\t\t\t\t\t\tgrad(p[BB], xMinus1, yMinus1, z))),\n\t\t\t\t\tlerp(v, lerp(u, grad(p[AA+1], x, y, zMinus1),\n\t\t\t\t\t\t\tgrad(p[BA+1], xMinus1, y, z-1)),\n\t\t\t\t\t\tlerp(u, grad(p[AB+1], x, yMinus1, zMinus1),\n\t\t\t\t\t\t\tgrad(p[BB+1], xMinus1, yMinus1, zMinus1))));\n\n\t\t}\n\t}\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/ShaderTerrain.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ShaderTerrain.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n *\n */\n\nTHREE.ShaderTerrain = {\n\n\t/* -------------------------------------------------------------------------\n\t//\tDynamic terrain shader\n\t//\t\t- Blinn-Phong\n\t//\t\t- height + normal + diffuse1 + diffuse2 + specular + detail maps\n\t//\t\t- point, directional and hemisphere lights (use with \"lights: true\" material option)\n\t//\t\t- shadow maps receiving\n\t ------------------------------------------------------------------------- */\n\n\t'terrain' : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"lights\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\n\t\t\t\"enableDiffuse1\" : { type: \"i\", value: 0 },\n\t\t\t\"enableDiffuse2\" : { type: \"i\", value: 0 },\n\t\t\t\"enableSpecular\" : { type: \"i\", value: 0 },\n\t\t\t\"enableReflection\": { type: \"i\", value: 0 },\n\n\t\t\t\"tDiffuse1\"\t : { type: \"t\", value: null },\n\t\t\t\"tDiffuse2\"\t : { type: \"t\", value: null },\n\t\t\t\"tDetail\"\t : { type: \"t\", value: null },\n\t\t\t\"tNormal\"\t : { type: \"t\", value: null },\n\t\t\t\"tSpecular\"\t : { type: \"t\", value: null },\n\t\t\t\"tDisplacement\": { type: \"t\", value: null },\n\n\t\t\t\"uNormalScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"uDisplacementBias\": { type: \"f\", value: 0.0 },\n\t\t\t\"uDisplacementScale\": { type: \"f\", value: 1.0 },\n\n\t\t\t\"diffuse\": { type: \"c\", value: new THREE.Color( 0xeeeeee ) },\n\t\t\t\"specular\": { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\"ambient\": { type: \"c\", value: new THREE.Color( 0x050505 ) },\n\t\t\t\"shininess\": { type: \"f\", value: 30 },\n\t\t\t\"opacity\": { type: \"f\", value: 1 },\n\n\t\t\t\"uRepeatBase\" : { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\t\t\t\"uRepeatOverlay\" : { type: \"v2\", value: new THREE.Vector2( 1, 1 ) },\n\n\t\t\t\"uOffset\" : { type: \"v2\", value: new THREE.Vector2( 0, 0 ) }\n\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader: [\n\n\t\t\t\"uniform vec3 ambient;\",\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform float shininess;\",\n\t\t\t\"uniform float opacity;\",\n\n\t\t\t\"uniform bool enableDiffuse1;\",\n\t\t\t\"uniform bool enableDiffuse2;\",\n\t\t\t\"uniform bool enableSpecular;\",\n\n\t\t\t\"uniform sampler2D tDiffuse1;\",\n\t\t\t\"uniform sampler2D tDiffuse2;\",\n\t\t\t\"uniform sampler2D tDetail;\",\n\t\t\t\"uniform sampler2D tNormal;\",\n\t\t\t\"uniform sampler2D tSpecular;\",\n\t\t\t\"uniform sampler2D tDisplacement;\",\n\n\t\t\t\"uniform float uNormalScale;\",\n\n\t\t\t\"uniform vec2 uRepeatOverlay;\",\n\t\t\t\"uniform vec2 uRepeatBase;\",\n\n\t\t\t\"uniform vec2 uOffset;\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec3 ambientLightColor;\",\n\n\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\",\n\t\t\t\t\"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"gl_FragColor = vec4( vec3( 1.0 ), opacity );\",\n\n\t\t\t\t\"vec3 specularTex = vec3( 1.0 );\",\n\n\t\t\t\t\"vec2 uvOverlay = uRepeatOverlay * vUv + uOffset;\",\n\t\t\t\t\"vec2 uvBase = uRepeatBase * vUv;\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tDetail, uvOverlay ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"normalTex.xy *= uNormalScale;\",\n\t\t\t\t\"normalTex = normalize( normalTex );\",\n\n\t\t\t\t\"if( enableDiffuse1 && enableDiffuse2 ) {\",\n\n\t\t\t\t\t\"vec4 colDiffuse1 = texture2D( tDiffuse1, uvOverlay );\",\n\t\t\t\t\t\"vec4 colDiffuse2 = texture2D( tDiffuse2, uvOverlay );\",\n\n\t\t\t\t\t\"#ifdef GAMMA_INPUT\",\n\n\t\t\t\t\t\t\"colDiffuse1.xyz *= colDiffuse1.xyz;\",\n\t\t\t\t\t\t\"colDiffuse2.xyz *= colDiffuse2.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * mix ( colDiffuse1, colDiffuse2, 1.0 - texture2D( tDisplacement, uvBase ) );\",\n\n\t\t\t\t\" } else if( enableDiffuse1 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * texture2D( tDiffuse1, uvOverlay );\",\n\n\t\t\t\t\"} else if( enableDiffuse2 ) {\",\n\n\t\t\t\t\t\"gl_FragColor = gl_FragColor * texture2D( tDiffuse2, uvOverlay );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"if( enableSpecular )\",\n\t\t\t\t\t\"specularTex = texture2D( tSpecular, uvOverlay ).xyz;\",\n\n\t\t\t\t\"mat3 tsb = mat3( vTangent, vBinormal, vNormal );\",\n\t\t\t\t\"vec3 finalNormal = tsb * normalTex;\",\n\n\t\t\t\t\"vec3 normal = normalize( finalNormal );\",\n\t\t\t\t\"vec3 viewPosition = normalize( vViewPosition );\",\n\n\t\t\t\t// point lights\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 pointDiffuse = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 pointSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = lPosition.xyz + vViewPosition.xyz;\",\n\n\t\t\t\t\t\t\"float lDistance = 1.0;\",\n\t\t\t\t\t\t\"if ( pointLightDistance[ i ] > 0.0 )\",\n\t\t\t\t\t\t\t\"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\",\n\n\t\t\t\t\t\t\"lVector = normalize( lVector );\",\n\n\t\t\t\t\t\t\"vec3 pointHalfVector = normalize( lVector + viewPosition );\",\n\t\t\t\t\t\t\"float pointDistance = lDistance;\",\n\n\t\t\t\t\t\t\"float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\",\n\t\t\t\t\t\t\"float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"float pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"pointDiffuse += pointDistance * pointLightColor[ i ] * diffuse * pointDiffuseWeight;\",\n\t\t\t\t\t\t\"pointSpecular += pointDistance * pointLightColor[ i ] * specular * pointSpecularWeight * pointDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// directional lights\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 dirDiffuse = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 dirSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\",\n\n\t\t\t\t\t\t\"vec3 dirVector = normalize( lDirection.xyz );\",\n\t\t\t\t\t\t\"vec3 dirHalfVector = normalize( dirVector + viewPosition );\",\n\n\t\t\t\t\t\t\"float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\",\n\t\t\t\t\t\t\"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\",\n\n\t\t\t\t\t\t\"float dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"dirDiffuse += directionalLightColor[ i ] * diffuse * dirDiffuseWeight;\",\n\t\t\t\t\t\t\"dirSpecular += directionalLightColor[ i ] * specular * dirSpecularWeight * dirDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// hemisphere lights\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"vec3 hemiDiffuse = vec3( 0.0 );\",\n\t\t\t\t\t\"vec3 hemiSpecular = vec3( 0.0 );\" ,\n\n\t\t\t\t\t\"for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\",\n\n\t\t\t\t\t\t\"vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\",\n\t\t\t\t\t\t\"vec3 lVector = normalize( lDirection.xyz );\",\n\n\t\t\t\t\t\t// diffuse\n\n\t\t\t\t\t\t\"float dotProduct = dot( normal, lVector );\",\n\t\t\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\t\t\"hemiDiffuse += diffuse * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\",\n\n\t\t\t\t\t\t// specular (sky light)\n\n\t\t\t\t\t\t\"float hemiSpecularWeight = 0.0;\",\n\n\t\t\t\t\t\t\"vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\",\n\t\t\t\t\t\t\"float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t// specular (ground light)\n\n\t\t\t\t\t\t\"vec3 lVectorGround = -lVector;\",\n\n\t\t\t\t\t\t\"vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\",\n\t\t\t\t\t\t\"float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\",\n\t\t\t\t\t\t\"hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );\",\n\n\t\t\t\t\t\t\"hemiSpecular += specular * mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight ) * hemiSpecularWeight * hemiDiffuseWeight;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// all lights contribution summation\n\n\t\t\t\t\"vec3 totalDiffuse = vec3( 0.0 );\",\n\t\t\t\t\"vec3 totalSpecular = vec3( 0.0 );\",\n\n\t\t\t\t\"#if MAX_DIR_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += dirDiffuse;\",\n\t\t\t\t\t\"totalSpecular += dirSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_HEMI_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += hemiDiffuse;\",\n\t\t\t\t\t\"totalSpecular += hemiSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"#if MAX_POINT_LIGHTS > 0\",\n\n\t\t\t\t\t\"totalDiffuse += pointDiffuse;\",\n\t\t\t\t\t\"totalSpecular += pointSpecular;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t//\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient) + totalSpecular;\",\n\t\t\t\t\"gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"linear_to_gamma_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader: [\n\n\t\t\t\"attribute vec4 tangent;\",\n\n\t\t\t\"uniform vec2 uRepeatBase;\",\n\n\t\t\t\"uniform sampler2D tNormal;\",\n\n\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\"uniform sampler2D tDisplacement;\",\n\t\t\t\t\"uniform float uDisplacementScale;\",\n\t\t\t\t\"uniform float uDisplacementBias;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 vTangent;\",\n\t\t\t\"varying vec3 vBinormal;\",\n\t\t\t\"varying vec3 vNormal;\",\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vNormal = normalize( normalMatrix * normal );\",\n\n\t\t\t\t// tangent and binormal vectors\n\n\t\t\t\t\"vTangent = normalize( normalMatrix * tangent.xyz );\",\n\n\t\t\t\t\"vBinormal = cross( vNormal, vTangent ) * tangent.w;\",\n\t\t\t\t\"vBinormal = normalize( vBinormal );\",\n\n\t\t\t\t// texture coordinates\n\n\t\t\t\t\"vUv = uv;\",\n\n\t\t\t\t\"vec2 uvBase = uv * uRepeatBase;\",\n\n\t\t\t\t// displacement mapping\n\n\t\t\t\t\"#ifdef VERTEX_TEXTURES\",\n\n\t\t\t\t\t\"vec3 dv = texture2D( tDisplacement, uvBase ).xyz;\",\n\t\t\t\t\t\"float df = uDisplacementScale * dv.x + uDisplacementBias;\",\n\t\t\t\t\t\"vec3 displacedPosition = normal * df + position;\",\n\n\t\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\",\n\t\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"vec3 normalTex = texture2D( tNormal, uvBase ).xyz * 2.0 - 1.0;\",\n\t\t\t\t\"vNormal = normalMatrix * normalTex;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/WaterShader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/WaterShader.js",
"module-type": "library",
"text": "/**\n * @author jbouny / https://github.com/jbouny\n *\n * Work based on :\n * @author Slayvin / http://slayvin.net : Flat mirror for three.js\n * @author Stemkoski / http://www.adelphi.edu/~stemkoski : An implementation of water shader based on the flat mirror\n * @author Jonas Wagner / http://29a.ch/ && http://29a.ch/slides/2012/webglwater/ : Water shader explanations in WebGL\n */\n\nTHREE.ShaderLib['water'] = {\n\n\tuniforms: { \"normalSampler\":\t{ type: \"t\", value: null },\n\t\t\t\t\"mirrorSampler\":\t{ type: \"t\", value: null },\n\t\t\t\t\"alpha\":\t\t\t{ type: \"f\", value: 1.0 },\n\t\t\t\t\"time\":\t\t\t\t{ type: \"f\", value: 0.0 },\n\t\t\t\t\"distortionScale\":\t{ type: \"f\", value: 20.0 },\n\t\t\t\t\"textureMatrix\" :\t{ type: \"m4\", value: new THREE.Matrix4() },\n\t\t\t\t\"sunColor\":\t\t\t{ type: \"c\", value: new THREE.Color( 0x7F7F7F ) },\n\t\t\t\t\"sunDirection\":\t\t{ type: \"v3\", value: new THREE.Vector3( 0.70707, 0.70707, 0 ) },\n\t\t\t\t\"eye\":\t\t\t\t{ type: \"v3\", value: new THREE.Vector3( 0, 0, 0 ) },\n\t\t\t\t\"waterColor\":\t\t{ type: \"c\", value: new THREE.Color( 0x555555 ) }\n\t},\n\n\tvertexShader: [\n\t\t'uniform mat4 textureMatrix;',\n\t\t'uniform float time;',\n\n\t\t'varying vec4 mirrorCoord;',\n\t\t'varying vec3 worldPosition;',\n\t\t\n\t\t'void main()',\n\t\t'{',\n\t\t'\tmirrorCoord = modelMatrix * vec4( position, 1.0 );',\n\t\t'\tworldPosition = mirrorCoord.xyz;',\n\t\t'\tmirrorCoord = textureMatrix * mirrorCoord;',\n\t\t'\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n\t\t'}'\n\t].join('\\n'),\n\n\tfragmentShader: [\n\t\t'precision highp float;',\n\t\t\n\t\t'uniform sampler2D mirrorSampler;',\n\t\t'uniform float alpha;',\n\t\t'uniform float time;',\n\t\t'uniform float distortionScale;',\n\t\t'uniform sampler2D normalSampler;',\n\t\t'uniform vec3 sunColor;',\n\t\t'uniform vec3 sunDirection;',\n\t\t'uniform vec3 eye;',\n\t\t'uniform vec3 waterColor;',\n\n\t\t'varying vec4 mirrorCoord;',\n\t\t'varying vec3 worldPosition;',\n\t\t\n\t\t'vec4 getNoise( vec2 uv )',\n\t\t'{',\n\t\t'\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);',\n\t\t'\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );',\n\t\t'\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );',\n\t\t'\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );',\n\t\t'\tvec4 noise = ( texture2D( normalSampler, uv0 ) ) +',\n '\t\t( texture2D( normalSampler, uv1 ) ) +',\n '\t\t( texture2D( normalSampler, uv2 ) ) +',\n\t\t'\t\t( texture2D( normalSampler, uv3 ) );',\n\t\t'\treturn noise * 0.5 - 1.0;',\n\t\t'}',\n\t\t\n\t\t'void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor )',\n\t\t'{',\n\t\t'\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );',\n\t\t'\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );',\n\t\t'\tspecularColor += pow( direction, shiny ) * sunColor * spec;',\n\t\t'\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;',\n\t\t'}',\n\t\t\n\t\t'void main()',\n\t\t'{',\n\t\t'\tvec4 noise = getNoise( worldPosition.xz );',\n\t\t'\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );',\n\n\t\t'\tvec3 diffuseLight = vec3(0.0);',\n\t\t'\tvec3 specularLight = vec3(0.0);',\n\n\t\t'\tvec3 worldToEye = eye-worldPosition;',\n\t\t'\tvec3 eyeDirection = normalize( worldToEye );',\n\t\t'\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );',\n\t\t\n\t\t'\tfloat distance = length(worldToEye);',\n\n\t\t'\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;',\n\t\t'\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.z + distortion ) );',\n\n\t\t'\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );',\n\t\t'\tfloat rf0 = 0.3;',\n\t\t'\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );',\n\t\t'\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;',\n\t\t'\tvec3 albedo = mix( sunColor * diffuseLight * 0.3 + scatter, ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance );',\n\t\t'\tgl_FragColor = vec4( albedo, alpha );',\n\t\t'}'\n\t].join('\\n')\n\n};\n\nTHREE.Water = function ( renderer, camera, scene, options ) {\n\n\tTHREE.Object3D.call( this );\n\tthis.name = 'water_' + this.id;\n\n\tfunction optionalParameter ( value, defaultValue ) {\n\t\treturn value !== undefined ? value : defaultValue;\n\t};\n\n\toptions = options || {};\n\t\n\tthis.matrixNeedsUpdate = true;\n\t\n\tvar width = optionalParameter( options.textureWidth, 512 );\n\tvar height = optionalParameter( options.textureHeight, 512 );\n\tthis.clipBias = optionalParameter( options.clipBias, 0.0 );\n\tthis.alpha = optionalParameter( options.alpha, 1.0 );\n\tthis.time = optionalParameter( options.time, 0.0 );\n\tthis.normalSampler = optionalParameter( options.waterNormals, null );\n\tthis.sunDirection = optionalParameter( options.sunDirection, new THREE.Vector3( 0.70707, 0.70707, 0.0 ) );\n\tthis.sunColor = new THREE.Color( optionalParameter( options.sunColor, 0xffffff ) );\n\tthis.waterColor = new THREE.Color( optionalParameter( options.waterColor, 0x7F7F7F ) );\n\tthis.eye = optionalParameter( options.eye, new THREE.Vector3( 0, 0, 0 ) );\n\tthis.distortionScale = optionalParameter( options.distortionScale, 20.0 );\n\t\n\tthis.renderer = renderer;\n\tthis.scene = scene;\n\tthis.mirrorPlane = new THREE.Plane();\n\tthis.normal = new THREE.Vector3( 0, 0, 1 );\n\tthis.mirrorWorldPosition = new THREE.Vector3();\n\tthis.cameraWorldPosition = new THREE.Vector3();\n\tthis.rotationMatrix = new THREE.Matrix4();\n\tthis.lookAtPosition = new THREE.Vector3( 0, 0, -1 );\n\tthis.clipPlane = new THREE.Vector4();\n\t\n\tif ( camera instanceof THREE.PerspectiveCamera )\n\t\tthis.camera = camera;\n\telse \n\t{\n\t\tthis.camera = new THREE.PerspectiveCamera();\n\t\tconsole.log(this.name + ': camera is not a Perspective Camera!')\n\t}\n\n\tthis.textureMatrix = new THREE.Matrix4();\n\n\tthis.mirrorCamera = this.camera.clone();\n\t\n\tthis.texture = new THREE.WebGLRenderTarget( width, height );\n\tthis.tempTexture = new THREE.WebGLRenderTarget( width, height );\n\t\n\tvar mirrorShader = THREE.ShaderLib[ \"water\" ];\n\tvar mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );\n\n\tthis.material = new THREE.ShaderMaterial( { \n\t\tfragmentShader: mirrorShader.fragmentShader, \n\t\tvertexShader: mirrorShader.vertexShader, \n\t\tuniforms: mirrorUniforms,\n\t\ttransparent: true\n\t} );\n\n\tthis.material.uniforms.mirrorSampler.value = this.texture;\n\tthis.material.uniforms.textureMatrix.value = this.textureMatrix;\n\tthis.material.uniforms.alpha.value = this.alpha;\n\tthis.material.uniforms.time.value = this.time;\n\tthis.material.uniforms.normalSampler.value = this.normalSampler;\n\tthis.material.uniforms.sunColor.value = this.sunColor;\n\tthis.material.uniforms.waterColor.value = this.waterColor;\n\tthis.material.uniforms.sunDirection.value = this.sunDirection;\n\tthis.material.uniforms.distortionScale.value = this.distortionScale;\n\t\n\tthis.material.uniforms.eye.value = this.eye;\n\t\n\tif ( !THREE.Math.isPowerOfTwo(width) || !THREE.Math.isPowerOfTwo(height) )\n\t{\n\t\tthis.texture.generateMipmaps = false;\n\t\tthis.tempTexture.generateMipmaps = false;\n\t}\n\n\tthis.updateTextureMatrix();\n\tthis.render();\n};\n\nTHREE.Water.prototype = Object.create( THREE.Mirror.prototype );\n\n\nTHREE.Water.prototype.updateTextureMatrix = function () {\n\n\tfunction sign(x) { return x ? x < 0 ? -1 : 1 : 0; }\n\n\tthis.updateMatrixWorld();\n\tthis.camera.updateMatrixWorld();\n\n\tthis.mirrorWorldPosition.setFromMatrixPosition( this.matrixWorld );\n\tthis.cameraWorldPosition.setFromMatrixPosition( this.camera.matrixWorld );\n\n\tthis.rotationMatrix.extractRotation( this.matrixWorld );\n\n\tthis.normal.set( 0, 0, 1 );\n\tthis.normal.applyMatrix4( this.rotationMatrix );\n\n\tvar view = this.mirrorWorldPosition.clone().sub( this.cameraWorldPosition );\n\tview.reflect( this.normal ).negate();\n\tview.add( this.mirrorWorldPosition );\n\n\tthis.rotationMatrix.extractRotation( this.camera.matrixWorld );\n\n\tthis.lookAtPosition.set(0, 0, -1);\n\tthis.lookAtPosition.applyMatrix4( this.rotationMatrix );\n\tthis.lookAtPosition.add( this.cameraWorldPosition );\n\n\tvar target = this.mirrorWorldPosition.clone().sub( this.lookAtPosition );\n\ttarget.reflect( this.normal ).negate();\n\ttarget.add( this.mirrorWorldPosition );\n\n\tthis.up.set(0, -1, 0);\n\tthis.up.applyMatrix4( this.rotationMatrix );\n\tthis.up.reflect( this.normal ).negate();\n\n\tthis.mirrorCamera.position.copy( view );\n\tthis.mirrorCamera.up = this.up;\n\tthis.mirrorCamera.lookAt( target );\n\tthis.mirrorCamera.aspect = this.camera.aspect;\n\n\tthis.mirrorCamera.updateProjectionMatrix();\n\tthis.mirrorCamera.updateMatrixWorld();\n\tthis.mirrorCamera.matrixWorldInverse.getInverse(this.mirrorCamera.matrixWorld);\n\n\t// Update the texture matrix\n\tthis.textureMatrix.set( 0.5, 0.0, 0.0, 0.5,\n\t\t\t\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0 );\n\tthis.textureMatrix.multiply(this.mirrorCamera.projectionMatrix);\n\tthis.textureMatrix.multiply(this.mirrorCamera.matrixWorldInverse);\n\n\t// Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html\n\t// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf\n\tthis.mirrorPlane.setFromNormalAndCoplanarPoint( this.normal, this.mirrorWorldPosition );\n\tthis.mirrorPlane.applyMatrix4(this.mirrorCamera.matrixWorldInverse);\n\n\tthis.clipPlane.set(this.mirrorPlane.normal.x, this.mirrorPlane.normal.y, this.mirrorPlane.normal.z, this.mirrorPlane.constant );\n\n\tvar q = new THREE.Vector4();\n\tvar projectionMatrix = this.mirrorCamera.projectionMatrix;\n\n\tq.x = (sign(this.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];\n\tq.y = (sign(this.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];\n\tq.z = -1.0;\n\tq.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];\n\n\t// Calculate the scaled plane vector\n\tvar c = new THREE.Vector4();\n\tc = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot(q) );\n\n\t// Replacing the third row of the projection matrix\n\tprojectionMatrix.elements[2] = c.x;\n\tprojectionMatrix.elements[6] = c.y;\n\tprojectionMatrix.elements[10] = c.z + 1.0 - this.clipBias;\n\tprojectionMatrix.elements[14] = c.w;\n\t\n\tvar worldCoordinates = new THREE.Vector3();\n\tworldCoordinates.setFromMatrixPosition( this.camera.matrixWorld );\n\tthis.eye = worldCoordinates;\n\tthis.material.uniforms.eye.value = this.eye;\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Octree.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Octree.js",
"module-type": "library",
"text": "/*!\n *\n * threeoctree.js (r60) / https://github.com/collinhover/threeoctree\n * (sparse) dynamic 3D spatial representation structure for fast searches.\n *\n * @author Collin Hover / http://collinhover.com/\n * based on Dynamic Octree by Piko3D @ http://www.piko3d.com/ and Octree by Marek Pawlowski @ pawlowski.it\n *\n */\n ( function ( THREE ) { \"use strict\";\n\t\n\t/*===================================================\n\n\tutility\n\n\t=====================================================*/\n\t\n\tfunction isNumber ( n ) {\n\t\treturn !isNaN( n ) && isFinite( n );\n\t}\n\t\n\tfunction isArray ( target ) {\n\t\treturn Object.prototype.toString.call( target ) === '[object Array]';\n\t}\n\t\n\tfunction toArray ( target ) {\n\t\treturn target ? ( isArray ( target ) !== true ? [ target ] : target ) : [];\n\t}\n\t\n\tfunction indexOfValue( array, value ) {\n\t\t\n\t\tfor ( var i = 0, il = array.length; i < il; i++ ) {\n\t\t\t\n\t\t\tif ( array[ i ] === value ) {\n\t\t\t\t\n\t\t\t\treturn i;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}\n\t\n\tfunction indexOfPropertyWithValue( array, property, value ) {\n\t\t\n\t\tfor ( var i = 0, il = array.length; i < il; i++ ) {\n\t\t\t\n\t\t\tif ( array[ i ][ property ] === value ) {\n\t\t\t\t\n\t\t\t\treturn i;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn -1;\n\t\t\n\t}\n\n\t/*===================================================\n\n\toctree\n\n\t=====================================================*/\n\n\tTHREE.Octree = function ( parameters ) {\n\t\t\n\t\t// handle parameters\n\t\t\n\t\tparameters = parameters || {};\n\t\t\n\t\tparameters.tree = this;\n\t\t\n\t\t// static properties ( modification is not recommended )\n\t\t\n\t\tthis.nodeCount = 0;\n\t\t\n\t\tthis.INDEX_INSIDE_CROSS = -1;\n\t\tthis.INDEX_OUTSIDE_OFFSET = 2;\n\t\t\n\t\tthis.INDEX_OUTSIDE_POS_X = isNumber( parameters.INDEX_OUTSIDE_POS_X ) ? parameters.INDEX_OUTSIDE_POS_X : 0;\n\t\tthis.INDEX_OUTSIDE_NEG_X = isNumber( parameters.INDEX_OUTSIDE_NEG_X ) ? parameters.INDEX_OUTSIDE_NEG_X : 1;\n\t\tthis.INDEX_OUTSIDE_POS_Y = isNumber( parameters.INDEX_OUTSIDE_POS_Y ) ? parameters.INDEX_OUTSIDE_POS_Y : 2;\n\t\tthis.INDEX_OUTSIDE_NEG_Y = isNumber( parameters.INDEX_OUTSIDE_NEG_Y ) ? parameters.INDEX_OUTSIDE_NEG_Y : 3;\n\t\tthis.INDEX_OUTSIDE_POS_Z = isNumber( parameters.INDEX_OUTSIDE_POS_Z ) ? parameters.INDEX_OUTSIDE_POS_Z : 4;\n\t\tthis.INDEX_OUTSIDE_NEG_Z = isNumber( parameters.INDEX_OUTSIDE_NEG_Z ) ? parameters.INDEX_OUTSIDE_NEG_Z : 5;\n\t\t\n\t\tthis.INDEX_OUTSIDE_MAP = [];\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_X ] = { index: this.INDEX_OUTSIDE_POS_X, count: 0, x: 1, y: 0, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_X ] = { index: this.INDEX_OUTSIDE_NEG_X, count: 0, x: -1, y: 0, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_Y ] = { index: this.INDEX_OUTSIDE_POS_Y, count: 0, x: 0, y: 1, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_Y ] = { index: this.INDEX_OUTSIDE_NEG_Y, count: 0, x: 0, y: -1, z: 0 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_POS_Z ] = { index: this.INDEX_OUTSIDE_POS_Z, count: 0, x: 0, y: 0, z: 1 };\n\t\tthis.INDEX_OUTSIDE_MAP[ this.INDEX_OUTSIDE_NEG_Z ] = { index: this.INDEX_OUTSIDE_NEG_Z, count: 0, x: 0, y: 0, z: -1 };\n\t\t\n\t\tthis.FLAG_POS_X = 1 << ( this.INDEX_OUTSIDE_POS_X + 1 );\n\t\tthis.FLAG_NEG_X = 1 << ( this.INDEX_OUTSIDE_NEG_X + 1 );\n\t\tthis.FLAG_POS_Y = 1 << ( this.INDEX_OUTSIDE_POS_Y + 1 );\n\t\tthis.FLAG_NEG_Y = 1 << ( this.INDEX_OUTSIDE_NEG_Y + 1 );\n\t\tthis.FLAG_POS_Z = 1 << ( this.INDEX_OUTSIDE_POS_Z + 1 );\n\t\tthis.FLAG_NEG_Z = 1 << ( this.INDEX_OUTSIDE_NEG_Z + 1 );\n\t\t\n\t\tthis.utilVec31Search = new THREE.Vector3();\n\t\tthis.utilVec32Search = new THREE.Vector3();\n\t\t\n\t\t// pass scene to see octree structure\n\t\t\n\t\tthis.scene = parameters.scene;\n\t\t\n\t\tif ( this.scene ) {\n\t\t\t\n\t\t\tthis.visualGeometry = new THREE.BoxGeometry( 1, 1, 1 );\n\t\t\tthis.visualMaterial = new THREE.MeshBasicMaterial( { color: 0xFF0066, wireframe: true, wireframeLinewidth: 1 } );\n\t\t\t\n\t\t}\n\t\t\n\t\t// properties\n\t\t\n\t\tthis.objects = [];\n\t\tthis.objectsMap = {};\n\t\tthis.objectsData = [];\n\t\tthis.objectsDeferred = [];\n\t\t\n\t\tthis.depthMax = isNumber( parameters.depthMax ) ? parameters.depthMax : Infinity;\n\t\tthis.objectsThreshold = isNumber( parameters.objectsThreshold ) ? parameters.objectsThreshold : 8;\n\t\tthis.overlapPct = isNumber( parameters.overlapPct ) ? parameters.overlapPct : 0.15;\n\t\tthis.undeferred = parameters.undeferred || false;\n\t\t\n\t\tthis.root = parameters.root instanceof THREE.OctreeNode ? parameters.root : new THREE.OctreeNode( parameters );\n\t\t\n\t};\n\n\tTHREE.Octree.prototype = {\n\t\t\n\t\tupdate: function () {\n\t\t\t\n\t\t\t// add any deferred objects that were waiting for render cycle\n\t\t\t\n\t\t\tif ( this.objectsDeferred.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( var i = 0, il = this.objectsDeferred.length; i < il; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tvar deferred = this.objectsDeferred[ i ];\n\t\t\t\t\t\n\t\t\t\t\tthis.addDeferred( deferred.object, deferred.options );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.objectsDeferred.length = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tadd: function ( object, options ) {\n\t\t\t\n\t\t\t// add immediately\n\t\t\t\n\t\t\tif ( this.undeferred ) {\n\t\t\t\t\n\t\t\t\tthis.updateObject( object );\n\t\t\t\t\n\t\t\t\tthis.addDeferred( object, options );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// defer add until update called\n\t\t\t\t\n\t\t\t\tthis.objectsDeferred.push( { object: object, options: options } );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddDeferred: function ( object, options ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tgeometry,\n\t\t\t\tfaces,\n\t\t\t\tuseFaces,\n\t\t\t\tvertices,\n\t\t\t\tuseVertices,\n\t\t\t\tobjectData;\n\t\t\t\n\t\t\t// ensure object is not object data\n\t\t\t\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tobject = object.object;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// check uuid to avoid duplicates\n\t\t\t\n\t\t\tif ( !object.uuid ) {\n\t\t\t\t\n\t\t\t\tobject.uuid = THREE.Math.generateUUID();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( !this.objectsMap[ object.uuid ] ) {\n\t\t\t\t\n\t\t\t\t// store\n\t\t\t\t\n\t\t\t\tthis.objects.push( object );\n\t\t\t\tthis.objectsMap[ object.uuid ] = object;\n\t\t\t\t\n\t\t\t\t// check options\n\t\t\t\t\n\t\t\t\tif ( options ) {\n\t\t\t\t\t\n\t\t\t\t\tuseFaces = options.useFaces;\n\t\t\t\t\tuseVertices = options.useVertices;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( useVertices === true ) {\n\t\t\t\t\t\n\t\t\t\t\tgeometry = object.geometry;\n\t\t\t\t\tvertices = geometry.vertices;\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = vertices.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.addObjectData( object, vertices[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if ( useFaces === true ) {\n\t\t\t\t\t\n\t\t\t\t\tgeometry = object.geometry;\n\t\t\t\t\tfaces = geometry.faces;\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = faces.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.addObjectData( object, faces[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tthis.addObjectData( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObjectData: function ( object, part ) {\n\t\t\t\n\t\t\tvar objectData = new THREE.OctreeObjectData( object, part );\n\t\t\t\n\t\t\t// add to tree objects data list\n\t\t\t\n\t\t\tthis.objectsData.push( objectData );\n\t\t\t\n\t\t\t// add to nodes\n\t\t\t\n\t\t\tthis.root.addObject( objectData );\n\t\t\t\n\t\t},\n\t\t\n\t\tremove: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobjectData = object,\n\t\t\t\tindex,\n\t\t\t\tobjectsDataRemoved;\n\t\t\t\n\t\t\t// ensure object is not object data for index search\n\t\t\t\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tobject = object.object;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// check uuid\n\t\t\t\n\t\t\tif ( this.objectsMap[ object.uuid ] ) {\n\t\t\t\t\n\t\t\t\tthis.objectsMap[ object.uuid ] = undefined;\n\t\t\t\t\n\t\t\t\t// check and remove from objects, nodes, and data lists\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.splice( index, 1 );\n\t\t\t\t\t\n\t\t\t\t\t// remove from nodes\n\t\t\t\t\t\n\t\t\t\t\tobjectsDataRemoved = this.root.removeObject( objectData );\n\t\t\t\t\t\n\t\t\t\t\t// remove from objects data list\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = objectsDataRemoved.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectData = objectsDataRemoved[ i ];\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex = indexOfValue( this.objectsData, objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.objectsData.splice( index, 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ( this.objectsDeferred.length > 0 ) {\n\t\t\t\t\n\t\t\t\t// check and remove from deferred\n\t\t\t\t\n\t\t\t\tindex = indexOfPropertyWithValue( this.objectsDeferred, 'object', object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objectsDeferred.splice( index, 1 );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\textend: function ( octree ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobjectsData,\n\t\t\t\tobjectData;\n\t\t\t\t\n\t\t\tif ( octree instanceof THREE.Octree ) {\n\t\t\t\t\n\t\t\t\t// for each object data\n\t\t\t\t\n\t\t\t\tobjectsData = octree.objectsData;\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objectsData.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = objectsData[ i ];\n\t\t\t\t\t\n\t\t\t\t\tthis.add( objectData, { useFaces: objectData.faces, useVertices: objectData.vertices } );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\trebuild: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tobject,\n\t\t\t\tobjectData,\n\t\t\t\tindexOctant,\n\t\t\t\tindexOctantLast,\n\t\t\t\tobjectsUpdate = [];\n\t\t\t\n\t\t\t// check all object data for changes in position\n\t\t\t// assumes all object matrices are up to date\n\t\t\t\n\t\t\tfor ( i = 0, l = this.objectsData.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobjectData = this.objectsData[ i ];\n\t\t\t\t\n\t\t\t\tnode = objectData.node;\n\t\t\t\t\n\t\t\t\t// update object\n\t\t\t\t\n\t\t\t\tobjectData.update();\n\t\t\t\t\n\t\t\t\t// if position has changed since last organization of object in tree\n\t\t\t\t\n\t\t\t\tif ( node instanceof THREE.OctreeNode && !objectData.positionLast.equals( objectData.position ) ) {\n\t\t\t\t\t\n\t\t\t\t\t// get octant index of object within current node\n\t\t\t\t\t\n\t\t\t\t\tindexOctantLast = objectData.indexOctant;\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = node.getOctantIndex( objectData );\n\t\t\t\t\t\n\t\t\t\t\t// if object octant index has changed\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant !== indexOctantLast ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// add to update list\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsUpdate.push( objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// update changed objects\n\t\t\t\n\t\t\tfor ( i = 0, l = objectsUpdate.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobjectData = objectsUpdate[ i ];\n\t\t\t\t\n\t\t\t\t// remove object from current node\n\t\t\t\t\n\t\t\t\tobjectData.node.removeObject( objectData );\n\t\t\t\t\n\t\t\t\t// add object to tree root\n\t\t\t\t\n\t\t\t\tthis.root.addObject( objectData );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tupdateObject: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tparentCascade = [ object ],\n\t\t\t\tparent,\n\t\t\t\tparentUpdate;\n\t\t\t\n\t\t\t// search all parents between object and root for world matrix update\n\t\t\t\n\t\t\tparent = object.parent;\n\t\t\t\n\t\t\twhile( parent ) {\n\t\t\t\t\n\t\t\t\tparentCascade.push( parent );\n\t\t\t\tparent = parent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor ( i = 0, l = parentCascade.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tparent = parentCascade[ i ];\n\t\t\t\t\n\t\t\t\tif ( parent.matrixWorldNeedsUpdate === true ) {\n\t\t\t\t\t\n\t\t\t\t\tparentUpdate = parent;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// update world matrix starting at uppermost parent that needs update\n\t\t\t\n\t\t\tif ( typeof parentUpdate !== 'undefined' ) {\n\t\t\t\t\n\t\t\t\tparentUpdate.updateMatrixWorld();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tsearch: function ( position, radius, organizeByObject, direction ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tobjects,\n\t\t\t\tobjectData,\n\t\t\t\tobject,\n\t\t\t\tresults,\n\t\t\t\tresultData,\n\t\t\t\tresultsObjectsIndices,\n\t\t\t\tresultObjectIndex,\n\t\t\t\tdirectionPct;\n\t\t\t\n\t\t\t// add root objects\n\t\t\t\n\t\t\tobjects = [].concat( this.root.objects );\n\t\t\t\n\t\t\t// ensure radius (i.e. distance of ray) is a number\n\t\t\t\n\t\t\tif ( !( radius > 0 ) ) {\n\t\t\t\t\n\t\t\t\tradius = Number.MAX_VALUE;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if direction passed, normalize and find pct\n\t\t\t\n\t\t\tif ( direction instanceof THREE.Vector3 ) {\n\t\t\t\t\n\t\t\t\tdirection = this.utilVec31Search.copy( direction ).normalize();\n\t\t\t\tdirectionPct = this.utilVec32Search.set( 1, 1, 1 ).divide( direction );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// search each node of root\n\t\t\t\n\t\t\tfor ( i = 0, l = this.root.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.root.nodesByIndex[ this.root.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tobjects = node.search( position, radius, objects, direction, directionPct );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if should organize results by object\n\t\t\t\n\t\t\tif ( organizeByObject === true ) {\n\t\t\t\t\n\t\t\t\tresults = [];\n\t\t\t\tresultsObjectsIndices = [];\n\t\t\t\t\n\t\t\t\t// for each object data found\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = objects[ i ];\n\t\t\t\t\tobject = objectData.object;\n\t\t\t\t\t\n\t\t\t\t\tresultObjectIndex = indexOfValue( resultsObjectsIndices, object );\n\t\t\t\t\t\n\t\t\t\t\t// if needed, create new result data\n\t\t\t\t\t\n\t\t\t\t\tif ( resultObjectIndex === -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData = {\n\t\t\t\t\t\t\tobject: object,\n\t\t\t\t\t\t\tfaces: [],\n\t\t\t\t\t\t\tvertices: []\n\t\t\t\t\t\t};\n\t\t\t\t\t\t\n\t\t\t\t\t\tresults.push( resultData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultsObjectsIndices.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData = results[ resultObjectIndex ];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// object data has faces or vertices, add to list\n\t\t\t\t\t\n\t\t\t\t\tif ( objectData.faces ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData.faces.push( objectData.faces );\n\t\t\t\t\t\t\n\t\t\t\t\t} else if ( objectData.vertices ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tresultData.vertices.push( objectData.vertices );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tresults = objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn results;\n\t\t\t\n\t\t},\n\t\t\n\t\tsetRoot: function ( root ) { \n\t\t\t\n\t\t\tif ( root instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\t// store new root\n\t\t\t\t\n\t\t\t\tthis.root = root;\n\t\t\t\t\n\t\t\t\t// update properties\n\t\t\t\t\n\t\t\t\tthis.root.updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tgetDepthEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getDepthEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getNodeCountEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountEnd: function () {\n\t\t\t\n\t\t\treturn this.root.getObjectCountEnd();\n\t\t\t\n\t\t},\n\t\t\n\t\ttoConsole: function () {\n\t\t\t\n\t\t\tthis.root.toConsole();\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\tobject data\n\n\t=====================================================*/\n\n\tTHREE.OctreeObjectData = function ( object, part ) {\n\t\t\n\t\t// properties\n\t\t\n\t\tthis.object = object;\n\t\t\n\t\t// handle part by type\n\t\t\n\t\tif ( part instanceof THREE.Face3 ) {\n\t\t\t\n\t\t\tthis.faces = part;\n\t\t\tthis.face3 = true;\n\t\t\tthis.utilVec31FaceBounds = new THREE.Vector3();\n\t\t\t\n\t\t} else if ( part instanceof THREE.Vector3 ) {\n\t\t\t\n\t\t\tthis.vertices = part;\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.radius = 0;\n\t\tthis.position = new THREE.Vector3();\n\t\t\t\n\t\t// initial update\n\t\t\n\t\tif ( this.object instanceof THREE.Object3D ) {\n\t\t\t\n\t\t\tthis.update();\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.positionLast = this.position.clone();\n\t\t\n\t};\n\n\tTHREE.OctreeObjectData.prototype = {\n\t\t\n\t\tupdate: function () {\n\t\t\t\n\t\t\tif ( this.face3 ) {\n\t\t\t\t\n\t\t\t\tthis.radius = this.getFace3BoundingRadius( this.object, this.faces );\n\t\t\t\tthis.position.copy( this.faces.centroid ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\n\t\t\t} else if ( this.vertices ) {\n\t\t\t\t\n\t\t\t\tthis.radius = this.object.material.size || 1;\n\t\t\t\tthis.position.copy( this.vertices ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif ( this.object.geometry ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( this.object.geometry.boundingSphere === null ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.object.geometry.computeBoundingSphere();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.radius = this.object.geometry.boundingSphere.radius;\n\t\t\t\t\tthis.position.copy( this.object.geometry.boundingSphere.center ).applyMatrix4( this.object.matrixWorld );\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tthis.radius = this.object.boundRadius;\n\t\t\t\t\tthis.position.setFromMatrixPosition( this.object.matrixWorld );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.radius = this.radius * Math.max( this.object.scale.x, this.object.scale.y, this.object.scale.z );\n\t\t\t\n\t\t},\n\t\t\n\t\tgetFace3BoundingRadius: function ( object, face ) {\n\n\t\t\tif ( face.centroid === undefined ) face.centroid = new THREE.Vector3();\n\t\t\t\n\t\t\tvar geometry = object.geometry || object,\n\t\t\t\tvertices = geometry.vertices,\n\t\t\t\tcentroid = face.centroid,\n\t\t\t\tva = vertices[ face.a ], vb = vertices[ face.b ], vc = vertices[ face.c ],\n\t\t\t\tcentroidToVert = this.utilVec31FaceBounds,\n\t\t\t\tradius;\n\t\t\t\t\n\t\t\tcentroid.addVectors( va, vb ).add( vc ).divideScalar( 3 );\n\t\t\tradius = Math.max( centroidToVert.subVectors( centroid, va ).length(), centroidToVert.subVectors( centroid, vb ).length(), centroidToVert.subVectors( centroid, vc ).length() );\n\t\t\t\n\t\t\treturn radius;\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\tnode\n\n\t=====================================================*/\n\n\tTHREE.OctreeNode = function ( parameters ) {\n\t\t\n\t\t// utility\n\t\t\n\t\tthis.utilVec31Branch = new THREE.Vector3();\n\t\tthis.utilVec31Expand = new THREE.Vector3();\n\t\tthis.utilVec31Ray = new THREE.Vector3();\n\t\t\n\t\t// handle parameters\n\t\t\n\t\tparameters = parameters || {};\n\t\t\n\t\t// store or create tree\n\t\t\n\t\tif ( parameters.tree instanceof THREE.Octree ) {\n\t\t\t\n\t\t\tthis.tree = parameters.tree;\n\t\t\t\n\t\t} else if ( parameters.parent instanceof THREE.OctreeNode !== true ) {\n\t\t\t\n\t\t\tparameters.root = this;\n\t\t\t\n\t\t\tthis.tree = new THREE.Octree( parameters );\n\t\t\t\n\t\t}\n\t\t\n\t\t// basic properties\n\t\t\n\t\tthis.id = this.tree.nodeCount++;\n\t\tthis.position = parameters.position instanceof THREE.Vector3 ? parameters.position : new THREE.Vector3();\n\t\tthis.radius = parameters.radius > 0 ? parameters.radius : 1;\n\t\tthis.indexOctant = parameters.indexOctant;\n\t\tthis.depth = 0;\n\t\t\n\t\t// reset and assign parent\n\t\t\n\t\tthis.reset();\n\t\tthis.setParent( parameters.parent );\n\t\t\n\t\t// additional properties\n\t\t\n\t\tthis.overlap = this.radius * this.tree.overlapPct;\n\t\tthis.radiusOverlap = this.radius + this.overlap;\n\t\tthis.left = this.position.x - this.radiusOverlap;\n\t\tthis.right = this.position.x + this.radiusOverlap;\n\t\tthis.bottom = this.position.y - this.radiusOverlap;\n\t\tthis.top = this.position.y + this.radiusOverlap;\n\t\tthis.back = this.position.z - this.radiusOverlap;\n\t\tthis.front = this.position.z + this.radiusOverlap;\n\t\t\n\t\t// visual\n\t\t\n\t\tif ( this.tree.scene ) {\n\t\t\t\n\t\t\tthis.visual = new THREE.Mesh( this.tree.visualGeometry, this.tree.visualMaterial );\n\t\t\tthis.visual.scale.set( this.radiusOverlap * 2, this.radiusOverlap * 2, this.radiusOverlap * 2 );\n\t\t\tthis.visual.position.copy( this.position );\n\t\t\tthis.tree.scene.add( this.visual );\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\tTHREE.OctreeNode.prototype = {\n\t\t\n\t\tsetParent: function ( parent ) {\n\t\t\t\n\t\t\t// store new parent\n\t\t\t\n\t\t\tif ( parent !== this && this.parent !== parent ) {\n\t\t\t\t\n\t\t\t\tthis.parent = parent;\n\t\t\t\t\n\t\t\t\t// update properties\n\t\t\t\t\n\t\t\t\tthis.updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tupdateProperties: function () {\n\t\t\t\n\t\t\tvar i, l;\n\t\t\t\n\t\t\t// properties\n\t\t\t\n\t\t\tif ( this.parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tthis.tree = this.parent.tree;\n\t\t\t\tthis.depth = this.parent.depth + 1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tthis.depth = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// cascade\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tthis.nodesByIndex[ this.nodesIndices[ i ] ].updateProperties();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\treset: function ( cascade, removeVisual ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tnodesIndices = this.nodesIndices || [],\n\t\t\t\tnodesByIndex = this.nodesByIndex;\n\t\t\t\n\t\t\tthis.objects = [];\n\t\t\tthis.nodesIndices = [];\n\t\t\tthis.nodesByIndex = {};\n\t\t\t\n\t\t\t// unset parent in nodes\n\t\t\t\n\t\t\tfor ( i = 0, l = nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = nodesByIndex[ nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tnode.setParent( undefined );\n\t\t\t\t\n\t\t\t\tif ( cascade === true ) {\n\t\t\t\t\t\n\t\t\t\t\tnode.reset( cascade, removeVisual );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// visual\n\t\t\t\n\t\t\tif ( removeVisual === true && this.visual && this.visual.parent ) {\n\t\t\t\t\n\t\t\t\tthis.visual.parent.remove( this.visual );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddNode: function ( node, indexOctant ) {\n\t\t\t\n\t\t\tnode.indexOctant = indexOctant;\n\t\t\t\n\t\t\tif ( indexOfValue( this.nodesIndices, indexOctant ) === -1 ) {\n\t\t\t\t\n\t\t\t\tthis.nodesIndices.push( indexOctant );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.nodesByIndex[ indexOctant ] = node;\n\t\t\t\n\t\t\tif ( node.parent !== this ) {\n\t\t\t\t\n\t\t\t\tnode.setParent( this );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveNode: function ( indexOctant ) {\n\t\t\t\n\t\t\tvar index,\n\t\t\t\tnode;\n\t\t\t\t\n\t\t\tindex = indexOfValue( this.nodesIndices, indexOctant );\n\t\t\t\n\t\t\tthis.nodesIndices.splice( index, 1 );\n\t\t\t\n\t\t\tnode = node || this.nodesByIndex[ indexOctant ];\n\t\t\t\n\t\t\tdelete this.nodesByIndex[ indexOctant ];\n\t\t\t\n\t\t\tif ( node.parent === this ) {\n\t\t\t\t\n\t\t\t\tnode.setParent( undefined );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObject: function ( object ) {\n\t\t\t\n\t\t\tvar index,\n\t\t\t\tindexOctant,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// get object octant index\n\t\t\t\n\t\t\tindexOctant = this.getOctantIndex( object );\n\t\t\t\n\t\t\t// if object fully contained by an octant, add to subtree\n\t\t\tif ( indexOctant > -1 && this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tnode = this.branch( indexOctant );\n\t\t\t\t\n\t\t\t\tnode.addObject( object );\n\t\t\t\t\n\t\t\t} else if ( indexOctant < -1 && this.parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\t// if object lies outside bounds, add to parent node\n\t\t\t\t\n\t\t\t\tthis.parent.addObject( object );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// add to this objects list\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index === -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.push( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// node reference\n\t\t\t\t\n\t\t\t\tobject.node = this;\n\t\t\t\t\n\t\t\t\t// check if need to expand, split, or both\n\t\t\t\t\n\t\t\t\tthis.checkGrow();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\taddObjectWithoutCheck: function ( objects ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobject;\n\n\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobject = objects[ i ];\n\t\t\t\t\n\t\t\t\tthis.objects.push( object );\n\t\t\t\t\n\t\t\t\tobject.node = this;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveObject: function ( object ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnodesRemovedFrom,\n\t\t\t\tremoveData;\n\t\t\t\n\t\t\t// cascade through tree to find and remove object\n\t\t\t\n\t\t\tremoveData = this.removeObjectRecursive( object, { searchComplete: false, nodesRemovedFrom: [], objectsDataRemoved: [] } );\n\t\t\t\n\t\t\t// if object removed, try to shrink the nodes it was removed from\n\t\t\t\n\t\t\tnodesRemovedFrom = removeData.nodesRemovedFrom;\n\t\t\t\n\t\t\tif ( nodesRemovedFrom.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = nodesRemovedFrom.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnodesRemovedFrom[ i ].shrink();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn removeData.objectsDataRemoved;\n\t\t\t\n\t\t},\n\t\t\n\t\tremoveObjectRecursive: function ( object, removeData ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tindex = -1,\n\t\t\t\tobjectData,\n\t\t\t\tnode,\n\t\t\t\tobjectRemoved;\n\t\t\t\n\t\t\t// find index of object in objects list\n\t\t\t\n\t\t\t// search and remove object data (fast)\n\t\t\tif ( object instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\t// remove from this objects list\n\t\t\t\t\n\t\t\t\tindex = indexOfValue( this.objects, object );\n\t\t\t\t\n\t\t\t\tif ( index !== -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects.splice( index, 1 );\n\t\t\t\t\tobject.node = undefined;\n\t\t\t\t\t\n\t\t\t\t\tremoveData.objectsDataRemoved.push( object );\n\t\t\t\t\t\n\t\t\t\t\tremoveData.searchComplete = objectRemoved = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t// search each object data for object and remove (slow)\n\t\t\t\t\n\t\t\t\tfor ( i = this.objects.length - 1; i >= 0; i-- ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectData = this.objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\tif ( objectData.object === object ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.objects.splice( i, 1 );\n\t\t\t\t\t\tobjectData.node = undefined;\n\t\t\t\t\t\t\n\t\t\t\t\t\tremoveData.objectsDataRemoved.push( objectData );\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectRemoved = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( !objectData.faces && !objectData.vertices ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tremoveData.searchComplete = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if object data removed and this is not on nodes removed from\n\t\t\t\n\t\t\tif ( objectRemoved === true ) {\n\t\t\t\t\n\t\t\t\tremoveData.nodesRemovedFrom.push( this );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if search not complete, search nodes\n\t\t\t\n\t\t\tif ( removeData.searchComplete !== true ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\t// try removing object from node\n\t\t\t\t\t\n\t\t\t\t\tremoveData = node.removeObjectRecursive( object, removeData );\n\t\t\t\t\t\n\t\t\t\t\tif ( removeData.searchComplete === true ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn removeData;\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckGrow: function () {\n\t\t\t\n\t\t\t// if object count above max\n\t\t\t\n\t\t\tif ( this.objects.length > this.tree.objectsThreshold && this.tree.objectsThreshold > 0 ) {\n\t\t\t\t\n\t\t\t\tthis.grow();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tgrow: function () {\n\t\t\t\n\t\t\tvar indexOctant,\n\t\t\t\tobject,\n\t\t\t\tobjectsExpand = [],\n\t\t\t\tobjectsExpandOctants = [],\n\t\t\t\tobjectsSplit = [],\n\t\t\t\tobjectsSplitOctants = [],\n\t\t\t\tobjectsRemaining = [],\n\t\t\t\ti, l;\n\t\t\t\n\t\t\t// for each object\n\t\t\t\n\t\t\tfor ( i = 0, l = this.objects.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tobject = this.objects[ i ];\n\t\t\t\t\n\t\t\t\t// get object octant index\n\t\t\t\t\n\t\t\t\tindexOctant = this.getOctantIndex( object );\n\t\t\t\t\n\t\t\t\t// if lies within octant\n\t\t\t\tif ( indexOctant > -1 ) {\n\t\t\t\t\t\n\t\t\t\t\tobjectsSplit.push( object );\n\t\t\t\t\tobjectsSplitOctants.push( indexOctant );\n\t\t\t\t\n\t\t\t\t} else if ( indexOctant < -1 ) {\n\t\t\t\t\t\n\t\t\t\t\t// lies outside radius\n\t\t\t\t\t\n\t\t\t\t\tobjectsExpand.push( object );\n\t\t\t\t\tobjectsExpandOctants.push( indexOctant );\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t// lies across bounds between octants\n\t\t\t\t\t\n\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if has objects to split\n\t\t\t\n\t\t\tif ( objectsSplit.length > 0) {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objectsRemaining.concat( this.split( objectsSplit, objectsSplitOctants ) );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if has objects to expand\n\t\t\t\n\t\t\tif ( objectsExpand.length > 0) {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objectsRemaining.concat( this.expand( objectsExpand, objectsExpandOctants ) );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// store remaining\n\t\t\t\n\t\t\tthis.objects = objectsRemaining;\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t},\n\t\t\n\t\tsplit: function ( objects, octants ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tindexOctant,\n\t\t\t\tobject,\n\t\t\t\tnode,\n\t\t\t\tobjectsRemaining;\n\t\t\t\n\t\t\t// if not at max depth\n\t\t\t\n\t\t\tif ( this.depth < this.tree.depthMax ) {\n\t\t\t\t\n\t\t\t\tobjects = objects || this.objects;\n\t\t\t\t\n\t\t\t\toctants = octants || [];\n\t\t\t\t\n\t\t\t\tobjectsRemaining = [];\n\t\t\t\t\n\t\t\t\t// for each object\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobject = objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// get object octant index\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = octants[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// if object contained by octant, branch this tree\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant > -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnode = this.branch( indexOctant );\n\t\t\t\t\t\t\n\t\t\t\t\t\tnode.addObject( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if all objects, set remaining as new objects\n\t\t\t\t\n\t\t\t\tif ( objects === this.objects ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects = objectsRemaining;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = this.objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objectsRemaining;\n\t\t\t\n\t\t},\n\t\t\n\t\tbranch: function ( indexOctant ) {\n\t\t\t\n\t\t\tvar node,\n\t\t\t\toverlap,\n\t\t\t\tradius,\n\t\t\t\tradiusOffset,\n\t\t\t\toffset,\n\t\t\t\tposition;\n\t\t\t\n\t\t\t// node exists\n\t\t\t\n\t\t\tif ( this.nodesByIndex[ indexOctant ] instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ indexOctant ];\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// properties\n\t\t\t\t\n\t\t\t\tradius = ( this.radiusOverlap ) * 0.5;\n\t\t\t\toverlap = radius * this.tree.overlapPct;\n\t\t\t\tradiusOffset = radius - overlap;\n\t\t\t\toffset = this.utilVec31Branch.set( indexOctant & 1 ? radiusOffset : -radiusOffset, indexOctant & 2 ? radiusOffset : -radiusOffset, indexOctant & 4 ? radiusOffset : -radiusOffset );\n\t\t\t\tposition = new THREE.Vector3().addVectors( this.position, offset );\n\t\t\t\t\n\t\t\t\t// node\n\t\t\t\t\n\t\t\t\tnode = new THREE.OctreeNode( {\n\t\t\t\t\ttree: this.tree,\n\t\t\t\t\tparent: this,\n\t\t\t\t\tposition: position,\n\t\t\t\t\tradius: radius,\n\t\t\t\t\tindexOctant: indexOctant\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\t// store\n\t\t\t\t\n\t\t\t\tthis.addNode( node, indexOctant );\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn node;\n\t\t\t\n\t\t},\n\t\t\n\t\texpand: function ( objects, octants ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tobject,\n\t\t\t\tobjectsRemaining,\n\t\t\t\tobjectsExpand,\n\t\t\t\tindexOctant,\n\t\t\t\tflagsOutside,\n\t\t\t\tindexOutside,\n\t\t\t\tindexOctantInverse,\n\t\t\t\tiom = this.tree.INDEX_OUTSIDE_MAP,\n\t\t\t\tindexOutsideCounts,\n\t\t\t\tinfoIndexOutside1,\n\t\t\t\tinfoIndexOutside2,\n\t\t\t\tinfoIndexOutside3,\n\t\t\t\tindexOutsideBitwise1,\n\t\t\t\tindexOutsideBitwise2,\n\t\t\t\tinfoPotential1,\n\t\t\t\tinfoPotential2,\n\t\t\t\tinfoPotential3,\n\t\t\t\tindexPotentialBitwise1,\n\t\t\t\tindexPotentialBitwise2,\n\t\t\t\toctantX, octantY, octantZ,\n\t\t\t\toverlap,\n\t\t\t\tradius,\n\t\t\t\tradiusOffset,\n\t\t\t\tradiusParent,\n\t\t\t\toverlapParent,\n\t\t\t\toffset = this.utilVec31Expand,\n\t\t\t\tposition,\n\t\t\t\tparent;\n\t\t\t\n\t\t\t// handle max depth down tree\n\t\t\t\n\t\t\tif ( this.tree.root.getDepthEnd() < this.tree.depthMax ) {\n\t\t\t\t\n\t\t\t\tobjects = objects || this.objects;\n\t\t\t\toctants = octants || [];\n\t\t\t\t\n\t\t\t\tobjectsRemaining = [];\n\t\t\t\tobjectsExpand = [];\n\t\t\t\t\n\t\t\t\t// reset counts\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = iom.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tiom[ i ].count = 0;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// for all outside objects, find outside octants containing most objects\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = objects.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tobject = objects[ i ];\n\t\t\t\t\t\n\t\t\t\t\t// get object octant index\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = octants[ i ] ;\n\t\t\t\t\t\n\t\t\t\t\t// if object outside this, include in calculations\n\t\t\t\t\t\n\t\t\t\t\tif ( indexOctant < -1 ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// convert octant index to outside flags\n\t\t\t\t\t\t\n\t\t\t\t\t\tflagsOutside = -indexOctant - this.tree.INDEX_OUTSIDE_OFFSET;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check against bitwise flags\n\t\t\t\t\t\t\n\t\t\t\t\t\t// x\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_X ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_X ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_X ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_X ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// y\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_Y ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_Y ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_Y ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_Y ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// z\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( flagsOutside & this.tree.FLAG_POS_Z ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_POS_Z ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else if ( flagsOutside & this.tree.FLAG_NEG_Z ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tiom[ this.tree.INDEX_OUTSIDE_NEG_Z ].count++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// store in expand list\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsExpand.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tobjectsRemaining.push( object );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if objects to expand\n\t\t\t\t\n\t\t\t\tif ( objectsExpand.length > 0 ) {\n\t\t\t\t\t\n\t\t\t\t\t// shallow copy index outside map\n\t\t\t\t\t\n\t\t\t\t\tindexOutsideCounts = iom.slice( 0 );\n\t\t\t\t\t\n\t\t\t\t\t// sort outside index count so highest is first\n\t\t\t\t\t\n\t\t\t\t\tindexOutsideCounts.sort( function ( a, b ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn b.count - a.count;\n\t\t\t\t\t\t\n\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t// get highest outside indices\n\t\t\t\t\t\n\t\t\t\t\t// first is first\n\t\t\t\t\tinfoIndexOutside1 = indexOutsideCounts[ 0 ];\n\t\t\t\t\tindexOutsideBitwise1 = infoIndexOutside1.index | 1;\n\t\t\t\t\t\n\t\t\t\t\t// second is ( one of next two bitwise OR 1 ) that is not opposite of ( first bitwise OR 1 )\n\t\t\t\t\t\n\t\t\t\t\tinfoPotential1 = indexOutsideCounts[ 1 ];\n\t\t\t\t\tinfoPotential2 = indexOutsideCounts[ 2 ];\n\t\t\t\t\t\n\t\t\t\t\tinfoIndexOutside2 = ( infoPotential1.index | 1 ) !== indexOutsideBitwise1 ? infoPotential1 : infoPotential2;\n\t\t\t\t\tindexOutsideBitwise2 = infoIndexOutside2.index | 1;\n\t\t\t\t\t\n\t\t\t\t\t// third is ( one of next three bitwise OR 1 ) that is not opposite of ( first or second bitwise OR 1 )\n\t\t\t\t\t\n\t\t\t\t\tinfoPotential1 = indexOutsideCounts[ 2 ];\n\t\t\t\t\tinfoPotential2 = indexOutsideCounts[ 3 ];\n\t\t\t\t\tinfoPotential3 = indexOutsideCounts[ 4 ];\n\t\t\t\t\t\n\t\t\t\t\tindexPotentialBitwise1 = infoPotential1.index | 1;\n\t\t\t\t\tindexPotentialBitwise2 = infoPotential2.index | 1;\n\t\t\t\t\t\n\t\t\t\t\tinfoIndexOutside3 = indexPotentialBitwise1 !== indexOutsideBitwise1 && indexPotentialBitwise1 !== indexOutsideBitwise2 ? infoPotential1 : indexPotentialBitwise2 !== indexOutsideBitwise1 && indexPotentialBitwise2 !== indexOutsideBitwise2 ? infoPotential2 : infoPotential3;\n\t\t\t\t\t\n\t\t\t\t\t// get this octant normal based on outside octant indices\n\t\t\t\t\t\n\t\t\t\t\toctantX = infoIndexOutside1.x + infoIndexOutside2.x + infoIndexOutside3.x;\n\t\t\t\t\toctantY = infoIndexOutside1.y + infoIndexOutside2.y + infoIndexOutside3.y;\n\t\t\t\t\toctantZ = infoIndexOutside1.z + infoIndexOutside2.z + infoIndexOutside3.z;\n\t\t\t\t\t\n\t\t\t\t\t// get this octant indices based on octant normal\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = this.getOctantIndexFromPosition( octantX, octantY, octantZ );\n\t\t\t\t\tindexOctantInverse = this.getOctantIndexFromPosition( -octantX, -octantY, -octantZ );\n\t\t\t\t\t\n\t\t\t\t\t// properties\n\t\t\t\t\t\n\t\t\t\t\toverlap = this.overlap;\n\t\t\t\t\tradius = this.radius;\n\t\t\t\t\t\n\t\t\t\t\t// radius of parent comes from reversing overlap of this, unless overlap percent is 0\n\t\t\t\t\t\n\t\t\t\t\tradiusParent = this.tree.overlapPct > 0 ? overlap / ( ( 0.5 * this.tree.overlapPct ) * ( 1 + this.tree.overlapPct ) ) : radius * 2; \n\t\t\t\t\toverlapParent = radiusParent * this.tree.overlapPct;\n\t\t\t\t\t\n\t\t\t\t\t// parent offset is difference between radius + overlap of parent and child\n\t\t\t\t\t\n\t\t\t\t\tradiusOffset = ( radiusParent + overlapParent ) - ( radius + overlap );\n\t\t\t\t\toffset.set( indexOctant & 1 ? radiusOffset : -radiusOffset, indexOctant & 2 ? radiusOffset : -radiusOffset, indexOctant & 4 ? radiusOffset : -radiusOffset );\n\t\t\t\t\tposition = new THREE.Vector3().addVectors( this.position, offset );\n\t\t\t\t\t\n\t\t\t\t\t// parent\n\t\t\t\t\t\n\t\t\t\t\tparent = new THREE.OctreeNode( {\n\t\t\t\t\t\ttree: this.tree,\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\tradius: radiusParent\n\t\t\t\t\t} );\n\t\t\t\t\t\n\t\t\t\t\t// set self as node of parent\n\t\t\t\t\t\n\t\t\t\t\tparent.addNode( this, indexOctantInverse );\n\t\t\t\t\t\n\t\t\t\t\t// set parent as root\n\t\t\t\t\t\n\t\t\t\t\tthis.tree.setRoot( parent );\n\t\t\t\t\t\n\t\t\t\t\t// add all expand objects to parent\n\t\t\t\t\t\n\t\t\t\t\tfor ( i = 0, l = objectsExpand.length; i < l; i++ ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.tree.root.addObject( objectsExpand[ i ] );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if all objects, set remaining as new objects\n\t\t\t\t\n\t\t\t\tif ( objects === this.objects ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.objects = objectsRemaining;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tobjectsRemaining = objects;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objectsRemaining;\n\t\t\t\n\t\t},\n\t\t\n\t\tshrink: function () {\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t\t// contract check\n\t\t\t\n\t\t\tthis.tree.root.checkContract();\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckMerge: function () {\n\t\t\t\n\t\t\tvar nodeParent = this,\n\t\t\t\tnodeMerge;\n\t\t\t\n\t\t\t// traverse up tree as long as node + entire subtree's object count is under minimum\n\t\t\t\n\t\t\twhile ( nodeParent.parent instanceof THREE.OctreeNode && nodeParent.getObjectCountEnd() < this.tree.objectsThreshold ) {\n\t\t\t\t\n\t\t\t\tnodeMerge = nodeParent;\n\t\t\t\tnodeParent = nodeParent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if parent node is not this, merge entire subtree into merge node\n\t\t\t\n\t\t\tif ( nodeParent !== this ) {\n\t\t\t\t\n\t\t\t\tnodeParent.merge( nodeMerge );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tmerge: function ( nodes ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tj, k,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// handle nodes\n\t\t\t\n\t\t\tnodes = toArray( nodes );\n\t\t\t\n\t\t\tfor ( i = 0, l = nodes.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = nodes[ i ];\n\t\t\t\t\n\t\t\t\t// gather node + all subtree objects\n\t\t\t\t\n\t\t\t\tthis.addObjectWithoutCheck( node.getObjectsEnd() );\n\t\t\t\t\n\t\t\t\t// reset node + entire subtree\n\t\t\t\t\n\t\t\t\tnode.reset( true, true );\n\t\t\t\t\n\t\t\t\t// remove node\n\t\t\t\t\n\t\t\t\tthis.removeNode( node.indexOctant, node );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// merge check\n\t\t\t\n\t\t\tthis.checkMerge();\n\t\t\t\n\t\t},\n\t\t\n\t\tcheckContract: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tnodeObjectsCount,\n\t\t\t\tnodeHeaviest,\n\t\t\t\tnodeHeaviestObjectsCount,\n\t\t\t\toutsideHeaviestObjectsCount;\n\t\t\t\n\t\t\t// find node with highest object count\n\t\t\t\n\t\t\tif ( this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tnodeHeaviestObjectsCount = 0;\n\t\t\t\toutsideHeaviestObjectsCount = this.objects.length;\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\tnodeObjectsCount = node.getObjectCountEnd();\n\t\t\t\t\toutsideHeaviestObjectsCount += nodeObjectsCount;\n\t\t\t\t\t\n\t\t\t\t\tif ( nodeHeaviest instanceof THREE.OctreeNode === false || nodeObjectsCount > nodeHeaviestObjectsCount ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnodeHeaviest = node;\n\t\t\t\t\t\tnodeHeaviestObjectsCount = nodeObjectsCount;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// subtract heaviest count from outside count\n\t\t\t\t\n\t\t\t\toutsideHeaviestObjectsCount -= nodeHeaviestObjectsCount;\n\t\t\t\t\n\t\t\t\t// if should contract\n\t\t\t\t\n\t\t\t\tif ( outsideHeaviestObjectsCount < this.tree.objectsThreshold && nodeHeaviest instanceof THREE.OctreeNode ) {\n\t\t\t\t\t\n\t\t\t\t\tthis.contract( nodeHeaviest );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t},\n\t\t\n\t\tcontract: function ( nodeRoot ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\t\t\t\n\t\t\t// handle all nodes\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\t// if node is not new root\n\t\t\t\t\n\t\t\t\tif ( node !== nodeRoot ) {\n\t\t\t\t\t\n\t\t\t\t\t// add node + all subtree objects to root\n\t\t\t\t\t\n\t\t\t\t\tnodeRoot.addObjectWithoutCheck( node.getObjectsEnd() );\n\t\t\t\t\t\n\t\t\t\t\t// reset node + entire subtree\n\t\t\t\t\t\n\t\t\t\t\tnode.reset( true, true );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// add own objects to root\n\t\t\t\n\t\t\tnodeRoot.addObjectWithoutCheck( this.objects );\n\t\t\t\n\t\t\t// reset self\n\t\t\t\n\t\t\tthis.reset( false, true );\n\t\t\t\n\t\t\t// set new root\n\t\t\t\n\t\t\tthis.tree.setRoot( nodeRoot );\n\t\t\t\n\t\t\t// contract check on new root\n\t\t\t\n\t\t\tnodeRoot.checkContract();\n\t\t\t\n\t\t},\n\t\t\n\t\tgetOctantIndex: function ( objectData ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tpositionObj,\n\t\t\t\tradiusObj,\n\t\t\t\tposition = this.position,\n\t\t\t\tradiusOverlap = this.radiusOverlap,\n\t\t\t\toverlap = this.overlap,\n\t\t\t\tdeltaX, deltaY, deltaZ,\n\t\t\t\tdistX, distY, distZ, \n\t\t\t\tdistance,\n\t\t\t\tindexOctant = 0;\n\t\t\t\n\t\t\t// handle type\n\t\t\t\n\t\t\tif ( objectData instanceof THREE.OctreeObjectData ) {\n\t\t\t\t\n\t\t\t\tradiusObj = objectData.radius;\n\t\t\t\t\n\t\t\t\tpositionObj = objectData.position;\n\t\t\t\t\n\t\t\t\t// update object data position last\n\t\t\t\t\n\t\t\t\tobjectData.positionLast.copy( positionObj );\n\t\t\t\t\n\t\t\t} else if ( objectData instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tpositionObj = objectData.position;\n\t\t\t\t\n\t\t\t\tradiusObj = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// find delta and distance\n\t\t\t\n\t\t\tdeltaX = positionObj.x - position.x;\n\t\t\tdeltaY = positionObj.y - position.y;\n\t\t\tdeltaZ = positionObj.z - position.z;\n\t\t\t\n\t\t\tdistX = Math.abs( deltaX );\n\t\t\tdistY = Math.abs( deltaY );\n\t\t\tdistZ = Math.abs( deltaZ );\n\t\t\tdistance = Math.max( distX, distY, distZ );\n\t\t\t\n\t\t\t// if outside, use bitwise flags to indicate on which sides object is outside of\n\t\t\t\n\t\t\tif ( distance + radiusObj > radiusOverlap ) {\n\t\t\t\t\n\t\t\t\t// x\n\t\t\t\t\n\t\t\t\tif ( distX + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaX > 0 ? this.tree.FLAG_POS_X : this.tree.FLAG_NEG_X );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// y\n\t\t\t\t\n\t\t\t\tif ( distY + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaY > 0 ? this.tree.FLAG_POS_Y : this.tree.FLAG_NEG_Y );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// z\n\t\t\t\t\n\t\t\t\tif ( distZ + radiusObj > radiusOverlap ) {\n\t\t\t\t\t\n\t\t\t\t\tindexOctant = indexOctant ^ ( deltaZ > 0 ? this.tree.FLAG_POS_Z : this.tree.FLAG_NEG_Z );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = -indexOctant - this.tree.INDEX_OUTSIDE_OFFSET;\n\t\t\t\t\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// return octant index from delta xyz\n\t\t\t\n\t\t\tif ( deltaX - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// x right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 1;\n\t\t\t\t\n\t\t\t} else if ( !( deltaX + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// x left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( deltaY - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// y right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 2;\n\t\t\t\t\n\t\t\t} else if ( !( deltaY + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// y left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif ( deltaZ - radiusObj > -overlap ) {\n\t\t\t\t\n\t\t\t\t// z right\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 4;\n\t\t\t\t\n\t\t\t} else if ( !( deltaZ + radiusObj < overlap ) ) {\n\t\t\t\t\n\t\t\t\t// z left\n\t\t\t\t\n\t\t\t\tobjectData.indexOctant = this.tree.INDEX_INSIDE_CROSS;\n\t\t\t\treturn objectData.indexOctant;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tobjectData.indexOctant = indexOctant;\n\t\t\treturn objectData.indexOctant;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetOctantIndexFromPosition: function ( x, y, z ) {\n\t\t\t\n\t\t\tvar indexOctant = 0;\n\t\t\t\n\t\t\tif ( x > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( y > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 2;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( z > 0 ) {\n\t\t\t\t\n\t\t\t\tindexOctant = indexOctant | 4;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn indexOctant;\n\t\t\t\n\t\t},\n\t\t\n\t\tsearch: function ( position, radius, objects, direction, directionPct ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tintersects;\n\t\t\t\n\t\t\t// test intersects by parameters\n\t\t\t\n\t\t\tif ( direction ) {\n\t\t\t\t\n\t\t\t\tintersects = this.intersectRay( position, direction, radius, directionPct );\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tintersects = this.intersectSphere( position, radius );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if intersects\n\t\t\t\n\t\t\tif ( intersects === true ) {\n\t\t\t\t\n\t\t\t\t// gather objects\n\t\t\t\t\n\t\t\t\tobjects = objects.concat( this.objects );\n\t\t\t\t\n\t\t\t\t// search subtree\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\t\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\t\n\t\t\t\t\tobjects = node.search( position, radius, objects, direction );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objects;\n\t\t\t\n\t\t},\n\t\t\n\t\tintersectSphere: function ( position, radius ) {\n\t\t\t\n\t\t\tvar\tdistance = radius * radius,\n\t\t\t\tpx = position.x,\n\t\t\t\tpy = position.y,\n\t\t\t\tpz = position.z;\n\t\t\t\n\t\t\tif ( px < this.left ) {\n\t\t\t\tdistance -= Math.pow( px - this.left, 2 );\n\t\t\t} else if ( px > this.right ) {\n\t\t\t\tdistance -= Math.pow( px - this.right, 2 );\n\t\t\t}\n\t\t\t\n\t\t\tif ( py < this.bottom ) {\n\t\t\t\tdistance -= Math.pow( py - this.bottom, 2 );\n\t\t\t} else if ( py > this.top ) {\n\t\t\t\tdistance -= Math.pow( py - this.top, 2 );\n\t\t\t}\n\t\t\t\n\t\t\tif ( pz < this.back ) {\n\t\t\t\tdistance -= Math.pow( pz - this.back, 2 );\n\t\t\t} else if ( pz > this.front ) {\n\t\t\t\tdistance -= Math.pow( pz - this.front, 2 );\n\t\t\t}\n\t\t\t\n\t\t\treturn distance >= 0;\n\t\t\t\n\t\t},\n\t\t\n\t\tintersectRay: function ( origin, direction, distance, directionPct ) {\n\t\t\t\n\t\t\tif ( typeof directionPct === 'undefined' ) {\n\t\t\t\t\n\t\t\t\tdirectionPct = this.utilVec31Ray.set( 1, 1, 1 ).divide( direction );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar t1 = ( this.left - origin.x ) * directionPct.x,\n\t\t\t\tt2 = ( this.right - origin.x ) * directionPct.x,\n\t\t\t\tt3 = ( this.bottom - origin.y ) * directionPct.y,\n\t\t\t\tt4 = ( this.top - origin.y ) * directionPct.y,\n\t\t\t\tt5 = ( this.back - origin.z ) * directionPct.z,\n\t\t\t\tt6 = ( this.front - origin.z ) * directionPct.z,\n\t\t\t\ttmax = Math.min( Math.min( Math.max( t1, t2), Math.max( t3, t4) ), Math.max( t5, t6) ),\n\t\t\t\ttmin;\n\n\t\t\t// ray would intersect in reverse direction, i.e. this is behind ray\n\t\t\tif (tmax < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\ttmin = Math.max( Math.max( Math.min( t1, t2), Math.min( t3, t4)), Math.min( t5, t6));\n\t\t\t\n\t\t\t// if tmin > tmax or tmin > ray distance, ray doesn't intersect AABB\n\t\t\tif( tmin > tmax || tmin > distance ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetDepthEnd: function ( depth ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\n\t\t\tif ( this.nodesIndices.length > 0 ) {\n\t\t\t\t\n\t\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\n\t\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\n\t\t\t\t\tdepth = node.getDepthEnd( depth );\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\n\t\t\t\tdepth = !depth || this.depth > depth ? this.depth : depth;\n\n\t\t\t}\n\n\t\t\treturn depth;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountEnd: function () {\n\t\t\t\n\t\t\treturn this.tree.root.getNodeCountRecursive() + 1;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetNodeCountRecursive: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tcount = this.nodesIndices.length;\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tcount += this.nodesByIndex[ this.nodesIndices[ i ] ].getNodeCountRecursive();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectsEnd: function ( objects ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode;\n\t\t\t\n\t\t\tobjects = ( objects || [] ).concat( this.objects );\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tobjects = node.getObjectsEnd( objects );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn objects;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountEnd: function () {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tcount = this.objects.length;\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tcount += this.nodesByIndex[ this.nodesIndices[ i ] ].getObjectCountEnd();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\tgetObjectCountStart: function () {\n\t\t\t\n\t\t\tvar count = this.objects.length,\n\t\t\t\tparent = this.parent;\n\t\t\t\n\t\t\twhile( parent instanceof THREE.OctreeNode ) {\n\t\t\t\t\n\t\t\t\tcount += parent.objects.length;\n\t\t\t\tparent = parent.parent;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn count;\n\t\t\t\n\t\t},\n\t\t\n\t\ttoConsole: function ( space ) {\n\t\t\t\n\t\t\tvar i, l,\n\t\t\t\tnode,\n\t\t\t\tspaceAddition = ' ';\n\t\t\t\n\t\t\tspace = typeof space === 'string' ? space : spaceAddition;\n\t\t\t\n\t\t\tconsole.log( ( this.parent ? space + ' octree NODE > ' : ' octree ROOT > ' ), this, ' // id: ', this.id, ' // indexOctant: ', this.indexOctant, ' // position: ', this.position.x, this.position.y, this.position.z, ' // radius: ', this.radius, ' // depth: ', this.depth );\n\t\t\tconsole.log( ( this.parent ? space + ' ' : ' ' ), '+ objects ( ', this.objects.length, ' ) ', this.objects );\n\t\t\tconsole.log( ( this.parent ? space + ' ' : ' ' ), '+ children ( ', this.nodesIndices.length, ' )', this.nodesIndices, this.nodesByIndex );\n\t\t\t\n\t\t\tfor ( i = 0, l = this.nodesIndices.length; i < l; i++ ) {\n\t\t\t\t\n\t\t\t\tnode = this.nodesByIndex[ this.nodesIndices[ i ] ];\n\t\t\t\t\n\t\t\t\tnode.toConsole( space + spaceAddition );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t};\n\n\t/*===================================================\n\n\traycaster additional functionality\n\n\t=====================================================*/\n\t\n\tTHREE.Raycaster.prototype.intersectOctreeObject = function ( object, recursive ) {\n\t\t\n\t\tvar intersects,\n\t\t\toctreeObject,\n\t\t\tfacesAll,\n\t\t\tfacesSearch;\n\t\t\n\t\tif ( object.object instanceof THREE.Object3D ) {\n\t\t\t\n\t\t\toctreeObject = object;\n\t\t\tobject = octreeObject.object;\n\t\t\t\n\t\t\t// temporarily replace object geometry's faces with octree object faces\n\t\t\t\n\t\t\tfacesSearch = octreeObject.faces;\n\t\t\tfacesAll = object.geometry.faces;\n\t\t\t\n\t\t\tif ( facesSearch.length > 0 ) {\n\t\t\t\t\n\t\t\t\tobject.geometry.faces = facesSearch;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// intersect\n\t\t\t\n\t\t\tintersects = this.intersectObject( object, recursive );\n\t\t\t\n\t\t\t// revert object geometry's faces\n\t\t\t\n\t\t\tif ( facesSearch.length > 0 ) {\n\t\t\t\t\n\t\t\t\tobject.geometry.faces = facesAll;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tintersects = this.intersectObject( object, recursive );\n\t\t\t\n\t\t}\n\t\t\n\t\treturn intersects;\n\t\t\n\t};\n\t\n\tTHREE.Raycaster.prototype.intersectOctreeObjects = function ( objects, recursive ) {\n\t\t\n\t\tvar i, il,\n\t\t\tintersects = [];\n\t\t\n\t\tfor ( i = 0, il = objects.length; i < il; i++ ) {\n\t\t\t\n\t\t\tintersects = intersects.concat( this.intersectOctreeObject( objects[ i ], recursive ) );\n\t\t\n\t\t}\n\t\t\n\t\treturn intersects;\n\t\t\n\t};\n\n}( THREE ) );"
},
"$:/plugins/rboue/Three.js/Lib/TypedArrayUtils.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/TypedArrayUtils.js",
"module-type": "library",
"text": "\nTHREE.TypedArrayUtils = {};\n\n/**\n * In-place quicksort for typed arrays (e.g. for Float32Array)\n * provides fast sorting\n * useful e.g. for a custom shader and/or BufferGeometry\n *\n * @author Roman Bolzern <roman.bolzern@fhnw.ch>, 2013\n * @author I4DS http://www.fhnw.ch/i4ds, 2013\n * @license MIT License <http://www.opensource.org/licenses/mit-license.php>\n *\n * Complexity: http://bigocheatsheet.com/ see Quicksort\n *\n * Example: \n * points: [x, y, z, x, y, z, x, y, z, ...]\n * eleSize: 3 //because of (x, y, z)\n * orderElement: 0 //order according to x\n */\n\nTHREE.TypedArrayUtils.quicksortIP = function ( arr, eleSize, orderElement ) {\n\n\tvar stack = [];\n\tvar sp = -1;\n\tvar left = 0;\n\tvar right = arr.length / eleSize - 1;\n\tvar tmp = 0.0, x = 0, y = 0;\n\n\tvar swapF = function ( a, b ) {\n\n\t\ta *= eleSize; b *= eleSize;\n\n\t\tfor ( y = 0; y < eleSize; y ++ ) {\n\n\t\t\ttmp = arr[ a + y ];\n\t\t\tarr[ a + y ]=arr[ b + y ];\n\t\t\tarr[ b + y ]=tmp;\n\n\t\t}\n\n\t};\n\t\n\tvar i, j, swap = new Float32Array( eleSize ), temp = new Float32Array( eleSize );\n\n\twhile ( true ) {\n\n\t\tif ( right - left <= 25 ) {\n\n\t\t\tfor ( j= left + 1; j <= right; j ++ ) {\n\n\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\t\t\t\n\t\t\t\t\tswap[ x ] = arr[ j * eleSize + x ];\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ti = j - 1;\n\t\t\t\t\n\t\t\t\twhile ( i >= left && arr[ i * eleSize + orderElement ] > swap[orderElement ] ) {\n\n\t\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\t\t\tarr[ ( i + 1 ) * eleSize + x ] = arr[ i * eleSize + x ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\ti --;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\t\tarr[ ( i + 1 ) * eleSize + x ] = swap[ x ];\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\tif ( sp == -1 ) break;\n\n\t\t\tright = stack[ sp -- ]; //?\n\t\t\tleft = stack[ sp -- ];\n\n\t\t} else {\n\n\t\t\tvar median = ( left + right ) >> 1;\n\n\t\t\ti = left + 1;\n\t\t\tj = right;\n\t\n\t\t\tswapF( median, i );\n\n\t\t\tif ( arr[ left * eleSize + orderElement ] > arr[ right * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( left, right );\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif ( arr[ i * eleSize + orderElement ] > arr[ right * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( i, right );\n\t\t\n\t\t\t}\n\n\t\t\tif ( arr[ left * eleSize + orderElement ] > arr[ i * eleSize + orderElement ] ) {\n\t\t\n\t\t\t\tswapF( left, i );\n\t\t\t\n\t\t\t}\n\n\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\ttemp[ x ] = arr[ i * eleSize + x ];\n\n\t\t\t}\n\t\t\t\n\t\t\twhile ( true ) {\n\t\t\t\t\n\t\t\t\tdo i ++; while ( arr[ i * eleSize + orderElement ] < temp[ orderElement ] );\n\t\t\t\tdo j --; while ( arr[ j * eleSize + orderElement ] > temp[ orderElement ] );\n\t\t\t\t\n\t\t\t\tif ( j < i ) break;\n\t\t\n\t\t\t\tswapF( i, j );\n\t\t\t\n\t\t\t}\n\n\t\t\tfor ( x = 0; x < eleSize; x ++ ) {\n\n\t\t\t\tarr[ ( left + 1 ) * eleSize + x ] = arr[ j * eleSize + x ];\n\t\t\t\tarr[ j * eleSize + x ] = temp[ x ];\n\n\t\t\t}\n\n\t\t\tif ( right - i + 1 >= j - left ) {\n\n\t\t\t\tstack[ ++ sp ] = i;\n\t\t\t\tstack[ ++ sp ] = right;\n\t\t\t\tright = j - 1;\n\n\t\t\t} else {\n\n\t\t\t\tstack[ ++ sp ] = left;\n\t\t\t\tstack[ ++ sp ] = j - 1;\n\t\t\t\tleft = i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn arr;\n\n};\n\n\n\n/**\n * k-d Tree for typed arrays (e.g. for Float32Array), in-place\n * provides fast nearest neighbour search\n * useful e.g. for a custom shader and/or BufferGeometry, saves tons of memory\n * has no insert and remove, only buildup and neares neighbour search\n *\n * Based on https://github.com/ubilabs/kd-tree-javascript by Ubilabs\n *\n * @author Roman Bolzern <roman.bolzern@fhnw.ch>, 2013\n * @author I4DS http://www.fhnw.ch/i4ds, 2013\n * @license MIT License <http://www.opensource.org/licenses/mit-license.php>\n *\n * Requires typed array quicksort\n *\n * Example: \n * points: [x, y, z, x, y, z, x, y, z, ...]\n * metric: function(a, b){\treturn Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2) + Math.pow(a[2] - b[2], 2); } //Manhatten distance\n * eleSize: 3 //because of (x, y, z)\n *\n * Further information (including mathematical properties)\n * http://en.wikipedia.org/wiki/Binary_tree\n * http://en.wikipedia.org/wiki/K-d_tree\n *\n * If you want to further minimize memory usage, remove Node.depth and replace in search algorithm with a traversal to root node (see comments at THREE.TypedArrayUtils.Kdtree.prototype.Node)\n */\n\n THREE.TypedArrayUtils.Kdtree = function ( points, metric, eleSize ) {\n\n\tvar self = this;\n\t\n\tvar maxDepth = 0;\n\t\n\tvar getPointSet = function ( points, pos ) {\n\n\t\treturn points.subarray( pos * eleSize, pos * eleSize + eleSize );\n\n\t};\n\t\t\n\tfunction buildTree( points, depth, parent, pos ) {\n\n\t\tvar dim = depth % eleSize,\n\t\t\tmedian,\n\t\t\tnode,\n\t\t\tplength = points.length / eleSize;\n\n\t\tif ( depth > maxDepth ) maxDepth = depth;\n\t\t\n\t\tif ( plength === 0 ) return null;\n\t\tif ( plength === 1 ) {\n\n\t\t\treturn new self.Node( getPointSet( points, 0 ), depth, parent, pos );\n\n\t\t}\n\n\t\tTHREE.TypedArrayUtils.quicksortIP( points, eleSize, dim );\n\t\t\n\t\tmedian = Math.floor( plength / 2 );\n\t\t\n\t\tnode = new self.Node( getPointSet( points, median ) , depth, parent, median + pos );\n\t\tnode.left = buildTree( points.subarray( 0, median * eleSize), depth + 1, node, pos );\n\t\tnode.right = buildTree( points.subarray( ( median + 1 ) * eleSize, points.length ), depth + 1, node, pos + median + 1 );\n\n\t\treturn node;\n\t\n\t}\n\n\tthis.root = buildTree( points, 0, null, 0 );\n\t\t\n\tthis.getMaxDepth = function () { return maxDepth; };\n\t\n\tthis.nearest = function ( point, maxNodes , maxDistance ) {\n\t\n\t\t /* point: array of size eleSize \n\t\t\tmaxNodes: max amount of nodes to return \n\t\t\tmaxDistance: maximum distance to point result nodes should have\n\t\t\tcondition (not implemented): function to test node before it's added to the result list, e.g. test for view frustum\n\t\t*/\n\n\t\tvar i,\n\t\t\tresult,\n\t\t\tbestNodes;\n\n\t\tbestNodes = new THREE.TypedArrayUtils.Kdtree.BinaryHeap(\n\n\t\t\tfunction ( e ) { return -e[ 1 ]; }\n\n\t\t);\n\n\t\tfunction nearestSearch( node ) {\n\n\t\t\tvar bestChild,\n\t\t\t\tdimension = node.depth % eleSize,\n\t\t\t\townDistance = metric(point, node.obj),\n\t\t\t\tlinearDistance = 0,\n\t\t\t\totherChild,\n\t\t\t\ti,\n\t\t\t\tlinearPoint = [];\n\n\t\t\tfunction saveNode( node, distance ) {\n\n\t\t\t\tbestNodes.push( [ node, distance ] );\n\n\t\t\t\tif ( bestNodes.size() > maxNodes ) {\n\n\t\t\t\t\tbestNodes.pop();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( i = 0; i < eleSize; i += 1 ) {\n\n\t\t\t\tif ( i === node.depth % eleSize ) {\n\n\t\t\t\t\tlinearPoint[ i ] = point[ i ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlinearPoint[ i ] = node.obj[ i ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tlinearDistance = metric( linearPoint, node.obj );\n\n\t\t\t// if it's a leaf\n\n\t\t\tif ( node.right === null && node.left === null ) {\n\n\t\t\t\tif ( bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\t\tsaveNode( node, ownDistance );\n\n\t\t\t\t}\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( node.right === null ) {\n\n\t\t\t\tbestChild = node.left;\n\n\t\t\t} else if ( node.left === null ) {\n\n\t\t\t\tbestChild = node.right;\n\n\t\t\t} else {\n\n\t\t\t\tif ( point[ dimension ] < node.obj[ dimension ] ) {\n\n\t\t\t\t\tbestChild = node.left;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbestChild = node.right;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// recursive search\n\n\t\t\tnearestSearch( bestChild );\n\n\t\t\tif ( bestNodes.size() < maxNodes || ownDistance < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\tsaveNode( node, ownDistance );\n\n\t\t\t}\n\n\t\t\t// if there's still room or the current distance is nearer than the best distance\n\n\t\t\tif ( bestNodes.size() < maxNodes || Math.abs(linearDistance) < bestNodes.peek()[ 1 ] ) {\n\n\t\t\t\tif ( bestChild === node.left ) {\n\n\t\t\t\t\totherChild = node.right;\n\n\t\t\t\t} else {\n\n\t\t\t\t\totherChild = node.left;\n\n\t\t\t\t}\n\n\t\t\t\tif ( otherChild !== null ) {\n\n\t\t\t\t\tnearestSearch( otherChild );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( maxDistance ) {\n\n\t\t\tfor ( i = 0; i < maxNodes; i += 1 ) {\n\n\t\t\t\tbestNodes.push( [ null, maxDistance ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tnearestSearch( self.root );\n\n\t\tresult = [];\n\n\t\tfor ( i = 0; i < maxNodes; i += 1 ) {\n\n\t\t\tif ( bestNodes.content[ i ][ 0 ] ) {\n\n\t\t\t\tresult.push( [ bestNodes.content[ i ][ 0 ], bestNodes.content[ i ][ 1 ] ] );\n\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn result;\n\t\n\t};\n\t\n};\n\n/**\n * If you need to free up additional memory and agree with an additional O( log n ) traversal time you can get rid of \"depth\" and \"pos\" in Node:\n * Depth can be easily done by adding 1 for every parent (care: root node has depth 0, not 1)\n * Pos is a bit tricky: Assuming the tree is balanced (which is the case when after we built it up), perform the following steps:\n * By traversing to the root store the path e.g. in a bit pattern (01001011, 0 is left, 1 is right)\n * From buildTree we know that \"median = Math.floor( plength / 2 );\", therefore for each bit...\n * 0: amountOfNodesRelevantForUs = Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n * 1: amountOfNodesRelevantForUs = Math.ceil( (pamountOfNodesRelevantForUs - 1) / 2 );\n * pos += Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n * when recursion done, we still need to add all left children of target node:\n * pos += Math.floor( (pamountOfNodesRelevantForUs - 1) / 2 );\n * and I think you need to +1 for the current position, not sure.. depends, try it out ^^\n *\n * I experienced that for 200'000 nodes you can get rid of 4 MB memory each, leading to 8 MB memory saved.\n */\nTHREE.TypedArrayUtils.Kdtree.prototype.Node = function ( obj, depth, parent, pos ) {\n\n\tthis.obj = obj;\n\tthis.left = null;\n\tthis.right = null;\n\tthis.parent = parent;\n\tthis.depth = depth;\n\tthis.pos = pos;\n\n}; \n\n/**\n * Binary heap implementation\n * @author http://eloquentjavascript.net/appendix2.htm\n */\n\nTHREE.TypedArrayUtils.Kdtree.BinaryHeap = function ( scoreFunction ) {\n\n\tthis.content = [];\n\tthis.scoreFunction = scoreFunction;\n\n};\n\nTHREE.TypedArrayUtils.Kdtree.BinaryHeap.prototype = {\n\n\tpush: function ( element ) {\n\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push( element );\n\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp( this.content.length - 1 );\n\n\t},\n\n\tpop: function () {\n\n\t\t// Store the first element so we can return it later.\n\t\tvar result = this.content[ 0 ];\n\n\t\t// Get the element at the end of the array.\n\t\tvar end = this.content.pop();\n\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif ( this.content.length > 0 ) {\n\n\t\t\tthis.content[ 0 ] = end;\n\t\t\tthis.sinkDown( 0 );\n\n\t\t}\n\n\t\treturn result;\n\n\t},\n\n\tpeek: function () {\n\n\t\treturn this.content[ 0 ];\n\n\t},\n\n\tremove: function ( node ) {\n\n\t\tvar len = this.content.length;\n\n\t\t// To remove a value, we must search through the array to find it.\n\t\tfor ( var i = 0; i < len; i ++ ) {\n\n\t\t\tif ( this.content[ i ] == node ) {\n\n\t\t\t\t// When it is found, the process seen in 'pop' is repeated\n\t\t\t\t// to fill up the hole.\n\t\t\t\tvar end = this.content.pop();\n\n\t\t\t\tif ( i != len - 1 ) {\n\n\t\t\t\t\tthis.content[ i ] = end;\n\n\t\t\t\t\tif ( this.scoreFunction( end ) < this.scoreFunction( node ) ) {\n\n\t\t\t\t\t\tthis.bubbleUp( i );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.sinkDown( i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthrow new Error( \"Node not found.\" );\n\n\t},\n\n\tsize: function () {\n\n\t\treturn this.content.length;\n\n\t},\n\n\tbubbleUp: function ( n ) {\n\n\t\t// Fetch the element that has to be moved.\n\t\tvar element = this.content[ n ];\n\n\t\t// When at 0, an element can not go up any further.\n\t\twhile ( n > 0 ) {\n\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tvar parentN = Math.floor( ( n + 1 ) / 2 ) - 1,\n\t\t\t\tparent = this.content[ parentN ];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif ( this.scoreFunction( element ) < this.scoreFunction( parent ) ) {\n\n\t\t\t\tthis.content[ parentN ] = element;\n\t\t\t\tthis.content[ n ] = parent;\n\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\n\t\t\t} else {\n\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t},\n\n\tsinkDown: function ( n ) {\n\n\t\t// Look up the target element and its score.\n\t\tvar length = this.content.length,\n\t\t\telement = this.content[ n ],\n\t\t\telemScore = this.scoreFunction( element );\n\n\t\twhile ( true ) {\n\n\t\t\t// Compute the indices of the child elements.\n\t\t\tvar child2N = ( n + 1 ) * 2, child1N = child2N - 1;\n\n\t\t\t// This is used to store the new position of the element, if any.\n\t\t\tvar swap = null;\n\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif ( child1N < length ) {\n\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tvar child1 = this.content[ child1N ],\n\t\t\t\t\tchild1Score = this.scoreFunction( child1 );\n\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif ( child1Score < elemScore ) swap = child1N;\n\n\t\t\t}\n\n\t\t\t// Do the same checks for the other child.\n\t\t\tif ( child2N < length ) {\n\n\t\t\t\tvar child2 = this.content[ child2N ],\n\t\t\t\t\tchild2Score = this.scoreFunction( child2 );\n\n\t\t\t\tif ( child2Score < ( swap === null ? elemScore : child1Score ) ) swap = child2N;\n\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif ( swap !== null ) {\n\n\t\t\t\tthis.content[ n ] = this.content[ swap ];\n\t\t\t\tthis.content[ swap ] = element;\n\t\t\t\tn = swap;\n\n\t\t\t} else {\n\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/Mirror.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Mirror.js",
"module-type": "library",
"text": "/**\r\n * @author Slayvin / http://slayvin.net\r\n */\r\n\r\nTHREE.ShaderLib['mirror'] = {\r\n\r\n\tuniforms: { \"mirrorColor\": { type: \"c\", value: new THREE.Color(0x7F7F7F) },\r\n\t\t\t\t\"mirrorSampler\": { type: \"t\", value: null },\r\n\t\t\t\t\"textureMatrix\" : { type: \"m4\", value: new THREE.Matrix4() }\r\n\t},\r\n\r\n\tvertexShader: [\r\n\r\n\t\t\"uniform mat4 textureMatrix;\",\r\n\r\n\t\t\"varying vec4 mirrorCoord;\",\r\n\r\n\t\t\"void main() {\",\r\n\r\n\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\r\n\t\t\t\"vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\",\r\n\t\t\t\"mirrorCoord = textureMatrix * worldPosition;\",\r\n\r\n\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\r\n\r\n\t\t\"}\"\r\n\r\n\t].join(\"\\n\"),\r\n\r\n\tfragmentShader: [\r\n\r\n\t\t\"uniform vec3 mirrorColor;\",\r\n\t\t\"uniform sampler2D mirrorSampler;\",\r\n\r\n\t\t\"varying vec4 mirrorCoord;\",\r\n\r\n\t\t\"float blendOverlay(float base, float blend) {\",\r\n\t\t\t\"return( base < 0.5 ? ( 2.0 * base * blend ) : (1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );\",\r\n\t\t\"}\",\r\n\t\t\r\n\t\t\"void main() {\",\r\n\r\n\t\t\t\"vec4 color = texture2DProj(mirrorSampler, mirrorCoord);\",\r\n\t\t\t\"color = vec4(blendOverlay(mirrorColor.r, color.r), blendOverlay(mirrorColor.g, color.g), blendOverlay(mirrorColor.b, color.b), 1.0);\",\r\n\r\n\t\t\t\"gl_FragColor = color;\",\r\n\r\n\t\t\"}\"\r\n\r\n\t].join(\"\\n\")\r\n\r\n};\r\n\r\nTHREE.Mirror = function ( renderer, camera, options ) {\r\n\r\n\tTHREE.Object3D.call( this );\r\n\r\n\tthis.name = 'mirror_' + this.id;\r\n\r\n\toptions = options || {};\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\tvar width = options.textureWidth !== undefined ? options.textureWidth : 512;\r\n\tvar height = options.textureHeight !== undefined ? options.textureHeight : 512;\r\n\r\n\tthis.clipBias = options.clipBias !== undefined ? options.clipBias : 0.0;\r\n\r\n\tvar mirrorColor = options.color !== undefined ? new THREE.Color(options.color) : new THREE.Color(0x7F7F7F);\r\n\r\n\tthis.renderer = renderer;\r\n\tthis.mirrorPlane = new THREE.Plane();\r\n\tthis.normal = new THREE.Vector3( 0, 0, 1 );\r\n\tthis.mirrorWorldPosition = new THREE.Vector3();\r\n\tthis.cameraWorldPosition = new THREE.Vector3();\r\n\tthis.rotationMatrix = new THREE.Matrix4();\r\n\tthis.lookAtPosition = new THREE.Vector3(0, 0, -1);\r\n\tthis.clipPlane = new THREE.Vector4();\r\n\t\r\n\t// For debug only, show the normal and plane of the mirror\r\n\tvar debugMode = options.debugMode !== undefined ? options.debugMode : false;\r\n\r\n\tif ( debugMode ) {\r\n\r\n\t\tvar arrow = new THREE.ArrowHelper(new THREE.Vector3( 0, 0, 1 ), new THREE.Vector3( 0, 0, 0 ), 10, 0xffff80 );\r\n\t\tvar planeGeometry = new THREE.Geometry();\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( -10, -10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( 10, -10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( 10, 10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( new THREE.Vector3( -10, 10, 0 ) );\r\n\t\tplaneGeometry.vertices.push( planeGeometry.vertices[0] );\r\n\t\tvar plane = new THREE.Line( planeGeometry, new THREE.LineBasicMaterial( { color: 0xffff80 } ) );\r\n\r\n\t\tthis.add(arrow);\r\n\t\tthis.add(plane);\r\n\r\n\t}\r\n\r\n\tif ( camera instanceof THREE.PerspectiveCamera ) {\r\n\r\n\t\tthis.camera = camera;\r\n\r\n\t} else {\r\n\r\n\t\tthis.camera = new THREE.PerspectiveCamera();\r\n\t\tconsole.log( this.name + ': camera is not a Perspective Camera!' );\r\n\r\n\t}\r\n\r\n\tthis.textureMatrix = new THREE.Matrix4();\r\n\r\n\tthis.mirrorCamera = this.camera.clone();\r\n\r\n\tthis.texture = new THREE.WebGLRenderTarget( width, height );\r\n\tthis.tempTexture = new THREE.WebGLRenderTarget( width, height );\r\n\r\n\tvar mirrorShader = THREE.ShaderLib[ \"mirror\" ];\r\n\tvar mirrorUniforms = THREE.UniformsUtils.clone( mirrorShader.uniforms );\r\n\r\n\tthis.material = new THREE.ShaderMaterial( {\r\n\r\n\t\tfragmentShader: mirrorShader.fragmentShader,\r\n\t\tvertexShader: mirrorShader.vertexShader,\r\n\t\tuniforms: mirrorUniforms\r\n\r\n\t} );\r\n\r\n\tthis.material.uniforms.mirrorSampler.value = this.texture;\r\n\tthis.material.uniforms.mirrorColor.value = mirrorColor;\r\n\tthis.material.uniforms.textureMatrix.value = this.textureMatrix;\r\n\r\n\tif ( !THREE.Math.isPowerOfTwo(width) || !THREE.Math.isPowerOfTwo( height ) ) {\r\n\r\n\t\tthis.texture.generateMipmaps = false;\r\n\t\tthis.tempTexture.generateMipmaps = false;\r\n\r\n\t}\r\n\r\n\tthis.updateTextureMatrix();\r\n\tthis.render();\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype = Object.create( THREE.Object3D.prototype );\r\n\r\nTHREE.Mirror.prototype.renderWithMirror = function ( otherMirror ) {\r\n\r\n\t// update the mirror matrix to mirror the current view\r\n\tthis.updateTextureMatrix();\r\n\tthis.matrixNeedsUpdate = false;\r\n\r\n\t// set the camera of the other mirror so the mirrored view is the reference view\r\n\tvar tempCamera = otherMirror.camera;\r\n\totherMirror.camera = this.mirrorCamera;\r\n\r\n\t// render the other mirror in temp texture\r\n\totherMirror.renderTemp();\r\n\totherMirror.material.uniforms.mirrorSampler.value = otherMirror.tempTexture;\r\n\r\n\t// render the current mirror\r\n\tthis.render();\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// restore material and camera of other mirror\r\n\totherMirror.material.uniforms.mirrorSampler.value = otherMirror.texture;\r\n\totherMirror.camera = tempCamera;\r\n\r\n\t// restore texture matrix of other mirror\r\n\totherMirror.updateTextureMatrix();\r\n};\r\n\r\nTHREE.Mirror.prototype.updateTextureMatrix = function () {\r\n\r\n\tvar sign = THREE.Math.sign;\r\n\r\n\tthis.updateMatrixWorld();\r\n\tthis.camera.updateMatrixWorld();\r\n\r\n\tthis.mirrorWorldPosition.setFromMatrixPosition( this.matrixWorld );\r\n\tthis.cameraWorldPosition.setFromMatrixPosition( this.camera.matrixWorld );\r\n\r\n\tthis.rotationMatrix.extractRotation( this.matrixWorld );\r\n\r\n\tthis.normal.set( 0, 0, 1 );\r\n\tthis.normal.applyMatrix4( this.rotationMatrix );\r\n\r\n\tvar view = this.mirrorWorldPosition.clone().sub( this.cameraWorldPosition );\r\n\tview.reflect( this.normal ).negate();\r\n\tview.add( this.mirrorWorldPosition );\r\n\r\n\tthis.rotationMatrix.extractRotation( this.camera.matrixWorld );\r\n\r\n\tthis.lookAtPosition.set(0, 0, -1);\r\n\tthis.lookAtPosition.applyMatrix4( this.rotationMatrix );\r\n\tthis.lookAtPosition.add( this.cameraWorldPosition );\r\n\r\n\tvar target = this.mirrorWorldPosition.clone().sub( this.lookAtPosition );\r\n\ttarget.reflect( this.normal ).negate();\r\n\ttarget.add( this.mirrorWorldPosition );\r\n\r\n\tthis.up.set( 0, -1, 0 );\r\n\tthis.up.applyMatrix4( this.rotationMatrix );\r\n\tthis.up.reflect( this.normal ).negate();\r\n\r\n\tthis.mirrorCamera.position.copy( view );\r\n\tthis.mirrorCamera.up = this.up;\r\n\tthis.mirrorCamera.lookAt( target );\r\n\r\n\tthis.mirrorCamera.updateProjectionMatrix();\r\n\tthis.mirrorCamera.updateMatrixWorld();\r\n\tthis.mirrorCamera.matrixWorldInverse.getInverse( this.mirrorCamera.matrixWorld );\r\n\r\n\t// Update the texture matrix\r\n\tthis.textureMatrix.set( 0.5, 0.0, 0.0, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.5, 0.0, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.0, 0.5, 0.5,\r\n\t\t\t\t\t\t\t0.0, 0.0, 0.0, 1.0 );\r\n\tthis.textureMatrix.multiply( this.mirrorCamera.projectionMatrix );\r\n\tthis.textureMatrix.multiply( this.mirrorCamera.matrixWorldInverse );\r\n\r\n\t// Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html\r\n\t// Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf\r\n\tthis.mirrorPlane.setFromNormalAndCoplanarPoint( this.normal, this.mirrorWorldPosition );\r\n\tthis.mirrorPlane.applyMatrix4( this.mirrorCamera.matrixWorldInverse );\r\n\r\n\tthis.clipPlane.set( this.mirrorPlane.normal.x, this.mirrorPlane.normal.y, this.mirrorPlane.normal.z, this.mirrorPlane.constant );\r\n\r\n\tvar q = new THREE.Vector4();\r\n\tvar projectionMatrix = this.mirrorCamera.projectionMatrix;\r\n\r\n\tq.x = ( sign(this.clipPlane.x) + projectionMatrix.elements[8] ) / projectionMatrix.elements[0];\r\n\tq.y = ( sign(this.clipPlane.y) + projectionMatrix.elements[9] ) / projectionMatrix.elements[5];\r\n\tq.z = - 1.0;\r\n\tq.w = ( 1.0 + projectionMatrix.elements[10] ) / projectionMatrix.elements[14];\r\n\r\n\t// Calculate the scaled plane vector\r\n\tvar c = new THREE.Vector4();\r\n\tc = this.clipPlane.multiplyScalar( 2.0 / this.clipPlane.dot(q) );\r\n\r\n\t// Replacing the third row of the projection matrix\r\n\tprojectionMatrix.elements[2] = c.x;\r\n\tprojectionMatrix.elements[6] = c.y;\r\n\tprojectionMatrix.elements[10] = c.z + 1.0 - this.clipBias;\r\n\tprojectionMatrix.elements[14] = c.w;\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype.render = function () {\r\n\r\n\tif ( this.matrixNeedsUpdate ) this.updateTextureMatrix();\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// Render the mirrored view of the current scene into the target texture\r\n\tvar scene = this;\r\n\r\n\twhile ( scene.parent !== undefined ) {\r\n\r\n\t\tscene = scene.parent;\r\n\r\n\t}\r\n\r\n\tif ( scene !== undefined && scene instanceof THREE.Scene) {\r\n\r\n\t\tthis.renderer.render( scene, this.mirrorCamera, this.texture, true );\r\n\r\n\t}\r\n\r\n};\r\n\r\nTHREE.Mirror.prototype.renderTemp = function () {\r\n\r\n\tif ( this.matrixNeedsUpdate ) this.updateTextureMatrix();\r\n\r\n\tthis.matrixNeedsUpdate = true;\r\n\r\n\t// Render the mirrored view of the current scene into the target texture\r\n\tvar scene = this;\r\n\r\n\twhile ( scene.parent !== undefined ) {\r\n\r\n\t\tscene = scene.parent;\r\n\r\n\t}\r\n\r\n\tif ( scene !== undefined && scene instanceof THREE.Scene) {\r\n\r\n\t\tthis.renderer.render( scene, this.mirrorCamera, this.tempTexture, true );\r\n\r\n\t}\r\n\r\n};\r\n"
},
"$:/plugins/rboue/Three.js/Lib/Sparks.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Sparks.js",
"module-type": "library",
"text": "/*\n * @author zz85 (http://github.com/zz85 http://www.lab4games.net/zz85/blog)\n *\n * a simple to use javascript 3d particles system inspired by FliNT and Stardust\n * created with TWEEN.js and THREE.js\n *\n * for feature requests or bugs, please visit https://github.com/zz85/sparks.js\n *\n * licensed under the MIT license\n */\n\nvar SPARKS = {};\n\n/********************************\n* Emitter Class\n*\n* Creates and Manages Particles\n*********************************/\n\nSPARKS.Emitter = function (counter) {\n\n this._counter = counter ? counter : new SPARKS.SteadyCounter(10); // provides number of particles to produce\n\n this._particles = [];\n\n\n this._initializers = []; // use for creation of particles\n this._actions = []; // uses action to update particles\n this._activities = []; // not supported yet\n\n this._handlers = [];\n\n this.callbacks = {};\n};\n\n\nSPARKS.Emitter.prototype = {\n\n\t_TIMESTEP: 15,\n\t_timer: null,\n\t_lastTime: null,\n\t_timerStep: 10,\n\t_velocityVerlet: true,\n\n\t// run its built in timer / stepping\n\tstart: function() {\n\t\tthis._lastTime = Date.now();\n\t\tthis._timer = setTimeout(this.step, this._timerStep, this);\n\t\tthis._isRunning = true;\n\t},\n\n\tstop: function() {\n\t\tthis._isRunning = false;\n\t\tclearTimeout(this._timer);\n\t},\n\n\tisRunning: function() {\n\t\treturn this._isRunning & true;\n\t},\n\n\t// Step gets called upon by the engine\n\t// but attempts to call update() on a regular basics\n\t// This method is also described in http://gameclosure.com/2011/04/11/deterministic-delta-tee-in-js-games/\n\tstep: function(emitter) {\n\n\t\tvar time = Date.now();\n\t\tvar elapsed = time - emitter._lastTime;\n\n\t\tif (!this._velocityVerlet) {\n\t\t\t// if elapsed is way higher than time step, (usually after switching tabs, or excution cached in ff)\n\t\t\t// we will drop cycles. perhaps set to a limit of 10 or something?\n\t\t\tvar maxBlock = emitter._TIMESTEP * 20;\n\n\t\t\tif (elapsed >= maxBlock) {\n\t\t\t\t//console.log('warning: sparks.js is fast fowarding engine, skipping steps', elapsed / emitter._TIMESTEP);\n\t\t\t\t//emitter.update( (elapsed - maxBlock) / 1000);\n\t\t\t\telapsed = maxBlock;\n\t\t\t}\n\n\t\t\twhile(elapsed >= emitter._TIMESTEP) {\n\t\t\t\temitter.update(emitter._TIMESTEP / 1000);\n\t\t\t\telapsed -= emitter._TIMESTEP;\n\t\t\t}\n\t\t\temitter._lastTime = time - elapsed;\n\n\t\t} else {\n\t\t\temitter.update(elapsed/1000);\n\t\t\temitter._lastTime = time;\n\t\t}\n\n\n\n\t\tif (emitter._isRunning)\n\t\tsetTimeout(emitter.step, emitter._timerStep, emitter);\n\n\t},\n\n\n\t// Update particle engine in seconds, not milliseconds\n update: function(time) {\n\n\t\tvar i, j;\n var len = this._counter.updateEmitter( this, time );\n\n // Create particles\n for( i = 0; i < len; i++ ) {\n this.createParticle();\n }\n\n // Update activities\n len = this._activities.length;\n for ( i = 0; i < len; i++ )\n {\n this._activities[i].update( this, time );\n }\n\n\n len = this._actions.length;\n\n\t\tvar particle;\n\t\tvar action;\n var len2 = this._particles.length;\n\n for( j = 0; j < len; j++ )\n {\n action = this._actions[j];\n for ( i = 0; i < len2; ++i )\n {\n particle = this._particles[i];\n action.update( this, particle, time );\n }\n }\n\n\n // remove dead particles\n for ( i = len2; i--; )\n {\n particle = this._particles[i];\n if ( particle.isDead )\n {\n //particle =\n\t\t\t\tthis._particles.splice( i, 1 );\n this.dispatchEvent(\"dead\", particle);\n\t\t\t\tSPARKS.VectorPool.release(particle.position); //\n\t\t\t\tSPARKS.VectorPool.release(particle.velocity);\n\n } else {\n this.dispatchEvent(\"updated\", particle);\n }\n }\n\n\t\tthis.dispatchEvent(\"loopUpdated\");\n\n },\n\n createParticle: function() {\n var particle = new SPARKS.Particle();\n // In future, use a Particle Factory\n var len = this._initializers.length, i;\n\n for ( i = 0; i < len; i++ ) {\n this._initializers[i].initialize( this, particle );\n }\n\n this._particles.push( particle );\n\n this.dispatchEvent(\"created\", particle); // ParticleCreated\n\n return particle;\n },\n\n addInitializer: function (initializer) {\n this._initializers.push(initializer);\n },\n\n addAction: function (action) {\n this._actions.push(action);\n },\n\n removeInitializer: function (initializer) {\n\t\tvar index = this._initializers.indexOf(initializer);\n\t\tif (index > -1) {\n\t\t\tthis._initializers.splice( index, 1 );\n\t\t}\n },\n\n removeAction: function (action) {\n\t\tvar index = this._actions.indexOf(action);\n\t\tif (index > -1) {\n\t\t\tthis._actions.splice( index, 1 );\n\t\t}\n\t\t//console.log('removeAction', index, this._actions);\n },\n\n addCallback: function(name, callback) {\n this.callbacks[name] = callback;\n },\n\n dispatchEvent: function(name, args) {\n var callback = this.callbacks[name];\n if (callback) {\n callback(args);\n }\n\n }\n\n\n};\n\n\n/*\n * Constant Names for\n * Events called by emitter.dispatchEvent()\n *\n */\nSPARKS.EVENT_PARTICLE_CREATED = \"created\"\nSPARKS.EVENT_PARTICLE_UPDATED = \"updated\"\nSPARKS.EVENT_PARTICLE_DEAD = \"dead\";\nSPARKS.EVENT_LOOP_UPDATED = \"loopUpdated\";\n\n\n\n/*\n * Steady Counter attempts to produces a particle rate steadily\n *\n */\n\n// Number of particles per seconds\nSPARKS.SteadyCounter = function(rate) {\n this.rate = rate;\n\n\t// we use a shortfall counter to make up for slow emitters\n\tthis.leftover = 0;\n\n};\n\nSPARKS.SteadyCounter.prototype.updateEmitter = function(emitter, time) {\n\n\tvar targetRelease = time * this.rate + this.leftover;\n\tvar actualRelease = Math.floor(targetRelease);\n\n\tthis.leftover = targetRelease - actualRelease;\n\n\treturn actualRelease;\n};\n\n\n/*\n * Shot Counter produces specified particles\n * on a single impluse or burst\n */\n\nSPARKS.ShotCounter = function(particles) {\n\tthis.particles = particles;\n\tthis.used = false;\n};\n\nSPARKS.ShotCounter.prototype.updateEmitter = function(emitter, time) {\n\n\tif (this.used) {\n\t\treturn 0;\n\t} else {\n\t\tthis.used = true;\n\t}\n\n\treturn this.particles;\n};\n\n\n/********************************\n* Particle Class\n*\n* Represents a single particle\n*********************************/\nSPARKS.Particle = function() {\n\n /**\n * The lifetime of the particle, in seconds.\n */\n this.lifetime = 0;\n\n /**\n * The age of the particle, in seconds.\n */\n this.age = 0;\n\n /**\n * The energy of the particle.\n */\n this.energy = 1;\n\n /**\n * Whether the particle is dead and should be removed from the stage.\n */\n this.isDead = false;\n\n this.target = null; // tag\n\n /**\n * For 3D\n */\n\n this.position = SPARKS.VectorPool.get().set(0,0,0); //new THREE.Vector3( 0, 0, 0 );\n this.velocity = SPARKS.VectorPool.get().set(0,0,0); //new THREE.Vector3( 0, 0, 0 );\n\tthis._oldvelocity = SPARKS.VectorPool.get().set(0,0,0);\n // rotation vec3\n // angVelocity vec3\n // faceAxis vec3\n\n};\n\n\n/********************************\n* Action Classes\n*\n* An abstract class which have\n* update function\n*********************************/\nSPARKS.Action = function() {\n this._priority = 0;\n};\n\n\nSPARKS.Age = function(easing) {\n this._easing = (easing == null) ? TWEEN.Easing.Linear.None : easing;\n};\n\nSPARKS.Age.prototype.update = function (emitter, particle, time) {\n particle.age += time;\n if( particle.age >= particle.lifetime )\n {\n particle.energy = 0;\n particle.isDead = true;\n }\n else\n {\n var t = this._easing(particle.age / particle.lifetime);\n particle.energy = -1 * t + 1;\n }\n};\n\n/*\n// Mark particle as dead when particle's < 0\n\nSPARKS.Death = function(easing) {\n this._easing = (easing == null) ? TWEEN.Linear.None : easing;\n};\n\nSPARKS.Death.prototype.update = function (emitter, particle, time) {\n if (particle.life <= 0) {\n particle.isDead = true;\n }\n};\n*/\n\n\nSPARKS.Move = function() {\n\n};\n\nSPARKS.Move.prototype.update = function(emitter, particle, time) {\n // attempt verlet velocity updating.\n var p = particle.position;\n\tvar v = particle.velocity;\n var old = particle._oldvelocity;\n\n\tif (this._velocityVerlet) {\n\t\tp.x += (v.x + old.x) * 0.5 * time;\n\t\tp.y += (v.y + old.y) * 0.5 * time;\n\t\tp.z += (v.z + old.z) * 0.5 * time;\n\t} else {\n\t\tp.x += v.x * time;\n\t\tp.y += v.y * time;\n\t\tp.z += v.z * time;\n\t}\n\n // OldVel = Vel;\n // Vel = Vel + Accel * dt;\n // Pos = Pos + (vel + Vel + Accel * dt) * 0.5 * dt;\n\n\n\n};\n\n/* Marks particles found in specified zone dead */\nSPARKS.DeathZone = function(zone) {\n this.zone = zone;\n};\n\nSPARKS.DeathZone.prototype.update = function(emitter, particle, time) {\n\n if (this.zone.contains(particle.position)) {\n\t\tparticle.isDead = true;\n\t}\n\n};\n\n/*\n * SPARKS.ActionZone applies an action when particle is found in zone\n */\nSPARKS.ActionZone = function(action, zone) {\n\tthis.action = action;\n this.zone = zone;\n};\n\nSPARKS.ActionZone.prototype.update = function(emitter, particle, time) {\n\n if (this.zone.contains(particle.position)) {\n\t\tthis.action.update( emitter, particle, time );\n\t}\n\n};\n\n/*\n * Accelerate action affects velocity in specified 3d direction\n */\nSPARKS.Accelerate = function(x,y,z) {\n\n\tif (x instanceof THREE.Vector3) {\n\t\tthis.acceleration = x;\n\t\treturn;\n\t}\n\n this.acceleration = new THREE.Vector3(x,y,z);\n\n};\n\nSPARKS.Accelerate.prototype.update = function(emitter, particle, time) {\n var acc = this.acceleration;\n\n var v = particle.velocity;\n\n\tparticle._oldvelocity.set(v.x, v.y, v.z);\n\n v.x += acc.x * time;\n v.y += acc.y * time;\n v.z += acc.z * time;\n\n};\n\n/*\n * Accelerate Factor accelerate based on a factor of particle's velocity.\n */\nSPARKS.AccelerateFactor = function(factor) {\n this.factor = factor;\n};\n\nSPARKS.AccelerateFactor.prototype.update = function(emitter, particle, time) {\n var factor = this.factor;\n\n var v = particle.velocity;\n\tvar len = v.length();\n\tvar adjFactor;\n if (len>0) {\n\n\t\tadjFactor = factor * time / len;\n\t\tadjFactor += 1;\n\n\t\tv.multiplyScalar(adjFactor);\n\t\t// v.x *= adjFactor;\n\t\t// \t v.y *= adjFactor;\n\t\t// \t v.z *= adjFactor;\n\t}\n\n};\n\n/*\nAccelerateNormal\n * AccelerateVelocity affects velocity based on its velocity direction\n */\nSPARKS.AccelerateVelocity = function(factor) {\n\n\tthis.factor = factor;\n\n};\n\nSPARKS.AccelerateVelocity.prototype.update = function(emitter, particle, time) {\n var factor = this.factor;\n\n var v = particle.velocity;\n\n\n v.z += - v.x * factor;\n v.y += v.z * factor;\n v.x += v.y * factor;\n\n};\n\n\n/* Set the max ammount of x,y,z drift movements in a second */\nSPARKS.RandomDrift = function(x,y,z) {\n\tif (x instanceof THREE.Vector3) {\n\t\tthis.drift = x;\n\t\treturn;\n\t}\n\n this.drift = new THREE.Vector3(x,y,z);\n}\n\n\nSPARKS.RandomDrift.prototype.update = function(emitter, particle, time) {\n var drift = this.drift;\n\n var v = particle.velocity;\n\n v.x += ( Math.random() - 0.5 ) * drift.x * time;\n v.y += ( Math.random() - 0.5 ) * drift.y * time;\n v.z += ( Math.random() - 0.5 ) * drift.z * time;\n\n};\n\n/********************************\n* Zone Classes\n*\n* An abstract classes which have\n* getLocation() function\n*********************************/\nSPARKS.Zone = function() {\n};\n\n// TODO, contains() for Zone\n\nSPARKS.PointZone = function(pos) {\n this.pos = pos;\n};\n\nSPARKS.PointZone.prototype.getLocation = function() {\n return this.pos;\n};\n\nSPARKS.PointZone = function(pos) {\n this.pos = pos;\n};\n\nSPARKS.PointZone.prototype.getLocation = function() {\n return this.pos;\n};\n\nSPARKS.LineZone = function(start, end) {\n this.start = start;\n\tthis.end = end;\n\tthis._length = end.clone().sub( start );\n};\n\nSPARKS.LineZone.prototype.getLocation = function() {\n var len = this._length.clone();\n\n\tlen.multiplyScalar( Math.random() );\n\treturn len.add( this.start );\n\n};\n\n// Basically a RectangleZone\nSPARKS.ParallelogramZone = function(corner, side1, side2) {\n this.corner = corner;\n\tthis.side1 = side1;\n\tthis.side2 = side2;\n};\n\nSPARKS.ParallelogramZone.prototype.getLocation = function() {\n\n\tvar d1 = this.side1.clone().multiplyScalar( Math.random() );\n\tvar d2 = this.side2.clone().multiplyScalar( Math.random() );\n\td1.add(d2);\n\treturn d1.add( this.corner );\n\n};\n\nSPARKS.CubeZone = function(position, x, y, z) {\n this.position = position;\n\tthis.x = x;\n\tthis.y = y;\n\tthis.z = z;\n};\n\nSPARKS.CubeZone.prototype.getLocation = function() {\n //TODO use pool?\n\n\tvar location = this.position.clone();\n\tlocation.x += Math.random() * this.x;\n\tlocation.y += Math.random() * this.y;\n\tlocation.z += Math.random() * this.z;\n\n\treturn location;\n\n};\n\n\nSPARKS.CubeZone.prototype.contains = function(position) {\n\n\tvar startX = this.position.x;\n\tvar startY = this.position.y;\n\tvar startZ = this.position.z;\n\tvar x = this.x; // width\n\tvar y = this.y; // depth\n\tvar z = this.z; // height\n\n\tif (x<0) {\n\t\tstartX += x;\n\t\tx = Math.abs(x);\n\t}\n\n\tif (y<0) {\n\t\tstartY += y;\n\t\ty = Math.abs(y);\n\t}\n\n\tif (z<0) {\n\t\tstartZ += z;\n\t\tz = Math.abs(z);\n\t}\n\n\tvar diffX = position.x - startX;\n\tvar diffY = position.y - startY;\n\tvar diffZ = position.z - startZ;\n\n\tif ( (diffX > 0) && (diffX < x) &&\n\t\t\t(diffY > 0) && (diffY < y) &&\n\t\t\t(diffZ > 0) && (diffZ < z) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n\n};\n\n\n\n/**\n * The constructor creates a DiscZone 3D zone.\n *\n * @param centre The point at the center of the disc.\n * @param normal A vector normal to the disc.\n * @param outerRadius The outer radius of the disc.\n * @param innerRadius The inner radius of the disc. This defines the hole\n * in the center of the disc. If set to zero, there is no hole.\n */\n\n/*\n// BUGGY!!\nSPARKS.DiscZone = function(center, radiusNormal, outerRadius, innerRadius) {\n this.center = center;\n\tthis.radiusNormal = radiusNormal;\n\tthis.outerRadius = (outerRadius==undefined) ? 0 : outerRadius;\n\tthis.innerRadius = (innerRadius==undefined) ? 0 : innerRadius;\n\n};\n\nSPARKS.DiscZone.prototype.getLocation = function() {\n var rand = Math.random();\n\tvar _innerRadius = this.innerRadius;\n\tvar _outerRadius = this.outerRadius;\n\tvar center = this.center;\n\tvar _normal = this.radiusNormal;\n\n\t_distToOrigin = _normal.dot( center );\n\n\tvar radius = _innerRadius + (1 - rand * rand ) * ( _outerRadius - _innerRadius );\n\tvar angle = Math.random() * SPARKS.Utils.TWOPI;\n\n\tvar _distToOrigin = _normal.dot( center );\n\tvar axes = SPARKS.Utils.getPerpendiculars( _normal.clone() );\n\tvar _planeAxis1 = axes[0];\n\tvar _planeAxis2 = axes[1];\n\n\tvar p = _planeAxis1.clone();\n\tp.multiplyScalar( radius * Math.cos( angle ) );\n\tvar p2 = _planeAxis2.clone();\n\tp2.multiplyScalar( radius * Math.sin( angle ) );\n\tp.add( p2 );\n\treturn _center.add( p );\n\n};\n*/\n\nSPARKS.SphereCapZone = function(x, y, z, minr, maxr, angle) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.minr = minr;\n this.maxr = maxr;\n this.angle = angle;\n};\n\nSPARKS.SphereCapZone.prototype.getLocation = function() {\n var theta = Math.PI *2 * SPARKS.Utils.random();\n var r = SPARKS.Utils.random();\n\n //new THREE.Vector3\n var v = SPARKS.VectorPool.get().set(r * Math.cos(theta), -1 / Math.tan(this.angle * SPARKS.Utils.DEGREE_TO_RADIAN), r * Math.sin(theta));\n\n //v.length = StardustMath.interpolate(0, _minRadius, 1, _maxRadius, Math.random());\n\n var i = this.minr - ((this.minr-this.maxr) * Math.random() );\n v.multiplyScalar(i);\n\n\tv.__markedForReleased = true;\n\n return v;\n};\n\n\n/********************************\n* Initializer Classes\n*\n* Classes which initializes\n* particles. Implements initialize( emitter:Emitter, particle:Particle )\n*********************************/\n\n// Specifies random life between max and min\nSPARKS.Lifetime = function(min, max) {\n this._min = min;\n\n this._max = max ? max : min;\n\n};\n\nSPARKS.Lifetime.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n particle.lifetime = this._min + SPARKS.Utils.random() * ( this._max - this._min );\n};\n\n\nSPARKS.Position = function(zone) {\n this.zone = zone;\n};\n\nSPARKS.Position.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n var pos = this.zone.getLocation();\n particle.position.set(pos.x, pos.y, pos.z);\n};\n\nSPARKS.Velocity = function(zone) {\n this.zone = zone;\n};\n\nSPARKS.Velocity.prototype.initialize = function( emitter/*Emitter*/, particle/*Particle*/ ) {\n var pos = this.zone.getLocation();\n particle.velocity.set(pos.x, pos.y, pos.z);\n\tif (pos.__markedForReleased) {\n\t\t//console.log(\"release\");\n\t\tSPARKS.VectorPool.release(pos);\n\t\tpos.__markedForReleased = false;\n\t}\n};\n\nSPARKS.Target = function(target, callback) {\n this.target = target;\n this.callback = callback;\n};\n\nSPARKS.Target.prototype.initialize = function( emitter, particle ) {\n\n if (this.callback) {\n particle.target = this.callback();\n } else {\n particle.target = this.target;\n }\n\n};\n\n/********************************\n* VectorPool\n*\n* Reuse much of Vectors if possible\n*********************************/\n\nSPARKS.VectorPool = {\n\t__pools: [],\n\n\t// Get a new Vector\n\tget: function() {\n\t\tif (this.__pools.length>0) {\n\t\t\treturn this.__pools.pop();\n\t\t}\n\n\t\treturn this._addToPool();\n\n\t},\n\n\t// Release a vector back into the pool\n\trelease: function(v) {\n\t\tthis.__pools.push(v);\n\t},\n\n\t// Create a bunch of vectors and add to the pool\n\t_addToPool: function() {\n\t\t//console.log(\"creating some pools\");\n\n\t\tfor (var i=0, size = 100; i < size; i++) {\n\t\t\tthis.__pools.push(new THREE.Vector3());\n\t\t}\n\n\t\treturn new THREE.Vector3();\n\n\t}\n\n\n\n};\n\n\n/********************************\n* Util Classes\n*\n* Classes which initializes\n* particles. Implements initialize( emitter:Emitter, particle:Particle )\n*********************************/\nSPARKS.Utils = {\n random: function() {\n return Math.random();\n },\n DEGREE_TO_RADIAN: Math.PI / 180,\n\tTWOPI: Math.PI * 2,\n\n\tgetPerpendiculars: function(normal) {\n\t\tvar p1 = this.getPerpendicular( normal );\n\t\tvar p2 = normal.cross( p1 );\n\t\tp2.normalize();\n\t\treturn [ p1, p2 ];\n\t},\n\n\tgetPerpendicular: function( v )\n\t{\n\t\tif( v.x == 0 )\n\t\t{\n\t\t\treturn new THREE.Vector3D( 1, 0, 0 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar temp = new THREE.Vector3( v.y, -v.x, 0 );\n\t\t\treturn temp.normalize();\n\t\t}\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Cameras/CombinedCamera.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Cameras/CombinedCamera.js",
"module-type": "library",
"text": "/**\n *\t@author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog\n *\n *\tA general perpose camera, for setting FOV, Lens Focal Length,\n *\t\tand switching between perspective and orthographic views easily.\n *\t\tUse this only if you do not wish to manage\n *\t\tboth a Orthographic and Perspective Camera\n *\n */\n\n\nTHREE.CombinedCamera = function ( width, height, fov, near, far, orthoNear, orthoFar ) {\n\n\tTHREE.Camera.call( this );\n\n\tthis.fov = fov;\n\n\tthis.left = -width / 2;\n\tthis.right = width / 2\n\tthis.top = height / 2;\n\tthis.bottom = -height / 2;\n\n\t// We could also handle the projectionMatrix internally, but just wanted to test nested camera objects\n\n\tthis.cameraO = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, \torthoNear, orthoFar );\n\tthis.cameraP = new THREE.PerspectiveCamera( fov, width / height, near, far );\n\n\tthis.zoom = 1;\n\n\tthis.toPerspective();\n\n\tvar aspect = width/height;\n\n};\n\nTHREE.CombinedCamera.prototype = Object.create( THREE.Camera.prototype );\n\nTHREE.CombinedCamera.prototype.toPerspective = function () {\n\n\t// Switches to the Perspective Camera\n\n\tthis.near = this.cameraP.near;\n\tthis.far = this.cameraP.far;\n\n\tthis.cameraP.fov = this.fov / this.zoom ;\n\n\tthis.cameraP.updateProjectionMatrix();\n\n\tthis.projectionMatrix = this.cameraP.projectionMatrix;\n\n\tthis.inPerspectiveMode = true;\n\tthis.inOrthographicMode = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toOrthographic = function () {\n\n\t// Switches to the Orthographic camera estimating viewport from Perspective\n\n\tvar fov = this.fov;\n\tvar aspect = this.cameraP.aspect;\n\tvar near = this.cameraP.near;\n\tvar far = this.cameraP.far;\n\n\t// The size that we set is the mid plane of the viewing frustum\n\n\tvar hyperfocus = ( near + far ) / 2;\n\n\tvar halfHeight = Math.tan( fov / 2 ) * hyperfocus;\n\tvar planeHeight = 2 * halfHeight;\n\tvar planeWidth = planeHeight * aspect;\n\tvar halfWidth = planeWidth / 2;\n\n\thalfHeight /= this.zoom;\n\thalfWidth /= this.zoom;\n\n\tthis.cameraO.left = -halfWidth;\n\tthis.cameraO.right = halfWidth;\n\tthis.cameraO.top = halfHeight;\n\tthis.cameraO.bottom = -halfHeight;\n\n\t// this.cameraO.left = -farHalfWidth;\n\t// this.cameraO.right = farHalfWidth;\n\t// this.cameraO.top = farHalfHeight;\n\t// this.cameraO.bottom = -farHalfHeight;\n\n\t// this.cameraO.left = this.left / this.zoom;\n\t// this.cameraO.right = this.right / this.zoom;\n\t// this.cameraO.top = this.top / this.zoom;\n\t// this.cameraO.bottom = this.bottom / this.zoom;\n\n\tthis.cameraO.updateProjectionMatrix();\n\n\tthis.near = this.cameraO.near;\n\tthis.far = this.cameraO.far;\n\tthis.projectionMatrix = this.cameraO.projectionMatrix;\n\n\tthis.inPerspectiveMode = false;\n\tthis.inOrthographicMode = true;\n\n};\n\n\nTHREE.CombinedCamera.prototype.setSize = function( width, height ) {\n\n\tthis.cameraP.aspect = width / height;\n\tthis.left = -width / 2;\n\tthis.right = width / 2\n\tthis.top = height / 2;\n\tthis.bottom = -height / 2;\n\n};\n\n\nTHREE.CombinedCamera.prototype.setFov = function( fov ) {\n\n\tthis.fov = fov;\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\n// For mantaining similar API with PerspectiveCamera\n\nTHREE.CombinedCamera.prototype.updateProjectionMatrix = function() {\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toPerspective();\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\n/*\n* Uses Focal Length (in mm) to estimate and set FOV\n* 35mm (fullframe) camera is used if frame size is not specified;\n* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html\n*/\nTHREE.CombinedCamera.prototype.setLens = function ( focalLength, frameHeight ) {\n\n\tif ( frameHeight === undefined ) frameHeight = 24;\n\n\tvar fov = 2 * THREE.Math.radToDeg( Math.atan( frameHeight / ( focalLength * 2 ) ) );\n\n\tthis.setFov( fov );\n\n\treturn fov;\n};\n\n\nTHREE.CombinedCamera.prototype.setZoom = function( zoom ) {\n\n\tthis.zoom = zoom;\n\n\tif ( this.inPerspectiveMode ) {\n\n\t\tthis.toPerspective();\n\n\t} else {\n\n\t\tthis.toOrthographic();\n\n\t}\n\n};\n\nTHREE.CombinedCamera.prototype.toFrontView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\n\t// should we be modifing the matrix instead?\n\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toBackView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = Math.PI;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toLeftView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = - Math.PI / 2;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toRightView = function() {\n\n\tthis.rotation.x = 0;\n\tthis.rotation.y = Math.PI / 2;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toTopView = function() {\n\n\tthis.rotation.x = - Math.PI / 2;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n\nTHREE.CombinedCamera.prototype.toBottomView = function() {\n\n\tthis.rotation.x = Math.PI / 2;\n\tthis.rotation.y = 0;\n\tthis.rotation.z = 0;\n\tthis.rotationAutoUpdate = false;\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/ProxyGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/ProxyGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author kile / http://kile.stravaganza.org/\n * @author alteredq / http://alteredqualia.com/\n * @author mikael emtinger / http://gomo.se/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n * @author bhouston / http://exocortex.com\n * @author jbaicoianu / http://baicoianu.com\n */\n\nTHREE.ProxyGeometry = function ( ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.addEventListener( 'allocate', this.onGeometryAllocate);\n\n\t// TODO - implement as BufferGeometry attributes\n\tthis.morphTargets = [];\n\tthis.morphColors = [];\n\n};\n\nTHREE.ProxyGeometry.prototype = Object.create( THREE.IndexedGeometry2.prototype );\n\nObject.defineProperties(THREE.ProxyGeometry.prototype, {\n\tvertices: { \n\t\tenumerable: true, \n\t\tconfigurable: true, \n\t\tget: function() { return this.createVertexProxies(); }\n\t},\n\tfaces: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createFaceProxies() } \n\t},\n\tfaceVertexUvs: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createUvProxies() } \n\t},\n\tcolors: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createColorProxies() } \n\t},\n\tskinIndices: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createSkinIndexProxies() } \n\t},\n\tskinWeights: {\n\t\tenumerable: true,\t\n\t\tget: function() { return this.createSkinWeightProxies() } \n\t},\n\t// TODO - fill in additional proxies:\n\t// - morphColors\n\t// - morphNormals\n\t// - morphTargets\n\n\tverticesNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'position' ]) return this.attributes[ 'position' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'position' ]) this.attributes[ 'position' ].needsUpdate = v; } \n\t},\n\tcolorsNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'color' ]) return this.attributes[ 'color' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'color' ]) this.attributes[ 'color' ].needsUpdate = v; } \n\t},\n\tnormalsNeedUpdate: {\n\t\tenumerable: true,\t\n\t\tget: function() { if (this.attributes[ 'normal' ]) return this.attributes[ 'normal' ].needsUpdate; } ,\n\t\tset: function(v) { if (this.attributes[ 'normal' ]) this.attributes[ 'normal' ].needsUpdate = v; } \n\t},\n});\n\nTHREE.ProxyGeometry.prototype.createVertexProxies = function(values) {\n\n\tif (!this.hasOwnProperty('vertices')) {\n\n\t\t// Replace the prototype getter with a local array property\n\n\t\tObject.defineProperty( this, \"vertices\", { value: [], writable: true } );\n\n\t} else {\n\n\t\t// Start with a new, empty array\n\n\t\tthis.vertices = [];\n\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.vertices, \"position\", THREE.ProxyVector3, 3);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.vertices[i].copy(values[i]);\n\n\t\t}\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.vertices;\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceProxies = function(values) {\n\n\tif (!this.hasOwnProperty(\"faces\")) {\n\n\t\t// Replace the prototype getter with a local array property\n\n\t\tObject.defineProperty( this, \"faces\", { value: [], writable: true } );\n\n\t} else {\n\n\t\t// Start with a new, empty array\n\n\t\tthis.faces = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tvar faces = this.faces,\n\t\t\tindexarray = false,\n\t\t\tpositionarray = false,\n\t\t\tnormalarray = false,\n\t\t\tcolorarray = false,\n\t\t\ttangentarray = false;\n\n\tif ( this.attributes[ 'index' ] ) {\n\t\tindexarray = this.attributes[ 'index' ].array;\n\t}\n\tif ( this.attributes[ 'position' ] ) {\n\t\tpositionarray = this.attributes[ 'position' ].array;\n\t}\n\tif (this.attributes[ 'normal' ]) {\n\t\tnormalarray = this.attributes[ 'normal' ].array;\n\t}\n\tif (this.attributes[ 'color' ]) {\n\t\tcolorarray = this.attributes[ 'color' ].array;\n\t}\n\tif (this.attributes[ 'tangent' ]) {\n\t\ttangentarray = this.attributes[ 'tangent' ].array;\n\t}\n\n\t// TODO - this should be accomplished using \"virtual\" functions on various classes (IndexedGeometry, SmoothGeometry, etc)\n\n\tif (indexarray) {\n\n\t\tfor ( var i = 0, l = indexarray.length / 3; i < l; i ++ ) {\n\n\t\t\tvar o = i * 3;\n\n\t\t\tvar face = new THREE.ProxyFace3( indexarray, i * 3 );\n\t\t\tfaces.push(face);\n\n\t\t}\n\n\t} else if (positionarray) {\n\n\t\tfor ( var i = 0, l = positionarray.length / 3; i < l; i += 3 ) {\n\n\t\t\tvar o = i * 3;\n\t\t\tvar v1 = i, v2 = i+1, v3 = i+2;\n\n\t\t\tvar face = new THREE.ProxyFace3( v1, v2, v3 );\n\t\t\tfaces.push(face);\n\n\t\t}\n\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = faces[i],\n\t\t\t v = values[i];\n\n\t\t\tf.a = v.a;\n\t\t\tf.b = v.b;\n\t\t\tf.c = v.c;\n\n\t\t}\n\n\t}\n\n\tif (normalarray) {\n\n\t\tthis.createFaceVertexNormalProxies(values);\n\n\t}\n\n\tif (colorarray) {\n\n\t\tthis.createFaceVertexColorProxies(values);\n\n\t}\n\n\tif (tangentarray) {\n\n\t\tthis.createFaceVertexTangentProxies(values);\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.faces;\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexNormalProxies = function(values) {\n\n\tif ( this.attributes[ 'normal' ] && this.attributes[ 'normal' ].array ) {\n\n\t\tvar normalarray = this.attributes[ 'normal' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i];\n\n\t\t\tf.vertexNormals = [\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.a * 3),\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.b * 3),\n\t\t\t\tnew THREE.ProxyVector3(normalarray, f.c * 3),\n\t\t\t];\n\t\t\tf.normal = new THREE.MultiVector3(f.vertexNormals);\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t v = values[i];\n\n\t\t\tif (v.vertexNormals.length > 0) {\n\n\t\t\t\tfor (var j = 0, l2 = f.vertexNormals.length; j < l2; j++) {\n\n\t\t\t\t\tf.vertexNormals[j].copy(v.vertexNormals[j]);\n\n\t\t\t\t}\n\n\t\t\t} else if (v.normal) {\n\n\t\t\t\tf.normal.copy(v.normal);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexColorProxies = function(values) {\n\n\tif ( this.attributes[ 'color' ] && this.attributes[ 'color' ].array ) {\n\n\t\tvar colorarray = this.attributes[ 'color' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\t\t\tvar f = this.faces[i];\n\n\t\t\tif ( this.attributes[ 'index' ] ) {\n\t\t\t\tf.vertexColors = [\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.a * 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.b * 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, f.c * 3),\n\t\t\t\t\t];\n\t\t\t} else {\n\t\t\t\tvar o = i * 9;\n\n\t\t\t\tf.vertexColors = [\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o + 3),\n\t\t\t\t\t\tnew THREE.ProxyColor(colorarray, o + 6),\n\t\t\t\t\t];\n\t\t\t}\n\t\t\tf.color = new THREE.MultiColor(f.vertexColors);\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t v = values[i];\n\n\t\t\tfor (var j = 0, l2 = f.vertexColors.length; j < l2; j++) {\n\n\t\t\t\tif (v.vertexColors.length > 0) {\n\n\t\t\t\t\tf.vertexColors[j].copy(v.vertexColors[j]);\n\n\t\t\t\t} else if (v.color) {\n\n\t\t\t\t\tf.color.copy(v.color);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createFaceVertexTangentProxies = function(values) {\n\n\tif ( this.attributes[ 'tangent' ] && this.attributes[ 'tangent' ].array ) {\n\n\t\tvar tangentarray = this.attributes[ 'tangent' ].array;\n\n\t\tfor (var i = 0, l = this.faces.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i];\n\n\t\t\tf.vertexTangents = [\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.a * 3),\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.b * 3),\n\t\t\t\tnew THREE.ProxyVector3(tangentarray, f.c * 3),\n\t\t\t];\n\n\t\t}\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tvar f = this.faces[i],\n\t\t\t v = values[i];\n\n\t\t\tif (v.vertexTangents.length > 0) {\n\n\t\t\t\tfor (var j = 0, l2 = f.vertexTangents.length; j < l2; j++) {\n\n\t\t\t\t\tf.vertexTangents[j].copy(v.vertexTangents[j]);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nTHREE.ProxyGeometry.prototype.createUvProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty(\"faceVertexUvs\")) {\n\t\tObject.defineProperty( this, \"faceVertexUvs\", { value: [[]], writable: true } );\n\t} else {\n\t\tthis.faceVertexUvs = [[]];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tif ( this.attributes[ 'uv' ] && this.attributes[ 'uv' ].array ) {\n\n\t\tvar faces = this.faces;\n\t\tvar uvarray = this.attributes[ 'uv' ].array;\n\n\t\tfor (var i = 0, l = faces.length; i < l; i++) {\n\t\t\tvar f = faces[i];\n\n\t\t\tthis.faceVertexUvs[0][i] = [];\n\n\t\t\tif ( this.attributes[ 'index' ] ) {\n\t\t\t\tthis.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, f.a * 2);\n\t\t\t\tthis.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, f.b * 2);\n\t\t\t\tthis.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, f.c * 2);\n\t\t\t} else {\n\t\t\t\tvar o = i * 6;\n\t\t\t\tthis.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, o);\n\t\t\t\tthis.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, o + 2);\n\t\t\t\tthis.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, o + 4);\n\t\t\t}\n\n\t\t}\n\t\n\t}\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0, l = values.length; i < l; i++) {\n\n\t\t\tfor (var j = 0, l2 = values[i].length; j < l2; j++) {\n\n\t\t\t\tvar uv = values[i][j];\n\t\t\t\tthis.faceVertexUvs[0][i][j].copy(uv);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.faceVertexUvs;\n\n}\n\nTHREE.ProxyGeometry.prototype.createSkinIndexProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('skinIndices')) {\n\t\tObject.defineProperty( this, \"skinIndices\", { value: [], writable: true } );\n\t} else {\n\t\tthis.skinIndices = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.skinIndices, \"skinIndex\", THREE.ProxyVector4, 4);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.skinIndices[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.skinIndices;\n\n}\n\nTHREE.ProxyGeometry.prototype.createSkinWeightProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('skinWeights')) {\n\t\tObject.defineProperty( this, \"skinWeights\", { value: [], writable: true } );\n\t} else {\n\t\tthis.skinWeights = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.skinWeights, \"skinWeight\", THREE.ProxyVector4, 4);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.skinWeights[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.skinWeights;\n\n}\n\nTHREE.ProxyGeometry.prototype.createColorProxies = function(values) {\n\n\t// Replace the prototype getter with a local array property\n\n\tif (!this.hasOwnProperty('colors')) {\n\t\tObject.defineProperty( this, \"colors\", { value: [], writable: true } );\n\t} else {\n\t\tthis.colors = [];\n\t}\n\n\t// If the attribute buffer has already been populated, set up proxy objects\n\n\tthis.populateProxyFromBuffer(this.colors, \"color\", THREE.ProxyColor, 3);\n\n\t// If values were passed in, store them in the buffer via the proxy objects\n\n\tif (values) {\n\n\t\tfor (var i = 0; i < values.length; i++) {\n\n\t\t\tthis.colors[i].copy(values[i]);\n\n\t\t}\n\n\t}\n\n\t// Return a reference to the newly-created array\n\n\treturn this.colors;\n\n}\n\nTHREE.ProxyGeometry.prototype.populateProxyFromBuffer = function(attr, buffername, proxytype, itemsize, offset, count) {\n\n\tif ( this.attributes[ buffername ] && this.attributes[ buffername ].array ) {\n\n\t\tvar array = this.attributes[ buffername ].array;\n\t\tvar size = itemsize || this.attributes[ buffername ].itemSize;\n\t\tvar start = offset || 0;\n\t\t\n\t\tcount = count || (array.length / size - start);\n\n\t\tfor ( var i = start, l = start + count; i < l; i ++ ) {\n\n\t\t\tattr.push( new proxytype( array, i * size ) );\n\n\t\t}\n\n\t}\n\n}\n\n/*\n * Checks for duplicate vertices with hashmap.\n * Duplicated vertices are removed\n * and faces' vertices are updated.\n */\n\nTHREE.ProxyGeometry.prototype.mergeVertices = function () {\n\n\tvar verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique)\n\tvar unique = [], changes = [];\n\n\tvar v, key;\n\tvar precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001\n\tvar precision = Math.pow( 10, precisionPoints );\n\tvar i,il, face;\n\tvar indices, k, j, jl, u;\n\n\tfor ( i = 0, il = this.vertices.length; i < il; i ++ ) {\n\n\t\tv = this.vertices[ i ];\n\t\tkey = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision );\n\n\t\tif ( verticesMap[ key ] === undefined ) {\n\n\t\t\tverticesMap[ key ] = i;\n\t\t\tunique.push( this.vertices[ i ] );\n\t\t\tchanges[ i ] = unique.length - 1;\n\n\t\t} else {\n\n\t\t\t//console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);\n\t\t\tchanges[ i ] = changes[ verticesMap[ key ] ];\n\n\t\t}\n\n\t};\n\n\n\t// if faces are completely degenerate after merging vertices, we\n\t// have to remove them from the geometry.\n\tvar faceIndicesToRemove = [];\n\n\tfor( i = 0, il = this.faces.length; i < il; i ++ ) {\n\n\t\tface = this.faces[ i ];\n\n\t\tface.a = changes[ face.a ];\n\t\tface.b = changes[ face.b ];\n\t\tface.c = changes[ face.c ];\n\n\t\tindices = [ face.a, face.b, face.c ];\n\n\t\tvar dupIndex = -1;\n\n\t\t// if any duplicate vertices are found in a Face3\n\t\t// we have to remove the face as nothing can be saved\n\t\tfor ( var n = 0; n < 3; n ++ ) {\n\t\t\tif ( indices[ n ] == indices[ ( n + 1 ) % 3 ] ) {\n\n\t\t\t\tdupIndex = n;\n\t\t\t\tfaceIndicesToRemove.push( i );\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfor ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {\n\t\tvar idx = faceIndicesToRemove[ i ];\n\n\t\tthis.faces.splice( idx, 1 );\n\n\t\tfor ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) {\n\n\t\t\tthis.faceVertexUvs[ j ].splice( idx, 1 );\n\n\t\t}\n\n\t}\n\n\t// Use unique set of vertices\n\n\tvar diff = this.vertices.length - unique.length;\n\tthis.vertices = unique;\n\treturn diff;\n\n}\n\nTHREE.ProxyGeometry.prototype.onGeometryAllocate = function (ev) {\n\n\t// Prevent allocate event listener from firing multiple times\n\tthis.removeEventListener( 'allocate', this.onGeometryAllocate);\n\n\tif (this.hasOwnProperty('vertices')) {\n\t\tvar attr = new THREE.Float32Attribute(this.vertices.length, 3);\n\t\tthis.addAttribute('position', attr);\n\t\tthis.createVertexProxies(this.vertices);\n\t}\n\tif (this.hasOwnProperty('faces')) {\n\t\tvar idxattr = new THREE.Uint16Attribute(this.faces.length, 3);\n\t\tthis.addAttribute('index', idxattr);\n\n\t\tif (this.faces.length > 0) {\n\t\t\tvar hasnormals = (this.hasOwnProperty('normals') || this.faces[0].normal || this.faces[0].vertexNormals.length > 0);\n\t\t\tvar hascolors = (this.hasOwnProperty('colors') || this.faces[0].color || this.faces[0].vertexColors.length > 0);\n\t\t\tvar hastangents = (this.faces[0].vertexTangents.length > 0);\n\n\t\t\tif (hasnormals) {\n\t\t\t\tvar normalattr = new THREE.Float32Attribute(this.vertices.length, 3);\n\t\t\t\tthis.addAttribute('normal', normalattr);\n\t\t\t}\n\n\t\t\tif (hascolors) {\n\t\t\t\tvar colorattr = new THREE.Float32Attribute(this.faces.length * 3, 3);\n\t\t\t\tthis.addAttribute('color', colorattr);\n\t\t\t}\n\n\t\t\tif (hastangents) {\n\t\t\t\tvar tangentattr = new THREE.Float32Attribute(this.faces.length * 3, 3);\n\t\t\t\tthis.addAttribute('tangent', tangentattr);\n\t\t\t}\n\t\t}\n\n\t\tthis.createFaceProxies(this.faces);\n\t}\n\n\tif (this.hasOwnProperty('faceVertexUvs')) {\n\n\t\tvar uvattr = new THREE.Float32Attribute(this.faces.length * 3, 2);\n\t\tthis.addAttribute('uv', uvattr);\n\t\tthis.createUvProxies(this.faceVertexUvs[0]);\n\n\t}\n\n\tif (this.hasOwnProperty('skinIndices')) {\n\n\t\tvar skinidxattr = new THREE.Float32Attribute(this.skinIndices.length, 4);\n\t\tthis.addAttribute('skinIndex', skinidxattr);\n\t\tthis.createSkinIndexProxies(this.skinIndices);\n\n\t}\n\n\tif (this.hasOwnProperty('skinWeights')) {\n\n\t\tvar skinweightattr = new THREE.Float32Attribute(this.skinWeights.length, 4);\n\t\tthis.addAttribute('skinWeight', skinweightattr);\n\t\tthis.createSkinWeightProxies(this.skinWeights);\n\n\t}\n}\n\nTHREE.ProxyGeometry.prototype.computeFaceNormals = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeFaceNormals.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeVertexNormals = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeVertexNormals.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeTangents = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\tvar ret = THREE.BufferGeometry.prototype.computeTangents.call(this);\n\n\t// FIXME - this doesn't work yet\n\t//this.createFaceVertexTangentProxies();\n\n\treturn ret;\n\n}\n\nTHREE.ProxyGeometry.prototype.computeBoundingSphere = function() {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeBoundingSphere.call(this);\n\n}\n\nTHREE.ProxyGeometry.prototype.computeBoundingBox = function () {\n\n\tthis.dispatchEvent( { type: 'allocate' } );\n\n\treturn THREE.BufferGeometry.prototype.computeBoundingBox.call(this);\n\n}\nTHREE.ProxyGeometry.prototype.clone = function () {\n\n\tvar buff = THREE.BufferGeometry.prototype.clone.call(this);\n\tvar geo = new THREE.ProxyGeometry();\n\tgeo.attributes = buff.attributes;\n\tgeo.offsets = buff.offsets;\n\n\treturn geo;\n\n}\n\nTHREE.EventDispatcher.prototype.apply( THREE.ProxyGeometry.prototype );\n\nTHREE.ProxyGeometryIdCount = 0;\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/IndexedTypedGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/IndexedTypedGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedTypedGeometry = function () {\n\n\tTHREE.BufferGeometry.call( this );\n\n};\n\nTHREE.IndexedTypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.IndexedTypedGeometry.prototype.setArrays = function ( indices, vertices, normals, uvs ) {\n\n\tthis.indices = indices;\n\tthis.vertices = vertices;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n\treturn this;\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/TypedGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/TypedGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.TypedGeometry = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tif ( size !== undefined ) {\n\n\t\tthis.vertices = new Float32Array( size * 3 * 3 );\n\t\tthis.normals = new Float32Array( size * 3 * 3 );\n\t\tthis.uvs = new Float32Array( size * 3 * 2 );\n\n\t\tthis.attributes[ 'position' ] = { array: this.vertices, itemSize: 3 };\n\t\tthis.attributes[ 'normal' ] = { array: this.normals, itemSize: 3 };\n\t\tthis.attributes[ 'uv' ] = { array: this.uvs, itemSize: 2 };\n\n\t}\n\n};\n\nTHREE.TypedGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedGeometry.prototype.setArrays = function ( vertices, normals, uvs ) {\n\n\tthis.vertices = vertices;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n\treturn this;\n\n};\n\nTHREE.TypedGeometry.prototype.merge = ( function () {\n\n\tvar offset = 0;\n\tvar normalMatrix = new THREE.Matrix3();\n\n\treturn function ( geometry, matrix, startOffset ) {\n\n\t\tif ( startOffset !== undefined ) offset = startOffset;\n\n\t\tvar offset2 = offset * 2;\n\t\tvar offset3 = offset * 3;\n\n\t\tvar vertices = this.attributes[ 'position' ].array;\n\t\tvar normals = this.attributes[ 'normal' ].array;\n\t\tvar uvs = this.attributes[ 'uv' ].array;\n\n\t\tif ( geometry instanceof THREE.TypedGeometry ) {\n\n\t\t\tvar vertices2 = geometry.attributes[ 'position' ].array;\n\t\t\tvar normals2 = geometry.attributes[ 'normal' ].array;\n\t\t\tvar uvs2 = geometry.attributes[ 'uv' ].array;\n\n\t\t\tfor ( var i = 0, l = vertices2.length; i < l; i += 3 ) {\n\n\t\t\t\tvertices[ i + offset3 ] = vertices2[ i ];\n\t\t\t\tvertices[ i + offset3 + 1 ] = vertices2[ i + 1 ];\n\t\t\t\tvertices[ i + offset3 + 2 ] = vertices2[ i + 2 ];\n\n\t\t\t\tnormals[ i + offset3 ] = normals2[ i ];\n\t\t\t\tnormals[ i + offset3 + 1 ] = normals2[ i + 1 ];\n\t\t\t\tnormals[ i + offset3 + 2 ] = normals2[ i + 2 ];\n\n\t\t\t\tuvs[ i + offset2 ] = uvs2[ i ];\n\t\t\t\tuvs[ i + offset2 + 1 ] = uvs2[ i + 1 ];\n\n\t\t\t}\n\n\t\t} else if ( geometry instanceof THREE.IndexedTypedGeometry ) {\n\n\t\t\tvar indices2 = geometry.attributes[ 'index' ].array;\n\t\t\tvar vertices2 = geometry.attributes[ 'position' ].array;\n\t\t\tvar normals2 = geometry.attributes[ 'normal' ].array;\n\t\t\tvar uvs2 = geometry.attributes[ 'uv' ].array;\n\n\t\t\tfor ( var i = 0, l = indices2.length; i < l; i ++ ) {\n\n\t\t\t\tvar index = indices2[ i ];\n\n\t\t\t\tvar index3 = index * 3;\n\t\t\t\tvar i3 = i * 3;\n\n\t\t\t\tvertices[ i3 + offset3 ] = vertices2[ index3 ];\n\t\t\t\tvertices[ i3 + offset3 + 1 ] = vertices2[ index3 + 1 ];\n\t\t\t\tvertices[ i3 + offset3 + 2 ] = vertices2[ index3 + 2 ];\n\n\t\t\t\tnormals[ i3 + offset3 ] = normals2[ index3 ];\n\t\t\t\tnormals[ i3 + offset3 + 1 ] = normals2[ index3 + 1 ];\n\t\t\t\tnormals[ i3 + offset3 + 2 ] = normals2[ index3 + 2 ];\n\n\t\t\t\tvar index2 = index * 2;\n\t\t\t\tvar i2 = i * 2;\n\n\t\t\t\tuvs[ i2 + offset2 ] = uvs2[ index2 ];\n\t\t\t\tuvs[ i2 + offset2 + 1 ] = uvs2[ index2 + 1 ];\n\n\t\t\t}\n\n\t\t\tif ( matrix !== undefined ) {\n\n\t\t\t\tmatrix.applyToVector3Array( vertices, offset3, indices2.length * 3 );\n\n\t\t\t\tnormalMatrix.getNormalMatrix( matrix );\n\t\t\t\tnormalMatrix.applyToVector3Array( normals, offset3, indices2.length * 3 );\n\n\t\t\t}\n\n\t\t\toffset += indices2.length;\n\n\t\t}\n\n\t};\n\n} )();"
},
"$:/plugins/rboue/Three.js/Lib/Wip/PlaneTypedGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/PlaneTypedGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneTypedGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2 ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tTHREE.IndexedTypedGeometry.call( this );\n\n\tthis.setArrays( indices, vertices, normals, uvs );\n\tthis.computeBoundingSphere();\n\n};\n\nTHREE.PlaneTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry4.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry4.js",
"module-type": "library",
"text": "THREE.Geometry4 = function ( size ) {\n\n THREE.BufferGeometry.call( this );\n\n var verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n var normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n var uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n this.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n this.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n this.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n this.vertices = new THREE.VectorArrayProxy( this.attributes[ 'position' ] );\n this.normals = new THREE.VectorArrayProxy( this.attributes[ 'normal' ] );\n this.uvs = new THREE.VectorArrayProxy( this.attributes[ 'uv' ] );\n\n};\nTHREE.Geometry4.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.VectorArrayProxy = function(attribute) {\n\n // Acts as a proxy for an array of vectors, by setting up accessors which return THREE.Vector*Proxy objects\n\n this.attribute = attribute;\n\n for (var i = 0, l = this.attribute.array.length / this.attribute.itemSize; i < l; i++) {\n\n Object.defineProperty(this, i, {\n get: (function(i) { return function() { return this.getValue(i); }})(i),\n set: (function(i) { return function(v) { return this.setValue(i, v); }})(i),\n });\n\n }\n\n}\n\nTHREE.VectorArrayProxy.prototype.getValue = function(i) {\n\n // Allocates a new THREE.Vector2Proxy or THREE.Vector3Proxy depending on the itemSize of our attribute\n\n var subarray = this.attribute.array.subarray(i * this.attribute.itemSize, (i + 1) * this.attribute.itemSize);\n\n switch (this.attribute.itemSize) {\n\n case 2:\n return new THREE.Vector2Proxy(subarray);\n\n case 3:\n return new THREE.Vector3Proxy(subarray);\n\n }\n\n}\nTHREE.VectorArrayProxy.prototype.setValue = function(i, v) {\n\n var vec = this[i];\n vec.copy(v);\n\n}\n\n// Vector Proxy Objects\n\nTHREE.Vector2Proxy = function(subarray) {\n\n this.subarray = subarray;\n\n}\nTHREE.Vector2Proxy.prototype = Object.create( THREE.Vector2.prototype );\nObject.defineProperty(THREE.Vector2Proxy.prototype, 'x', { get: function() { return this.subarray[0]; }, set: function(v) { this.subarray[0] = v; } });\nObject.defineProperty(THREE.Vector2Proxy.prototype, 'y', { get: function() { return this.subarray[1]; }, set: function(v) { this.subarray[1] = v; } });\n\n\nTHREE.Vector3Proxy = function(subarray) {\n\n this.subarray = subarray;\n\n}\nTHREE.Vector3Proxy.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'x', { get: function() { return this.subarray[0]; }, set: function(v) { this.subarray[0] = v; } });\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'y', { get: function() { return this.subarray[1]; }, set: function(v) { this.subarray[1] = v; } });\nObject.defineProperty(THREE.Vector3Proxy.prototype, 'z', { get: function() { return this.subarray[2]; }, set: function(v) { this.subarray[2] = v; } });"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneBufferGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneBufferGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2 ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new Uint16Array( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n};\n\nTHREE.PlaneBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry3.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry3 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry3.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 0 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 1 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 1 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 2 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 2 ][ 1 ] = y2;\n\n\t\t\tnormals[ offset + 0 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 1 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 2 ][ 2 ] = 1;\n\n\t\t\tvertices[ offset + 3 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 3 ][ 1 ] = y1;\n\n\t\t\tvertices[ offset + 4 ][ 0 ] = x2;\n\t\t\tvertices[ offset + 4 ][ 1 ] = y2;\n\n\t\t\tvertices[ offset + 5 ][ 0 ] = x1;\n\t\t\tvertices[ offset + 5 ][ 1 ] = y2;\n\n\t\t\tnormals[ offset + 3 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 4 ][ 2 ] = 1;\n\t\t\tnormals[ offset + 5 ][ 2 ] = 1;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry3.prototype = Object.create( THREE.Geometry3.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2Loader.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2Loader.js",
"module-type": "library",
"text": "/**\r\n * @author mrdoob / http://mrdoob.com/\r\n */\r\n\r\nTHREE.Geometry2Loader = function ( manager ) {\r\n\r\n\tthis.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;\r\n\r\n};\r\n\r\nTHREE.Geometry2Loader.prototype = {\r\n\r\n\tconstructor: THREE.Geometry2Loader,\r\n\r\n\tload: function ( url, onLoad, onProgress, onError ) {\r\n\r\n\t\tvar scope = this;\r\n\r\n\t\tvar loader = new THREE.XHRLoader();\r\n\t\tloader.setCrossOrigin( this.crossOrigin );\r\n\t\tloader.load( url, function ( text ) {\r\n\r\n\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\r\n\r\n\t\t} );\r\n\r\n\t},\r\n\r\n\tsetCrossOrigin: function ( value ) {\r\n\r\n\t\tthis.crossOrigin = value;\r\n\r\n\t},\r\n\r\n\tparse: function ( json ) {\r\n\r\n\t\tvar geometry = new THREE.Geometry2( json.vertices.length / 3 );\r\n\r\n\t\tvar attributes = [ 'vertices', 'normals', 'uvs' ];\r\n\t\tvar boundingSphere = json.boundingSphere;\r\n\r\n\t\tfor ( var key in attributes ) {\r\n\r\n\t\t\tvar attribute = attributes[ key ];\r\n\t\t\tgeometry[ attribute ].set( json[ attribute ] );\r\n\r\n\t\t}\r\n\r\n\t\tif ( boundingSphere !== undefined ) {\r\n\r\n\t\t\tgeometry.boundingSphere = new THREE.Sphere(\r\n\t\t\t\tnew THREE.Vector3().fromArray( boundingSphere.center !== undefined ? boundingSphere.center : [ 0, 0, 0 ] ),\r\n\t\t\t\tboundingSphere.radius\r\n\t\t\t);\r\n\r\n\t\t}\r\n\r\n\t\treturn geometry;\r\n\r\n\t}\r\n\r\n};\r\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry5.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry5.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedGeometry5 = function ( indices, size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new Float32Array( size * 3 );\n\tvar normalsBuffer = new Float32Array( size * 3 );\n\tvar uvsBuffer = new Float32Array( size * 2 );\n\n\tthis.indices = new Uint16Array( indices );\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: this.indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: verticesBuffer, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normalsBuffer, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvsBuffer, itemSize: 2 };\n\n};\n\nTHREE.IndexedGeometry5.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry2.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry2 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.vertices = new THREE.Float32Attribute( size, 3 );\n\tthis.normals = new THREE.Float32Attribute( size, 3 );\n\tthis.uvs = new THREE.Float32Attribute( size, 2 );\n\n\tthis.addAttribute( 'position', this.vertices );\n\tthis.addAttribute( 'normal', this.normals );\n\tthis.addAttribute( 'uv', this.uvs );\n\n};\n\nTHREE.Geometry2.prototype = Object.create( THREE.BufferGeometry.prototype );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry6.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry6.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PlaneGeometry6 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.PlaneBufferGeometry.call( this, width, height, widthSegments, heightSegments );\n\n\tvar indices = this.attributes.index.array;\n\tvar vertices = this.attributes.position.array;\n\tvar normals = this.attributes.normal.array;\n\tvar uvs = this.attributes.uv.array;\n\n\tthis.indices = indices;\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0, l = vertices.length / 3; i < l; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( vertices, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normals, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvs, i * 2 ) );\n\n\t}\n\n};\n\nTHREE.PlaneGeometry6.prototype = Object.create( THREE.PlaneBufferGeometry.prototype );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry2 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry2.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices.array;\n\tvar normals = this.normals.array;\n\tvar uvs = this.uvs.array;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ] = x1;\n\t\t\tvertices[ offset + 1 ] = y1;\n\n\t\t\tvertices[ offset + 3 ] = x2;\n\t\t\tvertices[ offset + 4 ] = y1;\n\n\t\t\tvertices[ offset + 6 ] = x1;\n\t\t\tvertices[ offset + 7 ] = y2;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\t\t\tnormals[ offset + 5 ] = 1;\n\t\t\tnormals[ offset + 8 ] = 1;\n\n\t\t\tvertices[ offset + 9 ] = x2;\n\t\t\tvertices[ offset + 10 ] = y1;\n\n\t\t\tvertices[ offset + 12 ] = x2;\n\t\t\tvertices[ offset + 13 ] = y2;\n\n\t\t\tvertices[ offset + 15 ] = x1;\n\t\t\tvertices[ offset + 16 ] = y2;\n\n\t\t\tnormals[ offset + 11 ] = 1;\n\t\t\tnormals[ offset + 13 ] = 1;\n\t\t\tnormals[ offset + 17 ] = 1;\n\n\t\t\toffset += 18;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry2.prototype = Object.create( THREE.Geometry2.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5b.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5b.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry5b = function ( bufferGeometry ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tthis.attributes = bufferGeometry.attributes;\n\n\tvar verticesBuffer = this.attributes.position.array;\n\tvar normalsBuffer = this.attributes.normal.array;\n\tvar uvsBuffer = this.attributes.uv.array;\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0, l = verticesBuffer.length / 3; i < l; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n};\n\nTHREE.Geometry5b.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedGeometry3.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.IndexedGeometry3 = function ( indices, size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n\tthis.indices = new Uint16Array( indices );\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new Float32Array( verticesBuffer, i * 3 * 4, 3 ) );\n\t\tthis.normals.push( new Float32Array( normalsBuffer, i * 3 * 4, 3 ) );\n\t\tthis.uvs.push( new Float32Array( uvsBuffer, i * 2 * 4, 2 ) );\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: this.indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n};\n\nTHREE.Geometry3.prototype = Object.create( THREE.BufferGeometry.prototype );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2b.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry2b.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry2b = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry2.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar index = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tthis.vertices.setXY( index + 0, x1, y1 );\n\t\t\tthis.vertices.setXY( index + 1, x2, y1 );\n\t\t\tthis.vertices.setXY( index + 2, x1, y2 );\n\n\t\t\tthis.vertices.setXY( index + 3, x2, y1 );\n\t\t\tthis.vertices.setXY( index + 4, x2, y2 );\n\t\t\tthis.vertices.setXY( index + 5, x1, y2 );\n\n\t\t\tthis.normals.setZ( index + 0, 1 );\n\t\t\tthis.normals.setZ( index + 1, 1 );\n\t\t\tthis.normals.setZ( index + 2, 1 );\n\n\t\t\tthis.normals.setZ( index + 3, 1 );\n\t\t\tthis.normals.setZ( index + 4, 1 );\n\t\t\tthis.normals.setZ( index + 5, 1 );\n\n\t\t\tindex += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry2b.prototype = Object.create( THREE.Geometry2.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/BoxGeometry2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/BoxGeometry2.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as\n */\n\nTHREE.BoxGeometry2 = function ( width, height, depth, widthSegments, heightSegments, depthSegments ) {\n\n\tvar scope = this;\n\n\tthis.width = width;\n\tthis.height = height;\n\tthis.depth = depth;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\tthis.depthSegments = depthSegments || 1;\n\n\tvar width_half = this.width / 2;\n\tvar height_half = this.height / 2;\n\tvar depth_half = this.depth / 2;\n\n\tvar vector = new THREE.Vector3();\n\n\tvar vectors = [];\n\tvar vertices = [];\n\n\tvar addVertex = function ( a, b, c ) {\n\n\t\tvertices.push( vectors[ a ], vectors[ a + 1 ], vectors[ a + 2 ] );\n\t\tvertices.push( vectors[ b ], vectors[ b + 1 ], vectors[ b + 2 ] );\n\t\tvertices.push( vectors[ c ], vectors[ c + 1 ], vectors[ c + 2 ] );\n\n\t};\n\n\tbuildPlane( 'z', 'y', - 1, - 1, this.depth, this.height, width_half, 0 ); // px\n\tbuildPlane( 'z', 'y', 1, - 1, this.depth, this.height, - width_half, 1 ); // nx\n\tbuildPlane( 'x', 'z', 1, 1, this.width, this.depth, height_half, 2 ); // py\n\tbuildPlane( 'x', 'z', 1, - 1, this.width, this.depth, - height_half, 3 ); // ny\n\tbuildPlane( 'x', 'y', 1, - 1, this.width, this.height, depth_half, 4 ); // pz\n\tbuildPlane( 'x', 'y', - 1, - 1, this.width, this.height, - depth_half, 5 ); // nz\n\n\tfunction buildPlane( u, v, udir, vdir, width, height, depth, materialIndex ) {\n\n\t\tvar w, ix, iy,\n\t\tgridX = scope.widthSegments,\n\t\tgridY = scope.heightSegments,\n\t\twidth_half = width / 2,\n\t\theight_half = height / 2,\n\t\toffset = vectors.length;\n\n\t\tif ( ( u === 'x' && v === 'y' ) || ( u === 'y' && v === 'x' ) ) {\n\n\t\t\tw = 'z';\n\n\t\t} else if ( ( u === 'x' && v === 'z' ) || ( u === 'z' && v === 'x' ) ) {\n\n\t\t\tw = 'y';\n\t\t\tgridY = scope.depthSegments;\n\n\t\t} else if ( ( u === 'z' && v === 'y' ) || ( u === 'y' && v === 'z' ) ) {\n\n\t\t\tw = 'x';\n\t\t\tgridX = scope.depthSegments;\n\n\t\t}\n\n\t\tvar gridX1 = gridX + 1,\n\t\tgridY1 = gridY + 1,\n\t\tsegment_width = width / gridX,\n\t\tsegment_height = height / gridY,\n\t\tnormal = new THREE.Vector3();\n\n\t\tnormal[ w ] = depth > 0 ? 1 : - 1;\n\n\t\tfor ( iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tfor ( ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tvector[ u ] = ( ix * segment_width - width_half ) * udir;\n\t\t\t\tvector[ v ] = ( iy * segment_height - height_half ) * vdir;\n\t\t\t\tvector[ w ] = depth;\n\n\t\t\t\tvectors.push( vector.x, vector.y, vector.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( iy = 0; iy < gridY; iy++ ) {\n\n\t\t\tfor ( ix = 0; ix < gridX; ix++ ) {\n\n\t\t\t\tvar a = ix + gridX1 * iy;\n\t\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\taddVertex( a * 3 + offset, b * 3 + offset, d * 3 + offset );\n\t\t\t\taddVertex( b * 3 + offset, c * 3 + offset, d * 3 + offset );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tTHREE.Geometry2.call( this, vertices.length / 3 );\n\n\tthis.vertices.set( vertices );\n\n};\n\nTHREE.BoxGeometry2.prototype = Object.create( THREE.Geometry2.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry99.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry99.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.PlaneGeometry99 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry99.call( this );\n\n\tthis.parameters = {\n\t\twidth: width,\n\t\theight: height,\n\t\twidthSegments: widthSegments,\n\t\theightSegments: heightSegments\n\t};\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = widthSegments || 1;\n\tvar gridY = heightSegments || 1;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = width / gridX;\n\tvar segment_height = height / gridY;\n\n\tvar vertices = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar normals = new Float32Array( gridX1 * gridY1 * 3 );\n\tvar uvs = new Float32Array( gridX1 * gridY1 * 2 );\n\n\tvar offset = 0;\n\tvar offset2 = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tvertices[ offset ] = x;\n\t\t\tvertices[ offset + 1 ] = - y;\n\n\t\t\tnormals[ offset + 2 ] = 1;\n\n\t\t\tuvs[ offset2 ] = ix / gridX;\n\t\t\tuvs[ offset2 + 1 ] = 1 - ( iy / gridY );\n\n\t\t\toffset += 3;\n\t\t\toffset2 += 2;\n\n\t\t}\n\n\t}\n\n\toffset = 0;\n\n\tvar indices = new Uint16Array( gridX * gridY * 6 );\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tindices[ offset ] = a;\n\t\t\tindices[ offset + 1 ] = b;\n\t\t\tindices[ offset + 2 ] = d;\n\n\t\t\tindices[ offset + 3 ] = b;\n\t\t\tindices[ offset + 4 ] = c;\n\t\t\tindices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n\tthis.attributes[ 'index' ] = { array: indices, itemSize: 1 };\n\tthis.attributes[ 'position' ] = { array: vertices, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normals, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };\n\n};\n\nTHREE.PlaneGeometry99.prototype = Object.create( THREE.Geometry99.prototype );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/TypedGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/TypedGeometry.js",
"module-type": "library",
"text": "THREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset * 2;\n\n};\n\nTHREE.TypedVector2.prototype = {\n\n\tconstructor: THREE.TypedVector3,\n\n\tget x () {\n\n\t\treturn this.array[ this.offset ];\n\n\t},\n\n\tset x ( value ) {\n\n\t\tthis.array[ this.offset ] = value;\n\n\t},\n\n\tget y () {\n\n\t\treturn this.array[ this.offset + 1 ];\n\n\t},\n\n\tset y ( value ) {\n\n\t\tthis.array[ this.offset + 1 ] = value;\n\n\t},\n\n\tset: function ( x, y ) {\n\n\t\tthis.array[ this.offset ] = x;\n\t\tthis.array[ this.offset + 1 ] = y;\n\t\treturn this;\n\n\t}\n\n};\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset * 3;\n\n};\n\nTHREE.TypedVector3.prototype = {\n\n\tconstructor: THREE.TypedVector3,\n\n\tget x () {\n\n\t\treturn this.array[ this.offset ];\n\n\t},\n\n\tset x ( value ) {\n\n\t\tthis.array[ this.offset ] = value;\n\n\t},\n\n\tget y () {\n\n\t\treturn this.array[ this.offset + 1 ];\n\n\t},\n\n\tset y ( value ) {\n\n\t\tthis.array[ this.offset + 1 ] = value;\n\n\t},\n\n\tget z () {\n\n\t\treturn this.array[ this.offset + 2 ];\n\n\t},\n\n\tset z ( value ) {\n\n\t\tthis.array[ this.offset + 2 ] = value;\n\n\t},\n\n\tset: function ( x, y, z ) {\n\n\t\tthis.array[ this.offset ] = x;\n\t\tthis.array[ this.offset + 1 ] = y;\n\t\tthis.array[ this.offset + 2 ] = z;\n\t\treturn this;\n\n\t},\n\n\ttoString: function () {\n\n\t\treturn '[' + this.array[ this.offset ] + ',' + this.array[ this.offset + 1 ] + ',' + this.array[ this.offset + 2 ] + ']';\n\n\t}\n\n};\n\nTHREE.TypedFace = function ( positions, normals, uvs, offset ) {\n\n\tthis.positions = positions;\n\tthis.normals = normals;\n\tthis.uvs = uvs;\n\tthis.offset = offset * 3;\n\n};\n\nTHREE.TypedFace.prototype = {\n\n\tconstructor: THREE.TypedFace,\n\n\tvertex: function ( index ) {\n\n\t\treturn new THREE.TypedVector3( this.positions, this.offset + index );\n\n\t},\n\n\tnormal: function ( index ) {\n\n\t\treturn new THREE.TypedVector3( this.normals, this.offset + index );\n\n\t},\n\n\tuv: function ( index ) {\n\n\t\treturn new THREE.TypedVector2( this.uvs, this.offset + index );\n\n\t}\n\n}\n\n\nTHREE.TypedGeometry = function ( size ) {\n\n\tthis.id = THREE.GeometryIdCount ++;\n\tthis.uuid = THREE.Math.generateUUID();\n\n\tthis.name = '';\n\n\tthis.positions = new Float32Array( size * 3 * 3 );\n\tthis.normals = new Float32Array( size * 3 * 3 );\n\tthis.uvs = new Float32Array( size * 3 * 2 );\n\n\tthis.boundingBox = null;\n\tthis.boundingSphere = null;\n\n};\n\nTHREE.TypedGeometry.prototype = {\n\n\tconstructor: THREE.TypedGeometry,\n\n\tface: function ( index ) {\n\n\t\treturn new THREE.TypedFace( this.positions, this.normals, this.uvs, index );\n\n\t},\n\n\tdispose: function () {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n};\n\nTHREE.EventDispatcher.prototype.apply( THREE.TypedGeometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry3.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry3 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar normalsBuffer = new ArrayBuffer( size * 3 * 4 );\n\tvar uvsBuffer = new ArrayBuffer( size * 2 * 4 );\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new Float32Array( verticesBuffer, i * 3 * 4, 3 ) );\n\t\tthis.normals.push( new Float32Array( normalsBuffer, i * 3 * 4, 3 ) );\n\t\tthis.uvs.push( new Float32Array( uvsBuffer, i * 2 * 4, 2 ) );\n\n\t}\n\n\tthis.attributes[ 'position' ] = { array: new Float32Array( verticesBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: new Float32Array( normalsBuffer, 0, size * 3 ), itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: new Float32Array( uvsBuffer, 0, size * 2 ), itemSize: 2 };\n\n};\n\nTHREE.Geometry3.prototype = Object.create( THREE.BufferGeometry.prototype );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry5.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry5.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry5 = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry5.call( this, ( widthSegments * heightSegments ) * 2 * 3 );\n\n\tvar vertices = this.vertices;\n\tvar normals = this.normals;\n\tvar uvs = this.uvs;\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar widthHalf = width / 2;\n\tvar heightHalf = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar segmentWidth = this.width / gridX;\n\tvar segmentHeight = this.height / gridY;\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tvar y1 = iy * segmentHeight - heightHalf;\n\t\tvar y2 = ( iy + 1 ) * segmentHeight - heightHalf;\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar x1 = ix * segmentWidth - widthHalf;\n\t\t\tvar x2 = ( ix + 1 ) * segmentWidth - widthHalf;\n\n\t\t\tvertices[ offset + 0 ].set( x1, y1, 0 );\n\t\t\tvertices[ offset + 1 ].set( x2, y1, 0 );\n\t\t\tvertices[ offset + 2 ].set( x1, y2, 0 );\n\n\t\t\tnormals[ offset + 0 ].z = 1;\n\t\t\tnormals[ offset + 1 ].z = 1;\n\t\t\tnormals[ offset + 2 ].z = 1;\n\n\t\t\tvertices[ offset + 3 ].set( x2, y1, 0 );\n\t\t\tvertices[ offset + 4 ].set( x2, y2, 0 );\n\t\t\tvertices[ offset + 5 ].set( x1, y2, 0 );\n\n\t\t\tnormals[ offset + 3 ].z = 1;\n\t\t\tnormals[ offset + 4 ].z = 1;\n\t\t\tnormals[ offset + 5 ].z = 1;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry5.prototype = Object.create( THREE.Geometry5.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/PlaneGeometry.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) {\n\n\tTHREE.Geometry.call( this );\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar ix, iz;\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridZ = this.heightSegments;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridZ1 = gridZ + 1;\n\n\tvar segment_width = this.width / gridX;\n\tvar segment_height = this.height / gridZ;\n\n\tvar normal = new THREE.Vector3( 0, 0, 1 );\n\n\tfor ( iz = 0; iz < gridZ1; iz ++ ) {\n\n\t\tfor ( ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\t\t\tvar y = iz * segment_height - height_half;\n\n\t\t\tthis.vertices.push( new THREE.Vector3( x, - y, 0 ) );\n\n\t\t}\n\n\t}\n\n\tfor ( iz = 0; iz < gridZ; iz ++ ) {\n\n\t\tfor ( ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iz;\n\t\t\tvar b = ix + gridX1 * ( iz + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iz + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iz;\n\n\t\t\tvar uva = new THREE.Vector2( ix / gridX, 1 - iz / gridZ );\n\t\t\tvar uvb = new THREE.Vector2( ix / gridX, 1 - ( iz + 1 ) / gridZ );\n\t\t\tvar uvc = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - ( iz + 1 ) / gridZ );\n\t\t\tvar uvd = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - iz / gridZ );\n\n\t\t\tvar face = new THREE.Face3( a, b, d );\n\t\t\tface.normal.copy( normal );\n\t\t\tface.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );\n\n\t\t\tthis.faces.push( face );\n\t\t\tthis.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] );\n\n\t\t\tface = new THREE.Face3( b, c, d );\n\t\t\tface.normal.copy( normal );\n\t\t\tface.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );\n\n\t\t\tthis.faces.push( face );\n\t\t\tthis.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/Geometry5.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.Geometry5 = function ( size ) {\n\n\tTHREE.BufferGeometry.call( this );\n\n\tvar verticesBuffer = new Float32Array( size * 3 );\n\tvar normalsBuffer = new Float32Array( size * 3 );\n\tvar uvsBuffer = new Float32Array( size * 2 );\n\n\tthis.vertices = [];\n\tthis.normals = [];\n\tthis.uvs = [];\n\n\tfor ( var i = 0; i < size; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.TypedVector3( verticesBuffer, i * 3 ) );\n\t\tthis.normals.push( new THREE.TypedVector3( normalsBuffer, i * 3 ) );\n\t\tthis.uvs.push( new THREE.TypedVector2( uvsBuffer, i * 2 ) );\n\n\t}\n\n\tthis.attributes[ 'position' ] = { array: verticesBuffer, itemSize: 3 };\n\tthis.attributes[ 'normal' ] = { array: normalsBuffer, itemSize: 3 };\n\tthis.attributes[ 'uv' ] = { array: uvsBuffer, itemSize: 2 };\n\n};\n\nTHREE.Geometry5.prototype = Object.create( THREE.BufferGeometry.prototype );\n\nTHREE.TypedVector2 = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\t\n};\n\nTHREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.TypedVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\nTHREE.TypedVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.TypedVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedPlaneGeometry5.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Benchmark/IndexedPlaneGeometry5.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as\n */\n\nTHREE.IndexedPlaneGeometry5 = function ( width, height, widthSegments, heightSegments ) {\n\n\tthis.width = width;\n\tthis.height = height;\n\n\tthis.widthSegments = widthSegments || 1;\n\tthis.heightSegments = heightSegments || 1;\n\n\tvar width_half = width / 2;\n\tvar height_half = height / 2;\n\n\tvar gridX = this.widthSegments;\n\tvar gridY = this.heightSegments;\n\n\tvar gridX1 = gridX + 1;\n\tvar gridY1 = gridY + 1;\n\n\tvar segment_width = this.width / gridX;\n\tvar segment_height = this.height / gridY;\n\n\tvar indices = gridX * gridY * 6;\n\tvar vertices = gridX1 * gridY1;\n\n\tTHREE.IndexedGeometry5.call( this, indices, vertices );\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY1; iy ++ ) {\n\n\t\tvar y = iy * segment_height - height_half;\n\n\t\tfor ( var ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\tvar x = ix * segment_width - width_half;\n\n\t\t\tthis.vertices[ offset ].x = x;\n\t\t\tthis.vertices[ offset ].y = - y;\n\n\t\t\tthis.normals[ offset ].z = 1;\n\n\t\t\tthis.uvs[ offset ].x = ix / gridX;\n\t\t\tthis.uvs[ offset ].y = iy / gridY;\n\n\t\t\toffset ++;\n\n\t\t}\n\n\t}\n\n\tvar offset = 0;\n\n\tfor ( var iy = 0; iy < gridY; iy ++ ) {\n\n\t\tfor ( var ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\tvar a = ix + gridX1 * iy;\n\t\t\tvar b = ix + gridX1 * ( iy + 1 );\n\t\t\tvar c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\tvar d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\tthis.indices[ offset ] = a;\n\t\t\tthis.indices[ offset + 1 ] = b;\n\t\t\tthis.indices[ offset + 2 ] = d;\n\n\t\t\tthis.indices[ offset + 3 ] = b;\n\t\t\tthis.indices[ offset + 4 ] = c;\n\t\t\tthis.indices[ offset + 5 ] = d;\n\n\t\t\toffset += 6;\n\n\t\t}\n\n\t}\n\n};\n\nTHREE.IndexedPlaneGeometry5.prototype = Object.create( THREE.IndexedGeometry5.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/CircleTypedGeometry.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/CircleTypedGeometry.js",
"module-type": "library",
"text": "/**\n * @author hughes\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.CircleTypedGeometry = function ( radius, segments, thetaStart, thetaLength ) {\n\n\tthis.parameters = {\n\t\tradius: radius,\n\t\tsegments: segments,\n\t\tthetaStart: thetaStart,\n\t\tthetaLength: thetaLength\n\t};\n\n\tradius = radius || 50;\n\tsegments = segments !== undefined ? Math.max( 3, segments ) : 8;\n\n\tthetaStart = thetaStart !== undefined ? thetaStart : 0;\n\tthetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2;\n\n\t//\n\n\tvar elements = segments + 2;\n\n\tvar indices = new Uint16Array( segments * 3 );\n\tvar vertices = new Float32Array( elements * 3 );\n\tvar normals = new Float32Array( elements * 3 );\n\tvar uvs = new Float32Array( elements * 2 );\n\n\t// center\n\n\tnormals[ 2 ] = 1;\n\n\tuvs[ 0 ] = 0.5;\n\tuvs[ 1 ] = 0.5;\n\n\tvar offset = 0, offset2 = 2, offset3 = 3;\n\n\tfor ( var i = 0; i <= segments; i ++ ) {\n\n\t\tvar segment = thetaStart + i / segments * thetaLength;\n\n\t\tvar x = radius * Math.cos( segment );\n\t\tvar y = radius * Math.sin( segment );\n\n\t\tvertices[ offset3 ] = x;\n\t\tvertices[ offset3 + 1 ] = y;\n\n\t\tnormals[ offset3 + 2 ] = 1;\n\n\t\tuvs[ offset2 ] = ( x / radius + 1 ) / 2;\n\t\tuvs[ offset2 + 1 ] = ( y / radius + 1 ) / 2;\n\n\t\toffset2 += 2;\n\t\toffset3 += 3;\n\n\t\t//\n\n\t\tindices[ offset ] = 0;\n\t\tindices[ offset + 1 ] = i + 1;\n\t\tindices[ offset + 2 ] = i + 2;\n\n\t\toffset += 3;\n\n\t}\n\n\tTHREE.IndexedTypedGeometry.call( this );\n\n\tthis.setArrays( indices, vertices, normals, uvs );\n\n\tthis.boundingSphere = new THREE.Sphere( new THREE.Vector3(), radius );\n\n};\n\nTHREE.CircleTypedGeometry.prototype = Object.create( THREE.IndexedTypedGeometry.prototype );\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector2.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector2.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector2 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype );\n\nObject.defineProperties( THREE.ProxyVector2.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t}\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyFace3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyFace3.js",
"module-type": "library",
"text": "/**\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyFace3 = function ( array, offset, vertexNormals, vertexColors, vertexTangents ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\tthis.vertexNormals = vertexNormals || [];\n\tthis.vertexColors = vertexColors || [];\n\tthis.vertexTangents = vertexTangents || [];\n\n\tthis.normal = new THREE.MultiVector3( this.vertexNormals );\n\tthis.color = new THREE.MultiColor( this.vertexColors );\n\n\t//THREE.Face3.call( this, array[offset], array[offset+1], array[offset+2] /*, normal, color, materialIndex */);\n\n}\n\nTHREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype );\n\nObject.defineProperties( THREE.ProxyFace3.prototype, {\n\t'a': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'b': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'c': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t},\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiColor.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiColor.js",
"module-type": "library",
"text": "// Allows updating of multiple THREE.Color objects with the same value\n// Used for face.color -> face.vertexColor[] compatibility layer for non-indexed geometry\n\nTHREE.MultiColor = function(links) {\n\n\tthis.links = links;\n\n}\n\nTHREE.MultiColor.prototype = Object.create( THREE.Color.prototype );\n\nTHREE.MultiColor.prototype.setAll = function(axis, value) {\n\n\tfor (var i = 0, l = this.links.length; i < l; i++) {\n\n\t\tthis.links[i][axis] = value;\n\n\t}\n\n}\n\n// Getters return value from the first linked color\n// Setters set the same value for all linked colors\nObject.defineProperties( THREE.MultiColor.prototype, {\n\t'r': {\n\t\tget: function () { return (this.links[0] ? this.links[0].r : 0); },\n\t\tset: function ( v ) { this.setAll('r', v); }\n\t},\n\t'g': {\n\t\tget: function () { return (this.links[0] ? this.links[0].g : 0); },\n\t\tset: function ( v ) { this.setAll('g', v); }\n\t},\n\t'b': {\n\t\tget: function () { return (this.links[0] ? this.links[0].b : 0); },\n\t\tset: function ( v ) { this.setAll('b', v); }\n\t}\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyColor.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyColor.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyColor = function ( array, offset ) {\n\n\tthis.array = array;\n\tthis.offset = offset;\n\n}\n\nTHREE.ProxyColor.prototype = Object.create( THREE.Color.prototype );\n\nObject.defineProperties( THREE.ProxyColor.prototype, {\n\t'r': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'g': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'b': {\n\t\tenumerable: true,\t\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiVector3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/MultiVector3.js",
"module-type": "library",
"text": "// Allows updating of multiple THREE.Vector3 objects with the same value\n// Used for face.normal -> face.vertexNormal[] compatibility layer for FlatShading\n\nTHREE.MultiVector3 = function(links) {\n\n\tthis.links = links;\n\n}\n\nTHREE.MultiVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nTHREE.MultiVector3.prototype.setAll = function(axis, value) {\n\n\tfor (var i = 0, l = this.links.length; i < l; i++) {\n\n\t\tthis.links[i][axis] = value;\n\n\t}\n\n}\n\n// Getters return value from the first linked vector\n// Setters set the same value for all linked vectors\nObject.defineProperties( THREE.MultiVector3.prototype, {\n\t'x': {\n\t\tget: function () { return (this.links[0] ? this.links[0].x : 0); },\n\t\tset: function ( v ) { this.setAll('x', v); }\n\t},\n\t'y': {\n\t\tget: function () { return (this.links[0] ? this.links[0].y : 0); },\n\t\tset: function ( v ) { this.setAll('y', v); }\n\t},\n\t'z': {\n\t\tget: function () { return (this.links[0] ? this.links[0].z : 0); },\n\t\tset: function ( v ) { this.setAll('z', v); }\n\t}\n} );\n\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector3.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector3.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector3 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype );\n\nObject.defineProperties( THREE.ProxyVector3.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t}\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector4.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/Proxies/ProxyVector4.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n * @author jbaicoianu / http://baicoianu.com/\n */\n\nTHREE.ProxyVector4 = function ( array, offset ) {\n\t\n\tthis.array = array;\n\tthis.offset = offset;\n\n};\n\nTHREE.ProxyVector4.prototype = Object.create( THREE.Vector4.prototype );\n\nObject.defineProperties( THREE.ProxyVector4.prototype, {\n\t'x': {\n\t\tget: function () { return this.array[ this.offset ]; },\n\t\tset: function ( v ) { this.array[ this.offset ] = v; }\n\t},\n\t'y': {\n\t\tget: function () { return this.array[ this.offset + 1 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 1 ] = v; }\n\t},\n\t'z': {\n\t\tget: function () { return this.array[ this.offset + 2 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 2 ] = v; }\n\t},\n\t'w': {\n\t\tget: function () { return this.array[ this.offset + 3 ]; },\n\t\tset: function ( v ) { this.array[ this.offset + 3 ] = v; }\n\t}\n} );\n\n"
},
"$:/plugins/rboue/Three.js/Lib/Wip/GeometryEditor.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/Wip/GeometryEditor.js",
"module-type": "library",
"text": "/**\n * @author mrdoob / http://mrdoob.com/\n */\n\nTHREE.GeometryEditor = function ( geometry ) {\n\n\tthis.geometry = geometry;\n\n};\n\nObject.defineProperties( THREE.GeometryEditor.prototype, {\n\tvertices: { \n\t\tenumerable: true,\n\t\tget: function() { return this.createVertexProxies(); }\n\t},\n\tnormals: {\n\t\tenumerable: true,\n\t\tget: function() { return this.createNormalProxies(); } \n\t},\n\tuvs: {\n\t\tenumerable: true,\n\t\tget: function() { return this.createUVProxies(); } \n\t}\n} );\n\nTHREE.GeometryEditor.prototype.createVertexProxies = function () {\n\n\tObject.defineProperty( this, 'vertices', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.vertices.push( new THREE.ProxyVector3( attributes.position.array, i * 3 ) );\n\n\t}\n\n\treturn this.vertices;\n\n};\n\nTHREE.GeometryEditor.prototype.createNormalProxies = function () {\n\n\tObject.defineProperty( this, 'normals', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.normals.push( new THREE.ProxyVector3( attributes.normal.array, i * 3 ) );\n\n\t}\n\n\treturn this.normals;\n\n};\n\nTHREE.GeometryEditor.prototype.createUVProxies = function () {\n\n\tObject.defineProperty( this, 'uvs', { value: [], writable: true } );\n\n\tvar attributes = this.geometry.attributes;\n\tvar length = attributes.position.array.length / 3;\n\n\tfor ( var i = 0; i < length; i ++ ) {\n\n\t\tthis.uvs.push( new THREE.ProxyVector2( attributes.uv.array, i * 2 ) );\n\n\t}\n\n\treturn this.uvs;\n\n};"
},
"$:/plugins/rboue/Three.js/Lib/ShaderGodRays.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ShaderGodRays.js",
"module-type": "library",
"text": "/**\n * @author huwb / http://huwbowles.com/\n *\n * God-rays (crepuscular rays)\n *\n * Similar implementation to the one used by Crytek for CryEngine 2 [Sousa2008].\n * Blurs a mask generated from the depth map along radial lines emanating from the light\n * source. The blur repeatedly applies a blur filter of increasing support but constant\n * sample count to produce a blur filter with large support.\n *\n * My implementation performs 3 passes, similar to the implementation from Sousa. I found\n * just 6 samples per pass produced acceptible results. The blur is applied three times,\n * with decreasing filter support. The result is equivalent to a single pass with\n * 6*6*6 = 216 samples.\n *\n * References:\n *\n * Sousa2008 - Crysis Next Gen Effects, GDC2008, http://www.crytek.com/sites/default/files/GDC08_SousaT_CrysisEffects.ppt\n */\n\nTHREE.ShaderGodRays = {\n\n\t/**\n\t * The god-ray generation shader.\n\t *\n\t * First pass:\n\t *\n\t * The input is the depth map. I found that the output from the\n\t * THREE.MeshDepthMaterial material was directly suitable without\n\t * requiring any treatment whatsoever.\n\t *\n\t * The depth map is blurred along radial lines towards the \"sun\". The\n\t * output is written to a temporary render target (I used a 1/4 sized\n\t * target).\n\t *\n\t * Pass two & three:\n\t *\n\t * The results of the previous pass are re-blurred, each time with a\n\t * decreased distance between samples.\n\t */\n\n\t'godrays_generate': {\n\n\t\tuniforms: {\n\n\t\t\ttInput: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\tfStepSize: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"#define TAPS_PER_PASS 6.0\",\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform sampler2D tInput;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fStepSize;\", // filter step size\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// delta from current pixel to \"sun\" position\n\n\t\t\t\t\"vec2 delta = vSunPositionScreenSpace - vUv;\",\n\t\t\t\t\"float dist = length( delta );\",\n\n\t\t\t\t// Step vector (uv space)\n\n\t\t\t\t\"vec2 stepv = fStepSize * delta / dist;\",\n\n\t\t\t\t// Number of iterations between pixel and sun\n\n\t\t\t\t\"float iters = dist/fStepSize;\",\n\n\t\t\t\t\"vec2 uv = vUv.xy;\",\n\t\t\t\t\"float col = 0.0;\",\n\n\t\t\t\t// This breaks ANGLE in Chrome 22\n\t\t\t\t//\t- see http://code.google.com/p/chromium/issues/detail?id=153105\n\n\t\t\t\t/*\n\t\t\t\t// Unrolling didnt do much on my hardware (ATI Mobility Radeon 3450),\n\t\t\t\t// so i've just left the loop\n\n\t\t\t\t\"for ( float i = 0.0; i < TAPS_PER_PASS; i += 1.0 ) {\",\n\n\t\t\t\t\t// Accumulate samples, making sure we dont walk past the light source.\n\n\t\t\t\t\t// The check for uv.y < 1 would not be necessary with \"border\" UV wrap\n\t\t\t\t\t// mode, with a black border colour. I don't think this is currently\n\t\t\t\t\t// exposed by three.js. As a result there might be artifacts when the\n\t\t\t\t\t// sun is to the left, right or bottom of screen as these cases are\n\t\t\t\t\t// not specifically handled.\n\n\t\t\t\t\t\"col += ( i <= iters && uv.y < 1.0 ? texture2D( tInput, uv ).r : 0.0 );\",\n\t\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"}\",\n\t\t\t\t*/\n\n\t\t\t\t// Unrolling loop manually makes it work in ANGLE\n\n\t\t\t\t\"if ( 0.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 1.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 2.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 3.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 4.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t\"if ( 5.0 <= iters && uv.y < 1.0 ) col += texture2D( tInput, uv ).r;\",\n\t\t\t\t\"uv += stepv;\",\n\n\t\t\t\t// Should technically be dividing by 'iters', but 'TAPS_PER_PASS' smooths out\n\t\t\t\t// objectionable artifacts, in particular near the sun position. The side\n\t\t\t\t// effect is that the result is darker than it should be around the sun, as\n\t\t\t\t// TAPS_PER_PASS is greater than the number of samples actually accumulated.\n\t\t\t\t// When the result is inverted (in the shader 'godrays_combine', this produces\n\t\t\t\t// a slight bright spot at the position of the sun, even when it is occluded.\n\n\t\t\t\t\"gl_FragColor = vec4( col/TAPS_PER_PASS );\",\n\t\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t/**\n\t * Additively applies god rays from texture tGodRays to a background (tColors).\n\t * fGodRayIntensity attenuates the god rays.\n\t */\n\n\t'godrays_combine': {\n\n\t\tuniforms: {\n\n\t\t\ttColors: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\ttGodRays: {\n\t\t\t\ttype: \"t\",\n\t\t\t\tvalue: null\n\t\t\t},\n\n\t\t\tfGodRayIntensity: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 0.69\n\t\t\t},\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform sampler2D tColors;\",\n\t\t\t\"uniform sampler2D tGodRays;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fGodRayIntensity;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// Since THREE.MeshDepthMaterial renders foreground objects white and background\n\t\t\t\t// objects black, the god-rays will be white streaks. Therefore value is inverted\n\t\t\t\t// before being combined with tColors\n\n\t\t\t\t\"gl_FragColor = texture2D( tColors, vUv ) + fGodRayIntensity * vec4( 1.0 - texture2D( tGodRays, vUv ).r );\",\n\t\t\t\t\"gl_FragColor.a = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\n\t/**\n\t * A dodgy sun/sky shader. Makes a bright spot at the sun location. Would be\n\t * cheaper/faster/simpler to implement this as a simple sun sprite.\n\t */\n\n\t'godrays_fake_sun': {\n\n\t\tuniforms: {\n\n\t\t\tvSunPositionScreenSpace: {\n\t\t\t\ttype: \"v2\",\n\t\t\t\tvalue: new THREE.Vector2( 0.5, 0.5 )\n\t\t\t},\n\n\t\t\tfAspect: {\n\t\t\t\ttype: \"f\",\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\n\t\t\tsunColor: {\n\t\t\t\ttype: \"c\",\n\t\t\t\tvalue: new THREE.Color( 0xffee00 )\n\t\t\t},\n\n\t\t\tbgColor: {\n\t\t\t\ttype: \"c\",\n\t\t\t\tvalue: new THREE.Color( 0x000000 )\n\t\t\t}\n\n\t\t},\n\n\t\tvertexShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vUv = uv;\",\n\t\t\t\t\"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tfragmentShader: [\n\n\t\t\t\"varying vec2 vUv;\",\n\n\t\t\t\"uniform vec2 vSunPositionScreenSpace;\",\n\t\t\t\"uniform float fAspect;\",\n\n\t\t\t\"uniform vec3 sunColor;\",\n\t\t\t\"uniform vec3 bgColor;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec2 diff = vUv - vSunPositionScreenSpace;\",\n\n\t\t\t\t// Correct for aspect ratio\n\n\t\t\t\t\"diff.x *= fAspect;\",\n\n\t\t\t\t\"float prop = clamp( length( diff ) / 0.5, 0.0, 1.0 );\",\n\t\t\t\t\"prop = 0.35 * pow( 1.0 - prop, 3.0 );\",\n\n\t\t\t\t\"gl_FragColor.xyz = mix( sunColor, bgColor, 1.0 - prop );\",\n\t\t\t\t\"gl_FragColor.w = 1.0;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js/Lib/CurveExtras.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/CurveExtras.js",
"module-type": "library",
"text": "/*\n * A bunch of parametric curves\n * @author zz85\n *\n * Formulas collected from various sources\n *\thttp://mathworld.wolfram.com/HeartCurve.html\n *\thttp://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page6.html\n *\thttp://en.wikipedia.org/wiki/Viviani%27s_curve\n *\thttp://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page4.html\n *\thttp://www.mi.sanu.ac.rs/vismath/taylorapril2011/Taylor.pdf\n *\thttp://prideout.net/blog/?p=44\n */\n\n// Lets define some curves\nTHREE.Curves = {};\n\n\n THREE.Curves.GrannyKnot = THREE.Curve.create( function(){},\n\n\t function(t) {\n\t t = 2 * Math.PI * t;\n\n\t var x = -0.22 * Math.cos(t) - 1.28 * Math.sin(t) - 0.44 * Math.cos(3 * t) - 0.78 * Math.sin(3 * t);\n\t var y = -0.1 * Math.cos(2 * t) - 0.27 * Math.sin(2 * t) + 0.38 * Math.cos(4 * t) + 0.46 * Math.sin(4 * t);\n\t var z = 0.7 * Math.cos(3 * t) - 0.4 * Math.sin(3 * t);\n\t return new THREE.Vector3(x, y, z).multiplyScalar(20);\n\t}\n);\n\nTHREE.Curves.HeartCurve = THREE.Curve.create(\n\nfunction(s) {\n\n\tthis.scale = (s === undefined) ? 5 : s;\n\n},\n\nfunction(t) {\n\n\tt *= 2 * Math.PI;\n\n\tvar tx = 16 * Math.pow(Math.sin(t), 3);\n\tvar ty = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t), tz = 0;\n\n\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n}\n\n);\n\n\n\n// Viviani's Curve\nTHREE.Curves.VivianiCurve = THREE.Curve.create(\n\n\tfunction(radius) {\n\n\t\tthis.radius = radius;\n\t},\n\n\tfunction(t) {\n\n\t\tt = t * 4 * Math.PI; // Normalized to 0..1\n\t\tvar a = this.radius / 2;\n\t\tvar tx = a * (1 + Math.cos(t)),\n\t\t\tty = a * Math.sin(t),\n\t\t\ttz = 2 * a * Math.sin(t / 2);\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\n\nTHREE.Curves.KnotCurve = THREE.Curve.create(\n\n\tfunction() {\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= 2 * Math.PI;\n\n\t\tvar R = 10;\n\t\tvar s = 50;\n\t\tvar tx = s * Math.sin(t),\n\t\t\tty = Math.cos(t) * (R + s * Math.cos(t)),\n\t\t\ttz = Math.sin(t) * (R + s * Math.cos(t));\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\nTHREE.Curves.HelixCurve = THREE.Curve.create(\n\n\tfunction() {\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar a = 30; // radius\n\t\tvar b = 150; //height\n\t\tvar t2 = 2 * Math.PI * t * b / 30;\n\t\tvar tx = Math.cos(t2) * a,\n\t\t\tty = Math.sin(t2) * a,\n\t\t\ttz = b * t;\n\n\t\treturn new THREE.Vector3(tx, ty, tz);\n\n\t}\n\n);\n\nTHREE.Curves.TrefoilKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(3 * t)) * Math.cos(2 * t),\n\t\t\tty = (2 + Math.cos(3 * t)) * Math.sin(2 * t),\n\t\t\ttz = Math.sin(3 * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.TorusKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar p = 3,\n\t\t\tq = 4;\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(q * t)) * Math.cos(p * t),\n\t\t\tty = (2 + Math.cos(q * t)) * Math.sin(p * t),\n\t\t\ttz = Math.sin(q * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.CinquefoilKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar p = 2,\n\t\t\tq = 5;\n\t\tt *= Math.PI * 2;\n\t\tvar tx = (2 + Math.cos(q * t)) * Math.cos(p * t),\n\t\t\tty = (2 + Math.cos(q * t)) * Math.sin(p * t),\n\t\t\ttz = Math.sin(q * t);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.TrefoilPolynomialKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 10 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt = t * 4 - 2;\n\t\tvar tx = Math.pow(t, 3) - 3 * t,\n\t\t\tty = Math.pow(t, 4) - 4 * t * t,\n\t\t\ttz = 1 / 5 * Math.pow(t, 5) - 2 * t;\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n// var scaleTo = function(x, y) {\n// var r = y - x;\n// return function(t) {\n// t * r + x;\n// };\n// }\nvar scaleTo = function(x, y, t) {\n\n\t\tvar r = y - x;\n\t\treturn t * r + x;\n\n\t}\n\nTHREE.Curves.FigureEightPolynomialKnot = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 1 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt = scaleTo(-4, 4, t);\n\t\tvar tx = 2 / 5 * t * (t * t - 7) * (t * t - 10),\n\t\t\tty = Math.pow(t, 4) - 13 * t * t,\n\t\t\ttz = 1 / 10 * t * (t * t - 4) * (t * t - 9) * (t * t - 12);\n\n\t\treturn new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.DecoratedTorusKnot4a = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tt *= Math.PI * 2;\n\t\tvar\n\t\tx = Math.cos(2 * t) * (1 + 0.6 * (Math.cos(5 * t) + 0.75 * Math.cos(10 * t))),\n\t\t\ty = Math.sin(2 * t) * (1 + 0.6 * (Math.cos(5 * t) + 0.75 * Math.cos(10 * t))),\n\t\t\tz = 0.35 * Math.sin(5 * t);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.DecoratedTorusKnot4b = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(2 * fi) * (1 + 0.45 * Math.cos(3 * fi) + 0.4 * Math.cos(9 * fi)),\n\t\t\ty = Math.sin(2 * fi) * (1 + 0.45 * Math.cos(3 * fi) + 0.4 * Math.cos(9 * fi)),\n\t\t\tz = 0.2 * Math.sin(9 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\n\nTHREE.Curves.DecoratedTorusKnot5a = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(3 * fi) * (1 + 0.3 * Math.cos(5 * fi) + 0.5 * Math.cos(10 * fi)),\n\t\t\ty = Math.sin(3 * fi) * (1 + 0.3 * Math.cos(5 * fi) + 0.5 * Math.cos(10 * fi)),\n\t\t\tz = 0.2 * Math.sin(20 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);\n\nTHREE.Curves.DecoratedTorusKnot5c = THREE.Curve.create(\n\n\tfunction(s) {\n\n\t\tthis.scale = (s === undefined) ? 40 : s;\n\n\t},\n\n\tfunction(t) {\n\n\t\tvar fi = t * Math.PI * 2;\n\t\tvar x = Math.cos(4 * fi) * (1 + 0.5 * (Math.cos(5 * fi) + 0.4 * Math.cos(20 * fi))),\n\t\t\ty = Math.sin(4 * fi) * (1 + 0.5 * (Math.cos(5 * fi) + 0.4 * Math.cos(20 * fi))),\n\t\t\tz = 0.35 * Math.sin(15 * fi);\n\n\t\treturn new THREE.Vector3(x, y, z).multiplyScalar(this.scale);\n\n\t}\n\n);"
},
"$:/plugins/rboue/Three.js/Lib/UCSCharacter.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/UCSCharacter.js",
"module-type": "library",
"text": "THREE.UCSCharacter = function() {\n\n\tvar scope = this;\n\t\n\tvar mesh;\n\n\tthis.scale = 1;\n\n\tthis.root = new THREE.Object3D();\n\t\n\tthis.numSkins;\n\tthis.numMorphs;\n\t\n\tthis.skins = [];\n\tthis.materials = [];\n\tthis.morphs = [];\n\n\tthis.onLoadComplete = function () {};\n\t\n\tthis.loadCounter = 0;\n\n\tthis.loadParts = function ( config ) {\n\t\t\n\t\tthis.numSkins = config.skins.length;\n\t\tthis.numMorphs = config.morphs.length;\n\t\t\n\t\t// Character geometry + number of skins\n\t\tthis.loadCounter = 1 + config.skins.length;\n\t\t\n\t\t// SKINS\n\t\tthis.skins = loadTextures( config.baseUrl + \"skins/\", config.skins );\n\t\tthis.materials = createMaterials( this.skins );\n\t\t\n\t\t// MORPHS\n\t\tthis.morphs = config.morphs;\n\t\t\n\t\t// CHARACTER\n\t\tvar loader = new THREE.JSONLoader();\n\t\tconsole.log( config.baseUrl + config.character );\n\t\tloader.load( config.baseUrl + config.character, function( geometry ) {\n\t\t\tgeometry.computeBoundingBox();\n\t\t\tgeometry.computeVertexNormals();\n\n\t\t\t//THREE.AnimationHandler.add( geometry.animation );\n\n\t\t\tmesh = new THREE.SkinnedMesh( geometry, new THREE.MeshFaceMaterial() );\n\t\t\tscope.root.add( mesh );\n\t\t\t\n\t\t\tvar bb = geometry.boundingBox;\n\t\t\tscope.root.scale.set( config.s, config.s, config.s );\n\t\t\tscope.root.position.set( config.x, config.y - bb.min.y * config.s, config.z );\n\n\t\t\tmesh.castShadow = true;\n\t\t\tmesh.receiveShadow = true;\n\n\t\t\tanimation = new THREE.Animation( mesh, geometry.animation );\n\t\t\tanimation.play();\n\t\t\t\n\t\t\tscope.setSkin(0);\n\t\t\t\n\t\t\tscope.checkLoadComplete();\n\t\t} );\n\n\t};\n\t\n\tthis.setSkin = function( index ) {\n\t\tif ( mesh && scope.materials ) {\n\t\t\tmesh.material = scope.materials[ index ];\n\t\t}\n\t};\n\t\n\tthis.updateMorphs = function( influences ) {\n\t\tif ( mesh ) {\n\t\t\tfor ( var i = 0; i < scope.numMorphs; i ++ ) {\n\t\t\t\tmesh.morphTargetInfluences[ i ] = influences[ scope.morphs[ i ] ] / 100;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tfunction loadTextures( baseUrl, textureUrls ) {\n\t\tvar mapping = new THREE.UVMapping();\n\t\tvar textures = [];\n\n\t\tfor ( var i = 0; i < textureUrls.length; i ++ ) {\n\n\t\t\ttextures[ i ] = THREE.ImageUtils.loadTexture( baseUrl + textureUrls[ i ], mapping, scope.checkLoadComplete );\n\t\t\ttextures[ i ].name = textureUrls[ i ];\n\n\t\t}\n\n\t\treturn textures;\n\t};\n\n\tfunction createMaterials( skins ) {\n\t\tvar materials = [];\n\t\t\n\t\tfor ( var i = 0; i < skins.length; i ++ ) {\n\n\t\t\tmaterials[ i ] = new THREE.MeshLambertMaterial( {\n\t\t\t\tcolor: 0xeeeeee,\n\t\t\t\tspecular: 10.0,\n\t\t\t\tmap: skins[ i ],\n\t\t\t\tskinning: true,\n\t\t\t\tmorphTargets: true,\n\t\t\t\twrapAround: true\n\t\t\t} );\n\n\t\t}\n\t\t\n\t\treturn materials;\n\t}\n\n\tthis.checkLoadComplete = function () {\n\n\t\tscope.loadCounter -= 1;\n\n\t\tif ( scope.loadCounter === 0 ) {\n\n\t\t\tscope.onLoadComplete();\n\n\t\t}\n\n\t}\n\n}\n"
},
"$:/plugins/rboue/Three.js/Lib/ShaderDeferred.js": {
"type": "application/javascript",
"title": "$:/plugins/rboue/Three.js/Lib/ShaderDeferred.js",
"module-type": "library",
"text": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author MPanknin / http://www.redplant.de/\n * @author benaadams / http://blog.illyriad.co.uk/\n *\n */\n\n\nTHREE.DeferredShaderChunk = {\n\n\t// decode float to vec3\n\n\tunpackFloat: [\n\n\t\t\"vec3 float_to_vec3( float data ) {\",\n\n\t\t\t\"vec3 uncompressed;\",\n\t\t\t\"uncompressed.x = fract( data );\",\n\t\t\t\"float zInt = floor( data / 255.0 );\",\n\t\t\t\"uncompressed.z = fract( zInt / 255.0 );\",\n\t\t\t\"uncompressed.y = fract( floor( data - ( zInt * 255.0 ) ) / 255.0 );\",\n\t\t\t\"return uncompressed;\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tcomputeVertexPositionVS: [\n\n\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\n\t\t\"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );\",\n\t\t\"float z = normalDepth.w;\",\n\n\t\t\"if ( z == 0.0 ) discard;\",\n\n\t\t\"vec2 xy = texCoord * 2.0 - 1.0;\",\n\n\t\t\"vec4 vertexPositionProjected = vec4( xy, z, 1.0 );\",\n\t\t\"vec4 vertexPositionVS = matProjInverse * vertexPositionProjected;\",\n\t\t\"vertexPositionVS.xyz /= vertexPositionVS.w;\",\n\t\t\"vertexPositionVS.w = 1.0;\"\n\n\t].join(\"\\n\"),\n\n\tcomputeNormal: [\n\n\t\t\"vec3 normal = normalDepth.xyz * 2.0 - 1.0;\"\n\n\t].join(\"\\n\"),\n\n\tunpackColorMap: [\n\n\t\t\"vec4 colorMap = texture2D( samplerColor, texCoord );\",\n\n\t\t\"vec3 albedo = float_to_vec3( abs( colorMap.x ) );\",\n\t\t\"vec3 specularColor = float_to_vec3( abs( colorMap.y ) );\",\n\t\t\"float shininess = abs( colorMap.z );\",\n\t\t\"float wrapAround = sign( colorMap.z );\",\n\t\t\"float additiveSpecular = sign( colorMap.y );\"\n\n\t].join(\"\\n\"),\n\n\tcomputeDiffuse: [\n\n\t\t\"float dotProduct = dot( normal, lightVector );\",\n\t\t\"float diffuseFull = max( dotProduct, 0.0 );\",\n\n\t\t\"vec3 diffuse;\",\n\n\t\t\"if ( wrapAround < 0.0 ) {\",\n\n\t\t\t// wrap around lighting\n\n\t\t\t\"float diffuseHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\",\n\n\t\t\t\"const vec3 wrapRGB = vec3( 1.0, 1.0, 1.0 );\",\n\t\t\t\"diffuse = mix( vec3( diffuseFull ), vec3( diffuseHalf ), wrapRGB );\",\n\n\t\t\"} else {\",\n\n\t\t\t// simple lighting\n\n\t\t\t\"diffuse = vec3( diffuseFull );\",\n\n\t\t\"}\"\n\n\t].join(\"\\n\"),\n\n\tcomputeSpecular: [\n\n\t\t\"vec3 halfVector = normalize( lightVector - normalize( vertexPositionVS.xyz ) );\",\n\t\t\"float dotNormalHalf = max( dot( normal, halfVector ), 0.0 );\",\n\n\t\t// simple specular\n\n\t\t//\"vec3 specular = specularColor * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse;\",\n\n\t\t// physically based specular\n\n\t\t\"float specularNormalization = ( shininess + 2.0001 ) / 8.0;\",\n\n\t\t\"vec3 schlick = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, halfVector ), 5.0 );\",\n\t\t\"vec3 specular = schlick * max( pow( dotNormalHalf, shininess ), 0.0 ) * diffuse * specularNormalization;\"\n\n\t].join(\"\\n\"),\n\n\tcombine: [\n\n\t\t\"vec3 light = lightIntensity * lightColor;\",\n\t\t\"gl_FragColor = vec4( light * ( albedo * diffuse + specular ), attenuation );\"\n\n\t].join(\"\\n\")\n\n};\n\nTHREE.ShaderDeferred = {\n\n\t\"color\" : {\n\n\t\tuniforms: THREE.UniformsUtils.merge( [\n\n\t\t\tTHREE.UniformsLib[ \"common\" ],\n\t\t\tTHREE.UniformsLib[ \"fog\" ],\n\t\t\tTHREE.UniformsLib[ \"shadowmap\" ],\n\n\t\t\t{\n\t\t\t\t\"emissive\" : { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\t\t\"specular\" : { type: \"c\", value: new THREE.Color( 0x111111 ) },\n\t\t\t\t\"shininess\": { type: \"f\", value: 30 },\n\t\t\t\t\"wrapAround\": \t\t{ type: \"f\", value: 1 },\n\t\t\t\t\"additiveSpecular\": { type: \"f\", value: 1 },\n\n\t\t\t\t\"samplerNormalDepth\": { type: \"t\", value: null },\n\t\t\t\t\"viewWidth\": \t\t{ type: \"f\", value: 800 },\n\t\t\t\t\"viewHeight\": \t\t{ type: \"f\", value: 600 }\n\t\t\t}\n\n\t\t] ),\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 diffuse;\",\n\t\t\t\"uniform vec3 specular;\",\n\t\t\t\"uniform vec3 emissive;\",\n\t\t\t\"uniform float shininess;\",\n\t\t\t\"uniform float wrapAround;\",\n\t\t\t\"uniform float additiveSpecular;\",\n\n\t\t\tTHREE.ShaderChunk[ \"color_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"map_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"lightmap_pars_fragment\" ],\n\n\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\"varying vec3 vWorldPosition;\",\n\n\t\t\t\t\"uniform float reflectivity;\",\n\t\t\t\t\"uniform samplerCube envMap;\",\n\t\t\t\t\"uniform float flipEnvMap;\",\n\t\t\t\t\"uniform int combine;\",\n\n\t\t\t\t\"uniform bool useRefract;\",\n\t\t\t\t\"uniform float refractionRatio;\",\n\n\t\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\t\t\t\t\"uniform float viewHeight;\",\n\t\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"#endif\",\n\n\t\t\tTHREE.ShaderChunk[ \"fog_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_fragment\" ],\n\t\t\tTHREE.ShaderChunk[ \"specularmap_pars_fragment\" ],\n\n\t\t\t\"const float unit = 255.0/256.0;\",\n\n\t\t\t\"float vec3_to_float( vec3 data ) {\",\n\n\t\t\t\t\"highp float compressed = fract( data.x * unit ) + floor( data.y * unit * 255.0 ) + floor( data.z * unit * 255.0 ) * 255.0;\",\n\t\t\t\t\"return compressed;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"const float opacity = 1.0;\",\n\n\t\t\t\t\"gl_FragColor = vec4( diffuse, opacity );\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"map_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"alphatest_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"specularmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"lightmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"color_fragment\" ],\n\n\t\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\t\t\t\t\t\"vec4 normalDepth = texture2D( samplerNormalDepth, texCoord );\",\n\t\t\t\t\t\"vec3 normal = normalDepth.xyz * 2.0 - 1.0;\",\n\n\t\t\t\t\t\"vec3 reflectVec;\",\n\n\t\t\t\t\t\"vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\",\n\n\t\t\t\t\t\"if ( useRefract ) {\",\n\n\t\t\t\t\t\t\"reflectVec = refract( cameraToVertex, normal, refractionRatio );\",\n\n\t\t\t\t\t\"} else { \",\n\n\t\t\t\t\t\t\"reflectVec = reflect( cameraToVertex, normal );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\t\"#ifdef DOUBLE_SIDED\",\n\n\t\t\t\t\t\t\"float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\",\n\t\t\t\t\t\t\"vec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\",\n\n\t\t\t\t\t\"#else\",\n\n\t\t\t\t\t\t\"vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"#ifdef GAMMA_INPUT\",\n\n\t\t\t\t\t\t\"cubeColor.xyz *= cubeColor.xyz;\",\n\n\t\t\t\t\t\"#endif\",\n\n\t\t\t\t\t\"if ( combine == 1 ) {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\",\n\n\t\t\t\t\t\"} else if ( combine == 2 ) {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\",\n\n\t\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\t\"gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"fog_fragment\" ],\n\n\t\t\t\t//\n\n\t\t\t\t\"const float compressionScale = 0.999;\",\n\n\t\t\t\t//\n\n\t\t\t\t\"vec3 diffuseMapColor;\",\n\n\t\t\t\t\"#ifdef USE_MAP\",\n\n\t\t\t\t\t\"diffuseMapColor = texelColor.xyz;\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"diffuseMapColor = vec3( 1.0 );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t// diffuse color\n\n\t\t\t\t\"gl_FragColor.x = vec3_to_float( compressionScale * gl_FragColor.xyz );\",\n\n\t\t\t\t// specular color\n\n\t\t\t\t\"if ( additiveSpecular < 0.0 ) {\",\n\n\t\t\t\t\t\"gl_FragColor.y = vec3_to_float( compressionScale * specular );\",\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"gl_FragColor.y = vec3_to_float( compressionScale * specular * diffuseMapColor );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\t\"gl_FragColor.y *= additiveSpecular;\",\n\n\t\t\t\t// shininess\n\n\t\t\t\t\"gl_FragColor.z = wrapAround * shininess;\",\n\n\t\t\t\t// emissive color\n\n\t\t\t\t\"#ifdef USE_COLOR\",\n\n\t\t\t\t\t\"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor * vColor );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"gl_FragColor.w = vec3_to_float( compressionScale * emissive * diffuseMapColor );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\tTHREE.ShaderChunk[ \"map_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"lightmap_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"color_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"morphtarget_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"skinning_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"shadowmap_pars_vertex\" ],\n\n\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\"varying vec3 vWorldPosition;\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"map_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"lightmap_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"color_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"skinbase_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphtarget_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinning_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"default_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"worldpos_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"shadowmap_vertex\" ],\n\n\t\t\t\t\"#ifdef USE_ENVMAP\",\n\n\t\t\t\t\t\"vWorldPosition = worldPosition.xyz;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"normalDepth\" : {\n\n\t\tuniforms: {\n\n\t\t\tbumpMap: \t { type: \"t\", value: null },\n\t\t\tbumpScale:\t { type: \"f\", value: 1 },\n\t\t\toffsetRepeat: { type: \"v4\", value: new THREE.Vector4( 0, 0, 1, 1 ) }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\"#extension GL_OES_standard_derivatives : enable\\n\",\n\n\t\t\t\t\"varying vec2 vUv;\",\n\t\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"bumpmap_pars_fragment\" ],\n\n\t\t\t\"#endif\",\n\n\t\t\t\"varying vec3 normalView;\",\n\t\t\t\"varying vec4 clipPos;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec3 normal = normalize( normalView );\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor.xyz = normal * 0.5 + 0.5;\",\n\t\t\t\t\"gl_FragColor.w = clipPos.z / clipPos.w;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"varying vec3 normalView;\",\n\t\t\t\"varying vec4 clipPos;\",\n\n\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\"varying vec2 vUv;\",\n\t\t\t\t\"varying vec3 vViewPosition;\",\n\n\t\t\t\t\"uniform vec4 offsetRepeat;\",\n\n\t\t\t\"#endif\",\n\n\t\t\tTHREE.ShaderChunk[ \"morphtarget_pars_vertex\" ],\n\t\t\tTHREE.ShaderChunk[ \"skinning_pars_vertex\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphnormal_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinbase_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinnormal_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"defaultnormal_vertex\" ],\n\n\t\t\t\tTHREE.ShaderChunk[ \"morphtarget_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"skinning_vertex\" ],\n\t\t\t\tTHREE.ShaderChunk[ \"default_vertex\" ],\n\n\t\t\t\t\"normalView = normalize( normalMatrix * objectNormal );\",\n\n\t\t\t\t\"#ifdef USE_BUMPMAP\",\n\n\t\t\t\t\t\"vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\",\n\t\t\t\t\t\"vViewPosition = -mvPosition.xyz;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"clipPos = gl_Position;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"composite\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerLight: \t{ type: \"t\", value: null },\n\t\t\tbrightness:\t\t{ type: \"f\", value: 1 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"varying vec2 texCoord;\",\n\t\t\t\"uniform sampler2D samplerLight;\",\n\t\t\t\"uniform float brightness;\",\n\n\t\t\t// tonemapping operators\n\t\t\t// based on John Hable's HLSL snippets\n\t\t\t// from http://filmicgames.com/archives/75\n\n\t\t\t\"#ifdef TONEMAP_UNCHARTED\",\n\n\t\t\t\t\"const float A = 0.15;\",\n\t\t\t\t\"const float B = 0.50;\",\n\t\t\t\t\"const float C = 0.10;\",\n\t\t\t\t\"const float D = 0.20;\",\n\t\t\t\t\"const float E = 0.02;\",\n\t\t\t\t\"const float F = 0.30;\",\n\t\t\t\t\"const float W = 11.2;\",\n\n\t\t\t\t\"vec3 Uncharted2Tonemap( vec3 x ) {\",\n\n\t\t\t\t \"return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"#endif\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec3 inColor = texture2D( samplerLight, texCoord ).xyz;\",\n\t\t\t\t\"inColor *= brightness;\",\n\n\t\t\t\t\"vec3 outColor;\",\n\n\t\t\t\t\"#if defined( TONEMAP_SIMPLE )\",\n\n\t\t\t\t\t\"outColor = sqrt( inColor );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_LINEAR )\",\n\n\t\t\t\t\t// simple linear to gamma conversion\n\n\t\t\t\t\t\"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_REINHARD )\",\n\n\t\t\t\t\t// Reinhard operator\n\n\t\t\t\t\t\"inColor = inColor / ( 1.0 + inColor );\",\n\t\t\t\t\t\"outColor = pow( inColor, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_FILMIC )\",\n\n\t\t\t\t\t// filmic operator by Jim Hejl and Richard Burgess-Dawson\n\n\t\t\t\t\t\"vec3 x = max( vec3( 0.0 ), inColor - 0.004 );\",\n\t\t\t\t\t\"outColor = ( x * ( 6.2 * x + 0.5 ) ) / ( x * ( 6.2 * x + 1.7 ) + 0.06 );\",\n\n\t\t\t\t\"#elif defined( TONEMAP_UNCHARTED )\",\n\n\t\t\t\t\t// tonemapping operator from Uncharted 2 by John Hable\n\n\t\t\t\t\t\"float ExposureBias = 2.0;\",\n\t\t\t\t\t\"vec3 curr = Uncharted2Tonemap( ExposureBias * inColor );\",\n\n\t\t\t\t\t\"vec3 whiteScale = vec3( 1.0 ) / Uncharted2Tonemap( vec3( W ) );\",\n\t\t\t\t\t\"vec3 color = curr * whiteScale;\",\n\n\t\t\t\t\t\"outColor = pow( color, vec3( 1.0 / 2.2 ) );\",\n\n\t\t\t\t\"#else\",\n\n\t\t\t\t\t\"outColor = inColor;\",\n\n\t\t\t\t\"#endif\",\n\n\t\t\t\t\"gl_FragColor = vec4( outColor, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"varying vec2 texCoord;\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec4 pos = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\t\t\t\t\"texCoord = pos.xy * vec2( 0.5 ) + 0.5;\",\n\t\t\t\t\"gl_Position = pos;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"pointLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS:{ type: \"v3\", value: new THREE.Vector3( 0, 0, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\t\t\tlightRadius: \t{ type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColor;\",\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\n\t\t\t\t// bail out early when pixel outside of light sphere\n\n\t\t\t\t\"vec3 lightVector = lightPositionVS - vertexPositionVS.xyz;\",\n\t\t\t\t\"float distance = length( lightVector );\",\n\n\t\t\t\t\"if ( distance > lightRadius ) discard;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"lightVector = normalize( lightVector );\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"float cutoff = 0.3;\",\n\t\t\t\t\"float denom = distance / lightRadius + 1.0;\",\n\t\t\t\t\"float attenuation = 1.0 / ( denom * denom );\",\n\t\t\t\t\"attenuation = ( attenuation - cutoff ) / ( 1.0 - cutoff );\",\n\t\t\t\t\"attenuation = max( attenuation, 0.0 );\",\n\t\t\t\t\"attenuation *= attenuation;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// sphere proxy needs real position\n\n\t\t\t\t\"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\",\n\t\t\t\t\"gl_Position = projectionMatrix * mvPosition;\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"spotLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS :{ type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightDirectionVS:{ type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\t\t\tlightDistance: \t{ type: \"f\", value: 1.0 },\n\t\t\tlightAngle: \t{ type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform float lightAngle;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform vec3 lightColor;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = normalize( lightPositionVS.xyz - vertexPositionVS.xyz );\",\n\n\t\t\t\t\"float rho = dot( lightDirectionVS, lightVector );\",\n\t\t\t\t\"float rhoMax = cos( lightAngle * 0.5 );\",\n\n\t\t\t\t\"if ( rho <= rhoMax ) discard;\",\n\n\t\t\t\t\"float theta = rhoMax + 0.0001;\",\n\t\t\t\t\"float phi = rhoMax + 0.05;\",\n\t\t\t\t\"float falloff = 4.0;\",\n\n\t\t\t\t\"float spot = 0.0;\",\n\n\t\t\t\t\"if ( rho >= phi ) {\",\n\n\t\t\t\t\t\"spot = 1.0;\",\n\n\t\t\t\t\"} else if ( rho <= theta ) {\",\n\n\t\t\t\t\t\"spot = 0.0;\",\n\n\t\t\t\t\"} else { \",\n\n\t\t\t\t\t\"spot = pow( ( rho - theta ) / ( phi - theta ), falloff );\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\n\t\t\t\t\"diffuse *= spot;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"const float attenuation = 1.0;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"directionalLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightDirectionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColor;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = lightDirectionVS;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeDiffuse\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeSpecular\" ],\n\n\t\t\t\t// combine\n\n\t\t\t\t\"const float attenuation = 1.0;\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"hemisphereLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightDirectionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightColorSky: \t { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightColorGround: { type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightRadius;\",\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform vec3 lightColorSky;\",\n\t\t\t\"uniform vec3 lightColorGround;\",\n\t\t\t\"uniform vec3 lightDirectionVS;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t// compute light\n\n\t\t\t\t\"vec3 lightVector = lightDirectionVS;\",\n\n\t\t\t\t// diffuse\n\n\t\t\t\t\"float dotProduct = dot( normal, lightVector );\",\n\t\t\t\t\"float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\",\n\n\t\t\t\t\"vec3 hemiColor = mix( lightColorGround, lightColorSky, hemiDiffuseWeight );\",\n\n\t\t\t\t\"vec3 diffuse = hemiColor;\",\n\n\t\t\t\t// specular (sky light)\n\n\t\t\t\t\"vec3 hemiHalfVectorSky = normalize( lightVector - vertexPositionVS.xyz );\",\n\t\t\t\t\"float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\",\n\t\t\t\t\"float hemiSpecularWeightSky = max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );\",\n\n\t\t\t\t// specular (ground light)\n\n\t\t\t\t\"vec3 lVectorGround = -lightVector;\",\n\n\t\t\t\t\"vec3 hemiHalfVectorGround = normalize( lVectorGround - vertexPositionVS.xyz );\",\n\t\t\t\t\"float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\",\n\t\t\t\t\"float hemiSpecularWeightGround = max( pow( hemiDotNormalHalfGround, shininess ), 0.0 );\",\n\n\t\t\t\t\"float dotProductGround = dot( normal, lVectorGround );\",\n\n\t\t\t\t\"float specularNormalization = ( shininess + 2.0001 ) / 8.0;\",\n\n\t\t\t\t\"vec3 schlickSky = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lightVector, hemiHalfVectorSky ), 5.0 );\",\n\t\t\t\t\"vec3 schlickGround = specularColor + vec3( 1.0 - specularColor ) * pow( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 5.0 );\",\n\t\t\t\t\"vec3 specular = hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\",\n\n\t\t\t\t// combine\n\n\t\t\t\t\"gl_FragColor = vec4( lightIntensity * ( albedo * diffuse + specular ), 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"areaLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerNormalDepth: { type: \"t\", value: null },\n\t\t\tsamplerColor: \t\t{ type: \"t\", value: null },\n\t\t\tmatProjInverse: { type: \"m4\", value: new THREE.Matrix4() },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t\tlightPositionVS: { type: \"v3\", value: new THREE.Vector3( 0, 1, 0 ) },\n\t\t\tlightNormalVS: \t { type: \"v3\", value: new THREE.Vector3( 0, -1, 0 ) },\n\t\t\tlightRightVS: \t { type: \"v3\", value: new THREE.Vector3( 1, 0, 0 ) },\n\t\t\tlightUpVS: \t { type: \"v3\", value: new THREE.Vector3( 1, 0, 0 ) },\n\n\t\t\tlightColor: \t{ type: \"c\", value: new THREE.Color( 0x000000 ) },\n\t\t\tlightIntensity: { type: \"f\", value: 1.0 },\n\n\t\t\tlightWidth: { type: \"f\", value: 1.0 },\n\t\t\tlightHeight: { type: \"f\", value: 1.0 },\n\n\t\t\tconstantAttenuation: { type: \"f\", value: 1.5 },\n\t\t\tlinearAttenuation: { type: \"f\", value: 0.5 },\n\t\t\tquadraticAttenuation: { type: \"f\", value: 0.1 }\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform vec3 lightPositionVS;\",\n\t\t\t\"uniform vec3 lightNormalVS;\",\n\t\t\t\"uniform vec3 lightRightVS;\",\n\t\t\t\"uniform vec3 lightUpVS;\",\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\t\t\t\"uniform sampler2D samplerNormalDepth;\",\n\n\t\t\t\"uniform float lightWidth;\",\n\t\t\t\"uniform float lightHeight;\",\n\n\t\t\t\"uniform float constantAttenuation;\",\n\t\t\t\"uniform float linearAttenuation;\",\n\t\t\t\"uniform float quadraticAttenuation;\",\n\n\t\t\t\"uniform float lightIntensity;\",\n\t\t\t\"uniform vec3 lightColor;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\t\"uniform mat4 matProjInverse;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"vec3 projectOnPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {\",\n\n\t\t\t\t\"return point - dot( point - planeCenter, planeNorm ) * planeNorm;\",\n\n\t\t\t\"}\",\n\n\t\t\t\"bool sideOfPlane( vec3 point, vec3 planeCenter, vec3 planeNorm ) {\",\n\n\t\t\t\t\"return ( dot( point - planeCenter, planeNorm ) >= 0.0 );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"vec3 linePlaneIntersect( vec3 lp, vec3 lv, vec3 pc, vec3 pn ) {\",\n\n\t\t\t\t\"return lp + lv * ( dot( pn, pc - lp ) / dot( pn, lv ) );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"float calculateAttenuation( float dist ) {\",\n\n\t\t\t\t\"return ( 1.0 / ( constantAttenuation + linearAttenuation * dist + quadraticAttenuation * dist * dist ) );\",\n\n\t\t\t\"}\",\n\n\t\t\t\"void main() {\",\n\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeVertexPositionVS\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"computeNormal\" ],\n\t\t\t\tTHREE.DeferredShaderChunk[ \"unpackColorMap\" ],\n\n\t\t\t\t\"float w = lightWidth;\",\n\t\t\t\t\"float h = lightHeight;\",\n\n\t\t\t\t\"vec3 proj = projectOnPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS );\",\n\t\t\t\t\"vec3 dir = proj - lightPositionVS;\",\n\n\t\t\t\t\"vec2 diagonal = vec2( dot( dir, lightRightVS ), dot( dir, lightUpVS ) );\",\n\t\t\t\t\"vec2 nearest2D = vec2( clamp( diagonal.x, -w, w ), clamp( diagonal.y, -h, h ) );\",\n\t\t\t\t\"vec3 nearestPointInside = vec3( lightPositionVS ) + ( lightRightVS * nearest2D.x + lightUpVS * nearest2D.y );\",\n\n\t\t\t\t\"vec3 lightDir = normalize( nearestPointInside - vertexPositionVS.xyz );\",\n\t\t\t\t\"float NdotL = max( dot( lightNormalVS, -lightDir ), 0.0 );\",\n\t\t\t\t\"float NdotL2 = max( dot( normal, lightDir ), 0.0 );\",\n\n\t\t\t\t//\"if ( NdotL2 * NdotL > 0.0 && sideOfPlane( vertexPositionVS.xyz, lightPositionVS, lightNormalVS ) ) {\",\n\t\t\t\t\"if ( NdotL2 * NdotL > 0.0 ) {\",\n\n\t\t\t\t\t// diffuse\n\n\t\t\t\t\t\"vec3 diffuse = vec3( sqrt( NdotL * NdotL2 ) );\",\n\n\t\t\t\t\t// specular\n\n\t\t\t\t\t\"vec3 specular = vec3( 0.0 );\",\n\n\t\t\t\t\t\"vec3 R = reflect( normalize( -vertexPositionVS.xyz ), normal );\",\n\t\t\t\t\t\"vec3 E = linePlaneIntersect( vertexPositionVS.xyz, R, vec3( lightPositionVS ), lightNormalVS );\",\n\n\t\t\t\t\t\"float specAngle = dot( R, lightNormalVS );\",\n\n\t\t\t\t\t\"if ( specAngle > 0.0 ) {\",\n\n\t\t\t\t\t\t\"vec3 dirSpec = E - vec3( lightPositionVS );\",\n\t\t\t\t\t\t\"vec2 dirSpec2D = vec2( dot( dirSpec, lightRightVS ), dot( dirSpec, lightUpVS ) );\",\n\t\t\t\t\t\t\"vec2 nearestSpec2D = vec2( clamp( dirSpec2D.x, -w, w ), clamp( dirSpec2D.y, -h, h ) );\",\n\t\t\t\t\t\t\"float specFactor = 1.0 - clamp( length( nearestSpec2D - dirSpec2D ) * 0.05 * shininess, 0.0, 1.0 );\",\n\t\t\t\t\t\t\"specular = specularColor * specFactor * specAngle * diffuse;\",\n\n\t\t\t\t\t\"}\",\n\n\t\t\t\t\t// combine\n\n\t\t\t\t\t\"float dist = distance( vertexPositionVS.xyz, nearestPointInside );\",\n\t\t\t\t\t\"float attenuation = calculateAttenuation( dist );\",\n\n\t\t\t\t\tTHREE.DeferredShaderChunk[ \"combine\" ],\n\n\t\t\t\t\"} else {\",\n\n\t\t\t\t\t\"discard;\",\n\n\t\t\t\t\"}\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t},\n\n\t\"emissiveLight\" : {\n\n\t\tuniforms: {\n\n\t\t\tsamplerColor: \t{ type: \"t\", value: null },\n\t\t\tviewWidth: \t\t{ type: \"f\", value: 800 },\n\t\t\tviewHeight: \t{ type: \"f\", value: 600 },\n\n\t\t},\n\n\t\tfragmentShader : [\n\n\t\t\t\"uniform sampler2D samplerColor;\",\n\n\t\t\t\"uniform float viewHeight;\",\n\t\t\t\"uniform float viewWidth;\",\n\n\t\t\tTHREE.DeferredShaderChunk[ \"unpackFloat\" ],\n\n\t\t\t\"void main() {\",\n\n\t\t\t\t\"vec2 texCoord = gl_FragCoord.xy / vec2( viewWidth, viewHeight );\",\n\n\t\t\t\t\"vec4 colorMap = texture2D( samplerColor, texCoord );\",\n\t\t\t\t\"vec3 emissiveColor = float_to_vec3( abs( colorMap.w ) );\",\n\n\t\t\t\t\"gl_FragColor = vec4( emissiveColor, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\"),\n\n\t\tvertexShader : [\n\n\t\t\t\"void main() { \",\n\n\t\t\t\t// full screen quad proxy\n\n\t\t\t\t\"gl_Position = vec4( sign( position.xy ), 0.0, 1.0 );\",\n\n\t\t\t\"}\"\n\n\t\t].join(\"\\n\")\n\n\t}\n\n};\n"
},
"$:/plugins/rboue/Three.js-plus/icon": {
"created": "20150122113649353",
"modified": "20150122113650949",
"title": "$:/plugins/rboue/Three.js-plus/icon",
"type": "image/png",
"text": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMRCAYZvJsQjgAAABl0RVh0Q29tbWVudABDcmVhdGVk\nIHdpdGggR0lNUFeBDhcAABHaSURBVHja7Z15VJNX3se/N7IoWElQgwiEVUBZBJdSSweFEZdaWjew\nIrZqO9O302l9562n9cx5zxydMzOnp6eli+2r09KilipuoxVKlUarUOqGBRcUiBKIiQjGLEAggZD7\n/kHTwRGyB7I837845Fnuc3+f53eX53d/l1BK4UqilOLBgwdob2+HQqGAQqGAUqmEWq2GUDMxPFWe\n22To/CrOvohw7wfCsWPHgs1mw8/PD2w2GwEBAfD39wchxKXqizg7ACqVCiKRCCKRCGKxGMHtm+36\nQGLuRyQ4OBihoaEICQmBr68vA8BISqfTQSQSQSAQoPJ2j9E32t4Sct4jUVFRiIqKAo/HA4vFYgCw\nh1tvampCXV0dvOtyHbrAvfH7SVxcHMLDw52iuXBoANra2nDp0iV4XnveKdupvoRiMnfuXAQEBDAA\nmOVWhUKcO3cOE1t+7xI9VFnY52TevHkICwtjADDk5uvr61FRUYEw2ZuuNTT5RS0T80laWhpiYmIc\npnlwCAAaGxvxww8/uKzhhwIhPT0d06ZNc28A7ty5gxMnToAn/ZNbGP6R55/8IVmyZAmCg4PdC4De\n3l6cOnUKrNpstzT8I5p1hGRkZMDT09P1ARAIBGg6nMwYfghF5VwhkZGRrgmAWq1GSUkJJtzayBjf\ngLpjvyLLli2Dl5fXiNxvRKat2trasL3wdD5jfOPyqV9P//blifD79++7hgeoqalB+4nfMIa3QAFL\nfyRJSUnOCQClFHw+H7rqFYzxrZBnynGSnp5ut3kDuzQBWq0WBw4cYIxvA/VdeJYePHgQWq3WOQDQ\naDQoKioCR/gyY3wbid30Ev3666+h0WgcG4DOzk78vfBkeGDrHxnj21hT7r5G/154Mryzs9MxAVAq\nlTh6dOfPo/193pWVKs9t+kdRZX5HR4djdQK7urpQtWMK89aPJAyv3yPjx48ffQ+gVqvxbtHpcMYk\nI6t3i06Hq9Xq0fUAWq0WRUVFYNr80dG9qZ+SdevWwcPDY+Q9gE6nw6FDhxjjj3LH8PDhw7DmJbbY\nA5SXl4NeXskY3wHkmXKcZGRkjJwHqKmpYYzvQOq78Cytr68fGQDa29uZuX0HVMvROdSSOQKzAOjr\n68MHR6rzmep2TB04cAD9/f326wOUlZVhzJUc5u13YLHmHCWZmZm29wDNzc2M8Z1AuuoV9M6dO7YF\noLe3Fw374xnjO4l2fXslT6fT2a4J4PP56L+0nAFgBNXs/z6ZPn06OBwOfHx80N/fD5VKBbFYDK/r\na43awi+dT5544gnrAWhvb0fNFxEuZ3wx9yPC5XIxbtw4AAMBLDKZDOyml0b1WaW8f5KFCxciICBg\n2HJQSnH16lVyryzVYFlTXhUTNpttHQB79+5FgOQPLgFA57TdJD4+HhEREdRQ0KVUKs2pr68/pKpc\nMqLPHZR1nsTHm97UarVafPPNN2R844tDnqOM/JLk5ORYDsDt27dx6+BMpzd+R1QhycjIeHvixInv\nmNWh0ulQU1NDpOXz7V4HcevrSXBwsNn3+SX0jgwXfRWz9joxtCaRZejCe76vc/qvfNwllSQ7O5ua\na3wAYLFYmD17Nn3qjTa0Bn5it8V8kdm1FhkfAAghWLhwIe2K3jNk+U6dOmWZB6irq4P4eIpTv/0z\nN94iU6bYJk6BUopTp04RW3eGe6YXkeXLl9O+vj6cPHmSnD17Fh0dHQgMDMTSpUuRkmKaDdRqNc5+\nMGnI32Jz60hoaKh5AOzatQvh8i1OC0DyS03+XC5XZuvrlpaWElvmK0h5VUxqa2vxyiuvoLGx8ZHr\nLly4kBQUFCA0NNToPX/88UcyVL9FyvsnWbdunekA3Lp1C7cPJTmt8X9ZYmWX8ut0OhQVFRFbdIxl\nYZ8THx8frF69mhqK+p00aVLOhQsXDkVEGB6N9fT0oOLDyUP+NiPvJgkJCTGtD3D+/Hnn9fuzjjxk\n/I6ODpSXl5Pdu3eTvXv3kjNnzhBrImlYLBZWrVplE7i4XC42bNhw21jIt1QqPfjCCy8Y/e4/btw4\nSAI+HrIvUFVVZVonUCaTYfKd/3Lat3/+/IEee01NDVmxYgXhcrlYvHgx3bhxI33xxRdpeno65XK5\n2LRpExEKhRZ17Hx9feHz1HdWdwq1F5+jCoUiwpRjq6qqKJ/PN3rPwMDAIf/PEb5M5XK5cQCqq6ud\n9uUf++S3xNvbG9u3bydz5syhx44do0PF0nd2dqKwsJBOnz6d7tmzxyJDmto5M6StB6eZde+ysjKj\nxzz22GPD/nb58mXDAPT39zt1oMfcuXOxZcsWsm3bNmrKXLhGo8HGjRvpzp07zYbAy8sLZPa/rPIC\nYrE425zjm5ubjR5jKD6w/9LyR+rlIQAEAoHTvv13p+wgx44dQ35+vlkAU0qxefNmev78ebONGRsb\na1WZvb29D5lzvI+Pj9FjjAWF3Lp1a3gA6urqnBYAHo+HLVu2WHRuX18fXn/9dbODKy2dvNHL3BxB\niYmJxkcWMsMj3xs3bgwNgFarxXBzys4g7cXnaGtrq8Xlr66uNtsLsFgstAfvtLgZ2Lroksnl9fLy\nwpo1awzXgVZr9GPWuJt5dHDU0K8ACIVCOLM+PZdhda+8pKTE7HOMfW0zprS0NJPK/dZbb5GwsDBq\nxL2bdK3BfQmWK7T/ANDQ0GD1NSxpAr29va2655tvvomEhASDhsvJySHbtm2jxiaoLl48/rMp9xxs\n618B4PQc6XJmAGQyWba115BKpSNebu+6XFpWVobt27eT4ODgh0CYOXMmKSwsJMXFxXTMmDEGr3Pp\n0iUSIPlrsin3PCvU5T8EgFKpREfjAafOe+7n53fI2mtwOByzz+np6bG67J+V/hy+detW2tLSQhsb\nG0l1dTWRSCSktraWbtiwgRrLDiIUConi9G9N7k8sUOT8Sb/CmAUMJGx0dg03A2aOwsPDLfE8Vt83\nVZ7b9LcvT0R0dHQ0TZs2jc6ePZtOnTrVJINeuXKFNBYnmN35FYvFrgXA/z5dY/UIJisry6zjKaWY\neu91m4ycUuW5TRd2BkfU1taaFKepUqnw7bffGg0LG04ikejfANy9e9fpAajgFK83NA1qTJGRkSQ9\nPd2symxtbbV5kEjbd0/RP+/67oPKykoilUpzBg/Zent70dTUREpLS8mPHwfA4+oai+FrbW0FABCd\nTofydx5zmaDPJX9WWXTewYMHSXa2ealry8vLiTNPnS/a2klYQ30hclbR5MNk6dKlZr+Vr732mtnG\nV6lUTr9AVqlUgjUaQx97idSsprt378amTZtMgoDFYuGdd94hO3bsMNuQFRUVTr99mFQqhUt5AGAg\n8KGgoADFxcUkLCxsWCMlJSURPp9P3n77bWpuEkaZTPaZK2Q6l8vl8FAoFC4FgE/9elpd/QNZs2YN\nzc7Oxrlz50hFRQXu3r0LFosFHo+HzMxMJCYmWmRAjUaD0tKCuQEuUFcKhQIeSqUSfnAtyfjpVDK1\ngQQFBdHU1FSamppqmz4GpSgpKSEBkr+6RKdZqVSC1d3dDVfU9b0xtL6+3mbttEajwb59+8hjgg0u\nM2JSqVRgCdST8uCiajk6h/70009W50JUKBRNe/bsIZNEr7jUGsmenh6QE//wdflVv21Bf6mZM+eZ\nWdOnTzerw9fV1YUzZ84QZ9230KSRkzsAoJeY+xFJTk5GdHQ0HS7LJqUUYrGYXL9+3S32NHIrAAZr\nQvQa1e2e9PH67/mUUiiVSrfbwcxtAWA0IBZTBQwAjBgAGDEAMHJPAKo4+yKYanBPCTnvEVbEWJmQ\nqQr3lI+PD1imrDdj5MIAWLuyhZHzis1mMwAwADAAuDcAkydPZmrCTcXlchkP4M6aMGECWIQQiLkf\nEaY63Et3p+wgwC8zgcHBwUyNuJn0NmcBA+lVGLmX9EkjGQ/AADCQW66CU7yeqRb3kJDzHvH19f03\nAAAwP8KriKka91BUVNSvf3sM/qfgMlM55qot6P+Iv78//Pz84OHhAS8vL3h7e4PFGni3ent7odVq\nodFooNFoIJPJIJfLRzX2cEgAeDweBIw9DUoZ+SUJDQ0Fj8cDl8vV5+2x0JC/Q3d3N8RiMWlpaUFL\nSwtC7v/3iEAxOGv4Q4smjh07hnE385gg0UHSJR0iCQkJVieFNEUajQY3b94k165dA1f8ql3up4nb\nR5599tmhARAIBGg6nOz2AFRwitfnzY8siomJoXpXPtLq6urCuXPnht0LyGL3P7CXwtAA9Pf3g/+u\nn1sDELjsJ5KQkGD2knF7qbOzE2fOnCGm7BVoijLf7iCDoX4I7zFjxsDj8W/cclr43tRPyW82tyMx\nMdFhjK8fomdlZdHQFdVWF8rriRLynx7tEf+WnJzsdsaXhX1O8vLyqCNHR8XGxtL4FxqsgiApKemR\n/z0CgL+/P+ThBW7jBSZEr1GtXr3aaCZOR1BQUBANee6iRbZRRHxBhkqEOWQPx5Q9Z11FPlFvjPf0\n9HSa8s6YMYO2TMw3G4Inn3xyyP8PCUBYWBiEnPfcwgtER0dTJyyzWceLJn0w5I5hwwIAAOnp6W7h\nAcaOHet0ZdZveG2qDNlyWABiYmLcIlBEKpXOcbYy379/3+RjWwM/IYOnfk0GAAAWLFjg8h7g8lBb\naTmwenp6YE7Gkvnz5xv83SAAkZGRLj8iIDWrqUgkcopnpJSirKzM5LJ2x35FjGVANzrPuXjxYpf3\nAje/nkElEglxdOOfPHmSmLOv06JFi4weYxQADoeDMXOPuXxf4PreGFpbW+uQz9nT04P9+/cTUrPa\nZOP7pfN/DfqwCgB9L9IdIobavnuK/mXX8YgbN244BAgajQZ8Pp9UfDgZE1t+b7Lx70z+kKSkpJjW\nBJqaQ6+5uRkN++Pd5kPR/ZBdZNasWYiOjqaGduO0h+RyOf/atWuZPVVPW1Tfw+0UbhUAAMDn89F/\nabnbfS1Uz/iaxMTEgMfj2eV7AaUU7e3tRCgUoq6uDsHtmy2u43GpZSQtLc30TrA5APT396OgoABh\nsjfd9pNxBad4/bxgFHG5XLDZbLDZbA6bzZZ5eXmZZOiuri4oFAqiUCggl8shkUjg3/w7m9Rne/BO\nkpeXB3O+ZpqdRrW9vR01X0QwUUMGAInwbCvy8vICpRRqtRqhD/5nROrryT+2EnO3zbEoj25DQwOa\n/zWbgcCBFJtbR0JDQ80+z6J4p5iYGKu3TmdkO3mmHLfI+BYDAACZmZnQxO1jIBjtoWLcPmLNhzuL\nASCEICsrC4qILxgIRknKyC9JVlYWrAlhsyrklRCCVatW/brUmNHI6e6UHWTlypWwNn7R6phnDw8P\n5Obmuk0AiSOo2f99kpubC1tMUNkk6N3b2xtr165FW9Bfahjz2Fdn2Ac/WLt2rdXb1ls1DBxOarUa\n+/fvt9l+uoweVmvgJ+T555+3aRSTTQEABmYLjxw5Ar/bmxgIbKiOqEKycuVK2Dp62eYAAANTnqWl\npbDVahZ3V19CMVm2bBnssWDFLgDoITh9+jS0F59jILBCXk+UkAULFsBeq5XsBoBeLS0tqN8Xx0Bg\ngeJfaCBBQUF2vYfdAQCA7u5uHD16FK6275699CD0M7J8+XKMxFK1EQFA3yRcvHgRitO/ZSAwIHbG\nKfL4449jpBaojhgAeonFYpSWliJcvoUBYZCa/d8nzzzzDOzt8kcdAL03uHr1Ku6VpTIQAJjydBVJ\nTEzEaCxLHxUA9Orq6sL3338Pn/r1bglCd+xXZNGiRTAletclAdBLIBDg7NmzI5YkabTVMjGfZGRk\nwNCSLbcCQC+hUIjKykoESP5AXdXwaWlpAwE1DpKFxKEA0EsikaCyshIc4csuAYIs7HMyb948hIWF\nOVzZHBIAvTo7O3H16lV0VSx2ShDGp50kM2fOxHA7lTMAmDFqaGpqQl1dHbzrch26wL3x+0lcXBzC\nw8PhSMmmnBqAwdLpdBCJRBAIBKi83ROeKs9tGtV+C+c9EhUVhaioKPB4PIxWXkG3AeA/pVKpIBKJ\nIBKJIJFIENT2hl0fSBLwMQkKCkJoaChCQkJGdQjHADCMOjo6IJVKoVQqoVAooFAo0N3dDZVKZXSR\nRsvEfOLr6wsfHx/9yh+w2WxMmjQJ5i66cAb9P0ino5gBTAIlAAAAAElFTkSuQmCC\n"
},
"$:/plugins/rboue/Three.js-plus/license": {
"title": "$:/plugins/rboue/Three.js-plus/license",
"text": "!Plugin license\nCopyright (C) 2015 René Boué (rboue) <rboue01 (at) gmail (dot) com><br>\nAll rights reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see <http://www.gnu.org/licenses/>.\n\n!Three.js r69 license\nThe Three.js r69 LICENSE file is as follows :\n\n```\nThe MIT License\n\nCopyright © 2010-2014 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```"
},
"$:/plugins/rboue/Three.js-plus/readme": {
"title": "$:/plugins/rboue/Three.js-plus/readme",
"text": "Three.js r69 extras for ~TiddlyWiki (needs Three.js plugin)."
}
}
}
{
"tiddlers": {
"$:/config/EditorTypeMappings/application/javascript": {
"title": "$:/config/EditorTypeMappings/application/javascript",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/application/json": {
"title": "$:/config/EditorTypeMappings/application/json",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/application/x-tiddler-dictionary": {
"title": "$:/config/EditorTypeMappings/application/x-tiddler-dictionary",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/text/css": {
"title": "$:/config/EditorTypeMappings/text/css",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/text/html": {
"title": "$:/config/EditorTypeMappings/text/html",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/text/plain": {
"title": "$:/config/EditorTypeMappings/text/plain",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/text/vnd.tiddlywiki": {
"title": "$:/config/EditorTypeMappings/text/vnd.tiddlywiki",
"text": "codemirror"
},
"$:/config/EditorTypeMappings/text/x-tiddlywiki": {
"title": "$:/config/EditorTypeMappings/text/x-tiddlywiki",
"text": "codemirror"
},
"$:/core/modules/widgets/edit-codemirror.js": {
"text": "/*\\\ntitle: $:/core/modules/widgets/edit-codemirror.js\ntype: application/javascript\nmodule-type: widget\n\nCodemirror-based text editor widget\n\nConfig options \"$:/config/CodeMirror\" e.g. to allow vim key bindings\n {\n\t\"require\": [\n\t\t\"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js\",\n\t\t\"$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js\",\n\t\t\"$:/plugins/tiddlywiki/codemirror/keymap/vim.js\"\n\t],\n\t\"configuration\": {\n\t\t\t\"keyMap\": \"vim\",\n\t\t\t\"showCursorWhenSelecting\": true\n\t}\n}\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CODEMIRROR_OPTIONS = \"$:/config/CodeMirror\";\n\n// Install CodeMirror\nif($tw.browser && !window.CodeMirror) {\n\twindow.CodeMirror = require(\"$:/plugins/tiddlywiki/codemirror/lib/codemirror.js\");\n\t// Install required CodeMirror plugins\n\tvar configOptions = $tw.wiki.getTiddlerData(CODEMIRROR_OPTIONS,{}),\n\t\treq = configOptions.require;\n\tif(req) {\n\t\tif($tw.utils.isArray(req)) {\n\t\t\tfor(var index=0; index<req.length; index++) {\n\t\t\t\trequire(req[index]);\n\t\t\t}\n\t\t} else {\n\t\t\trequire(req);\n\t\t}\n\t}\n}\n\nvar MIN_TEXT_AREA_HEIGHT = 100; // Minimum height of textareas in pixels\n\nvar Widget = require(\"$:/core/modules/widgets/widget.js\").widget;\n\nvar EditCodeMirrorWidget = function(parseTreeNode,options) {\n\tthis.initialise(parseTreeNode,options);\n};\n\n/*\nInherit from the base widget class\n*/\nEditCodeMirrorWidget.prototype = new Widget();\n\n/*\nRender this widget into the DOM\n*/\nEditCodeMirrorWidget.prototype.render = function(parent,nextSibling) {\n\tvar self = this;\n\t// Save the parent dom node\n\tthis.parentDomNode = parent;\n\t// Compute our attributes\n\tthis.computeAttributes();\n\t// Execute our logic\n\tthis.execute();\n\t// Get the configuration options for the CodeMirror object\n\tvar config = $tw.wiki.getTiddlerData(CODEMIRROR_OPTIONS,{}).configuration || {},\n\t\teditInfo = this.getEditInfo();\n\tif(!(\"lineWrapping\" in config)) {\n\t\tconfig.lineWrapping = true;\n\t}\n\tif(!(\"lineNumbers\" in config)) {\n\t\tconfig.lineNumbers = true;\n\t}\n\tconfig.mode = editInfo.type;\n\tconfig.value = editInfo.value;\n\t// Create the CodeMirror instance\n\tvar cm = window.CodeMirror(function(domNode) {\n\t\tparent.insertBefore(domNode,nextSibling);\n\t\tself.domNodes.push(domNode);\n\t},config);\n\t// Set up a change event handler\n\tcm.on(\"change\",function() {\n\t\tself.saveChanges(cm.getValue());\n\t});\n\tthis.codeMirrorInstance = cm;\n};\n\n/*\nGet the tiddler being edited and current value\n*/\nEditCodeMirrorWidget.prototype.getEditInfo = function() {\n\t// Get the edit value\n\tvar self = this,\n\t\tvalue,\n\t\ttype = \"text/plain\",\n\t\tupdate;\n\tif(this.editIndex) {\n\t\tvalue = this.wiki.extractTiddlerDataItem(this.editTitle,this.editIndex,this.editDefault);\n\t\tupdate = function(value) {\n\t\t\tvar data = self.wiki.getTiddlerData(self.editTitle,{});\n\t\t\tif(data[self.editIndex] !== value) {\n\t\t\t\tdata[self.editIndex] = value;\n\t\t\t\tself.wiki.setTiddlerData(self.editTitle,data);\n\t\t\t}\n\t\t};\n\t} else {\n\t\t// Get the current tiddler and the field name\n\t\tvar tiddler = this.wiki.getTiddler(this.editTitle);\n\t\tif(tiddler) {\n\t\t\t// If we've got a tiddler, the value to display is the field string value\n\t\t\tvalue = tiddler.getFieldString(this.editField);\n\t\t\tif(this.editField === \"text\") {\n\t\t\t\ttype = tiddler.fields.type || \"text/vnd.tiddlywiki\";\n\t\t\t}\n\t\t} else {\n\t\t\t// Otherwise, we need to construct a default value for the editor\n\t\t\tswitch(this.editField) {\n\t\t\t\tcase \"text\":\n\t\t\t\t\tvalue = \"Type the text for the tiddler '\" + this.editTitle + \"'\";\n\t\t\t\t\ttype = \"text/vnd.tiddlywiki\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"title\":\n\t\t\t\t\tvalue = this.editTitle;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = \"\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(this.editDefault !== undefined) {\n\t\t\t\tvalue = this.editDefault;\n\t\t\t}\n\t\t}\n\t\tupdate = function(value) {\n\t\t\tvar tiddler = self.wiki.getTiddler(self.editTitle),\n\t\t\t\tupdateFields = {\n\t\t\t\t\ttitle: self.editTitle\n\t\t\t\t};\n\t\t\tupdateFields[self.editField] = value;\n\t\t\tself.wiki.addTiddler(new $tw.Tiddler(self.wiki.getCreationFields(),tiddler,updateFields,self.wiki.getModificationFields()));\n\t\t};\n\t}\n\tif(this.editType) {\n\t\ttype = this.editType;\n\t}\n\treturn {value: value || \"\", type: type, update: update};\n};\n\n/*\nCompute the internal state of the widget\n*/\nEditCodeMirrorWidget.prototype.execute = function() {\n\t// Get our parameters\n\tthis.editTitle = this.getAttribute(\"tiddler\",this.getVariable(\"currentTiddler\"));\n\tthis.editField = this.getAttribute(\"field\",\"text\");\n\tthis.editIndex = this.getAttribute(\"index\");\n\tthis.editDefault = this.getAttribute(\"default\");\n\tthis.editType = this.getAttribute(\"type\");\n};\n\n/*\nSelectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering\n*/\nEditCodeMirrorWidget.prototype.refresh = function(changedTiddlers) {\n\tvar changedAttributes = this.computeAttributes();\n\t// Completely rerender if any of our attributes have changed\n\tif(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index) {\n\t\tthis.refreshSelf();\n\t\treturn true;\n\t} else if(changedTiddlers[this.editTitle]) {\n\t\tthis.updateEditor(this.getEditInfo().value);\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n/*\nUpdate the editor with new text. This method is separate from updateEditorDomNode()\nso that subclasses can override updateEditor() and still use updateEditorDomNode()\n*/\nEditCodeMirrorWidget.prototype.updateEditor = function(text) {\n\tthis.updateEditorDomNode(text);\n};\n\n/*\nUpdate the editor dom node with new text\n*/\nEditCodeMirrorWidget.prototype.updateEditorDomNode = function(text) {\n\tif(this.codeMirrorInstance) {\n\t\tif(!this.codeMirrorInstance.hasFocus()) {\n\t\t\tthis.codeMirrorInstance.setValue(text);\n\t\t}\n\t}\n};\n\nEditCodeMirrorWidget.prototype.saveChanges = function(text) {\n\tvar editInfo = this.getEditInfo();\n\tif(text !== editInfo.value) {\n\t\teditInfo.update(text);\n\t}\n};\n\nexports[\"edit-codemirror\"] = EditCodeMirrorWidget;\n\n})();\n",
"title": "$:/core/modules/widgets/edit-codemirror.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/plugins/tiddlywiki/codemirror/lib/codemirror.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/lib/codemirror.js",
"module-type": "library",
"text": "// This is CodeMirror (http://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n module.exports = mod();\n else if (typeof define == \"function\" && define.amd) // AMD\n return define([], mod);\n else // Plain browser env\n this.CodeMirror = mod();\n})(function() {\n \"use strict\";\n\n // BROWSER SNIFFING\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n\n var gecko = /gecko\\/\\d/i.test(navigator.userAgent);\n // ie_uptoN means Internet Explorer version N or lower\n var ie_upto10 = /MSIE \\d/.test(navigator.userAgent);\n var ie_upto7 = ie_upto10 && (document.documentMode == null || document.documentMode < 8);\n var ie_upto8 = ie_upto10 && (document.documentMode == null || document.documentMode < 9);\n var ie_upto9 = ie_upto10 && (document.documentMode == null || document.documentMode < 10);\n var ie_11up = /Trident\\/([7-9]|\\d{2,})\\./.test(navigator.userAgent);\n var ie = ie_upto10 || ie_11up;\n var webkit = /WebKit\\//.test(navigator.userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(navigator.userAgent);\n var chrome = /Chrome\\//.test(navigator.userAgent);\n var presto = /Opera\\//.test(navigator.userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var khtml = /KHTML\\//.test(navigator.userAgent);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(navigator.userAgent);\n var phantom = /PhantomJS/.test(navigator.userAgent);\n\n var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\\/\\w+/.test(navigator.userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);\n var mac = ios || /Mac/.test(navigator.platform);\n var windows = /win/i.test(navigator.platform);\n\n var presto_version = presto && navigator.userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) presto_version = Number(presto_version[1]);\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && !ie_upto8);\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n // EDITOR CONSTRUCTOR\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);\n\n this.options = options = options || {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") doc = new Doc(doc, options.mode);\n this.doc = doc;\n\n var display = this.display = new Display(place, doc);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n this.display.wrapper.className += \" CodeMirror-wrap\";\n if (options.autofocus && !mobile) focusInput(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false, focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in readInput\n draggingText: false,\n highlight: new Delayed() // stores highlight worker timeout\n };\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie_upto10) setTimeout(bind(resetInput, this, true), 20);\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n var cm = this;\n runInOp(this, function() {\n cm.curOp.forceUpdate = true;\n attachDoc(cm, doc);\n\n if ((options.autofocus && !mobile) || activeElt() == display.input)\n setTimeout(bind(onFocus, cm), 20);\n else\n onBlur(cm);\n\n for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt))\n optionHandlers[opt](cm, options[opt], Init);\n for (var i = 0; i < initHooks.length; ++i) initHooks[i](cm);\n });\n }\n\n // DISPLAY CONSTRUCTOR\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie_upto7) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie_upto7) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }\n\n // STATE UPDATES\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function(line) {\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n });\n cm.doc.frontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) regChange(cm);\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function(){updateScrollbars(cm);}, 100);\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function(line) {\n var estHeight = est(line);\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n });\n }\n\n function keyMapChanged(cm) {\n var map = keyMap[cm.options.keyMap], style = map.style;\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-keymap-\\S+/g, \"\") +\n (style ? \" cm-keymap-\" + style : \"\");\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n setTimeout(function(){alignHorizontally(cm);}, 20);\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n cm.display.scrollbarH.style.left = cm.options.fixedGutter ? width + \"px\" : 0;\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var scroll = cm.display.scroller;\n return {\n clientHeight: scroll.clientHeight,\n barHeight: cm.display.scrollbarV.clientHeight,\n scrollWidth: scroll.scrollWidth, clientWidth: scroll.clientWidth,\n barWidth: cm.display.scrollbarH.clientWidth,\n docHeight: Math.round(cm.doc.height + paddingVert(cm.display))\n };\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display;\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n var needsV = scrollHeight > measure.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (scrollbarWidth(d.measure) === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewPort may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? viewPort.top : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: to};\n }\n\n // LINE NUMBERS\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber));\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }\n\n // DISPLAY DRAWING\n\n // Updates the display, selection, and scrollbars, using the\n // information in display.view to find out which nodes are no longer\n // up-to-date. Tries to bail out early when no changes are needed,\n // unless forced is true.\n // Returns true if an actual update happened, false otherwise.\n function updateDisplay(cm, viewPort, forced) {\n var oldFrom = cm.display.viewFrom, oldTo = cm.display.viewTo, updated;\n var visible = visibleLines(cm.display, cm.doc, viewPort);\n for (var first = true;; first = false) {\n var oldWidth = cm.display.scroller.clientWidth;\n if (!updateDisplayInner(cm, visible, forced)) break;\n updated = true;\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n if (cm.display.maxLineChanged && !cm.options.lineWrapping)\n adjustContentWidth(cm);\n\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n setDocumentHeight(cm, barMeasure);\n updateScrollbars(cm, barMeasure);\n if (webkit && cm.options.lineWrapping)\n checkForWebkitWidthBug(cm, barMeasure); // (Issue #2420)\n if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) {\n forced = true;\n continue;\n }\n forced = false;\n\n // Clip forced viewport to actual scrollable area.\n if (viewPort && viewPort.top != null)\n viewPort = {top: Math.min(barMeasure.docHeight - scrollerCutOff - barMeasure.clientHeight, viewPort.top)};\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n visible = visibleLines(cm.display, cm.doc, viewPort);\n if (visible.from >= cm.display.viewFrom && visible.to <= cm.display.viewTo)\n break;\n }\n\n cm.display.updateLineNumbers = null;\n if (updated) {\n signalLater(cm, \"update\", cm);\n if (cm.display.viewFrom != oldFrom || cm.display.viewTo != oldTo)\n signalLater(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n }\n return updated;\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayInner(cm, visible, forced) {\n var display = cm.display, doc = cm.doc;\n if (!display.wrapper.offsetWidth) {\n resetView(cm);\n return;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!forced && visible.from >= display.viewFrom && visible.to <= display.viewTo &&\n countDirtyView(cm) == 0)\n return;\n\n if (maybeUpdateLineNumberWidth(cm))\n resetView(cm);\n var dims = getDimensions(cm);\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != display.wrapper.clientHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !forced) return;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = display.wrapper.clientHeight;\n startWorker(cm, 400);\n }\n\n updateHeightsInViewport(cm);\n\n return true;\n }\n\n function adjustContentWidth(cm) {\n var display = cm.display;\n var width = measureChar(cm, display.maxLine, display.maxLine.text.length).left;\n display.maxLineChanged = false;\n var minWidth = Math.max(0, width + 3);\n var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + minWidth + scrollerCutOff - display.scroller.clientWidth);\n display.sizer.style.minWidth = minWidth + \"px\";\n if (maxScrollLeft < cm.doc.scrollLeft)\n setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = Math.max(measure.docHeight, measure.clientHeight - scrollerCutOff) + \"px\";\n }\n\n\n function checkForWebkitWidthBug(cm, measure) {\n // Work around Webkit bug where it sometimes reserves space for a\n // non-existing phantom scrollbar in the scroller (Issue #2420)\n if (cm.display.sizer.offsetWidth + cm.display.gutters.offsetWidth < cm.display.scroller.clientWidth - 1) {\n cm.display.sizer.style.minHeight = cm.display.heightForcer.style.top = \"0px\";\n cm.display.gutters.style.height = measure.docHeight + \"px\";\n }\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], height;\n if (cur.hidden) continue;\n if (ie_upto7) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n }\n var diff = cur.line.height - height;\n if (height < 2) height = textHeight(display);\n if (diff > .001 || diff < -.001) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) for (var j = 0; j < cur.rest.length; j++)\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft;\n width[cm.options.gutters[i]] = n.offsetWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie_upto7) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }\n\n function updateLineBackground(lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) cls += \" CodeMirror-linebackground\";\n if (lineView.background) {\n if (cls) lineView.background.className = cls;\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(lineView) {\n updateLineBackground(lineView);\n if (lineView.line.wrapClass)\n ensureLineWrapped(lineView).className = lineView.line.wrapClass;\n else if (lineView.node != lineView.text)\n lineView.node.className = \"\";\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter =\n wrap.insertBefore(elt(\"div\", null, \"CodeMirror-gutter-wrapper\", \"position: absolute; left: \" +\n (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"),\n lineView.text);\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n \"left: \" + dims.gutterLeft[\"CodeMirror-linenumbers\"] + \"px; width: \"\n + cm.display.lineNumInnerWidth + \"px\"));\n if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\", \"left: \" +\n dims.gutterLeft[id] + \"px; width: \" + dims.gutterWidth[id] + \"px\"));\n }\n }\n }\n\n function updateLineWidgets(lineView, dims) {\n if (lineView.alignable) lineView.alignable = null;\n for (var node = lineView.node.firstChild, next; node; node = next) {\n var next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n lineView.node.removeChild(node);\n }\n insertLineWidgets(lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }\n\n function insertLineWidgetsFor(line, lineView, dims, allowAbove) {\n if (!line.widgets) return;\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) node.ignoreEvents = true;\n positionLineWidget(widget, node, lineView, dims);\n if (allowAbove && widget.above)\n wrap.insertBefore(node, lineView.gutter || lineView.text);\n else\n wrap.appendChild(node);\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + \"px\";\n }\n }\n\n // POSITION OBJECT\n\n // A Pos instance represents a position within the text.\n var Pos = CodeMirror.Pos = function(line, ch) {\n if (!(this instanceof Pos)) return new Pos(line, ch);\n this.line = line; this.ch = ch;\n };\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; };\n\n function copyPos(x) {return Pos(x.line, x.ch);}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b; }\n\n // SELECTION / CURSOR\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n function Selection(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n }\n\n Selection.prototype = {\n primary: function() { return this.ranges[this.primIndex]; },\n equals: function(other) {\n if (other == this) return true;\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false;\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false;\n }\n return true;\n },\n deepCopy: function() {\n for (var out = [], i = 0; i < this.ranges.length; i++)\n out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head));\n return new Selection(out, this.primIndex);\n },\n somethingSelected: function() {\n for (var i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].empty()) return true;\n return false;\n },\n contains: function(pos, end) {\n if (!end) end = pos;\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n return i;\n }\n return -1;\n }\n };\n\n function Range(anchor, head) {\n this.anchor = anchor; this.head = head;\n }\n\n Range.prototype = {\n from: function() { return minPos(this.anchor, this.head); },\n to: function() { return maxPos(this.anchor, this.head); },\n empty: function() {\n return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch;\n }\n };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(ranges, primIndex) {\n var prim = ranges[primIndex];\n ranges.sort(function(a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n if (cmp(prev.to(), cur.from()) >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) --primIndex;\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex);\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0);\n }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) return Pos(doc.first, 0);\n var last = doc.first + doc.size - 1;\n if (pos.line > last) return Pos(last, getLine(doc, last).text.length);\n return clipToLen(pos, getLine(doc, pos.line).text.length);\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) return Pos(pos.line, linelen);\n else if (ch < 0) return Pos(pos.line, 0);\n else return pos;\n }\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}\n function clipPosArray(doc, array) {\n for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]);\n return out;\n }\n\n // SELECTION UPDATES\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(doc, range, head, other) {\n if (doc.cm && doc.cm.display.shift || doc.extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head);\n } else {\n return new Range(other || head, head);\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options) {\n setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n for (var out = [], i = 0; i < doc.sel.ranges.length; i++)\n out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null);\n var newSel = normalizeSelection(out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n sel = filterSelectionChange(doc, sel);\n\n var bias = cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1;\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n ensureCursorVisible(doc.cm);\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) return;\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) out = sel.ranges.slice(0, i);\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(out, sel.primIndex) : sel;\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, bias, mayClear) {\n var flipped = false, curPos = pos;\n var dir = bias || 1;\n doc.cantEdit = false;\n search: for (;;) {\n var line = getLine(doc, curPos.line);\n if (line.markedSpans) {\n for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) break;\n else {--i; continue;}\n }\n }\n if (!m.atomic) continue;\n var newPos = m.find(dir < 0 ? -1 : 1);\n if (cmp(newPos, curPos) == 0) {\n newPos.ch += dir;\n if (newPos.ch < 0) {\n if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));\n else newPos = null;\n } else if (newPos.ch > line.text.length) {\n if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0);\n else newPos = null;\n }\n if (!newPos) {\n if (flipped) {\n // Driven in a corner -- no valid cursor position found at all\n // -- try again *with* clearing, if we didn't already\n if (!mayClear) return skipAtomic(doc, pos, bias, true);\n // Otherwise, turn off editing until further notice, and return the start of the doc\n doc.cantEdit = true;\n return Pos(doc.first, 0);\n }\n flipped = true; newPos = pos; dir = -dir;\n }\n }\n curPos = newPos;\n continue search;\n }\n }\n }\n return curPos;\n }\n }\n\n // SELECTION DRAWING\n\n // Redraw the selection and/or cursor\n function updateSelection(cm) {\n var display = cm.display, doc = cm.doc;\n var curFragment = document.createDocumentFragment();\n var selFragment = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n var collapsed = range.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n drawSelectionCursor(cm, range, curFragment);\n if (!collapsed)\n drawSelectionRange(cm, range, selFragment);\n }\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n var top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n var left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n display.inputDiv.style.top = top + \"px\";\n display.inputDiv.style.left = left + \"px\";\n }\n\n removeChildrenAndAdd(display.cursorDiv, curFragment);\n removeChildrenAndAdd(display.selectionDiv, selFragment);\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\");\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) return;\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n display.blinker = setInterval(function() {\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate);\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)\n cm.state.highlight.set(time, bind(highlightWorker, cm));\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.frontier < doc.first) doc.frontier = doc.first;\n if (doc.frontier >= cm.display.viewTo) return;\n var end = +new Date + cm.options.workTime;\n var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));\n\n runInOp(cm, function() {\n doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) {\n if (doc.frontier >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var highlighted = highlightLine(cm, line, state, true);\n line.styles = highlighted.styles;\n if (highlighted.classes) line.styleClasses = highlighted.classes;\n else if (line.styleClasses) line.styleClasses = null;\n var ischange = !oldStyles || oldStyles.length != line.styles.length;\n for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];\n if (ischange) regLineChange(cm, doc.frontier, \"text\");\n line.stateAfter = copyState(doc.mode, state);\n } else {\n processLine(cm, line.text, state);\n line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;\n }\n ++doc.frontier;\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true;\n }\n });\n });\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }\n\n function getStateBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) return true;\n var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;\n if (!state) state = startState(doc.mode);\n else state = copyState(doc.mode, state);\n doc.iter(pos, n, function(line) {\n processLine(cm, line.text, state);\n var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo;\n line.stateAfter = save ? copyState(doc.mode, state) : null;\n ++pos;\n });\n if (precise) doc.frontier = pos;\n return state;\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop;}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}\n function paddingH(display) {\n if (display.cachedPaddingH) return display.cachedPaddingH;\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data;\n return data;\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right, top: found.top, bottom: found.bottom};\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function measureCharInner(cm, prepared, ch, bias) {\n var map = prepared.map;\n\n var node, start, end, collapse;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n var mStart = map[i], mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) collapse = \"right\";\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n collapse = bias;\n if (bias == \"left\" && start == 0)\n while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n }\n if (bias == \"right\" && start == mEnd - mStart)\n while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n }\n break;\n }\n }\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start;\n while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end;\n if (ie_upto8 && start == 0 && end == mEnd - mStart) {\n rect = node.parentNode.getBoundingClientRect();\n } else if (ie && cm.options.lineWrapping) {\n var rects = range(node, start, end).getClientRects();\n if (rects.length)\n rect = rects[bias == \"right\" ? rects.length - 1 : 0];\n else\n rect = nullRect;\n } else {\n rect = range(node, start, end).getBoundingClientRect() || nullRect;\n }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) collapse = bias = \"right\";\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n rect = rects[bias == \"right\" ? rects.length - 1 : 0];\n else\n rect = node.getBoundingClientRect();\n }\n if (ie_upto8 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom};\n else\n rect = nullRect;\n }\n\n var top, bot = (rect.bottom + rect.top) / 2 - prepared.rect.top;\n var heights = prepared.view.measure.heights;\n for (var i = 0; i < heights.length - 1; i++)\n if (bot < heights[i]) break;\n top = i ? heights[i - 1] : 0; bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) result.bogus = true;\n return result;\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n lineView.measure.caches[i] = {};\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n clearLineMeasurementCacheFor(cm.display.view[i]);\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }\n function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"/null (editor), or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"/null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) lineObj = getLine(cm.doc, pos.line);\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context);\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\");\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n var innerOff = y - heightAtLine(lineObj);\n var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\n function getX(ch) {\n var sp = cursorCoords(cm, Pos(lineNo, ch), \"line\", lineObj, preparedMeasure);\n wrongLine = true;\n if (innerOff > sp.bottom) return sp.left - adjust;\n else if (innerOff < sp.top) return sp.left + adjust;\n else wrongLine = false;\n return sp.left;\n }\n\n var bidi = getOrder(lineObj), dist = lineObj.text.length;\n var from = lineLeft(lineObj), to = lineRight(lineObj);\n var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;\n\n if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);\n // Do a binary search between these bounds.\n for (;;) {\n if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {\n var ch = x < fromX || x - fromX <= toX - x ? from : to;\n var xDiff = x - (ch == from ? fromX : toX);\n while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;\n var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,\n xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0);\n return pos;\n }\n var step = Math.ceil(dist / 2), middle = from + step;\n if (bidi) {\n middle = from;\n for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);\n }\n var middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}\n else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}\n }\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }\n\n // OPERATIONS\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (!delayedCallbackDepth++) delayedCallbacks = [];\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp, doc = cm.doc, display = cm.display;\n cm.curOp = null;\n\n if (op.updateMaxLine) findMaxLine(cm);\n\n // If it looks like an update might be needed, call updateDisplay\n if (op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping) {\n var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;\n }\n // If no update was run, but the selection changed, redraw that.\n if (!updated && op.selectionChanged) updateSelection(cm);\n if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm);\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) {\n var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));\n display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;\n }\n if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) {\n var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));\n display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;\n alignHorizontally(cm);\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),\n clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);\n if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);\n }\n\n if (op.selectionChanged) restartBlink(cm);\n\n if (cm.state.focused && op.updateInput)\n resetInput(cm, op.typing);\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) for (var i = 0; i < hidden.length; ++i)\n if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\n if (unhidden) for (var i = 0; i < unhidden.length; ++i)\n if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\n\n var delayed;\n if (!--delayedCallbackDepth) {\n delayed = delayedCallbacks;\n delayedCallbacks = null;\n }\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n signal(cm, \"changes\", cm, op.changeObjs);\n if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();\n if (op.cursorActivityHandlers)\n for (var i = 0; i < op.cursorActivityHandlers.length; i++)\n op.cursorActivityHandlers[i](cm);\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) return f.apply(this, arguments);\n startOperation(cm);\n try { return f.apply(this, arguments); }\n finally { endOperation(cm); }\n };\n }\n\n // VIEW TRACKING\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) return null;\n n -= cm.display.viewFrom;\n if (n < 0) return null;\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) return i;\n }\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n return {index: index, lineN: newN};\n for (var i = 0, n = cm.display.viewFrom; i < index; i++)\n n += view[i].size;\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) return null;\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) return null;\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN};\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }\n\n // INPUT HANDLING\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n function readInput(cm) {\n var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput)\n return false;\n // See paste handler for more on the fakedLastChar kludge\n if (cm.state.pasteIncoming && cm.state.fakedLastChar) {\n input.value = input.value.substring(0, input.value.length - 1);\n cm.state.fakedLastChar = false;\n }\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) return false;\n // Work around nonsensical selection resetting in IE9/10\n if (ie && !ie_upto8 && cm.display.inputHasSelection === text) {\n resetInput(cm);\n return false;\n }\n\n var withOp = !cm.curOp;\n if (withOp) startOperation(cm);\n cm.display.shift = false;\n\n if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)\n prevInput = \"\\u200b\";\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;\n var inserted = text.slice(same), textLines = splitLines(inserted);\n\n // When pasing N lines into N selections, insert one line per selection\n var multiPaste = cm.state.pasteIncoming && textLines.length > 1 && doc.sel.ranges.length == textLines.length;\n\n // Normal behavior is to insert the new text into every selection\n for (var i = doc.sel.ranges.length - 1; i >= 0; i--) {\n var range = doc.sel.ranges[i];\n var from = range.from(), to = range.to();\n // Handle deletion\n if (same < prevInput.length)\n from = Pos(from.line, from.ch - (prevInput.length - same));\n // Handle overwrite\n else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming)\n to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));\n var updateInput = cm.curOp.updateInput;\n var changeEvent = {from: from, to: to, text: multiPaste ? [textLines[i]] : textLines,\n origin: cm.state.pasteIncoming ? \"paste\" : cm.state.cutIncoming ? \"cut\" : \"+input\"};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&\n cm.options.smartIndent && range.head.ch < 100 &&\n (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) {\n var mode = cm.getModeAt(range.head);\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indentLine(cm, range.head.line, \"smart\");\n break;\n }\n } else if (mode.electricInput) {\n var end = changeEnd(changeEvent);\n if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))\n indentLine(cm, range.head.line, \"smart\");\n }\n }\n }\n ensureCursorVisible(cm);\n cm.curOp.updateInput = updateInput;\n cm.curOp.typing = true;\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) input.value = cm.display.prevInput = \"\";\n else cm.display.prevInput = text;\n if (withOp) endOperation(cm);\n cm.state.pasteIncoming = cm.state.cutIncoming = false;\n return true;\n }\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && !ie_upto8) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && !ie_upto8) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }\n\n function focusInput(cm) {\n if (cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != cm.display.input))\n cm.display.input.focus();\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { focusInput(cm); onFocus(cm); }\n }\n\n function isReadOnly(cm) {\n return cm.options.readOnly || cm.doc.cantEdit;\n }\n\n // EVENT HANDLERS\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie_upto10)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = findWordAt(cm, pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Prevent normal selection in the editor (we handle our own)\n on(d.lineSpace, \"selectstart\", function(e) {\n if (!eventInWidget(d, e)) e_preventDefault(e);\n });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n on(d.scrollbarV, \"scroll\", function() {\n if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);\n });\n on(d.scrollbarH, \"scroll\", function() {\n if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent clicks in the scrollbars from killing focus\n function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }\n on(d.scrollbarH, \"mousedown\", reFocus);\n on(d.scrollbarV, \"mousedown\", reFocus);\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n on(d.input, \"keyup\", operation(cm, onKeyUp));\n on(d.input, \"input\", function() {\n if (ie && !ie_upto8 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;\n fastPoll(cm);\n });\n on(d.input, \"keydown\", operation(cm, onKeyDown));\n on(d.input, \"keypress\", operation(cm, onKeyPress));\n on(d.input, \"focus\", bind(onFocus, cm));\n on(d.input, \"blur\", bind(onBlur, cm));\n\n function drag_(e) {\n if (!signalDOMEvent(cm, e)) e_stop(e);\n }\n if (cm.options.dragDrop) {\n on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n on(d.scroller, \"dragenter\", drag_);\n on(d.scroller, \"dragover\", drag_);\n on(d.scroller, \"drop\", operation(cm, onDrop));\n }\n on(d.scroller, \"paste\", function(e) {\n if (eventInWidget(d, e)) return;\n cm.state.pasteIncoming = true;\n focusInput(cm);\n fastPoll(cm);\n });\n on(d.input, \"paste\", function() {\n // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206\n // Add a char to the end of textarea before paste occur so that\n // selection doesn't span to the end of textarea.\n if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {\n var start = d.input.selectionStart, end = d.input.selectionEnd;\n d.input.value += \"$\";\n d.input.selectionStart = start;\n d.input.selectionEnd = end;\n cm.state.fakedLastChar = true;\n }\n cm.state.pasteIncoming = true;\n fastPoll(cm);\n });\n\n function prepareCopyCut(e) {\n if (cm.somethingSelected()) {\n if (d.inaccurateSelection) {\n d.prevInput = \"\";\n d.inaccurateSelection = false;\n d.input.value = cm.getSelection();\n selectInput(d.input);\n }\n } else {\n var text = \"\", ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text += cm.getRange(lineRange.anchor, lineRange.head);\n }\n if (e.type == \"cut\") {\n cm.setSelections(ranges, null, sel_dontScroll);\n } else {\n d.prevInput = \"\";\n d.input.value = text;\n selectInput(d.input);\n }\n }\n if (e.type == \"cut\") cm.state.cutIncoming = true;\n }\n on(d.input, \"cut\", prepareCopyCut);\n on(d.input, \"copy\", prepareCopyCut);\n\n // Needed to handle Tab key in KHTML\n if (khtml) on(d.sizer, \"mouseup\", function() {\n if (activeElt() == d.input) d.input.blur();\n focusInput(cm);\n });\n }\n\n // Called when the window resizes\n function onResize(cm) {\n // Might be a text scaling operation, clear size caches.\n var d = cm.display;\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n cm.setSize();\n }\n\n // MOUSE EVENTS\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n if (signalDOMEvent(this, e)) return;\n var cm = this, display = cm.display;\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function(){display.scroller.draggable = true;}, 100);\n }\n return;\n }\n if (clickInGutter(cm, e)) return;\n var start = posFromMouse(cm, e);\n window.focus();\n\n switch (e_button(e)) {\n case 1:\n if (start)\n leftButtonDown(cm, e, start);\n else if (e_target(e) == display.scroller)\n e_preventDefault(e);\n break;\n case 2:\n if (webkit) cm.state.lastMiddleDown = +new Date;\n if (start) extendSelection(cm.doc, start);\n setTimeout(bind(focusInput, cm), 20);\n e_preventDefault(e);\n break;\n case 3:\n if (captureRightClick) onContextMenu(cm, e);\n break;\n }\n }\n\n var lastClick, lastDoubleClick;\n function leftButtonDown(cm, e, start) {\n setTimeout(bind(ensureFocus, cm), 0);\n\n var now = +new Date, type;\n if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {\n type = \"triple\";\n } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {\n type = \"double\";\n lastDoubleClick = {time: now, pos: start};\n } else {\n type = \"single\";\n lastClick = {time: now, pos: start};\n }\n\n var sel = cm.doc.sel, addNew = mac ? e.metaKey : e.ctrlKey;\n if (cm.options.dragDrop && dragAndDrop && !addNew && !isReadOnly(cm) &&\n type == \"single\" && sel.contains(start) > -1 && sel.somethingSelected())\n leftButtonStartDrag(cm, e, start);\n else\n leftButtonSelect(cm, e, start, type, addNew);\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, e, start) {\n var display = cm.display;\n var dragEnd = operation(cm, function(e2) {\n if (webkit) display.scroller.draggable = false;\n cm.state.draggingText = false;\n off(document, \"mouseup\", dragEnd);\n off(display.scroller, \"drop\", dragEnd);\n if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {\n e_preventDefault(e2);\n extendSelection(cm.doc, start);\n focusInput(cm);\n // Work around unexplainable focus problem in IE9 (#2127)\n if (ie_upto10 && !ie_upto8)\n setTimeout(function() {document.body.focus(); focusInput(cm);}, 20);\n }\n });\n // Let the drag handler handle this.\n if (webkit) display.scroller.draggable = true;\n cm.state.draggingText = dragEnd;\n // IE's approach to draggable\n if (display.scroller.dragDrop) display.scroller.dragDrop();\n on(document, \"mouseup\", dragEnd);\n on(display.scroller, \"drop\", dragEnd);\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if ((ie && !ie_upto9) ? !e.buttons : !e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent, signalfn) {\n try { var mX = e.clientX, mY = e.clientY; }\n catch(e) { return false; }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;\n if (prevent) e_preventDefault(e);\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signalfn(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e);\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true, signalLater);\n }\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n return;\n e_preventDefault(e);\n if (ie) lastDrop = +new Date;\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || isReadOnly(cm)) return;\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function(file, i) {\n var reader = new FileReader;\n reader.onload = operation(cm, function() {\n text[i] = reader.result;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos, text: splitLines(text.join(\"\\n\")), origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) loadFile(files[i], i);\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(bind(focusInput, cm), 20);\n return;\n }\n try {\n var text = e.dataTransfer.getData(\"Text\");\n if (text) {\n var selected = cm.state.draggingText && cm.listSelections();\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) for (var i = 0; i < selected.length; ++i)\n replaceRange(cm.doc, \"\", selected[i].anchor, selected[i].head, \"drag\");\n cm.replaceSelection(text, \"around\", \"paste\");\n focusInput(cm);\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) img.parentNode.removeChild(img);\n }\n }\n\n // SCROLL EVENTS\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function setScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) return;\n cm.doc.scrollTop = val;\n if (!gecko) updateDisplay(cm, {top: val});\n if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;\n if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;\n if (gecko) updateDisplay(cm);\n startWorker(cm, 100);\n }\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller) {\n if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;\n if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) wheelPixelsPerUnit = -.53;\n else if (gecko) wheelPixelsPerUnit = 15;\n else if (chrome) wheelPixelsPerUnit = -.7;\n else if (safari) wheelPixelsPerUnit = -1/3;\n\n function onScrollWheel(cm, e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;\n else if (dy == null) dy = e.wheelDelta;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n if (!(dx && scroll.scrollWidth > scroll.clientWidth ||\n dy && scroll.scrollHeight > scroll.clientHeight)) return;\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer;\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy)\n setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));\n setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));\n e_preventDefault(e);\n display.wheelStartX = null; // Abort measurement, if in progress\n return;\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) top = Math.max(0, top + pixels - 50);\n else bot = Math.min(cm.doc.height, bot + pixels + 50);\n updateDisplay(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function() {\n if (display.wheelStartX == null) return;\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) return;\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // KEY EVENTS\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) return false;\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;\n var prevShift = cm.display.shift, done = false;\n try {\n if (isReadOnly(cm)) cm.state.suppressEdits = true;\n if (dropShift) cm.display.shift = false;\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done;\n }\n\n // Collect the currently active keymaps.\n function allKeyMaps(cm) {\n var maps = cm.state.keyMaps.slice(0);\n if (cm.options.extraKeys) maps.push(cm.options.extraKeys);\n maps.push(cm.options.keyMap);\n return maps;\n }\n\n var maybeTransition;\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n // Handle automatic keymap transitions\n var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;\n clearTimeout(maybeTransition);\n if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {\n if (getKeyMap(cm.options.keyMap) == startMap) {\n cm.options.keyMap = (next.call ? next.call(null, cm) : next);\n keyMapChanged(cm);\n }\n }, 50);\n\n var name = keyName(e, true), handled = false;\n if (!name) return false;\n var keymaps = allKeyMaps(cm);\n\n if (e.shiftKey) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n handled = lookupKey(\"Shift-\" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})\n || lookupKey(name, keymaps, function(b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n return doHandleBinding(cm, b);\n });\n } else {\n handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });\n }\n\n if (handled) {\n e_preventDefault(e);\n restartBlink(cm);\n signalLater(cm, \"keyHandled\", cm, name, e);\n }\n return handled;\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n var handled = lookupKey(\"'\" + ch + \"'\", allKeyMaps(cm),\n function(b) { return doHandleBinding(cm, b, true); });\n if (handled) {\n e_preventDefault(e);\n restartBlink(cm);\n signalLater(cm, \"keyHandled\", cm, \"'\" + ch + \"'\", e);\n }\n return handled;\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n ensureFocus(cm);\n if (signalDOMEvent(cm, e)) return;\n // IE does strange things with escape.\n if (ie_upto10 && e.keyCode == 27) e.returnValue = false;\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n cm.replaceSelection(\"\", null, \"cut\");\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n showCrossHair(cm);\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (signalDOMEvent(this, e)) return;\n if (e.keyCode == 16) this.doc.sel.shift = false;\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (signalDOMEvent(cm, e)) return;\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}\n if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n if (handleCharBinding(cm, e, ch)) return;\n if (ie && !ie_upto8) cm.display.inputHasSelection = null;\n fastPoll(cm);\n }\n\n // FOCUS/BLUR EVENTS\n\n function onFocus(cm) {\n if (cm.options.readOnly == \"nocursor\") return;\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // The prevInput test prevents this from firing when a context\n // menu is closed (since the resetInput would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n resetInput(cm);\n if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730\n }\n }\n slowPoll(cm);\n restartBlink(cm);\n }\n function onBlur(cm) {\n if (cm.state.focused) {\n signal(cm, \"blur\", cm);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150);\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (signalDOMEvent(cm, e, \"contextmenu\")) return;\n var display = cm.display;\n if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;\n\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) return; // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);\n\n var oldCSS = display.input.style.cssText;\n display.inputDiv.style.position = \"absolute\";\n display.input.style.cssText = \"position: fixed; width: 30px; height: 30px; top: \" + (e.clientY - 5) +\n \"px; left: \" + (e.clientX - 5) + \"px; z-index: 1000; background: \" +\n (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") +\n \"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n focusInput(cm);\n resetInput(cm);\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) display.input.value = display.prevInput = \" \";\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (display.input.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = display.input.value = \"\\u200b\" + (selected ? display.input.value : \"\");\n display.prevInput = selected ? \"\" : \"\\u200b\";\n display.input.selectionStart = 1; display.input.selectionEnd = extval.length;\n }\n }\n function rehide() {\n display.inputDiv.style.position = \"relative\";\n display.input.style.cssText = oldCSS;\n if (ie_upto8) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;\n slowPoll(cm);\n\n // Try to detect the user choosing select-all\n if (display.input.selectionStart != null) {\n if (!ie || ie_upto8) prepareSelectAllHack();\n var i = 0, poll = function() {\n if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)\n operation(cm, commands.selectAll)(cm);\n else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);\n else resetInput(cm);\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && !ie_upto8) prepareSelectAllHack();\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function() {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) return false;\n return gutterEvent(cm, e, \"gutterContextMenu\", false, signal);\n }\n\n // UPDATING\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n var changeEnd = CodeMirror.changeEnd = function(change) {\n if (!change.text) return change.to;\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));\n };\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) return pos;\n if (cmp(pos, change.to) <= 0) return changeEnd(change);\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch;\n return Pos(line, ch);\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(out, doc.sel.primIndex);\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n return Pos(nw.line, pos.ch - old.ch + nw.ch);\n else\n return Pos(nw.line + (pos.line - old.line), pos.ch);\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex);\n }\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function() { this.canceled = true; }\n };\n if (update) obj.update = function(from, to, text, origin) {\n if (from) this.from = clipPos(doc, from);\n if (to) this.to = clipPos(doc, to);\n if (text) this.text = text;\n if (origin !== undefined) this.origin = origin;\n };\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeChange\", doc.cm, obj);\n\n if (obj.canceled) return null;\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n if (doc.cm.state.suppressEdits) return;\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) return;\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text});\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) return;\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function(doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n if (doc.cm && doc.cm.state.suppressEdits) return;\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n for (var i = 0; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n break;\n }\n if (i == source.length) return;\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return;\n }\n selAfter = event;\n }\n else break;\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n for (var i = event.changes.length - 1; i >= 0; --i) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return;\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change, null) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) doc.cm.scrollIntoView(change);\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function(doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) return;\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function(range) {\n return new Range(Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch));\n }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n regLineChange(doc.cm, l, \"gutter\");\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return;\n }\n if (change.from.line > doc.lastLine()) return;\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) selAfter = computeSelAfterChange(doc, change, null);\n if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans);\n else updateDoc(doc, change, spans);\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function(line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true;\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n signalCursorActivity(cm);\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function(line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) cm.curOp.updateMaxLine = true;\n }\n\n // Adjust frontier, schedule worker\n doc.frontier = Math.min(doc.frontier, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n regLineChange(cm, from.line, \"text\");\n else\n regChange(cm, from.line, to.line + 1, lendiff);\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) signalLater(cm, \"change\", cm, obj);\n if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj);\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n if (!to) to = from;\n if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }\n if (typeof code == \"string\") code = splitLines(code);\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, coords) {\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (coords.top + box.top < 0) doScroll = true;\n else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, \"position: absolute; top: \" +\n (coords.top - display.viewOffset - paddingTop(cm.display)) + \"px; height: \" +\n (coords.bottom - coords.top + scrollerCutOff) + \"px; left: \" +\n coords.left + \"px; width: 2px;\");\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (;;) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) return coords;\n }\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = display.scroller.clientHeight - scrollerCutOff, result = {};\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = display.scroller.clientWidth - scrollerCutOff;\n x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;\n var gutterw = display.gutters.offsetWidth;\n var atLeft = x1 < gutterw + 10;\n if (x1 < screenleft + gutterw || atLeft) {\n if (atLeft) x1 = 0;\n result.scrollLeft = Math.max(0, x1 - 10 - gutterw);\n } else if (x2 > screenw + screenleft - 3) {\n result.scrollLeft = x2 + 10 - screenw;\n }\n return result;\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }\n\n // API UTILITIES\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) how = \"add\";\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!cm.doc.mode.indent) how = \"prev\";\n else state = getStateBefore(cm, n);\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) line.stateAfter = null;\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass) {\n if (!aggressive) return;\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);\n else indentation = 0;\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";}\n if (pos < indentation) indentString += spaceStr(indentation - pos);\n\n if (indentString != curSpaceString) {\n replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i, new Range(pos, pos));\n break;\n }\n }\n }\n line.stateAfter = null;\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(cm, handle, changeType, op) {\n var no = handle, line = handle, doc = cm.doc;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no)) regLineChange(cm, no, changeType);\n return line;\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break;\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function() {\n for (var i = kill.length - 1; i >= 0; i--)\n replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\");\n ensureCursorVisible(cm);\n });\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var line = pos.line, ch = pos.ch, origDir = dir;\n var lineObj = getLine(doc, line);\n var possible = true;\n function findNextLine() {\n var l = line + dir;\n if (l < doc.first || l >= doc.first + doc.size) return (possible = false);\n line = l;\n return lineObj = getLine(doc, l);\n }\n function moveOnce(boundToLine) {\n var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);\n if (next == null) {\n if (!boundToLine && findNextLine()) {\n if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);\n else ch = dir < 0 ? lineObj.text.length : 0;\n } else return (possible = false);\n } else ch = next;\n return true;\n }\n\n if (unit == \"char\") moveOnce();\n else if (unit == \"column\") moveOnce(true);\n else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) break;\n var cur = lineObj.text.charAt(ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) type = \"s\";\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce();}\n break;\n }\n\n if (type) sawType = type;\n if (dir > 0 && !moveOnce(!first)) break;\n }\n }\n var result = skipAtomic(doc, Pos(line, ch), origDir, true);\n if (!possible) result.hitSide = true;\n return result;\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n for (;;) {\n var target = coordsChar(cm, x, y);\n if (!target.outside) break;\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }\n y += dir * 5;\n }\n return target;\n }\n\n // Find the word at the given position (as returned by coordsChar).\n function findWordAt(cm, pos) {\n var doc = cm.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = cm.getHelper(pos, \"wordChars\");\n if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function(ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function(ch) {return /\\s/.test(ch);}\n : function(ch) {return !/\\s/.test(ch) && !isWordChar(ch);};\n while (start > 0 && check(line.charAt(start - 1))) --start;\n while (end < line.length && check(line.charAt(end))) ++end;\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end));\n }\n\n // EDITOR METHODS\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); focusInput(this); fastPoll(this);},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") return;\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n operation(this, optionHandlers[option])(this, value, old);\n },\n\n getOption: function(option) {return this.options[option];},\n getDoc: function() {return this.doc;},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](map);\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n if (maps[i] == map || (typeof maps[i] != \"string\" && maps[i].name == map)) {\n maps.splice(i, 1);\n return true;\n }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) throw new Error(\"Overlays may not be stateful.\");\n this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return;\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) dir = this.options.smartIndent ? \"smart\" : \"prev\";\n else dir = dir ? \"add\" : \"subtract\";\n }\n if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var start = Math.max(end, range.from().line);\n var to = range.to();\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n indentLine(this, j, how);\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) ensureCursorVisible(this);\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n var doc = this.doc;\n pos = clipPos(doc, pos);\n var state = getStateBefore(this, pos.line, precise), mode = this.doc.mode;\n var line = getLine(doc, pos.line);\n var stream = new StringStream(line.text, this.options.tabSize);\n while (stream.pos < pos.ch && !stream.eol()) {\n stream.start = stream.pos;\n var style = readToken(mode, stream, state);\n }\n return {start: stream.start,\n end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: state};\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) type = styles[2];\n else for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;\n else if (styles[mid * 2 + 1] < ch) before = mid + 1;\n else { type = styles[mid * 2 + 2]; break; }\n }\n var cut = type ? type.indexOf(\"cm-overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1);\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) return mode;\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0];\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) return helpers;\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) found.push(help[mode[type]]);\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) found.push(val);\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i = 0; i < help._global.length; i++) {\n var cur = help._global[i];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n found.push(cur.val);\n }\n return found;\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getStateBefore(this, line + 1, precise);\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) pos = range.head;\n else if (typeof start == \"object\") pos = clipPos(this.doc, start);\n else pos = start ? range.from() : range.to();\n return cursorCoords(this, pos, mode || \"page\");\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\");\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top);\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset);\n },\n heightAtLine: function(line, mode) {\n var end = false, last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) line = this.doc.first;\n else if (line > last) { line = last; end = true; }\n var lineObj = getLine(this.doc, line);\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\").top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0);\n },\n\n defaultTextHeight: function() { return textHeight(this.display); },\n defaultCharWidth: function() { return charWidth(this.display); },\n\n setGutterMarker: methodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function(line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) line.gutterMarkers = null;\n return true;\n });\n }),\n\n clearGutter: methodOp(function(gutterID) {\n var cm = this, doc = cm.doc, i = doc.first;\n doc.iter(function(line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n line.gutterMarkers[gutterID] = null;\n regLineChange(cm, i, \"gutter\");\n if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;\n }\n ++i;\n });\n }),\n\n addLineClass: methodOp(function(handle, where, cls) {\n return changeLine(this, handle, \"class\", function(line) {\n var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n if (!line[prop]) line[prop] = cls;\n else if (new RegExp(\"(?:^|\\\\s)\" + cls + \"(?:$|\\\\s)\").test(line[prop])) return false;\n else line[prop] += \" \" + cls;\n return true;\n });\n }),\n\n removeLineClass: methodOp(function(handle, where, cls) {\n return changeLine(this, handle, \"class\", function(line) {\n var prop = where == \"text\" ? \"textClass\" : where == \"background\" ? \"bgClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) return false;\n else if (cls == null) line[prop] = null;\n else {\n var found = cur.match(new RegExp(\"(?:^|\\\\s+)\" + cls + \"(?:$|\\\\s+)\"));\n if (!found) return false;\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true;\n });\n }),\n\n addLineWidget: methodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options);\n }),\n\n removeLineWidget: function(widget) { widget.clear(); },\n\n lineInfo: function(line) {\n if (typeof line == \"number\") {\n if (!isLine(this.doc, line)) return null;\n var n = line;\n line = getLine(this.doc, line);\n if (!line) return null;\n } else {\n var n = lineNo(line);\n if (n == null) return null;\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets};\n },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n top = pos.top - node.offsetHeight;\n else if (pos.bottom + node.offsetHeight <= vspace)\n top = pos.bottom;\n if (left + node.offsetWidth > hspace)\n left = hspace - node.offsetWidth;\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") left = 0;\n else if (horiz == \"middle\") left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n node.style.left = left + \"px\";\n }\n if (scroll)\n scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: methodOp(onKeyUp),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n return commands[cmd](this);\n },\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) break;\n }\n return cur;\n },\n\n moveH: methodOp(function(dir, unit) {\n var cm = this;\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually);\n else\n return dir < 0 ? range.from() : range.to();\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n doc.replaceSelection(\"\", null, \"+delete\");\n else\n deleteNearSelection(this, function(range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other};\n });\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) x = coords.left;\n else coords.left = x;\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) break;\n }\n return cur;\n },\n\n moveV: methodOp(function(dir, unit) {\n var cm = this, doc = this.doc, goals = [];\n var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function(range) {\n if (collapse)\n return dir < 0 ? range.from() : range.to();\n var headPos = cursorCoords(cm, range.head, \"div\");\n if (range.goalColumn != null) headPos.left = range.goalColumn;\n goals.push(headPos.left);\n var pos = findPosV(cm, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n addToScrollPos(cm, null, charCoords(cm, pos, \"div\").top - headPos.top);\n return pos;\n }, sel_move);\n if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++)\n doc.sel.ranges[i].goalColumn = goals[i];\n }),\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) return;\n if (this.state.overwrite = !this.state.overwrite)\n addClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n else\n rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return activeElt() == this.display.input; },\n\n scrollTo: methodOp(function(x, y) {\n if (x != null || y != null) resolveScrollToPos(this);\n if (x != null) this.curOp.scrollLeft = x;\n if (y != null) this.curOp.scrollTop = y;\n }),\n getScrollInfo: function() {\n var scroller = this.display.scroller, co = scrollerCutOff;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - co, width: scroller.scrollWidth - co,\n clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) margin = this.options.cursorScrollMargin;\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) range.to = range.from;\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n resolveScrollToPos(this);\n this.curOp.scrollToPos = range;\n } else {\n var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),\n Math.min(range.from.top, range.to.top) - range.margin,\n Math.max(range.from.right, range.to.right),\n Math.max(range.from.bottom, range.to.bottom) + range.margin);\n this.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n function interpret(val) {\n return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n }\n if (width != null) this.display.wrapper.style.width = interpret(width);\n if (height != null) this.display.wrapper.style.height = interpret(height);\n if (this.options.lineWrapping) clearLineMeasurementCache(this);\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f);},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n estimateLineHeights(this);\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n resetInput(this);\n this.scrollTo(doc.scrollLeft, doc.scrollTop);\n signalLater(this, \"swapDoc\", this, old);\n return old;\n }),\n\n getInputField: function(){return this.display.input;},\n getWrapperElement: function(){return this.display.wrapper;},\n getScrollerElement: function(){return this.display.scroller;},\n getGutterElement: function(){return this.display.gutters;}\n };\n eventMixin(CodeMirror);\n\n // OPTION DEFAULTS\n\n // The default configuration options.\n var defaults = CodeMirror.defaults = {};\n // Functions to run when options are changed.\n var optionHandlers = CodeMirror.optionHandlers = {};\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) optionHandlers[name] =\n notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;\n }\n\n // Passed to option handlers when there is no old value.\n var Init = CodeMirror.Init = {toString: function(){return \"CodeMirror.Init\";}};\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function(cm, val) {\n cm.setValue(val);\n }, true);\n option(\"mode\", null, function(cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function(cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n option(\"specialChars\", /[\\t\\u0000-\\u0019\\u00ad\\u200b\\u2028\\u2029\\ufeff]/g, function(cm, val) {\n cm.options.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n cm.refresh();\n }, true);\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true);\n option(\"electricChars\", true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function(cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", keyMapChanged);\n option(\"extraKeys\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function(cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function(cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, updateScrollbars, true);\n option(\"lineNumbers\", false, function(cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function(integer) {return integer;}, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n\n option(\"readOnly\", false, function(cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n cm.display.disabled = true;\n } else {\n cm.display.disabled = false;\n if (!val) resetInput(cm);\n }\n });\n option(\"disableInput\", false, function(cm, val) {if (!val) resetInput(cm);}, true);\n option(\"dragDrop\", true);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function(cm, val){cm.doc.history.undoDepth = val;});\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function(cm){cm.refresh();}, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function(cm, val) {\n if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0;\n });\n\n option(\"tabindex\", null, function(cm, val) {\n cm.display.input.tabIndex = val || \"\";\n });\n option(\"autofocus\", null);\n\n // MODE DEFINITION AND QUERYING\n\n // Known modes, by name and by MIME\n var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name, mode) {\n if (!CodeMirror.defaults.mode && name != \"null\") CodeMirror.defaults.mode = name;\n if (arguments.length > 2) {\n mode.dependencies = [];\n for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);\n }\n modes[name] = mode;\n };\n\n CodeMirror.defineMIME = function(mime, spec) {\n mimeModes[mime] = spec;\n };\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n CodeMirror.resolveMode = function(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") found = {name: found};\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return CodeMirror.resolveMode(\"application/xml\");\n }\n if (typeof spec == \"string\") return {name: spec};\n else return spec || {name: \"null\"};\n };\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n CodeMirror.getMode = function(options, spec) {\n var spec = CodeMirror.resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) return CodeMirror.getMode(options, \"text/plain\");\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) continue;\n if (modeObj.hasOwnProperty(prop)) modeObj[\"_\" + prop] = modeObj[prop];\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) modeObj.helperType = spec.helperType;\n if (spec.modeProps) for (var prop in spec.modeProps)\n modeObj[prop] = spec.modeProps[prop];\n\n return modeObj;\n };\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function() {\n return {token: function(stream) {stream.skipToEnd();}};\n });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = CodeMirror.modeExtensions = {};\n CodeMirror.extendMode = function(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n };\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function(name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function(name, func) {\n Doc.prototype[name] = func;\n };\n CodeMirror.defineOption = option;\n\n var initHooks = [];\n CodeMirror.defineInitHook = function(f) {initHooks.push(f);};\n\n var helpers = CodeMirror.helpers = {};\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []};\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n\n // MODE STATE HANDLING\n\n // Utility functions for working with state. Exported because nested\n // modes need to do this for their inner modes.\n\n var copyState = CodeMirror.copyState = function(mode, state) {\n if (state === true) return state;\n if (mode.copyState) return mode.copyState(state);\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) val = val.concat([]);\n nstate[n] = val;\n }\n return nstate;\n };\n\n var startState = CodeMirror.startState = function(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true;\n };\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n CodeMirror.innerMode = function(mode, state) {\n while (mode.innerMode) {\n var info = mode.innerMode(state);\n if (!info || info.mode == mode) break;\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state};\n };\n\n // STANDARD COMMANDS\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = CodeMirror.commands = {\n selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);},\n singleSelection: function(cm) {\n cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll);\n },\n killLine: function(cm) {\n deleteNearSelection(cm, function(range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n return {from: range.head, to: Pos(range.head.line + 1, 0)};\n else\n return {from: range.head, to: Pos(range.head.line, len)};\n } else {\n return {from: range.from(), to: range.to()};\n }\n });\n },\n deleteLine: function(cm) {\n deleteNearSelection(cm, function(range) {\n return {from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))};\n });\n },\n delLineLeft: function(cm) {\n deleteNearSelection(cm, function(range) {\n return {from: Pos(range.from().line, 0), to: range.from()};\n });\n },\n undo: function(cm) {cm.undo();},\n redo: function(cm) {cm.redo();},\n undoSelection: function(cm) {cm.undoSelection();},\n redoSelection: function(cm) {cm.redoSelection();},\n goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},\n goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},\n goLineStart: function(cm) {\n cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, sel_move);\n },\n goLineStartSmart: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var start = lineStart(cm, range.head.line);\n var line = cm.getLineHandle(start.line);\n var order = getOrder(line);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = range.head.line == start.line && range.head.ch <= firstNonWS && range.head.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS);\n }\n return start;\n }, sel_move);\n },\n goLineEnd: function(cm) {\n cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, sel_move);\n },\n goLineRight: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n }, sel_move);\n },\n goLineLeft: function(cm) {\n cm.extendSelectionsBy(function(range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\");\n }, sel_move);\n },\n goLineUp: function(cm) {cm.moveV(-1, \"line\");},\n goLineDown: function(cm) {cm.moveV(1, \"line\");},\n goPageUp: function(cm) {cm.moveV(-1, \"page\");},\n goPageDown: function(cm) {cm.moveV(1, \"page\");},\n goCharLeft: function(cm) {cm.moveH(-1, \"char\");},\n goCharRight: function(cm) {cm.moveH(1, \"char\");},\n goColumnLeft: function(cm) {cm.moveH(-1, \"column\");},\n goColumnRight: function(cm) {cm.moveH(1, \"column\");},\n goWordLeft: function(cm) {cm.moveH(-1, \"word\");},\n goGroupRight: function(cm) {cm.moveH(1, \"group\");},\n goGroupLeft: function(cm) {cm.moveH(-1, \"group\");},\n goWordRight: function(cm) {cm.moveH(1, \"word\");},\n delCharBefore: function(cm) {cm.deleteH(-1, \"char\");},\n delCharAfter: function(cm) {cm.deleteH(1, \"char\");},\n delWordBefore: function(cm) {cm.deleteH(-1, \"word\");},\n delWordAfter: function(cm) {cm.deleteH(1, \"word\");},\n delGroupBefore: function(cm) {cm.deleteH(-1, \"group\");},\n delGroupAfter: function(cm) {cm.deleteH(1, \"group\");},\n indentAuto: function(cm) {cm.indentSelection(\"smart\");},\n indentMore: function(cm) {cm.indentSelection(\"add\");},\n indentLess: function(cm) {cm.indentSelection(\"subtract\");},\n insertTab: function(cm) {cm.replaceSelection(\"\\t\");},\n insertSoftTab: function(cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(new Array(tabSize - col % tabSize + 1).join(\" \"));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function(cm) {\n if (cm.somethingSelected()) cm.indentSelection(\"add\");\n else cm.execCommand(\"insertTab\");\n },\n transposeChars: function(cm) {\n runInOp(cm, function() {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1);\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev)\n cm.replaceRange(line.charAt(0) + \"\\n\" + prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), \"+transpose\");\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n });\n },\n newlineAndIndent: function(cm) {\n runInOp(cm, function() {\n var len = cm.listSelections().length;\n for (var i = 0; i < len; i++) {\n var range = cm.listSelections()[i];\n cm.replaceRange(\"\\n\", range.anchor, range.head, \"+input\");\n cm.indentLine(range.from().line + 1, null, true);\n ensureCursorVisible(cm);\n }\n });\n },\n toggleOverwrite: function(cm) {cm.toggleOverwrite();}\n };\n\n // STANDARD KEYMAPS\n\n var keyMap = CodeMirror.keyMap = {};\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Down\": \"goDocEnd\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n fallthrough: \"basic\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineStart\", \"Cmd-Right\": \"goLineEnd\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delLineLeft\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\",\n fallthrough: [\"basic\", \"emacsy\"]\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\"\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function getKeyMap(val) {\n if (typeof val == \"string\") return keyMap[val];\n else return val;\n }\n\n // Given an array of keymaps and a key name, call handle on any\n // bindings found, until that returns a truthy value, at which point\n // we consider the key handled. Implements things like binding a key\n // to false stopping further handling and keymap fallthrough.\n var lookupKey = CodeMirror.lookupKey = function(name, maps, handle) {\n function lookup(map) {\n map = getKeyMap(map);\n var found = map[name];\n if (found === false) return \"stop\";\n if (found != null && handle(found)) return true;\n if (map.nofallthrough) return \"stop\";\n\n var fallthrough = map.fallthrough;\n if (fallthrough == null) return false;\n if (Object.prototype.toString.call(fallthrough) != \"[object Array]\")\n return lookup(fallthrough);\n for (var i = 0; i < fallthrough.length; ++i) {\n var done = lookup(fallthrough[i]);\n if (done) return done;\n }\n return false;\n }\n\n for (var i = 0; i < maps.length; ++i) {\n var done = lookup(maps[i]);\n if (done) return done != \"stop\";\n }\n };\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n var isModifierKey = CodeMirror.isModifierKey = function(event) {\n var name = keyNames[event.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\";\n };\n\n // Look up the name of a key as indicated by an event object.\n var keyName = CodeMirror.keyName = function(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) return false;\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) return false;\n if (event.altKey) name = \"Alt-\" + name;\n if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = \"Ctrl-\" + name;\n if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = \"Cmd-\" + name;\n if (!noShift && event.shiftKey) name = \"Shift-\" + name;\n return name;\n };\n\n // FROMTEXTAREA\n\n CodeMirror.fromTextArea = function(textarea, options) {\n if (!options) options = {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabindex)\n options.tabindex = textarea.tabindex;\n if (!options.placeholder && textarea.placeholder)\n options.placeholder = textarea.placeholder;\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form, realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function() {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function(node) {\n textarea.parentNode.insertBefore(node, textarea.nextSibling);\n }, options);\n cm.save = save;\n cm.getTextArea = function() { return textarea; };\n cm.toTextArea = function() {\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n textarea.form.submit = realSubmit;\n }\n };\n return cm;\n };\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = CodeMirror.StringStream = function(string, tabSize) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n };\n\n StringStream.prototype = {\n eol: function() {return this.pos >= this.string.length;},\n sol: function() {return this.pos == this.lineStart;},\n peek: function() {return this.string.charAt(this.pos) || undefined;},\n next: function() {\n if (this.pos < this.string.length)\n return this.string.charAt(this.pos++);\n },\n eat: function(match) {\n var ch = this.string.charAt(this.pos);\n if (typeof match == \"string\") var ok = ch == match;\n else var ok = ch && (match.test ? match.test(ch) : match(ch));\n if (ok) {++this.pos; return ch;}\n },\n eatWhile: function(match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start;\n },\n eatSpace: function() {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;\n return this.pos > start;\n },\n skipToEnd: function() {this.pos = this.string.length;},\n skipTo: function(ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true;}\n },\n backUp: function(n) {this.pos -= n;},\n column: function() {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);\n },\n indentation: function() {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0);\n },\n match: function(pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) this.pos += pattern.length;\n return true;\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) return null;\n if (match && consume !== false) this.pos += match[0].length;\n return match;\n }\n },\n current: function(){return this.string.slice(this.start, this.pos);},\n hideFirstChars: function(n, inner) {\n this.lineStart += n;\n try { return inner(); }\n finally { this.lineStart -= n; }\n }\n };\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n var TextMarker = CodeMirror.TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n };\n eventMixin(TextMarker);\n\n // Clear the marker.\n TextMarker.prototype.clear = function() {\n if (this.explicitlyCleared) return;\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) startOperation(cm);\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) signalLater(this, \"clear\", found.from, found.to);\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) regLineChange(cm, lineNo(line), \"text\");\n else if (cm) {\n if (span.to != null) max = lineNo(line);\n if (span.from != null) min = lineNo(line);\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n updateLineHeight(line, textHeight(cm.display));\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {\n var visual = visualLine(this.lines[i]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n }\n\n if (min != null && cm && this.collapsed) regChange(cm, min, max + 1);\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) reCheckSelection(cm.doc);\n }\n if (cm) signalLater(cm, \"markerCleared\", cm, this);\n if (withOp) endOperation(cm);\n if (this.parent) this.parent.clear();\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function(side, lineObj) {\n if (side == null && this.type == \"bookmark\") side = 1;\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) return from;\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) return to;\n }\n }\n return from && {from: from, to: to};\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function() {\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) return;\n runInOp(cm, function() {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n updateLineHeight(line, line.height + dHeight);\n }\n });\n };\n\n TextMarker.prototype.attachLine = function(line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);\n }\n this.lines.push(line);\n };\n TextMarker.prototype.detachLine = function(line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) return markTextShared(doc, from, to, options, type);\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) copyObj(options, marker, false);\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n return marker;\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = elt(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) marker.widgetNode.ignoreEvents = true;\n if (options.insertLeft) marker.widgetNode.insertLeft = true;\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n throw new Error(\"Inserting collapsed marker partially overlapping an existing one\");\n sawCollapsedSpans = true;\n }\n\n if (marker.addToHistory)\n addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN);\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function(line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n updateMaxLine = true;\n if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0);\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {\n if (lineIsHidden(doc, line)) updateLineHeight(line, 0);\n });\n\n if (marker.clearOnEnter) on(marker, \"beforeCursorEnter\", function() { marker.clear(); });\n\n if (marker.readOnly) {\n sawReadOnlySpans = true;\n if (doc.history.done.length || doc.history.undone.length)\n doc.clearHistory();\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) cm.curOp.updateMaxLine = true;\n if (marker.collapsed)\n regChange(cm, from.line, to.line + 1);\n else if (marker.className || marker.title || marker.startStyle || marker.endStyle)\n for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, \"text\");\n if (marker.atomic) reCheckSelection(cm.doc);\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker;\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n markers[i].parent = this;\n };\n eventMixin(SharedTextMarker);\n\n SharedTextMarker.prototype.clear = function() {\n if (this.explicitlyCleared) return;\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n this.markers[i].clear();\n signalLater(this, \"clear\");\n };\n SharedTextMarker.prototype.find = function(side, lineObj) {\n return this.primary.find(side, lineObj);\n };\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function(doc) {\n if (widget) options.widgetNode = widget.cloneNode(true);\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n if (doc.linked[i].isParent) return;\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary);\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())),\n function(m) { return m.parent; });\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], linked = [marker.primary.doc];;\n linkedDocs(marker.primary.doc, function(d) { linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n }\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n if (old) for (var i = 0, nw; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);\n (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n }\n return nw;\n }\n function markedSpansAfter(old, endCh, isInsert) {\n if (old) for (var i = 0, nw; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);\n (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n }\n return nw;\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.attachLine(line);\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) || extraRight(sp.marker) - extraLeft(marker)) > 0 ||\n fromCmp >= 0 && (cmp(found.from, to) || extraLeft(sp.marker) - extraRight(marker)) < 0)\n return true;\n }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker));\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n return true;\n for (var sp, i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) return true;\n }\n }\n\n // LINE WIDGETS\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = CodeMirror.LineWidget = function(cm, node, options) {\n if (options) for (var opt in options) if (options.hasOwnProperty(opt))\n this[opt] = options[opt];\n this.cm = cm;\n this.node = node;\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n addToScrollPos(cm, null, diff);\n }\n\n LineWidget.prototype.clear = function() {\n var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) return;\n for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);\n if (!ws.length) line.widgets = null;\n var height = widgetHeight(this);\n runInOp(cm, function() {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n updateLineHeight(line, Math.max(0, line.height - height));\n });\n };\n LineWidget.prototype.changed = function() {\n var oldH = this.height, cm = this.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) return;\n runInOp(cm, function() {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n updateLineHeight(line, line.height + diff);\n });\n };\n\n function widgetHeight(widget) {\n if (widget.height != null) return widget.height;\n if (!contains(document.body, widget.node))\n removeChildrenAndAdd(widget.cm.display.measure, elt(\"div\", [widget.node], null, \"position: relative\"));\n return widget.height = widget.node.offsetHeight;\n }\n\n function addLineWidget(cm, handle, node, options) {\n var widget = new LineWidget(cm, node, options);\n if (widget.noHScroll) cm.display.alignWidgets = true;\n changeLine(cm, handle, \"widget\", function(line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) widgets.push(widget);\n else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget);\n widget.line = line;\n if (!lineIsHidden(cm.doc, line)) {\n var aboveVisible = heightAtLine(line) < cm.doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) addToScrollPos(cm, null, widget.height);\n cm.curOp.forceUpdate = true;\n }\n return true;\n });\n return widget;\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n eventMixin(Line);\n Line.prototype.lineNo = function() { return lineNo(this); };\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n function extractLineClasses(type, output) {\n if (type) for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) break;\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n output[prop] = lineClass[2];\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n output[prop] += \" \" + lineClass[2];\n }\n return type;\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) return mode.blankLine(state);\n if (!mode.innerMode) return;\n var inner = CodeMirror.innerMode(mode, state);\n if (inner.mode.blankLine) return inner.mode.blankLine(inner.state);\n }\n\n function readToken(mode, stream, state) {\n for (var i = 0; i < 10; i++) {\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) return style;\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\");\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state), lineClasses);\n }\n if (cm.options.addModeClass) {\n var mName = CodeMirror.innerMode(mode, state).mode.name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }\n\n function getLineStyles(cm, line) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));\n line.styles = result.styles;\n if (result.classes) line.styleClasses = result.classes;\n else if (line.styleClasses) line.styleClasses = null;\n }\n return line.styles;\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) return null;\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"));\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n return builder;\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n return token;\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, title) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie_upto8) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie_upto8) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie_upto8) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }\n\n function buildTokenSplitSpaces(inner) {\n function split(old) {\n var out = \" \";\n for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? \" \" : \"\\u00a0\";\n out += \" \";\n return out;\n }\n return function(builder, text, style, startStyle, endStyle, title) {\n inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title);\n };\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function(builder, text, style, startStyle, endStyle, title) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n for (var i = 0; i < order.length; i++) {\n var part = order[i];\n if (part.to > start && part.from <= start) break;\n }\n if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title);\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, title);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n };\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) {\n builder.map.push(builder.pos, builder.pos + size, widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null;}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n for (var i = 0, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) doc.remove(from.line, nlines);\n if (added.length) doc.insert(from.line, added);\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n for (var added = [], i = 1; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n for (var i = 1, added = []; i < text.length - 1; ++i)\n added.push(new Line(text[i], spansFor(i), estimateHeight));\n if (nlines > 1) doc.remove(from.line + 1, nlines - 1);\n doc.insert(from.line + 1, added);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n for (var i = 0, height = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length; },\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) lines[i].parent = this;\n },\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n if (op(this.lines[at])) return true;\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size; },\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) break;\n at = 0;\n } else at -= sz;\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines);\n },\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n while (child.lines.length > 50) {\n var spilled = child.lines.splice(child.lines.length - 25, 25);\n var newleaf = new LeafChunk(spilled);\n child.height -= newleaf.height;\n this.children.splice(i + 1, 0, newleaf);\n newleaf.parent = this;\n }\n this.maybeSpill();\n }\n break;\n }\n at -= sz;\n }\n },\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) return;\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10);\n me.parent.maybeSpill();\n },\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) return true;\n if ((n -= used) == 0) break;\n at = 0;\n } else at -= sz;\n }\n }\n };\n\n var nextDocId = 0;\n var Doc = CodeMirror.Doc = function(text, mode, firstLine) {\n if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);\n if (firstLine == null) firstLine = 0;\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.frontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n\n if (typeof text == \"string\") text = splitLines(text);\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) this.iterN(from - this.first, to - from, op);\n else this.iterN(this.first, this.first + this.size, from);\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) height += lines[i].height;\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) return lines;\n return lines.join(lineSep || \"\\n\");\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: splitLines(code), origin: \"setValue\"}, true);\n setSelection(this, simpleSelection(top));\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) return lines;\n return lines.join(lineSep || \"\\n\");\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},\n\n getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},\n getLineNumber: function(line) {return lineNo(line);},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") line = getLine(this, line);\n return visualLine(line);\n },\n\n lineCount: function() {return this.size;},\n firstLine: function() {return this.first;},\n lastLine: function() {return this.first + this.size - 1;},\n\n clipPos: function(pos) {return clipPos(this, pos);},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") pos = range.head;\n else if (start == \"anchor\") pos = range.anchor;\n else if (start == \"end\" || start == \"to\" || start === false) pos = range.to();\n else pos = range.from();\n return pos;\n },\n listSelections: function() { return this.sel.ranges; },\n somethingSelected: function() {return this.sel.somethingSelected();},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads, options));\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n extendSelections(this, map(this.sel.ranges, f), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) return;\n for (var i = 0, out = []; i < ranges.length; i++)\n out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head));\n if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex);\n setSelection(this, normalizeSelection(out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) return lines;\n else return lines.join(lineSep || \"\\n\");\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) sel = sel.join(lineSep || \"\\n\");\n parts[i] = sel;\n }\n return parts;\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n dup[i] = code;\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i = changes.length - 1; i >= 0; i--)\n makeChange(this, changes[i]);\n if (newSel) setSelectionReplaceHistory(this, newSel);\n else if (this.cm) ensureCursorVisible(this.cm);\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend;},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done;\n for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone;\n return {undo: done, redo: undone};\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n this.history.lastOp = this.history.lastOrigin = null;\n return this.history.generation;\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration);\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)};\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, \"range\");\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\");\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n markers.push(span.marker.parent || span.marker);\n }\n return markers;\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function(line) {\n var spans = line.markedSpans;\n if (spans) for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(lineNo == from.line && from.ch > span.to ||\n span.from == null && lineNo != from.line||\n lineNo == to.line && span.from > to.ch) &&\n (!filter || filter(span.marker)))\n found.push(span.marker.parent || span.marker);\n }\n ++lineNo;\n });\n return found;\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function(line) {\n var sps = line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i)\n if (sps[i].from != null) markers.push(sps[i].marker);\n });\n return markers;\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first;\n this.iter(function(line) {\n var sz = line.text.length + 1;\n if (sz > off) { ch = off; return true; }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch));\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) return 0;\n this.iter(this.first, coords.line, function (line) {\n index += line.text.length + 1;\n });\n return index;\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc;\n },\n\n linkedDoc: function(options) {\n if (!options) options = {};\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) from = options.from;\n if (options.to != null && options.to < to) to = options.to;\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from);\n if (options.sharedHist) copy.history = this.history;\n (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy;\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) other = other.doc;\n if (this.linked) for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) continue;\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break;\n }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode;},\n getEditor: function() {return this.cm;}\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor\".split(\" \");\n for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments);};\n })(Doc.prototype[prop]);\n\n eventMixin(Doc);\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) continue;\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) continue;\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) throw new Error(\"This document is already in use.\");\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n if (!cm.options.lineWrapping) findMaxLine(cm);\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n // LINE UTILITIES\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\");\n for (var chunk = doc; !chunk.lines;) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break; }\n n -= sz;\n }\n }\n return chunk.lines[n];\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function(line) {\n var text = line.text;\n if (n == end.line) text = text.slice(0, end.ch);\n if (n == start.line) text = text.slice(start.ch);\n out.push(text);\n ++n;\n });\n return out;\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function(line) { out.push(line.text); });\n return out;\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) return null;\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) break;\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first;\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i = 0; i < chunk.children.length; ++i) {\n var child = chunk.children[i], ch = child.height;\n if (h < ch) { chunk = child; continue outer; }\n h -= ch;\n n += child.chunkSize();\n }\n return n;\n } while (!chunk.lines);\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) break;\n h -= lh;\n }\n return n + i;\n }\n\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }\n\n // HISTORY\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);\n return histChange;\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) array.pop();\n else break;\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done);\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done);\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done);\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, ore are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n var last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n pushSelectionToHistory(doc.sel, hist.done);\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) hist.done.shift();\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) signal(doc, \"historyAdded\");\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500);\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n hist.done[hist.done.length - 1] = sel;\n else\n pushSelectionToHistory(sel, hist.done);\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastOp = opId;\n if (options && options.clearRedo !== false)\n clearSelectionEvents(hist.undone);\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n dest.push(sel);\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {\n if (line.markedSpans)\n (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans;\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n for (var i = 0, copy = []; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue;\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m;\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n }\n }\n }\n return copy;\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue;\n }\n for (var j = 0; j < sub.changes.length; ++j) {\n var cur = sub.changes[j];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break;\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // EVENT UTILITIES\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n var e_preventDefault = CodeMirror.e_preventDefault = function(e) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n };\n var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) {\n if (e.stopPropagation) e.stopPropagation();\n else e.cancelBubble = true;\n };\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;\n }\n var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);};\n\n function e_target(e) {return e.target || e.srcElement;}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) b = 1;\n else if (e.button & 2) b = 3;\n else if (e.button & 4) b = 2;\n }\n if (mac && e.ctrlKey && b == 1) b = 3;\n return b;\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var on = CodeMirror.on = function(emitter, type, f) {\n if (emitter.addEventListener)\n emitter.addEventListener(type, f, false);\n else if (emitter.attachEvent)\n emitter.attachEvent(\"on\" + type, f);\n else {\n var map = emitter._handlers || (emitter._handlers = {});\n var arr = map[type] || (map[type] = []);\n arr.push(f);\n }\n };\n\n var off = CodeMirror.off = function(emitter, type, f) {\n if (emitter.removeEventListener)\n emitter.removeEventListener(type, f, false);\n else if (emitter.detachEvent)\n emitter.detachEvent(\"on\" + type, f);\n else {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n for (var i = 0; i < arr.length; ++i)\n if (arr[i] == f) { arr.splice(i, 1); break; }\n }\n };\n\n var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);\n };\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n var delayedCallbacks, delayedCallbackDepth = 0;\n function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2);\n if (!delayedCallbacks) {\n ++delayedCallbackDepth;\n delayedCallbacks = [];\n setTimeout(fireDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n delayedCallbacks.push(bnd(arr[i]));\n }\n\n function fireDelayed() {\n --delayedCallbackDepth;\n var delayed = delayedCallbacks;\n delayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) delayed[i]();\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) return;\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1)\n set.push(arr[i]);\n }\n\n function hasHandler(emitter, type) {\n var arr = emitter._handlers && emitter._handlers[type];\n return arr && arr.length > 0;\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // MISC UTILITIES\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerCutOff = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = CodeMirror.Pass = {toString: function(){return \"CodeMirror.Pass\";}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n function Delayed() {this.id = null;}\n Delayed.prototype.set = function(ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) end = string.length;\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n return n + (end - i);\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n };\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) nextTab = string.length;\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n return pos + Math.min(skipped, goal - col);\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) return pos;\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n spaceStrs.push(lst(spaceStrs) + \" \");\n return spaceStrs[n];\n }\n\n function lst(arr) { return arr[arr.length-1]; }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; };\n else if (ie) // Suppress mysterious IE10 errors\n selectInput = function(node) { try { node.select(); } catch(_e) {} };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n if (array[i] == elt) return i;\n return -1;\n }\n if ([].indexOf) indexOf = function(array, elt) { return array.indexOf(elt); };\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) out[i] = f(array[i], i);\n return out;\n }\n if ([].map) map = function(array, f) { return array.map(f); };\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n var ctor = function() {};\n ctor.prototype = base;\n inst = new ctor();\n }\n if (props) copyObj(props, inst);\n return inst;\n };\n\n function copyObj(obj, target, overwrite) {\n if (!target) target = {};\n for (var prop in obj)\n if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n target[prop] = obj[prop];\n return target;\n }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args);};\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n var isWordCharBasic = CodeMirror.isWordChar = function(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));\n };\n function isWordChar(ch, helper) {\n if (!helper) return isWordCharBasic(ch);\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) return true;\n return helper.test(ch);\n }\n\n function isEmpty(obj) {\n for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;\n return true;\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); }\n\n // DOM UTILITIES\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) e.className = className;\n if (style) e.style.cssText = style;\n if (typeof content == \"string\") e.appendChild(document.createTextNode(content));\n else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);\n return e;\n }\n\n var range;\n if (document.createRange) range = function(node, start, end) {\n var r = document.createRange();\n r.setEnd(node, end);\n r.setStart(node, start);\n return r;\n };\n else range = function(node, start, end) {\n var r = document.body.createTextRange();\n r.moveToElementText(node.parentNode);\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r;\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n e.removeChild(e.firstChild);\n return e;\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e);\n }\n\n function contains(parent, child) {\n if (parent.contains)\n return parent.contains(child);\n while (child = child.parentNode)\n if (child == parent) return true;\n }\n\n function activeElt() { return document.activeElement; }\n // Older versions of IE throws unspecified error when touching\n // document.activeElement in some cases (during loading, in iframe)\n if (ie_upto10) activeElt = function() {\n try { return document.activeElement; }\n catch(e) { return document.body; }\n };\n\n function classTest(cls) { return new RegExp(\"\\\\b\" + cls + \"\\\\b\\\\s*\"); }\n function rmClass(node, cls) {\n var test = classTest(cls);\n if (test.test(node.className)) node.className = node.className.replace(test, \"\");\n }\n function addClass(node, cls) {\n if (!classTest(cls).test(node.className)) node.className += \" \" + cls;\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n if (as[i] && !classTest(as[i]).test(b)) b += \" \" + as[i];\n return b;\n }\n\n // WINDOW-WIDE EVENTS\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.body.getElementsByClassName) return;\n var byClass = document.body.getElementsByClassName(\"CodeMirror\");\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) f(cm);\n }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) return;\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function() {\n if (resizeTimer == null) resizeTimer = setTimeout(function() {\n resizeTimer = null;\n knownScrollbarWidth = null;\n forEachCodeMirror(onResize);\n }, 100);\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function() {\n forEachCodeMirror(onBlur);\n });\n }\n\n // FEATURE DETECTION\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie_upto8) return false;\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div;\n }();\n\n var knownScrollbarWidth;\n function scrollbarWidth(measure) {\n if (knownScrollbarWidth != null) return knownScrollbarWidth;\n var test = elt(\"div\", null, null, \"width: 50px; height: 50px; overflow-x: scroll\");\n removeChildrenAndAdd(measure, test);\n if (test.offsetWidth)\n knownScrollbarWidth = test.offsetHeight - test.clientHeight;\n return knownScrollbarWidth || 0;\n }\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_upto7;\n }\n if (zwspSupported) return elt(\"span\", \"\\u200b\");\n else return elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) return badBidiRects;\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n if (r0.left == r0.right) return false;\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n return badBidiRects = (r1.right - r0.right < 3);\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLines = CodeMirror.splitLines = \"\\n\\nb\".split(/\\n/).length != 3 ? function(string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) nl = string.length;\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result;\n } : function(string){return string.split(/\\r\\n?|\\n/);};\n\n var hasSelection = window.getSelection ? function(te) {\n try { return te.selectionStart != te.selectionEnd; }\n catch(e) { return false; }\n } : function(te) {\n try {var range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) return false;\n return range.compareEndPoints(\"StartToEnd\", range) != 0;\n };\n\n var hasCopyEvent = (function() {\n var e = elt(\"div\");\n if (\"oncopy\" in e) return true;\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\";\n })();\n\n // KEY NAMES\n\n var keyNames = {3: \"Enter\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\", 107: \"=\", 109: \"-\", 127: \"Delete\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"};\n CodeMirror.keyNames = keyNames;\n (function() {\n // Number keys\n for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i);\n // Alphabetic keys\n for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);\n // Function keys\n for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = \"F\" + i;\n })();\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) return f(from, to, \"ltr\");\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\");\n found = true;\n }\n }\n if (!found) f(from, to, \"ltr\");\n }\n\n function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }\n function bidiRight(part) { return part.level % 2 ? part.from : part.to; }\n\n function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }\n function lineRight(line) {\n var order = getOrder(line);\n if (!order) return line.text.length;\n return bidiRight(lst(order));\n }\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) lineN = lineNo(visual);\n var order = getOrder(visual);\n var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);\n return Pos(lineN, ch);\n }\n function lineEnd(cm, lineN) {\n var merged, line = getLine(cm.doc, lineN);\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n lineN = null;\n }\n var order = getOrder(line);\n var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);\n return Pos(lineN == null ? lineNo(line) : lineN, ch);\n }\n\n function compareBidiLevel(order, a, b) {\n var linedir = order[0].level;\n if (a == linedir) return true;\n if (b == linedir) return false;\n return a < b;\n }\n var bidiOther;\n function getBidiPartAt(order, pos) {\n bidiOther = null;\n for (var i = 0, found; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < pos && cur.to > pos) return i;\n if ((cur.from == pos || cur.to == pos)) {\n if (found == null) {\n found = i;\n } else if (compareBidiLevel(order, cur.level, order[found].level)) {\n if (cur.from != cur.to) bidiOther = found;\n return i;\n } else {\n if (cur.from != cur.to) bidiOther = i;\n return found;\n }\n }\n }\n return found;\n }\n\n function moveInLine(line, pos, dir, byUnit) {\n if (!byUnit) return pos + dir;\n do pos += dir;\n while (pos > 0 && isExtendingChar(line.text.charAt(pos)));\n return pos;\n }\n\n // This is needed in order to move 'visually' through bi-directional\n // text -- i.e., pressing left should make the cursor go left, even\n // when in RTL text. The tricky part is the 'jumps', where RTL and\n // LTR text touch each other. This often requires the cursor offset\n // to move more than one unit, in order to visually move one unit.\n function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }\n\n function moveLogically(line, start, dir, byUnit) {\n var target = start + dir;\n if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir;\n return target < 0 || target > line.text.length ? null : target;\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6ff\n var arabicTypes = \"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm\";\n function charType(code) {\n if (code <= 0xf7) return lowTypes.charAt(code);\n else if (0x590 <= code && code <= 0x5f4) return \"R\";\n else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600);\n else if (0x6ee <= code && code <= 0x8ac) return \"r\";\n else if (0x2000 <= code && code <= 0x200b) return \"w\";\n else if (code == 0x200c) return \"b\";\n else return \"L\";\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n // Browsers seem to always treat the boundaries of block elements as being L.\n var outerType = \"L\";\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str) {\n if (!bidiRE.test(str)) return false;\n var len = str.length, types = [];\n for (var i = 0, type; i < len; ++i)\n types.push(type = charType(str.charCodeAt(i)));\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i = 0, prev = outerType; i < len; ++i) {\n var type = types[i];\n if (type == \"m\") types[i] = prev;\n else prev = type;\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i = 0, cur = outerType; i < len; ++i) {\n var type = types[i];\n if (type == \"1\" && cur == \"r\") types[i] = \"n\";\n else if (isStrong.test(type)) { cur = type; if (type == \"r\") types[i] = \"R\"; }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i = 1, prev = types[0]; i < len - 1; ++i) {\n var type = types[i];\n if (type == \"+\" && prev == \"1\" && types[i+1] == \"1\") types[i] = \"1\";\n else if (type == \",\" && prev == types[i+1] &&\n (prev == \"1\" || prev == \"n\")) types[i] = prev;\n prev = type;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i = 0; i < len; ++i) {\n var type = types[i];\n if (type == \",\") types[i] = \"N\";\n else if (type == \"%\") {\n for (var end = i + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i && types[i-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i; j < end; ++j) types[j] = replace;\n i = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i = 0, cur = outerType; i < len; ++i) {\n var type = types[i];\n if (cur == \"L\" && type == \"1\") types[i] = \"L\";\n else if (isStrong.test(type)) cur = type;\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i = 0; i < len; ++i) {\n if (isNeutral.test(types[i])) {\n for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}\n var before = (i ? types[i-1] : outerType) == \"L\";\n var after = (end < len ? types[end] : outerType) == \"L\";\n var replace = before || after ? \"L\" : \"R\";\n for (var j = i; j < end; ++j) types[j] = replace;\n i = end - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i = 0; i < len;) {\n if (countsAsLeft.test(types[i])) {\n var start = i;\n for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}\n order.push(new BidiSpan(0, start, i));\n } else {\n var pos = i, at = order.length;\n for (++i; i < len && types[i] != \"L\"; ++i) {}\n for (var j = pos; j < i;) {\n if (countsAsNum.test(types[j])) {\n if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j));\n var nstart = j;\n for (++j; j < i && countsAsNum.test(types[j]); ++j) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j));\n pos = j;\n } else ++j;\n }\n if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i));\n }\n }\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n if (order[0].level != lst(order).level)\n order.push(new BidiSpan(order[0].level, len, len));\n\n return order;\n };\n })();\n\n // THE END\n\n CodeMirror.version = \"4.1.1\";\n\n return CodeMirror;\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/lib/codemirror.css": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/codemirror/lib/codemirror.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": "/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n}\n.CodeMirror-scroll {\n /* Set scrolling behaviour here */\n overflow: auto;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n/* CURSOR */\n\n.CodeMirror div.CodeMirror-cursor {\n border-left: 1px solid black;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {\n width: auto;\n border: 0;\n background: #7e7;\n}\n/* Can style cursor different in overwrite (non-insert) mode */\ndiv.CodeMirror-overwrite div.CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; }\n\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3 {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n line-height: 1;\n position: relative;\n overflow: hidden;\n background: white;\n color: black;\n}\n\n.CodeMirror-scroll {\n /* 30px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -30px; margin-right: -30px;\n padding-bottom: 30px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 30px solid transparent;\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actuall scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n padding-bottom: 30px;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n padding-bottom: 30px;\n margin-bottom: -32px;\n display: inline-block;\n /* Hack to make IE7 behave */\n *zoom:1;\n *display:inline;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n\n.CodeMirror-lines {\n cursor: text;\n}\n.CodeMirror pre {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n}\n.CodeMirror-wrap pre {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n overflow: auto;\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-wrap .CodeMirror-scroll {\n overflow-x: hidden;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n.CodeMirror-measure pre { position: static; }\n\n.CodeMirror div.CodeMirror-cursor {\n position: absolute;\n border-right: none;\n width: 0;\n}\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 1;\n}\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n\n.cm-searching {\n background: #ffa;\n background: rgba(255, 255, 0, .4);\n}\n\n/* IE7 hack to prevent it from returning funny offsetTops on the spans */\n.CodeMirror span { *vertical-align: text-bottom; }\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n"
},
"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.css": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": ".CodeMirror-dialog {\n position: absolute;\n left: 0; right: 0;\n background: white;\n z-index: 15;\n padding: .1em .8em;\n overflow: hidden;\n color: #333;\n}\n\n.CodeMirror-dialog-top {\n border-bottom: 1px solid #eee;\n top: 0;\n}\n\n.CodeMirror-dialog-bottom {\n border-top: 1px solid #eee;\n bottom: 0;\n}\n\n.CodeMirror-dialog input {\n border: none;\n outline: none;\n background: transparent;\n width: 20em;\n color: inherit;\n font-family: monospace;\n}\n\n.CodeMirror-dialog button {\n font-size: 70%;\n}\n"
},
"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js",
"module-type": "library",
"text": "// Open simple dialogs on top of an editor. Relies on dialog.css.\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n function dialogDiv(cm, template, bottom) {\n var wrap = cm.getWrapperElement();\n var dialog;\n dialog = wrap.appendChild(document.createElement(\"div\"));\n if (bottom) {\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-bottom\";\n } else {\n dialog.className = \"CodeMirror-dialog CodeMirror-dialog-top\";\n }\n if (typeof template == \"string\") {\n dialog.innerHTML = template;\n } else { // Assuming it's a detached DOM element.\n dialog.appendChild(template);\n }\n return dialog;\n }\n\n function closeNotification(cm, newVal) {\n if (cm.state.currentNotificationClose)\n cm.state.currentNotificationClose();\n cm.state.currentNotificationClose = newVal;\n }\n\n CodeMirror.defineExtension(\"openDialog\", function(template, callback, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var closed = false, me = this;\n function close() {\n if (closed) return;\n closed = true;\n dialog.parentNode.removeChild(dialog);\n }\n var inp = dialog.getElementsByTagName(\"input\")[0], button;\n if (inp) {\n if (options && options.value) inp.value = options.value;\n CodeMirror.on(inp, \"keydown\", function(e) {\n if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }\n if (e.keyCode == 13 || e.keyCode == 27) {\n inp.blur();\n CodeMirror.e_stop(e);\n close();\n me.focus();\n if (e.keyCode == 13) callback(inp.value);\n }\n });\n if (options && options.onKeyUp) {\n CodeMirror.on(inp, \"keyup\", function(e) {options.onKeyUp(e, inp.value, close);});\n }\n if (options && options.value) inp.value = options.value;\n inp.focus();\n CodeMirror.on(inp, \"blur\", close);\n } else if (button = dialog.getElementsByTagName(\"button\")[0]) {\n CodeMirror.on(button, \"click\", function() {\n close();\n me.focus();\n });\n button.focus();\n CodeMirror.on(button, \"blur\", close);\n }\n return close;\n });\n\n CodeMirror.defineExtension(\"openConfirm\", function(template, callbacks, options) {\n closeNotification(this, null);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var buttons = dialog.getElementsByTagName(\"button\");\n var closed = false, me = this, blurring = 1;\n function close() {\n if (closed) return;\n closed = true;\n dialog.parentNode.removeChild(dialog);\n me.focus();\n }\n buttons[0].focus();\n for (var i = 0; i < buttons.length; ++i) {\n var b = buttons[i];\n (function(callback) {\n CodeMirror.on(b, \"click\", function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n if (callback) callback(me);\n });\n })(callbacks[i]);\n CodeMirror.on(b, \"blur\", function() {\n --blurring;\n setTimeout(function() { if (blurring <= 0) close(); }, 200);\n });\n CodeMirror.on(b, \"focus\", function() { ++blurring; });\n }\n });\n\n /*\n * openNotification\n * Opens a notification, that can be closed with an optional timer\n * (default 5000ms timer) and always closes on click.\n *\n * If a notification is opened while another is opened, it will close the\n * currently opened one and open the new one immediately.\n */\n CodeMirror.defineExtension(\"openNotification\", function(template, options) {\n closeNotification(this, close);\n var dialog = dialogDiv(this, template, options && options.bottom);\n var duration = options && (options.duration === undefined ? 5000 : options.duration);\n var closed = false, doneTimer;\n\n function close() {\n if (closed) return;\n closed = true;\n clearTimeout(doneTimer);\n dialog.parentNode.removeChild(dialog);\n }\n\n CodeMirror.on(dialog, 'click', function(e) {\n CodeMirror.e_preventDefault(e);\n close();\n });\n if (duration)\n doneTimer = setTimeout(close, options.duration);\n });\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
"module-type": "library",
"text": "(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\"};\n\n function findMatchingBracket(cm, where, strict, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\\]]/;\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {\n var match = matching[ch];\n if ((match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);\n if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textare whever this fires.\n if (ie_lt8 && cm.state.focused) cm.display.input.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n var currentlyHighlighted = null;\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}\n currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init)\n cm.off(\"cursorActivity\", doMatchBrackets);\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, strict, config){\n return findMatchingBracket(this, pos, strict, config);\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
"module-type": "library",
"text": "(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n var Pos = CodeMirror.Pos;\n\n function SearchCursor(doc, query, pos, caseFold) {\n this.atOccurrence = false; this.doc = doc;\n if (caseFold == null && typeof query == \"string\") caseFold = false;\n\n pos = pos ? doc.clipPos(pos) : Pos(0, 0);\n this.pos = {from: pos, to: pos};\n\n // The matches method is filled in based on the type of query.\n // It takes a position and a direction, and returns an object\n // describing the next occurrence of the query, or null if no\n // more matches were found.\n if (typeof query != \"string\") { // Regexp match\n if (!query.global) query = new RegExp(query.source, query.ignoreCase ? \"ig\" : \"g\");\n this.matches = function(reverse, pos) {\n if (reverse) {\n query.lastIndex = 0;\n var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;\n for (;;) {\n query.lastIndex = cutOff;\n var newMatch = query.exec(line);\n if (!newMatch) break;\n match = newMatch;\n start = match.index;\n cutOff = match.index + (match[0].length || 1);\n if (cutOff == line.length) break;\n }\n var matchLen = (match && match[0].length) || 0;\n if (!matchLen) {\n if (start == 0 && line.length == 0) {match = undefined;}\n else if (start != doc.getLine(pos.line).length) {\n matchLen++;\n }\n }\n } else {\n query.lastIndex = pos.ch;\n var line = doc.getLine(pos.line), match = query.exec(line);\n var matchLen = (match && match[0].length) || 0;\n var start = match && match.index;\n if (start + matchLen != line.length && !matchLen) matchLen = 1;\n }\n if (match && matchLen)\n return {from: Pos(pos.line, start),\n to: Pos(pos.line, start + matchLen),\n match: match};\n };\n } else { // String query\n var origQuery = query;\n if (caseFold) query = query.toLowerCase();\n var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};\n var target = query.split(\"\\n\");\n // Different methods for single-line and multi-line queries\n if (target.length == 1) {\n if (!query.length) {\n // Empty string would match anything and never progress, so\n // we define it to match nothing instead.\n this.matches = function() {};\n } else {\n this.matches = function(reverse, pos) {\n if (reverse) {\n var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);\n var match = line.lastIndexOf(query);\n if (match > -1) {\n match = adjustPos(orig, line, match);\n return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};\n }\n } else {\n var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);\n var match = line.indexOf(query);\n if (match > -1) {\n match = adjustPos(orig, line, match) + pos.ch;\n return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};\n }\n }\n };\n }\n } else {\n var origTarget = origQuery.split(\"\\n\");\n this.matches = function(reverse, pos) {\n var last = target.length - 1;\n if (reverse) {\n if (pos.line - (target.length - 1) < doc.firstLine()) return;\n if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;\n var to = Pos(pos.line, origTarget[last].length);\n for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)\n if (target[i] != fold(doc.getLine(ln))) return;\n var line = doc.getLine(ln), cut = line.length - origTarget[0].length;\n if (fold(line.slice(cut)) != target[0]) return;\n return {from: Pos(ln, cut), to: to};\n } else {\n if (pos.line + (target.length - 1) > doc.lastLine()) return;\n var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;\n if (fold(line.slice(cut)) != target[0]) return;\n var from = Pos(pos.line, cut);\n for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)\n if (target[i] != fold(doc.getLine(ln))) return;\n if (doc.getLine(ln).slice(0, origTarget[last].length) != target[last]) return;\n return {from: from, to: Pos(ln, origTarget[last].length)};\n }\n };\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false);},\n findPrevious: function() {return this.find(true);},\n\n find: function(reverse) {\n var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n function savePosAndFail(line) {\n var pos = Pos(line, 0);\n self.pos = {from: pos, to: pos};\n self.atOccurrence = false;\n return false;\n }\n\n for (;;) {\n if (this.pos = this.matches(reverse, pos)) {\n this.atOccurrence = true;\n return this.pos.match || true;\n }\n if (reverse) {\n if (!pos.line) return savePosAndFail(0);\n pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);\n }\n else {\n var maxLine = this.doc.lineCount();\n if (pos.line == maxLine - 1) return savePosAndFail(maxLine);\n pos = Pos(pos.line + 1, 0);\n }\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from;},\n to: function() {if (this.atOccurrence) return this.pos.to;},\n\n replace: function(newText) {\n if (!this.atOccurrence) return;\n var lines = CodeMirror.splitLines(newText);\n this.doc.replaceRange(lines, this.pos.from, this.pos.to);\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));\n }\n };\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos) {\n if (orig.length == folded.length) return pos;\n for (var pos1 = Math.min(pos, orig.length);;) {\n var len1 = orig.slice(0, pos1).toLowerCase().length;\n if (len1 < pos) ++pos1;\n else if (len1 > pos) --pos1;\n else return pos1;\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold);\n });\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold);\n });\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = [], next;\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold);\n while (next = cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break;\n ranges.push({anchor: cur.from(), head: cur.to()});\n }\n if (ranges.length)\n this.setSelections(ranges, 0);\n });\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
"module-type": "library",
"text": "// TODO actually recognize syntax of TypeScript constructs\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var isTS = parserConfig.typescript;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n var jsKeywords = {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": C, \"break\": C, \"continue\": C, \"new\": C, \"delete\": C, \"throw\": C, \"debugger\": C,\n \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"module\": kw(\"module\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C\n };\n\n // Extend the 'normal' keywords with the TypeScript language extensions\n if (isTS) {\n var type = {type: \"variable\", style: \"variable-3\"};\n var tsKeywords = {\n // object-like things\n \"interface\": kw(\"interface\"),\n \"extends\": kw(\"extends\"),\n \"constructor\": kw(\"constructor\"),\n\n // scope modifiers\n \"public\": kw(\"public\"),\n \"private\": kw(\"private\"),\n \"protected\": kw(\"protected\"),\n \"static\": kw(\"static\"),\n\n // types\n \"string\": type, \"number\": type, \"bool\": type, \"any\": type\n };\n\n for (var attr in tsKeywords) {\n jsKeywords[attr] = tsKeywords[attr];\n }\n }\n\n return jsKeywords;\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d+(?:[eE][+\\-]?\\d+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.eat(/x/i)) {\n stream.eatWhile(/[\\da-f]/i);\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^\\d*(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (state.lastType == \"operator\" || state.lastType == \"keyword c\" ||\n state.lastType == \"sof\" || /^[\\[{}\\(,;:]$/.test(state.lastType)) {\n readRegexp(stream);\n stream.eatWhile(/[gimy]/); // 'y' is \"sticky\" option in Mozilla\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\") {\n stream.skipToEnd();\n return ret(\"error\", \"error\");\n } else if (isOperatorChar.test(ch)) {\n stream.eatWhile(isOperatorChar);\n return ret(\"operator\", \"operator\", stream.current());\n } else {\n stream.eatWhile(/[\\w\\$_]/);\n var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];\n return (known && state.lastType != \".\") ? ret(known.type, known.style, word) :\n ret(\"variable\", \"variable\", word);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) break;\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (/[$\\w]/.test(ch)) {\n sawSomething = true;\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true, \"regexp\": true, \"this\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function register(varname) {\n function inList(list) {\n for (var v = list; v; v = v.next)\n if (v.name == varname) return true;\n return false;\n }\n var state = cx.state;\n if (state.context) {\n cx.marked = \"def\";\n if (inList(state.localVars)) return;\n state.localVars = {name: varname, next: state.localVars};\n } else {\n if (inList(state.globalVars)) return;\n if (parserConfig.globalVars)\n state.globalVars = {name: varname, next: state.globalVars};\n }\n }\n\n // Combinators\n\n var defaultVars = {name: \"this\", next: {name: \"arguments\"}};\n function pushcontext() {\n cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};\n cx.state.localVars = defaultVars;\n }\n function popcontext() {\n cx.state.localVars = cx.state.context.vars;\n cx.state.context = cx.state.context.prev;\n }\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value.length), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), expression, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"{\") return cont(pushlex(\"}\"), block, poplex);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), expression, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), forspec, statement, poplex);\n if (type == \"variable\") return cont(pushlex(\"stat\"), maybelabel);\n if (type == \"switch\") return cont(pushlex(\"form\"), expression, pushlex(\"}\", \"switch\"), expect(\"{\"),\n block, poplex, poplex);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, expect(\"(\"), funarg, expect(\")\"),\n statement, poplex, popcontext);\n if (type == \"module\") return cont(pushlex(\"form\"), pushcontext, afterModule, popcontext, poplex);\n if (type == \"class\") return cont(pushlex(\"form\"), className, objlit, poplex);\n if (type == \"export\") return cont(pushlex(\"form\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"form\"), afterImport, poplex);\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function expression(type) {\n return expressionInner(type, false);\n }\n function expressionNoComma(type) {\n return expressionInner(type, true);\n }\n function expressionInner(type, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(pattern, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"keyword c\") return cont(noComma ? maybeexpressionNoComma : maybeexpression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, comprehension, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") { return pass(quasi, maybeop); }\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n function maybeexpressionNoComma(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expressionNoComma);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(expression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (value == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value)) return cont(me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(expression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n if (type == \"{\") return pass(statement);\n return pass(expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n if (type == \"{\") return pass(statement);\n return pass(expressionNoComma);\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"variable\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (type + \" property\");\n } else if (type == \"[\") {\n return cont(expression, expect(\"]\"), afterprop);\n }\n if (atomicTypes.hasOwnProperty(type)) return cont(afterprop);\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end) {\n function proceed(type) {\n if (type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(what, proceed);\n }\n if (type == end) return cont();\n return cont(expect(end));\n }\n return function(type) {\n if (type == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type) {\n if (isTS && type == \":\") return cont(typedef);\n }\n function typedef(type) {\n if (type == \"variable\"){cx.marked = \"variable-3\"; return cont();}\n }\n function vardef() {\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"[\") return contCommasep(pattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type) {\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, expect(\")\"), poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, expect(\";\"), forspec2);\n if (type == \";\") return cont(forspec2);\n if (type == \"variable\") return cont(formaybeinof);\n return pass(expression, expect(\";\"), forspec2);\n }\n function formaybeinof(_type, value) {\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return cont(maybeoperatorComma, forspec2);\n }\n function forspec2(type, value) {\n if (type == \";\") return cont(forspec3);\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression); }\n return pass(expression, expect(\";\"), forspec3);\n }\n function forspec3(type) {\n if (type != \")\") cont(expression);\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, statement, popcontext);\n }\n function funarg(type) {\n if (type == \"spread\") return cont(funarg);\n return pass(pattern, maybetype);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(_type, value) {\n if (value == \"extends\") return cont(expression);\n }\n function objlit(type) {\n if (type == \"{\") return contCommasep(objprop, \"}\");\n }\n function afterModule(type, value) {\n if (type == \"string\") return cont(statement);\n if (type == \"variable\") { register(value); return cont(maybeFrom); }\n }\n function afterExport(_type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n return pass(statement);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n return pass(importSpec, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n return cont();\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(expressionNoComma, maybeArrayComprehension);\n }\n function maybeArrayComprehension(type) {\n if (type == \"for\") return pass(comprehension, expect(\"]\"));\n if (type == \",\") return cont(commasep(expressionNoComma, \"]\"));\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function comprehension(type) {\n if (type == \"for\") return cont(forspec, comprehension);\n if (type == \"if\") return cont(expression, comprehension);\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && {vars: parserConfig.localVars},\n indented: 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse) break;\n }\n if (lexical.type == \"stat\" && firstChar == \"}\") lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricChars: \":{}\",\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/x-json\", {name: \"javascript\", json: true});\nCodeMirror.defineMIME(\"application/ld+json\", {name: \"javascript\", jsonld: true});\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/keymap/vim.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
"module-type": "library",
"text": "/**\n * Supported keybindings:\n *\n * Motion:\n * h, j, k, l\n * gj, gk\n * e, E, w, W, b, B, ge, gE\n * f<character>, F<character>, t<character>, T<character>\n * $, ^, 0, -, +, _\n * gg, G\n * %\n * '<character>, `<character>\n *\n * Operator:\n * d, y, c\n * dd, yy, cc\n * g~, g~g~\n * >, <, >>, <<\n *\n * Operator-Motion:\n * x, X, D, Y, C, ~\n *\n * Action:\n * a, i, s, A, I, S, o, O\n * zz, z., z<CR>, zt, zb, z-\n * J\n * u, Ctrl-r\n * m<character>\n * r<character>\n *\n * Modes:\n * ESC - leave insert mode, visual mode, and clear input state.\n * Ctrl-[, Ctrl-c - same as ESC.\n *\n * Registers: unnamed, -, a-z, A-Z, 0-9\n * (Does not respect the special case for number registers when delete\n * operator is made with these commands: %, (, ), , /, ?, n, N, {, } )\n * TODO: Implement the remaining registers.\n * Marks: a-z, A-Z, and 0-9\n * TODO: Implement the remaining special marks. They have more complex\n * behavior.\n *\n * Events:\n * 'vim-mode-change' - raised on the editor anytime the current mode changes,\n * Event object: {mode: \"visual\", subMode: \"linewise\"}\n *\n * Code structure:\n * 1. Default keymap\n * 2. Variable declarations and short basic helpers\n * 3. Instance (External API) implementation\n * 4. Internal state tracking objects (input state, counter) implementation\n * and instanstiation\n * 5. Key handler (the main command dispatcher) implementation\n * 6. Motion, operator, and action implementations\n * 7. Helper functions for the key handler, motions, operators, and actions\n * 8. Set up Vim to work as a keymap for CodeMirror.\n */\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/dialog/dialog\"), require(\"../addon/edit/matchbrackets.js\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/dialog/dialog\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n 'use strict';\n\n var defaultKeymap = [\n // Key to key mapping. This goes first to make it possible to override\n // existing mappings.\n { keys: ['<Left>'], type: 'keyToKey', toKeys: ['h'] },\n { keys: ['<Right>'], type: 'keyToKey', toKeys: ['l'] },\n { keys: ['<Up>'], type: 'keyToKey', toKeys: ['k'] },\n { keys: ['<Down>'], type: 'keyToKey', toKeys: ['j'] },\n { keys: ['<Space>'], type: 'keyToKey', toKeys: ['l'] },\n { keys: ['<BS>'], type: 'keyToKey', toKeys: ['h'] },\n { keys: ['<C-Space>'], type: 'keyToKey', toKeys: ['W'] },\n { keys: ['<C-BS>'], type: 'keyToKey', toKeys: ['B'] },\n { keys: ['<S-Space>'], type: 'keyToKey', toKeys: ['w'] },\n { keys: ['<S-BS>'], type: 'keyToKey', toKeys: ['b'] },\n { keys: ['<C-n>'], type: 'keyToKey', toKeys: ['j'] },\n { keys: ['<C-p>'], type: 'keyToKey', toKeys: ['k'] },\n { keys: ['<C-[>'], type: 'keyToKey', toKeys: ['<Esc>'] },\n { keys: ['<C-c>'], type: 'keyToKey', toKeys: ['<Esc>'] },\n { keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'], context: 'normal' },\n { keys: ['s'], type: 'keyToKey', toKeys: ['x', 'i'], context: 'visual'},\n { keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'], context: 'normal' },\n { keys: ['S'], type: 'keyToKey', toKeys: ['d', 'c', 'c'], context: 'visual' },\n { keys: ['<Home>'], type: 'keyToKey', toKeys: ['0'] },\n { keys: ['<End>'], type: 'keyToKey', toKeys: ['$'] },\n { keys: ['<PageUp>'], type: 'keyToKey', toKeys: ['<C-b>'] },\n { keys: ['<PageDown>'], type: 'keyToKey', toKeys: ['<C-f>'] },\n { keys: ['<CR>'], type: 'keyToKey', toKeys: ['j', '^'], context: 'normal' },\n // Motions\n { keys: ['H'], type: 'motion',\n motion: 'moveToTopLine',\n motionArgs: { linewise: true, toJumplist: true }},\n { keys: ['M'], type: 'motion',\n motion: 'moveToMiddleLine',\n motionArgs: { linewise: true, toJumplist: true }},\n { keys: ['L'], type: 'motion',\n motion: 'moveToBottomLine',\n motionArgs: { linewise: true, toJumplist: true }},\n { keys: ['h'], type: 'motion',\n motion: 'moveByCharacters',\n motionArgs: { forward: false }},\n { keys: ['l'], type: 'motion',\n motion: 'moveByCharacters',\n motionArgs: { forward: true }},\n { keys: ['j'], type: 'motion',\n motion: 'moveByLines',\n motionArgs: { forward: true, linewise: true }},\n { keys: ['k'], type: 'motion',\n motion: 'moveByLines',\n motionArgs: { forward: false, linewise: true }},\n { keys: ['g','j'], type: 'motion',\n motion: 'moveByDisplayLines',\n motionArgs: { forward: true }},\n { keys: ['g','k'], type: 'motion',\n motion: 'moveByDisplayLines',\n motionArgs: { forward: false }},\n { keys: ['w'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: true, wordEnd: false }},\n { keys: ['W'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: true, wordEnd: false, bigWord: true }},\n { keys: ['e'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: true, wordEnd: true, inclusive: true }},\n { keys: ['E'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: true, wordEnd: true, bigWord: true,\n inclusive: true }},\n { keys: ['b'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: false, wordEnd: false }},\n { keys: ['B'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: false, wordEnd: false, bigWord: true }},\n { keys: ['g', 'e'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: false, wordEnd: true, inclusive: true }},\n { keys: ['g', 'E'], type: 'motion',\n motion: 'moveByWords',\n motionArgs: { forward: false, wordEnd: true, bigWord: true,\n inclusive: true }},\n { keys: ['{'], type: 'motion', motion: 'moveByParagraph',\n motionArgs: { forward: false, toJumplist: true }},\n { keys: ['}'], type: 'motion', motion: 'moveByParagraph',\n motionArgs: { forward: true, toJumplist: true }},\n { keys: ['<C-f>'], type: 'motion',\n motion: 'moveByPage', motionArgs: { forward: true }},\n { keys: ['<C-b>'], type: 'motion',\n motion: 'moveByPage', motionArgs: { forward: false }},\n { keys: ['<C-d>'], type: 'motion',\n motion: 'moveByScroll',\n motionArgs: { forward: true, explicitRepeat: true }},\n { keys: ['<C-u>'], type: 'motion',\n motion: 'moveByScroll',\n motionArgs: { forward: false, explicitRepeat: true }},\n { keys: ['g', 'g'], type: 'motion',\n motion: 'moveToLineOrEdgeOfDocument',\n motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},\n { keys: ['G'], type: 'motion',\n motion: 'moveToLineOrEdgeOfDocument',\n motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},\n { keys: ['0'], type: 'motion', motion: 'moveToStartOfLine' },\n { keys: ['^'], type: 'motion',\n motion: 'moveToFirstNonWhiteSpaceCharacter' },\n { keys: ['+'], type: 'motion',\n motion: 'moveByLines',\n motionArgs: { forward: true, toFirstChar:true }},\n { keys: ['-'], type: 'motion',\n motion: 'moveByLines',\n motionArgs: { forward: false, toFirstChar:true }},\n { keys: ['_'], type: 'motion',\n motion: 'moveByLines',\n motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }},\n { keys: ['$'], type: 'motion',\n motion: 'moveToEol',\n motionArgs: { inclusive: true }},\n { keys: ['%'], type: 'motion',\n motion: 'moveToMatchedSymbol',\n motionArgs: { inclusive: true, toJumplist: true }},\n { keys: ['f', 'character'], type: 'motion',\n motion: 'moveToCharacter',\n motionArgs: { forward: true , inclusive: true }},\n { keys: ['F', 'character'], type: 'motion',\n motion: 'moveToCharacter',\n motionArgs: { forward: false }},\n { keys: ['t', 'character'], type: 'motion',\n motion: 'moveTillCharacter',\n motionArgs: { forward: true, inclusive: true }},\n { keys: ['T', 'character'], type: 'motion',\n motion: 'moveTillCharacter',\n motionArgs: { forward: false }},\n { keys: [';'], type: 'motion', motion: 'repeatLastCharacterSearch',\n motionArgs: { forward: true }},\n { keys: [','], type: 'motion', motion: 'repeatLastCharacterSearch',\n motionArgs: { forward: false }},\n { keys: ['\\'', 'character'], type: 'motion', motion: 'goToMark',\n motionArgs: {toJumplist: true, linewise: true}},\n { keys: ['`', 'character'], type: 'motion', motion: 'goToMark',\n motionArgs: {toJumplist: true}},\n { keys: [']', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },\n { keys: ['[', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },\n { keys: [']', '\\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },\n { keys: ['[', '\\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },\n // the next two aren't motions but must come before more general motion declarations\n { keys: [']', 'p'], type: 'action', action: 'paste', isEdit: true,\n actionArgs: { after: true, isEdit: true, matchIndent: true}},\n { keys: ['[', 'p'], type: 'action', action: 'paste', isEdit: true,\n actionArgs: { after: false, isEdit: true, matchIndent: true}},\n { keys: [']', 'character'], type: 'motion',\n motion: 'moveToSymbol',\n motionArgs: { forward: true, toJumplist: true}},\n { keys: ['[', 'character'], type: 'motion',\n motion: 'moveToSymbol',\n motionArgs: { forward: false, toJumplist: true}},\n { keys: ['|'], type: 'motion',\n motion: 'moveToColumn',\n motionArgs: { }},\n { keys: ['o'], type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: { },context:'visual'},\n // Operators\n { keys: ['d'], type: 'operator', operator: 'delete' },\n { keys: ['y'], type: 'operator', operator: 'yank' },\n { keys: ['c'], type: 'operator', operator: 'change' },\n { keys: ['>'], type: 'operator', operator: 'indent',\n operatorArgs: { indentRight: true }},\n { keys: ['<'], type: 'operator', operator: 'indent',\n operatorArgs: { indentRight: false }},\n { keys: ['g', '~'], type: 'operator', operator: 'swapcase' },\n { keys: ['n'], type: 'motion', motion: 'findNext',\n motionArgs: { forward: true, toJumplist: true }},\n { keys: ['N'], type: 'motion', motion: 'findNext',\n motionArgs: { forward: false, toJumplist: true }},\n // Operator-Motion dual commands\n { keys: ['x'], type: 'operatorMotion', operator: 'delete',\n motion: 'moveByCharacters', motionArgs: { forward: true },\n operatorMotionArgs: { visualLine: false }},\n { keys: ['X'], type: 'operatorMotion', operator: 'delete',\n motion: 'moveByCharacters', motionArgs: { forward: false },\n operatorMotionArgs: { visualLine: true }},\n { keys: ['D'], type: 'operatorMotion', operator: 'delete',\n motion: 'moveToEol', motionArgs: { inclusive: true },\n operatorMotionArgs: { visualLine: true }},\n { keys: ['Y'], type: 'operatorMotion', operator: 'yank',\n motion: 'moveToEol', motionArgs: { inclusive: true },\n operatorMotionArgs: { visualLine: true }},\n { keys: ['C'], type: 'operatorMotion',\n operator: 'change',\n motion: 'moveToEol', motionArgs: { inclusive: true },\n operatorMotionArgs: { visualLine: true }},\n { keys: ['~'], type: 'operatorMotion',\n operator: 'swapcase', operatorArgs: { shouldMoveCursor: true },\n motion: 'moveByCharacters', motionArgs: { forward: true }},\n // Actions\n { keys: ['<C-i>'], type: 'action', action: 'jumpListWalk',\n actionArgs: { forward: true }},\n { keys: ['<C-o>'], type: 'action', action: 'jumpListWalk',\n actionArgs: { forward: false }},\n { keys: ['<C-e>'], type: 'action',\n action: 'scroll',\n actionArgs: { forward: true, linewise: true }},\n { keys: ['<C-y>'], type: 'action',\n action: 'scroll',\n actionArgs: { forward: false, linewise: true }},\n { keys: ['a'], type: 'action', action: 'enterInsertMode', isEdit: true,\n actionArgs: { insertAt: 'charAfter' }},\n { keys: ['A'], type: 'action', action: 'enterInsertMode', isEdit: true,\n actionArgs: { insertAt: 'eol' }},\n { keys: ['i'], type: 'action', action: 'enterInsertMode', isEdit: true,\n actionArgs: { insertAt: 'inplace' }},\n { keys: ['I'], type: 'action', action: 'enterInsertMode', isEdit: true,\n actionArgs: { insertAt: 'firstNonBlank' }},\n { keys: ['o'], type: 'action', action: 'newLineAndEnterInsertMode',\n isEdit: true, interlaceInsertRepeat: true,\n actionArgs: { after: true }},\n { keys: ['O'], type: 'action', action: 'newLineAndEnterInsertMode',\n isEdit: true, interlaceInsertRepeat: true,\n actionArgs: { after: false }},\n { keys: ['v'], type: 'action', action: 'toggleVisualMode' },\n { keys: ['V'], type: 'action', action: 'toggleVisualMode',\n actionArgs: { linewise: true }},\n { keys: ['g', 'v'], type: 'action', action: 'reselectLastSelection' },\n { keys: ['J'], type: 'action', action: 'joinLines', isEdit: true },\n { keys: ['p'], type: 'action', action: 'paste', isEdit: true,\n actionArgs: { after: true, isEdit: true }},\n { keys: ['P'], type: 'action', action: 'paste', isEdit: true,\n actionArgs: { after: false, isEdit: true }},\n { keys: ['r', 'character'], type: 'action', action: 'replace', isEdit: true },\n { keys: ['@', 'character'], type: 'action', action: 'replayMacro' },\n { keys: ['q', 'character'], type: 'action', action: 'enterMacroRecordMode' },\n // Handle Replace-mode as a special case of insert mode.\n { keys: ['R'], type: 'action', action: 'enterInsertMode', isEdit: true,\n actionArgs: { replace: true }},\n { keys: ['u'], type: 'action', action: 'undo' },\n { keys: ['u'], type: 'action', action: 'changeCase', actionArgs: {toLower: true}, context: 'visual', isEdit: true },\n { keys: ['U'],type: 'action', action: 'changeCase', actionArgs: {toLower: false}, context: 'visual', isEdit: true },\n { keys: ['<C-r>'], type: 'action', action: 'redo' },\n { keys: ['m', 'character'], type: 'action', action: 'setMark' },\n { keys: ['\"', 'character'], type: 'action', action: 'setRegister' },\n { keys: ['z', 'z'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'center' }},\n { keys: ['z', '.'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'center' },\n motion: 'moveToFirstNonWhiteSpaceCharacter' },\n { keys: ['z', 't'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'top' }},\n { keys: ['z', '<CR>'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'top' },\n motion: 'moveToFirstNonWhiteSpaceCharacter' },\n { keys: ['z', '-'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'bottom' }},\n { keys: ['z', 'b'], type: 'action', action: 'scrollToCursor',\n actionArgs: { position: 'bottom' },\n motion: 'moveToFirstNonWhiteSpaceCharacter' },\n { keys: ['.'], type: 'action', action: 'repeatLastEdit' },\n { keys: ['<C-a>'], type: 'action', action: 'incrementNumberToken',\n isEdit: true,\n actionArgs: {increase: true, backtrack: false}},\n { keys: ['<C-x>'], type: 'action', action: 'incrementNumberToken',\n isEdit: true,\n actionArgs: {increase: false, backtrack: false}},\n // Text object motions\n { keys: ['a', 'character'], type: 'motion',\n motion: 'textObjectManipulation' },\n { keys: ['i', 'character'], type: 'motion',\n motion: 'textObjectManipulation',\n motionArgs: { textObjectInner: true }},\n // Search\n { keys: ['/'], type: 'search',\n searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }},\n { keys: ['?'], type: 'search',\n searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }},\n { keys: ['*'], type: 'search',\n searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},\n { keys: ['#'], type: 'search',\n searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},\n { keys: ['g', '*'], type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }},\n { keys: ['g', '#'], type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},\n // Ex command\n { keys: [':'], type: 'ex' }\n ];\n\n var Pos = CodeMirror.Pos;\n\n var Vim = function() {\n CodeMirror.defineOption('vimMode', false, function(cm, val) {\n if (val) {\n cm.setOption('keyMap', 'vim');\n cm.setOption('disableInput', true);\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"normal\"});\n cm.on('beforeSelectionChange', beforeSelectionChange);\n cm.on('cursorActivity', onCursorActivity);\n maybeInitVimState(cm);\n CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));\n } else if (cm.state.vim) {\n cm.setOption('keyMap', 'default');\n cm.setOption('disableInput', false);\n cm.off('beforeSelectionChange', beforeSelectionChange);\n cm.off('cursorActivity', onCursorActivity);\n CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));\n cm.state.vim = null;\n }\n });\n function beforeSelectionChange(cm, obj) {\n var vim = cm.state.vim;\n if (vim.insertMode || vim.exMode) return;\n\n var head = obj.ranges[0].head;\n var anchor = obj.ranges[0].anchor;\n if (head.ch && head.ch == cm.doc.getLine(head.line).length) {\n var pos = Pos(head.line, head.ch - 1);\n obj.update([{anchor: cursorEqual(head, anchor) ? pos : anchor,\n head: pos}]);\n }\n }\n function getOnPasteFn(cm) {\n var vim = cm.state.vim;\n if (!vim.onPasteFn) {\n vim.onPasteFn = function() {\n if (!vim.insertMode) {\n cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));\n actions.enterInsertMode(cm, {}, vim);\n }\n };\n }\n return vim.onPasteFn;\n }\n\n var numberRegex = /[\\d]/;\n var wordRegexp = [(/\\w/), (/[^\\w\\s]/)], bigWordRegexp = [(/\\S/)];\n function makeKeyRange(start, size) {\n var keys = [];\n for (var i = start; i < start + size; i++) {\n keys.push(String.fromCharCode(i));\n }\n return keys;\n }\n var upperCaseAlphabet = makeKeyRange(65, 26);\n var lowerCaseAlphabet = makeKeyRange(97, 26);\n var numbers = makeKeyRange(48, 10);\n var specialSymbols = '~`!@#$%^&*()_-+=[{}]\\\\|/?.,<>:;\"\\''.split('');\n var specialKeys = ['Left', 'Right', 'Up', 'Down', 'Space', 'Backspace',\n 'Esc', 'Home', 'End', 'PageUp', 'PageDown', 'Enter'];\n var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);\n var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '\"', '.', ':']);\n\n function isLine(cm, line) {\n return line >= cm.firstLine() && line <= cm.lastLine();\n }\n function isLowerCase(k) {\n return (/^[a-z]$/).test(k);\n }\n function isMatchableSymbol(k) {\n return '()[]{}'.indexOf(k) != -1;\n }\n function isNumber(k) {\n return numberRegex.test(k);\n }\n function isUpperCase(k) {\n return (/^[A-Z]$/).test(k);\n }\n function isWhiteSpaceString(k) {\n return (/^\\s*$/).test(k);\n }\n function inArray(val, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] == val) {\n return true;\n }\n }\n return false;\n }\n\n var options = {};\n function defineOption(name, defaultValue, type) {\n if (defaultValue === undefined) { throw Error('defaultValue is required'); }\n if (!type) { type = 'string'; }\n options[name] = {\n type: type,\n defaultValue: defaultValue\n };\n setOption(name, defaultValue);\n }\n\n function setOption(name, value) {\n var option = options[name];\n if (!option) {\n throw Error('Unknown option: ' + name);\n }\n if (option.type == 'boolean') {\n if (value && value !== true) {\n throw Error('Invalid argument: ' + name + '=' + value);\n } else if (value !== false) {\n // Boolean options are set to true if value is not defined.\n value = true;\n }\n }\n option.value = option.type == 'boolean' ? !!value : value;\n }\n\n function getOption(name) {\n var option = options[name];\n if (!option) {\n throw Error('Unknown option: ' + name);\n }\n return option.value;\n }\n\n var createCircularJumpList = function() {\n var size = 100;\n var pointer = -1;\n var head = 0;\n var tail = 0;\n var buffer = new Array(size);\n function add(cm, oldCur, newCur) {\n var current = pointer % size;\n var curMark = buffer[current];\n function useNextSlot(cursor) {\n var next = ++pointer % size;\n var trashMark = buffer[next];\n if (trashMark) {\n trashMark.clear();\n }\n buffer[next] = cm.setBookmark(cursor);\n }\n if (curMark) {\n var markPos = curMark.find();\n // avoid recording redundant cursor position\n if (markPos && !cursorEqual(markPos, oldCur)) {\n useNextSlot(oldCur);\n }\n } else {\n useNextSlot(oldCur);\n }\n useNextSlot(newCur);\n head = pointer;\n tail = pointer - size + 1;\n if (tail < 0) {\n tail = 0;\n }\n }\n function move(cm, offset) {\n pointer += offset;\n if (pointer > head) {\n pointer = head;\n } else if (pointer < tail) {\n pointer = tail;\n }\n var mark = buffer[(size + pointer) % size];\n // skip marks that are temporarily removed from text buffer\n if (mark && !mark.find()) {\n var inc = offset > 0 ? 1 : -1;\n var newCur;\n var oldCur = cm.getCursor();\n do {\n pointer += inc;\n mark = buffer[(size + pointer) % size];\n // skip marks that are the same as current position\n if (mark &&\n (newCur = mark.find()) &&\n !cursorEqual(oldCur, newCur)) {\n break;\n }\n } while (pointer < head && pointer > tail);\n }\n return mark;\n }\n return {\n cachedCursor: undefined, //used for # and * jumps\n add: add,\n move: move\n };\n };\n\n // Returns an object to track the changes associated insert mode. It\n // clones the object that is passed in, or creates an empty object one if\n // none is provided.\n var createInsertModeChanges = function(c) {\n if (c) {\n // Copy construction\n return {\n changes: c.changes,\n expectCursorActivityForChange: c.expectCursorActivityForChange\n };\n }\n return {\n // Change list\n changes: [],\n // Set to true on change, false on cursorActivity.\n expectCursorActivityForChange: false\n };\n };\n\n function MacroModeState() {\n this.latestRegister = undefined;\n this.isPlaying = false;\n this.isRecording = false;\n this.replaySearchQueries = [];\n this.onRecordingDone = undefined;\n this.lastInsertModeChanges = createInsertModeChanges();\n }\n MacroModeState.prototype = {\n exitMacroRecordMode: function() {\n var macroModeState = vimGlobalState.macroModeState;\n macroModeState.onRecordingDone(); // close dialog\n macroModeState.onRecordingDone = undefined;\n macroModeState.isRecording = false;\n },\n enterMacroRecordMode: function(cm, registerName) {\n var register =\n vimGlobalState.registerController.getRegister(registerName);\n if (register) {\n register.clear();\n this.latestRegister = registerName;\n this.onRecordingDone = cm.openDialog(\n '(recording)['+registerName+']', null, {bottom:true});\n this.isRecording = true;\n }\n }\n };\n\n function maybeInitVimState(cm) {\n if (!cm.state.vim) {\n // Store instance state in the CodeMirror object.\n cm.state.vim = {\n inputState: new InputState(),\n // Vim's input state that triggered the last edit, used to repeat\n // motions and operators with '.'.\n lastEditInputState: undefined,\n // Vim's action command before the last edit, used to repeat actions\n // with '.' and insert mode repeat.\n lastEditActionCommand: undefined,\n // When using jk for navigation, if you move from a longer line to a\n // shorter line, the cursor may clip to the end of the shorter line.\n // If j is pressed again and cursor goes to the next line, the\n // cursor should go back to its horizontal position on the longer\n // line if it can. This is to keep track of the horizontal position.\n lastHPos: -1,\n // Doing the same with screen-position for gj/gk\n lastHSPos: -1,\n // The last motion command run. Cleared if a non-motion command gets\n // executed in between.\n lastMotion: null,\n marks: {},\n insertMode: false,\n // Repeat count for changes made in insert mode, triggered by key\n // sequences like 3,i. Only exists when insertMode is true.\n insertModeRepeat: undefined,\n visualMode: false,\n // If we are in visual line mode. No effect if visualMode is false.\n visualLine: false,\n lastSelection: null\n };\n }\n return cm.state.vim;\n }\n var vimGlobalState;\n function resetVimGlobalState() {\n vimGlobalState = {\n // The current search query.\n searchQuery: null,\n // Whether we are searching backwards.\n searchIsReversed: false,\n // Replace part of the last substituted pattern\n lastSubstituteReplacePart: undefined,\n jumpList: createCircularJumpList(),\n macroModeState: new MacroModeState,\n // Recording latest f, t, F or T motion command.\n lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''},\n registerController: new RegisterController({})\n };\n for (var optionName in options) {\n var option = options[optionName];\n option.value = option.defaultValue;\n }\n }\n\n var vimApi= {\n buildKeyMap: function() {\n // TODO: Convert keymap into dictionary format for fast lookup.\n },\n // Testing hook, though it might be useful to expose the register\n // controller anyways.\n getRegisterController: function() {\n return vimGlobalState.registerController;\n },\n // Testing hook.\n resetVimGlobalState_: resetVimGlobalState,\n\n // Testing hook.\n getVimGlobalState_: function() {\n return vimGlobalState;\n },\n\n // Testing hook.\n maybeInitVimState_: maybeInitVimState,\n\n InsertModeKey: InsertModeKey,\n map: function(lhs, rhs, ctx) {\n // Add user defined key bindings.\n exCommandDispatcher.map(lhs, rhs, ctx);\n },\n setOption: setOption,\n getOption: getOption,\n defineOption: defineOption,\n defineEx: function(name, prefix, func){\n if (name.indexOf(prefix) !== 0) {\n throw new Error('(Vim.defineEx) \"'+prefix+'\" is not a prefix of \"'+name+'\", command not registered');\n }\n exCommands[name]=func;\n exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'};\n },\n // This is the outermost function called by CodeMirror, after keys have\n // been mapped to their Vim equivalents.\n handleKey: function(cm, key) {\n var command;\n var vim = maybeInitVimState(cm);\n var macroModeState = vimGlobalState.macroModeState;\n if (macroModeState.isRecording) {\n if (key == 'q') {\n macroModeState.exitMacroRecordMode();\n vim.inputState = new InputState();\n return;\n }\n }\n if (key == '<Esc>') {\n // Clear input state and get back to normal mode.\n vim.inputState = new InputState();\n if (vim.visualMode) {\n exitVisualMode(cm);\n }\n return;\n }\n // Enter visual mode when the mouse selects text.\n if (!vim.visualMode &&\n !cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {\n vim.visualMode = true;\n vim.visualLine = false;\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"visual\"});\n cm.on('mousedown', exitVisualMode);\n }\n if (key != '0' || (key == '0' && vim.inputState.getRepeat() === 0)) {\n // Have to special case 0 since it's both a motion and a number.\n command = commandDispatcher.matchCommand(key, defaultKeymap, vim);\n }\n if (!command) {\n if (isNumber(key)) {\n // Increment count unless count is 0 and key is 0.\n vim.inputState.pushRepeatDigit(key);\n }\n if (macroModeState.isRecording) {\n logKey(macroModeState, key);\n }\n return;\n }\n if (command.type == 'keyToKey') {\n // TODO: prevent infinite recursion.\n for (var i = 0; i < command.toKeys.length; i++) {\n this.handleKey(cm, command.toKeys[i]);\n }\n } else {\n if (macroModeState.isRecording) {\n logKey(macroModeState, key);\n }\n commandDispatcher.processCommand(cm, vim, command);\n }\n },\n handleEx: function(cm, input) {\n exCommandDispatcher.processCommand(cm, input);\n }\n };\n\n // Represents the current input state.\n function InputState() {\n this.prefixRepeat = [];\n this.motionRepeat = [];\n\n this.operator = null;\n this.operatorArgs = null;\n this.motion = null;\n this.motionArgs = null;\n this.keyBuffer = []; // For matching multi-key commands.\n this.registerName = null; // Defaults to the unnamed register.\n }\n InputState.prototype.pushRepeatDigit = function(n) {\n if (!this.operator) {\n this.prefixRepeat = this.prefixRepeat.concat(n);\n } else {\n this.motionRepeat = this.motionRepeat.concat(n);\n }\n };\n InputState.prototype.getRepeat = function() {\n var repeat = 0;\n if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {\n repeat = 1;\n if (this.prefixRepeat.length > 0) {\n repeat *= parseInt(this.prefixRepeat.join(''), 10);\n }\n if (this.motionRepeat.length > 0) {\n repeat *= parseInt(this.motionRepeat.join(''), 10);\n }\n }\n return repeat;\n };\n\n /*\n * Register stores information about copy and paste registers. Besides\n * text, a register must store whether it is linewise (i.e., when it is\n * pasted, should it insert itself into a new line, or should the text be\n * inserted at the cursor position.)\n */\n function Register(text, linewise) {\n this.clear();\n this.keyBuffer = [text || ''];\n this.insertModeChanges = [];\n this.searchQueries = [];\n this.linewise = !!linewise;\n }\n Register.prototype = {\n setText: function(text, linewise) {\n this.keyBuffer = [text || ''];\n this.linewise = !!linewise;\n },\n pushText: function(text, linewise) {\n // if this register has ever been set to linewise, use linewise.\n if (linewise) {\n if (!this.linewise) {\n this.keyBuffer.push('\\n');\n }\n this.linewise = true;\n }\n this.keyBuffer.push(text);\n },\n pushInsertModeChanges: function(changes) {\n this.insertModeChanges.push(createInsertModeChanges(changes));\n },\n pushSearchQuery: function(query) {\n this.searchQueries.push(query);\n },\n clear: function() {\n this.keyBuffer = [];\n this.insertModeChanges = [];\n this.searchQueries = [];\n this.linewise = false;\n },\n toString: function() {\n return this.keyBuffer.join('');\n }\n };\n\n /*\n * vim registers allow you to keep many independent copy and paste buffers.\n * See http://usevim.com/2012/04/13/registers/ for an introduction.\n *\n * RegisterController keeps the state of all the registers. An initial\n * state may be passed in. The unnamed register '\"' will always be\n * overridden.\n */\n function RegisterController(registers) {\n this.registers = registers;\n this.unnamedRegister = registers['\"'] = new Register();\n registers['.'] = new Register();\n registers[':'] = new Register();\n }\n RegisterController.prototype = {\n pushText: function(registerName, operator, text, linewise) {\n if (linewise && text.charAt(0) == '\\n') {\n text = text.slice(1) + '\\n';\n }\n if (linewise && text.charAt(text.length - 1) !== '\\n'){\n text += '\\n';\n }\n // Lowercase and uppercase registers refer to the same register.\n // Uppercase just means append.\n var register = this.isValidRegister(registerName) ?\n this.getRegister(registerName) : null;\n // if no register/an invalid register was specified, things go to the\n // default registers\n if (!register) {\n switch (operator) {\n case 'yank':\n // The 0 register contains the text from the most recent yank.\n this.registers['0'] = new Register(text, linewise);\n break;\n case 'delete':\n case 'change':\n if (text.indexOf('\\n') == -1) {\n // Delete less than 1 line. Update the small delete register.\n this.registers['-'] = new Register(text, linewise);\n } else {\n // Shift down the contents of the numbered registers and put the\n // deleted text into register 1.\n this.shiftNumericRegisters_();\n this.registers['1'] = new Register(text, linewise);\n }\n break;\n }\n // Make sure the unnamed register is set to what just happened\n this.unnamedRegister.setText(text, linewise);\n return;\n }\n\n // If we've gotten to this point, we've actually specified a register\n var append = isUpperCase(registerName);\n if (append) {\n register.pushText(text, linewise);\n } else {\n register.setText(text, linewise);\n }\n // The unnamed register always has the same value as the last used\n // register.\n this.unnamedRegister.setText(register.toString(), linewise);\n },\n // Gets the register named @name. If one of @name doesn't already exist,\n // create it. If @name is invalid, return the unnamedRegister.\n getRegister: function(name) {\n if (!this.isValidRegister(name)) {\n return this.unnamedRegister;\n }\n name = name.toLowerCase();\n if (!this.registers[name]) {\n this.registers[name] = new Register();\n }\n return this.registers[name];\n },\n isValidRegister: function(name) {\n return name && inArray(name, validRegisters);\n },\n shiftNumericRegisters_: function() {\n for (var i = 9; i >= 2; i--) {\n this.registers[i] = this.getRegister('' + (i - 1));\n }\n }\n };\n\n var commandDispatcher = {\n matchCommand: function(key, keyMap, vim) {\n var inputState = vim.inputState;\n var keys = inputState.keyBuffer.concat(key);\n var matchedCommands = [];\n var selectedCharacter;\n for (var i = 0; i < keyMap.length; i++) {\n var command = keyMap[i];\n if (matchKeysPartial(keys, command.keys)) {\n if (inputState.operator && command.type == 'action') {\n // Ignore matched action commands after an operator. Operators\n // only operate on motions. This check is really for text\n // objects since aW, a[ etcs conflicts with a.\n continue;\n }\n // Match commands that take <character> as an argument.\n if (command.keys[keys.length - 1] == 'character') {\n selectedCharacter = keys[keys.length - 1];\n if (selectedCharacter.length>1){\n switch(selectedCharacter){\n case '<CR>':\n selectedCharacter='\\n';\n break;\n case '<Space>':\n selectedCharacter=' ';\n break;\n default:\n continue;\n }\n }\n }\n // Add the command to the list of matched commands. Choose the best\n // command later.\n matchedCommands.push(command);\n }\n }\n\n // Returns the command if it is a full match, or null if not.\n function getFullyMatchedCommandOrNull(command) {\n if (keys.length < command.keys.length) {\n // Matches part of a multi-key command. Buffer and wait for next\n // stroke.\n inputState.keyBuffer.push(key);\n return null;\n } else {\n if (command.keys[keys.length - 1] == 'character') {\n inputState.selectedCharacter = selectedCharacter;\n }\n // Clear the buffer since a full match was found.\n inputState.keyBuffer = [];\n return command;\n }\n }\n\n if (!matchedCommands.length) {\n // Clear the buffer since there were no matches.\n inputState.keyBuffer = [];\n return null;\n } else if (matchedCommands.length == 1) {\n return getFullyMatchedCommandOrNull(matchedCommands[0]);\n } else {\n // Find the best match in the list of matchedCommands.\n var context = vim.visualMode ? 'visual' : 'normal';\n var bestMatch; // Default to first in the list.\n for (var i = 0; i < matchedCommands.length; i++) {\n var current = matchedCommands[i];\n if (current.context == context) {\n bestMatch = current;\n break;\n } else if (!bestMatch && !current.context) {\n // Only set an imperfect match to best match if no best match is\n // set and the imperfect match is not restricted to another\n // context.\n bestMatch = current;\n }\n }\n return getFullyMatchedCommandOrNull(bestMatch);\n }\n },\n processCommand: function(cm, vim, command) {\n vim.inputState.repeatOverride = command.repeatOverride;\n switch (command.type) {\n case 'motion':\n this.processMotion(cm, vim, command);\n break;\n case 'operator':\n this.processOperator(cm, vim, command);\n break;\n case 'operatorMotion':\n this.processOperatorMotion(cm, vim, command);\n break;\n case 'action':\n this.processAction(cm, vim, command);\n break;\n case 'search':\n this.processSearch(cm, vim, command);\n break;\n case 'ex':\n case 'keyToEx':\n this.processEx(cm, vim, command);\n break;\n default:\n break;\n }\n },\n processMotion: function(cm, vim, command) {\n vim.inputState.motion = command.motion;\n vim.inputState.motionArgs = copyArgs(command.motionArgs);\n this.evalInput(cm, vim);\n },\n processOperator: function(cm, vim, command) {\n var inputState = vim.inputState;\n if (inputState.operator) {\n if (inputState.operator == command.operator) {\n // Typing an operator twice like 'dd' makes the operator operate\n // linewise\n inputState.motion = 'expandToLine';\n inputState.motionArgs = { linewise: true };\n this.evalInput(cm, vim);\n return;\n } else {\n // 2 different operators in a row doesn't make sense.\n vim.inputState = new InputState();\n }\n }\n inputState.operator = command.operator;\n inputState.operatorArgs = copyArgs(command.operatorArgs);\n if (vim.visualMode) {\n // Operating on a selection in visual mode. We don't need a motion.\n this.evalInput(cm, vim);\n }\n },\n processOperatorMotion: function(cm, vim, command) {\n var visualMode = vim.visualMode;\n var operatorMotionArgs = copyArgs(command.operatorMotionArgs);\n if (operatorMotionArgs) {\n // Operator motions may have special behavior in visual mode.\n if (visualMode && operatorMotionArgs.visualLine) {\n vim.visualLine = true;\n }\n }\n this.processOperator(cm, vim, command);\n if (!visualMode) {\n this.processMotion(cm, vim, command);\n }\n },\n processAction: function(cm, vim, command) {\n var inputState = vim.inputState;\n var repeat = inputState.getRepeat();\n var repeatIsExplicit = !!repeat;\n var actionArgs = copyArgs(command.actionArgs) || {};\n if (inputState.selectedCharacter) {\n actionArgs.selectedCharacter = inputState.selectedCharacter;\n }\n // Actions may or may not have motions and operators. Do these first.\n if (command.operator) {\n this.processOperator(cm, vim, command);\n }\n if (command.motion) {\n this.processMotion(cm, vim, command);\n }\n if (command.motion || command.operator) {\n this.evalInput(cm, vim);\n }\n actionArgs.repeat = repeat || 1;\n actionArgs.repeatIsExplicit = repeatIsExplicit;\n actionArgs.registerName = inputState.registerName;\n vim.inputState = new InputState();\n vim.lastMotion = null;\n if (command.isEdit) {\n this.recordLastEdit(vim, inputState, command);\n }\n actions[command.action](cm, actionArgs, vim);\n },\n processSearch: function(cm, vim, command) {\n if (!cm.getSearchCursor) {\n // Search depends on SearchCursor.\n return;\n }\n var forward = command.searchArgs.forward;\n var wholeWordOnly = command.searchArgs.wholeWordOnly;\n getSearchState(cm).setReversed(!forward);\n var promptPrefix = (forward) ? '/' : '?';\n var originalQuery = getSearchState(cm).getQuery();\n var originalScrollPos = cm.getScrollInfo();\n function handleQuery(query, ignoreCase, smartCase) {\n try {\n updateSearchQuery(cm, query, ignoreCase, smartCase);\n } catch (e) {\n showConfirm(cm, 'Invalid regex: ' + query);\n return;\n }\n commandDispatcher.processMotion(cm, vim, {\n type: 'motion',\n motion: 'findNext',\n motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }\n });\n }\n function onPromptClose(query) {\n cm.scrollTo(originalScrollPos.left, originalScrollPos.top);\n handleQuery(query, true /** ignoreCase */, true /** smartCase */);\n var macroModeState = vimGlobalState.macroModeState;\n if (macroModeState.isRecording) {\n logSearchQuery(macroModeState, query);\n }\n }\n function onPromptKeyUp(_e, query) {\n var parsedQuery;\n try {\n parsedQuery = updateSearchQuery(cm, query,\n true /** ignoreCase */, true /** smartCase */);\n } catch (e) {\n // Swallow bad regexes for incremental search.\n }\n if (parsedQuery) {\n cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);\n } else {\n clearSearchHighlight(cm);\n cm.scrollTo(originalScrollPos.left, originalScrollPos.top);\n }\n }\n function onPromptKeyDown(e, _query, close) {\n var keyName = CodeMirror.keyName(e);\n if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {\n updateSearchQuery(cm, originalQuery);\n clearSearchHighlight(cm);\n cm.scrollTo(originalScrollPos.left, originalScrollPos.top);\n\n CodeMirror.e_stop(e);\n close();\n cm.focus();\n }\n }\n switch (command.searchArgs.querySrc) {\n case 'prompt':\n var macroModeState = vimGlobalState.macroModeState;\n if (macroModeState.isPlaying) {\n var query = macroModeState.replaySearchQueries.shift();\n handleQuery(query, true /** ignoreCase */, false /** smartCase */);\n } else {\n showPrompt(cm, {\n onClose: onPromptClose,\n prefix: promptPrefix,\n desc: searchPromptDesc,\n onKeyUp: onPromptKeyUp,\n onKeyDown: onPromptKeyDown\n });\n }\n break;\n case 'wordUnderCursor':\n var word = expandWordUnderCursor(cm, false /** inclusive */,\n true /** forward */, false /** bigWord */,\n true /** noSymbol */);\n var isKeyword = true;\n if (!word) {\n word = expandWordUnderCursor(cm, false /** inclusive */,\n true /** forward */, false /** bigWord */,\n false /** noSymbol */);\n isKeyword = false;\n }\n if (!word) {\n return;\n }\n var query = cm.getLine(word.start.line).substring(word.start.ch,\n word.end.ch);\n if (isKeyword && wholeWordOnly) {\n query = '\\\\b' + query + '\\\\b';\n } else {\n query = escapeRegex(query);\n }\n\n // cachedCursor is used to save the old position of the cursor\n // when * or # causes vim to seek for the nearest word and shift\n // the cursor before entering the motion.\n vimGlobalState.jumpList.cachedCursor = cm.getCursor();\n cm.setCursor(word.start);\n\n handleQuery(query, true /** ignoreCase */, false /** smartCase */);\n break;\n }\n },\n processEx: function(cm, vim, command) {\n function onPromptClose(input) {\n // Give the prompt some time to close so that if processCommand shows\n // an error, the elements don't overlap.\n exCommandDispatcher.processCommand(cm, input);\n }\n function onPromptKeyDown(e, _input, close) {\n var keyName = CodeMirror.keyName(e);\n if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {\n CodeMirror.e_stop(e);\n close();\n cm.focus();\n }\n }\n if (command.type == 'keyToEx') {\n // Handle user defined Ex to Ex mappings\n exCommandDispatcher.processCommand(cm, command.exArgs.input);\n } else {\n if (vim.visualMode) {\n showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\\'<,\\'>',\n onKeyDown: onPromptKeyDown});\n } else {\n showPrompt(cm, { onClose: onPromptClose, prefix: ':',\n onKeyDown: onPromptKeyDown});\n }\n }\n },\n evalInput: function(cm, vim) {\n // If the motion comand is set, execute both the operator and motion.\n // Otherwise return.\n var inputState = vim.inputState;\n var motion = inputState.motion;\n var motionArgs = inputState.motionArgs || {};\n var operator = inputState.operator;\n var operatorArgs = inputState.operatorArgs || {};\n var registerName = inputState.registerName;\n var selectionEnd = copyCursor(cm.getCursor('head'));\n var selectionStart = copyCursor(cm.getCursor('anchor'));\n // The difference between cur and selection cursors are that cur is\n // being operated on and ignores that there is a selection.\n var curStart = copyCursor(selectionEnd);\n var curOriginal = copyCursor(curStart);\n var curEnd;\n var repeat;\n if (operator) {\n this.recordLastEdit(vim, inputState);\n }\n if (inputState.repeatOverride !== undefined) {\n // If repeatOverride is specified, that takes precedence over the\n // input state's repeat. Used by Ex mode and can be user defined.\n repeat = inputState.repeatOverride;\n } else {\n repeat = inputState.getRepeat();\n }\n if (repeat > 0 && motionArgs.explicitRepeat) {\n motionArgs.repeatIsExplicit = true;\n } else if (motionArgs.noRepeat ||\n (!motionArgs.explicitRepeat && repeat === 0)) {\n repeat = 1;\n motionArgs.repeatIsExplicit = false;\n }\n if (inputState.selectedCharacter) {\n // If there is a character input, stick it in all of the arg arrays.\n motionArgs.selectedCharacter = operatorArgs.selectedCharacter =\n inputState.selectedCharacter;\n }\n motionArgs.repeat = repeat;\n vim.inputState = new InputState();\n if (motion) {\n var motionResult = motions[motion](cm, motionArgs, vim);\n vim.lastMotion = motions[motion];\n if (!motionResult) {\n return;\n }\n if (motionArgs.toJumplist) {\n var jumpList = vimGlobalState.jumpList;\n // if the current motion is # or *, use cachedCursor\n var cachedCursor = jumpList.cachedCursor;\n if (cachedCursor) {\n recordJumpPosition(cm, cachedCursor, motionResult);\n delete jumpList.cachedCursor;\n } else {\n recordJumpPosition(cm, curOriginal, motionResult);\n }\n }\n if (motionResult instanceof Array) {\n curStart = motionResult[0];\n curEnd = motionResult[1];\n } else {\n curEnd = motionResult;\n }\n // TODO: Handle null returns from motion commands better.\n if (!curEnd) {\n curEnd = Pos(curStart.line, curStart.ch);\n }\n if (vim.visualMode) {\n // Check if the selection crossed over itself. Will need to shift\n // the start point if that happened.\n if (cursorIsBefore(selectionStart, selectionEnd) &&\n (cursorEqual(selectionStart, curEnd) ||\n cursorIsBefore(curEnd, selectionStart))) {\n // The end of the selection has moved from after the start to\n // before the start. We will shift the start right by 1.\n selectionStart.ch += 1;\n } else if (cursorIsBefore(selectionEnd, selectionStart) &&\n (cursorEqual(selectionStart, curEnd) ||\n cursorIsBefore(selectionStart, curEnd))) {\n // The opposite happened. We will shift the start left by 1.\n selectionStart.ch -= 1;\n }\n selectionEnd = curEnd;\n selectionStart = (motionResult instanceof Array) ? curStart : selectionStart;\n if (vim.visualLine) {\n if (cursorIsBefore(selectionStart, selectionEnd)) {\n selectionStart.ch = 0;\n\n var lastLine = cm.lastLine();\n if (selectionEnd.line > lastLine) {\n selectionEnd.line = lastLine;\n }\n selectionEnd.ch = lineLength(cm, selectionEnd.line);\n } else {\n selectionEnd.ch = 0;\n selectionStart.ch = lineLength(cm, selectionStart.line);\n }\n }\n cm.setSelection(selectionStart, selectionEnd);\n updateMark(cm, vim, '<',\n cursorIsBefore(selectionStart, selectionEnd) ? selectionStart\n : selectionEnd);\n updateMark(cm, vim, '>',\n cursorIsBefore(selectionStart, selectionEnd) ? selectionEnd\n : selectionStart);\n } else if (!operator) {\n curEnd = clipCursorToContent(cm, curEnd);\n cm.setCursor(curEnd.line, curEnd.ch);\n }\n }\n\n if (operator) {\n var inverted = false;\n vim.lastMotion = null;\n operatorArgs.repeat = repeat; // Indent in visual mode needs this.\n if (vim.visualMode) {\n curStart = selectionStart;\n curEnd = selectionEnd;\n motionArgs.inclusive = true;\n }\n // Swap start and end if motion was backward.\n if (curEnd && cursorIsBefore(curEnd, curStart)) {\n var tmp = curStart;\n curStart = curEnd;\n curEnd = tmp;\n inverted = true;\n } else if (!curEnd) {\n curEnd = copyCursor(curStart);\n }\n if (motionArgs.inclusive && !(vim.visualMode && inverted)) {\n // Move the selection end one to the right to include the last\n // character.\n curEnd.ch++;\n }\n if (operatorArgs.selOffset) {\n // Replaying a visual mode operation\n curEnd.line = curStart.line + operatorArgs.selOffset.line;\n if (operatorArgs.selOffset.line) {curEnd.ch = operatorArgs.selOffset.ch; }\n else { curEnd.ch = curStart.ch + operatorArgs.selOffset.ch; }\n } else if (vim.visualMode) {\n var selOffset = Pos();\n selOffset.line = curEnd.line - curStart.line;\n if (selOffset.line) { selOffset.ch = curEnd.ch; }\n else { selOffset.ch = curEnd.ch - curStart.ch; }\n operatorArgs.selOffset = selOffset;\n }\n var linewise = motionArgs.linewise ||\n (vim.visualMode && vim.visualLine) ||\n operatorArgs.linewise;\n if (linewise) {\n // Expand selection to entire line.\n expandSelectionToLine(cm, curStart, curEnd);\n } else if (motionArgs.forward) {\n // Clip to trailing newlines only if the motion goes forward.\n clipToLine(cm, curStart, curEnd);\n }\n operatorArgs.registerName = registerName;\n // Keep track of linewise as it affects how paste and change behave.\n operatorArgs.linewise = linewise;\n operators[operator](cm, operatorArgs, vim, curStart,\n curEnd, curOriginal);\n if (vim.visualMode) {\n exitVisualMode(cm);\n }\n }\n },\n recordLastEdit: function(vim, inputState, actionCommand) {\n var macroModeState = vimGlobalState.macroModeState;\n if (macroModeState.isPlaying) { return; }\n vim.lastEditInputState = inputState;\n vim.lastEditActionCommand = actionCommand;\n macroModeState.lastInsertModeChanges.changes = [];\n macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;\n }\n };\n\n /**\n * typedef {Object{line:number,ch:number}} Cursor An object containing the\n * position of the cursor.\n */\n // All of the functions below return Cursor objects.\n var motions = {\n moveToTopLine: function(cm, motionArgs) {\n var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;\n return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n },\n moveToMiddleLine: function(cm) {\n var range = getUserVisibleLines(cm);\n var line = Math.floor((range.top + range.bottom) * 0.5);\n return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n },\n moveToBottomLine: function(cm, motionArgs) {\n var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;\n return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));\n },\n expandToLine: function(cm, motionArgs) {\n // Expands forward to end of line, and then to next line if repeat is\n // >1. Does not handle backward motion!\n var cur = cm.getCursor();\n return Pos(cur.line + motionArgs.repeat - 1, Infinity);\n },\n findNext: function(cm, motionArgs) {\n var state = getSearchState(cm);\n var query = state.getQuery();\n if (!query) {\n return;\n }\n var prev = !motionArgs.forward;\n // If search is initiated with ? instead of /, negate direction.\n prev = (state.isReversed()) ? !prev : prev;\n highlightSearchMatches(cm, query);\n return findNext(cm, prev/** prev */, query, motionArgs.repeat);\n },\n goToMark: function(cm, motionArgs, vim) {\n var mark = vim.marks[motionArgs.selectedCharacter];\n if (mark) {\n var pos = mark.find();\n return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;\n }\n return null;\n },\n moveToOtherHighlightedEnd: function(cm) {\n var curEnd = copyCursor(cm.getCursor('head'));\n var curStart = copyCursor(cm.getCursor('anchor'));\n if (cursorIsBefore(curStart, curEnd)) {\n curEnd.ch += 1;\n } else if (cursorIsBefore(curEnd, curStart)) {\n curStart.ch -= 1;\n }\n return ([curEnd,curStart]);\n },\n jumpToMark: function(cm, motionArgs, vim) {\n var best = cm.getCursor();\n for (var i = 0; i < motionArgs.repeat; i++) {\n var cursor = best;\n for (var key in vim.marks) {\n if (!isLowerCase(key)) {\n continue;\n }\n var mark = vim.marks[key].find();\n var isWrongDirection = (motionArgs.forward) ?\n cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);\n\n if (isWrongDirection) {\n continue;\n }\n if (motionArgs.linewise && (mark.line == cursor.line)) {\n continue;\n }\n\n var equal = cursorEqual(cursor, best);\n var between = (motionArgs.forward) ?\n cusrorIsBetween(cursor, mark, best) :\n cusrorIsBetween(best, mark, cursor);\n\n if (equal || between) {\n best = mark;\n }\n }\n }\n\n if (motionArgs.linewise) {\n // Vim places the cursor on the first non-whitespace character of\n // the line if there is one, else it places the cursor at the end\n // of the line, regardless of whether a mark was found.\n best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));\n }\n return best;\n },\n moveByCharacters: function(cm, motionArgs) {\n var cur = cm.getCursor();\n var repeat = motionArgs.repeat;\n var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;\n return Pos(cur.line, ch);\n },\n moveByLines: function(cm, motionArgs, vim) {\n var cur = cm.getCursor();\n var endCh = cur.ch;\n // Depending what our last motion was, we may want to do different\n // things. If our last motion was moving vertically, we want to\n // preserve the HPos from our last horizontal move. If our last motion\n // was going to the end of a line, moving vertically we should go to\n // the end of the line, etc.\n switch (vim.lastMotion) {\n case this.moveByLines:\n case this.moveByDisplayLines:\n case this.moveByScroll:\n case this.moveToColumn:\n case this.moveToEol:\n endCh = vim.lastHPos;\n break;\n default:\n vim.lastHPos = endCh;\n }\n var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0);\n var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;\n var first = cm.firstLine();\n var last = cm.lastLine();\n // Vim cancels linewise motions that start on an edge and move beyond\n // that edge. It does not cancel motions that do not start on an edge.\n if ((line < first && cur.line == first) ||\n (line > last && cur.line == last)) {\n return;\n }\n if (motionArgs.toFirstChar){\n endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));\n vim.lastHPos = endCh;\n }\n vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left;\n return Pos(line, endCh);\n },\n moveByDisplayLines: function(cm, motionArgs, vim) {\n var cur = cm.getCursor();\n switch (vim.lastMotion) {\n case this.moveByDisplayLines:\n case this.moveByScroll:\n case this.moveByLines:\n case this.moveToColumn:\n case this.moveToEol:\n break;\n default:\n vim.lastHSPos = cm.charCoords(cur,'div').left;\n }\n var repeat = motionArgs.repeat;\n var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos);\n if (res.hitSide) {\n if (motionArgs.forward) {\n var lastCharCoords = cm.charCoords(res, 'div');\n var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };\n var res = cm.coordsChar(goalCoords, 'div');\n } else {\n var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div');\n resCoords.left = vim.lastHSPos;\n res = cm.coordsChar(resCoords, 'div');\n }\n }\n vim.lastHPos = res.ch;\n return res;\n },\n moveByPage: function(cm, motionArgs) {\n // CodeMirror only exposes functions that move the cursor page down, so\n // doing this bad hack to move the cursor and move it back. evalInput\n // will move the cursor to where it should be in the end.\n var curStart = cm.getCursor();\n var repeat = motionArgs.repeat;\n return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page');\n },\n moveByParagraph: function(cm, motionArgs) {\n var line = cm.getCursor().line;\n var repeat = motionArgs.repeat;\n var inc = motionArgs.forward ? 1 : -1;\n for (var i = 0; i < repeat; i++) {\n if ((!motionArgs.forward && line === cm.firstLine() ) ||\n (motionArgs.forward && line == cm.lastLine())) {\n break;\n }\n line += inc;\n while (line !== cm.firstLine() && line != cm.lastLine() && cm.getLine(line)) {\n line += inc;\n }\n }\n return Pos(line, 0);\n },\n moveByScroll: function(cm, motionArgs, vim) {\n var scrollbox = cm.getScrollInfo();\n var curEnd = null;\n var repeat = motionArgs.repeat;\n if (!repeat) {\n repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());\n }\n var orig = cm.charCoords(cm.getCursor(), 'local');\n motionArgs.repeat = repeat;\n var curEnd = motions.moveByDisplayLines(cm, motionArgs, vim);\n if (!curEnd) {\n return null;\n }\n var dest = cm.charCoords(curEnd, 'local');\n cm.scrollTo(null, scrollbox.top + dest.top - orig.top);\n return curEnd;\n },\n moveByWords: function(cm, motionArgs) {\n return moveToWord(cm, motionArgs.repeat, !!motionArgs.forward,\n !!motionArgs.wordEnd, !!motionArgs.bigWord);\n },\n moveTillCharacter: function(cm, motionArgs) {\n var repeat = motionArgs.repeat;\n var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,\n motionArgs.selectedCharacter);\n var increment = motionArgs.forward ? -1 : 1;\n recordLastCharacterSearch(increment, motionArgs);\n if (!curEnd) return null;\n curEnd.ch += increment;\n return curEnd;\n },\n moveToCharacter: function(cm, motionArgs) {\n var repeat = motionArgs.repeat;\n recordLastCharacterSearch(0, motionArgs);\n return moveToCharacter(cm, repeat, motionArgs.forward,\n motionArgs.selectedCharacter) || cm.getCursor();\n },\n moveToSymbol: function(cm, motionArgs) {\n var repeat = motionArgs.repeat;\n return findSymbol(cm, repeat, motionArgs.forward,\n motionArgs.selectedCharacter) || cm.getCursor();\n },\n moveToColumn: function(cm, motionArgs, vim) {\n var repeat = motionArgs.repeat;\n // repeat is equivalent to which column we want to move to!\n vim.lastHPos = repeat - 1;\n vim.lastHSPos = cm.charCoords(cm.getCursor(),'div').left;\n return moveToColumn(cm, repeat);\n },\n moveToEol: function(cm, motionArgs, vim) {\n var cur = cm.getCursor();\n vim.lastHPos = Infinity;\n var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);\n var end=cm.clipPos(retval);\n end.ch--;\n vim.lastHSPos = cm.charCoords(end,'div').left;\n return retval;\n },\n moveToFirstNonWhiteSpaceCharacter: function(cm) {\n // Go to the start of the line where the text begins, or the end for\n // whitespace-only lines\n var cursor = cm.getCursor();\n return Pos(cursor.line,\n findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));\n },\n moveToMatchedSymbol: function(cm) {\n var cursor = cm.getCursor();\n var line = cursor.line;\n var ch = cursor.ch;\n var lineText = cm.getLine(line);\n var symbol;\n do {\n symbol = lineText.charAt(ch++);\n if (symbol && isMatchableSymbol(symbol)) {\n var style = cm.getTokenTypeAt(Pos(line, ch));\n if (style !== \"string\" && style !== \"comment\") {\n break;\n }\n }\n } while (symbol);\n if (symbol) {\n var matched = cm.findMatchingBracket(Pos(line, ch));\n return matched.to;\n } else {\n return cursor;\n }\n },\n moveToStartOfLine: function(cm) {\n var cursor = cm.getCursor();\n return Pos(cursor.line, 0);\n },\n moveToLineOrEdgeOfDocument: function(cm, motionArgs) {\n var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();\n if (motionArgs.repeatIsExplicit) {\n lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');\n }\n return Pos(lineNum,\n findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));\n },\n textObjectManipulation: function(cm, motionArgs) {\n // TODO: lots of possible exceptions that can be thrown here. Try da(\n // outside of a () block.\n\n // TODO: adding <> >< to this map doesn't work, presumably because\n // they're operators\n var mirroredPairs = {'(': ')', ')': '(',\n '{': '}', '}': '{',\n '[': ']', ']': '['};\n var selfPaired = {'\\'': true, '\"': true};\n\n var character = motionArgs.selectedCharacter;\n // 'b' refers to '()' block.\n // 'B' refers to '{}' block.\n if (character == 'b') {\n character = '(';\n } else if (character == 'B') {\n character = '{';\n }\n\n // Inclusive is the difference between a and i\n // TODO: Instead of using the additional text object map to perform text\n // object operations, merge the map into the defaultKeyMap and use\n // motionArgs to define behavior. Define separate entries for 'aw',\n // 'iw', 'a[', 'i[', etc.\n var inclusive = !motionArgs.textObjectInner;\n\n var tmp;\n if (mirroredPairs[character]) {\n tmp = selectCompanionObject(cm, character, inclusive);\n } else if (selfPaired[character]) {\n tmp = findBeginningAndEnd(cm, character, inclusive);\n } else if (character === 'W') {\n tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,\n true /** bigWord */);\n } else if (character === 'w') {\n tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,\n false /** bigWord */);\n } else {\n // No text object defined for this, don't move.\n return null;\n }\n\n return [tmp.start, tmp.end];\n },\n\n repeatLastCharacterSearch: function(cm, motionArgs) {\n var lastSearch = vimGlobalState.lastChararacterSearch;\n var repeat = motionArgs.repeat;\n var forward = motionArgs.forward === lastSearch.forward;\n var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);\n cm.moveH(-increment, 'char');\n motionArgs.inclusive = forward ? true : false;\n var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);\n if (!curEnd) {\n cm.moveH(increment, 'char');\n return cm.getCursor();\n }\n curEnd.ch += increment;\n return curEnd;\n }\n };\n\n var operators = {\n change: function(cm, operatorArgs, _vim, curStart, curEnd) {\n vimGlobalState.registerController.pushText(\n operatorArgs.registerName, 'change', cm.getRange(curStart, curEnd),\n operatorArgs.linewise);\n if (operatorArgs.linewise) {\n // Push the next line back down, if there is a next line.\n var replacement = curEnd.line > cm.lastLine() ? '' : '\\n';\n cm.replaceRange(replacement, curStart, curEnd);\n cm.indentLine(curStart.line, 'smart');\n // null ch so setCursor moves to end of line.\n curStart.ch = null;\n } else {\n // Exclude trailing whitespace if the range is not all whitespace.\n var text = cm.getRange(curStart, curEnd);\n if (!isWhiteSpaceString(text)) {\n var match = (/\\s+$/).exec(text);\n if (match) {\n curEnd = offsetCursor(curEnd, 0, - match[0].length);\n }\n }\n cm.replaceRange('', curStart, curEnd);\n }\n actions.enterInsertMode(cm, {}, cm.state.vim);\n cm.setCursor(curStart);\n },\n // delete is a javascript keyword.\n 'delete': function(cm, operatorArgs, _vim, curStart, curEnd) {\n // If the ending line is past the last line, inclusive, instead of\n // including the trailing \\n, include the \\n before the starting line\n if (operatorArgs.linewise &&\n curEnd.line > cm.lastLine() && curStart.line > cm.firstLine()) {\n curStart.line--;\n curStart.ch = lineLength(cm, curStart.line);\n }\n vimGlobalState.registerController.pushText(\n operatorArgs.registerName, 'delete', cm.getRange(curStart, curEnd),\n operatorArgs.linewise);\n cm.replaceRange('', curStart, curEnd);\n if (operatorArgs.linewise) {\n cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));\n } else {\n cm.setCursor(curStart);\n }\n },\n indent: function(cm, operatorArgs, vim, curStart, curEnd) {\n var startLine = curStart.line;\n var endLine = curEnd.line;\n // In visual mode, n> shifts the selection right n times, instead of\n // shifting n lines right once.\n var repeat = (vim.visualMode) ? operatorArgs.repeat : 1;\n if (operatorArgs.linewise) {\n // The only way to delete a newline is to delete until the start of\n // the next line, so in linewise mode evalInput will include the next\n // line. We don't want this in indent, so we go back a line.\n endLine--;\n }\n for (var i = startLine; i <= endLine; i++) {\n for (var j = 0; j < repeat; j++) {\n cm.indentLine(i, operatorArgs.indentRight);\n }\n }\n cm.setCursor(curStart);\n cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));\n },\n swapcase: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {\n var toSwap = cm.getRange(curStart, curEnd);\n var swapped = '';\n for (var i = 0; i < toSwap.length; i++) {\n var character = toSwap.charAt(i);\n swapped += isUpperCase(character) ? character.toLowerCase() :\n character.toUpperCase();\n }\n cm.replaceRange(swapped, curStart, curEnd);\n if (!operatorArgs.shouldMoveCursor) {\n cm.setCursor(curOriginal);\n }\n },\n yank: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {\n vimGlobalState.registerController.pushText(\n operatorArgs.registerName, 'yank',\n cm.getRange(curStart, curEnd), operatorArgs.linewise);\n cm.setCursor(curOriginal);\n }\n };\n\n var actions = {\n jumpListWalk: function(cm, actionArgs, vim) {\n if (vim.visualMode) {\n return;\n }\n var repeat = actionArgs.repeat;\n var forward = actionArgs.forward;\n var jumpList = vimGlobalState.jumpList;\n\n var mark = jumpList.move(cm, forward ? repeat : -repeat);\n var markPos = mark ? mark.find() : undefined;\n markPos = markPos ? markPos : cm.getCursor();\n cm.setCursor(markPos);\n },\n scroll: function(cm, actionArgs, vim) {\n if (vim.visualMode) {\n return;\n }\n var repeat = actionArgs.repeat || 1;\n var lineHeight = cm.defaultTextHeight();\n var top = cm.getScrollInfo().top;\n var delta = lineHeight * repeat;\n var newPos = actionArgs.forward ? top + delta : top - delta;\n var cursor = copyCursor(cm.getCursor());\n var cursorCoords = cm.charCoords(cursor, 'local');\n if (actionArgs.forward) {\n if (newPos > cursorCoords.top) {\n cursor.line += (newPos - cursorCoords.top) / lineHeight;\n cursor.line = Math.ceil(cursor.line);\n cm.setCursor(cursor);\n cursorCoords = cm.charCoords(cursor, 'local');\n cm.scrollTo(null, cursorCoords.top);\n } else {\n // Cursor stays within bounds. Just reposition the scroll window.\n cm.scrollTo(null, newPos);\n }\n } else {\n var newBottom = newPos + cm.getScrollInfo().clientHeight;\n if (newBottom < cursorCoords.bottom) {\n cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;\n cursor.line = Math.floor(cursor.line);\n cm.setCursor(cursor);\n cursorCoords = cm.charCoords(cursor, 'local');\n cm.scrollTo(\n null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);\n } else {\n // Cursor stays within bounds. Just reposition the scroll window.\n cm.scrollTo(null, newPos);\n }\n }\n },\n scrollToCursor: function(cm, actionArgs) {\n var lineNum = cm.getCursor().line;\n var charCoords = cm.charCoords(Pos(lineNum, 0), 'local');\n var height = cm.getScrollInfo().clientHeight;\n var y = charCoords.top;\n var lineHeight = charCoords.bottom - y;\n switch (actionArgs.position) {\n case 'center': y = y - (height / 2) + lineHeight;\n break;\n case 'bottom': y = y - height + lineHeight*1.4;\n break;\n case 'top': y = y + lineHeight*0.4;\n break;\n }\n cm.scrollTo(null, y);\n },\n replayMacro: function(cm, actionArgs, vim) {\n var registerName = actionArgs.selectedCharacter;\n var repeat = actionArgs.repeat;\n var macroModeState = vimGlobalState.macroModeState;\n if (registerName == '@') {\n registerName = macroModeState.latestRegister;\n }\n while(repeat--){\n executeMacroRegister(cm, vim, macroModeState, registerName);\n }\n },\n enterMacroRecordMode: function(cm, actionArgs) {\n var macroModeState = vimGlobalState.macroModeState;\n var registerName = actionArgs.selectedCharacter;\n macroModeState.enterMacroRecordMode(cm, registerName);\n },\n enterInsertMode: function(cm, actionArgs, vim) {\n if (cm.getOption('readOnly')) { return; }\n vim.insertMode = true;\n vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;\n var insertAt = (actionArgs) ? actionArgs.insertAt : null;\n if (insertAt == 'eol') {\n var cursor = cm.getCursor();\n cursor = Pos(cursor.line, lineLength(cm, cursor.line));\n cm.setCursor(cursor);\n } else if (insertAt == 'charAfter') {\n cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));\n } else if (insertAt == 'firstNonBlank') {\n cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));\n }\n cm.setOption('keyMap', 'vim-insert');\n cm.setOption('disableInput', false);\n if (actionArgs && actionArgs.replace) {\n // Handle Replace-mode as a special case of insert mode.\n cm.toggleOverwrite(true);\n cm.setOption('keyMap', 'vim-replace');\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"replace\"});\n } else {\n cm.setOption('keyMap', 'vim-insert');\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"insert\"});\n }\n if (!vimGlobalState.macroModeState.isPlaying) {\n // Only record if not replaying.\n cm.on('change', onChange);\n CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);\n }\n },\n toggleVisualMode: function(cm, actionArgs, vim) {\n var repeat = actionArgs.repeat;\n var curStart = cm.getCursor();\n var curEnd;\n // TODO: The repeat should actually select number of characters/lines\n // equal to the repeat times the size of the previous visual\n // operation.\n if (!vim.visualMode) {\n cm.on('mousedown', exitVisualMode);\n vim.visualMode = true;\n vim.visualLine = !!actionArgs.linewise;\n if (vim.visualLine) {\n curStart.ch = 0;\n curEnd = clipCursorToContent(\n cm, Pos(curStart.line + repeat - 1, lineLength(cm, curStart.line)),\n true /** includeLineBreak */);\n } else {\n curEnd = clipCursorToContent(\n cm, Pos(curStart.line, curStart.ch + repeat),\n true /** includeLineBreak */);\n }\n // Make the initial selection.\n if (!actionArgs.repeatIsExplicit && !vim.visualLine) {\n // This is a strange case. Here the implicit repeat is 1. The\n // following commands lets the cursor hover over the 1 character\n // selection.\n cm.setCursor(curEnd);\n cm.setSelection(curEnd, curStart);\n } else {\n cm.setSelection(curStart, curEnd);\n }\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"visual\", subMode: vim.visualLine ? \"linewise\" : \"\"});\n } else {\n curStart = cm.getCursor('anchor');\n curEnd = cm.getCursor('head');\n if (!vim.visualLine && actionArgs.linewise) {\n // Shift-V pressed in characterwise visual mode. Switch to linewise\n // visual mode instead of exiting visual mode.\n vim.visualLine = true;\n curStart.ch = cursorIsBefore(curStart, curEnd) ? 0 :\n lineLength(cm, curStart.line);\n curEnd.ch = cursorIsBefore(curStart, curEnd) ?\n lineLength(cm, curEnd.line) : 0;\n cm.setSelection(curStart, curEnd);\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"visual\", subMode: \"linewise\"});\n } else if (vim.visualLine && !actionArgs.linewise) {\n // v pressed in linewise visual mode. Switch to characterwise visual\n // mode instead of exiting visual mode.\n vim.visualLine = false;\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"visual\"});\n } else {\n exitVisualMode(cm);\n }\n }\n updateMark(cm, vim, '<', cursorIsBefore(curStart, curEnd) ? curStart\n : curEnd);\n updateMark(cm, vim, '>', cursorIsBefore(curStart, curEnd) ? curEnd\n : curStart);\n },\n reselectLastSelection: function(cm, _actionArgs, vim) {\n if (vim.lastSelection) {\n var lastSelection = vim.lastSelection;\n cm.setSelection(lastSelection.curStart, lastSelection.curEnd);\n if (lastSelection.visualLine) {\n vim.visualMode = true;\n vim.visualLine = true;\n }\n else {\n vim.visualMode = true;\n vim.visualLine = false;\n }\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"visual\", subMode: vim.visualLine ? \"linewise\" : \"\"});\n }\n },\n joinLines: function(cm, actionArgs, vim) {\n var curStart, curEnd;\n if (vim.visualMode) {\n curStart = cm.getCursor('anchor');\n curEnd = cm.getCursor('head');\n curEnd.ch = lineLength(cm, curEnd.line) - 1;\n } else {\n // Repeat is the number of lines to join. Minimum 2 lines.\n var repeat = Math.max(actionArgs.repeat, 2);\n curStart = cm.getCursor();\n curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1,\n Infinity));\n }\n var finalCh = 0;\n cm.operation(function() {\n for (var i = curStart.line; i < curEnd.line; i++) {\n finalCh = lineLength(cm, curStart.line);\n var tmp = Pos(curStart.line + 1,\n lineLength(cm, curStart.line + 1));\n var text = cm.getRange(curStart, tmp);\n text = text.replace(/\\n\\s*/g, ' ');\n cm.replaceRange(text, curStart, tmp);\n }\n var curFinalPos = Pos(curStart.line, finalCh);\n cm.setCursor(curFinalPos);\n });\n },\n newLineAndEnterInsertMode: function(cm, actionArgs, vim) {\n vim.insertMode = true;\n var insertAt = copyCursor(cm.getCursor());\n if (insertAt.line === cm.firstLine() && !actionArgs.after) {\n // Special case for inserting newline before start of document.\n cm.replaceRange('\\n', Pos(cm.firstLine(), 0));\n cm.setCursor(cm.firstLine(), 0);\n } else {\n insertAt.line = (actionArgs.after) ? insertAt.line :\n insertAt.line - 1;\n insertAt.ch = lineLength(cm, insertAt.line);\n cm.setCursor(insertAt);\n var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||\n CodeMirror.commands.newlineAndIndent;\n newlineFn(cm);\n }\n this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);\n },\n paste: function(cm, actionArgs) {\n var cur = copyCursor(cm.getCursor());\n var register = vimGlobalState.registerController.getRegister(\n actionArgs.registerName);\n var text = register.toString();\n if (!text) {\n return;\n }\n if (actionArgs.matchIndent) {\n // length that considers tabs and cm.options.tabSize\n var whitespaceLength = function(str) {\n var tabs = (str.split(\"\\t\").length - 1);\n var spaces = (str.split(\" \").length - 1);\n return tabs * cm.options.tabSize + spaces * 1;\n };\n var currentLine = cm.getLine(cm.getCursor().line);\n var indent = whitespaceLength(currentLine.match(/^\\s*/)[0]);\n // chomp last newline b/c don't want it to match /^\\s*/gm\n var chompedText = text.replace(/\\n$/, '');\n var wasChomped = text !== chompedText;\n var firstIndent = whitespaceLength(text.match(/^\\s*/)[0]);\n var text = chompedText.replace(/^\\s*/gm, function(wspace) {\n var newIndent = indent + (whitespaceLength(wspace) - firstIndent);\n if (newIndent < 0) {\n return \"\";\n }\n else if (cm.options.indentWithTabs) {\n var quotient = Math.floor(newIndent / cm.options.tabSize);\n return Array(quotient + 1).join('\\t');\n }\n else {\n return Array(newIndent + 1).join(' ');\n }\n });\n text += wasChomped ? \"\\n\" : \"\";\n }\n if (actionArgs.repeat > 1) {\n var text = Array(actionArgs.repeat + 1).join(text);\n }\n var linewise = register.linewise;\n if (linewise) {\n if (actionArgs.after) {\n // Move the newline at the end to the start instead, and paste just\n // before the newline character of the line we are on right now.\n text = '\\n' + text.slice(0, text.length - 1);\n cur.ch = lineLength(cm, cur.line);\n } else {\n cur.ch = 0;\n }\n } else {\n cur.ch += actionArgs.after ? 1 : 0;\n }\n cm.replaceRange(text, cur);\n // Now fine tune the cursor to where we want it.\n var curPosFinal;\n var idx;\n if (linewise && actionArgs.after) {\n curPosFinal = Pos(\n cur.line + 1,\n findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));\n } else if (linewise && !actionArgs.after) {\n curPosFinal = Pos(\n cur.line,\n findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));\n } else if (!linewise && actionArgs.after) {\n idx = cm.indexFromPos(cur);\n curPosFinal = cm.posFromIndex(idx + text.length - 1);\n } else {\n idx = cm.indexFromPos(cur);\n curPosFinal = cm.posFromIndex(idx + text.length);\n }\n cm.setCursor(curPosFinal);\n },\n undo: function(cm, actionArgs) {\n cm.operation(function() {\n repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();\n cm.setCursor(cm.getCursor('anchor'));\n });\n },\n redo: function(cm, actionArgs) {\n repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();\n },\n setRegister: function(_cm, actionArgs, vim) {\n vim.inputState.registerName = actionArgs.selectedCharacter;\n },\n setMark: function(cm, actionArgs, vim) {\n var markName = actionArgs.selectedCharacter;\n updateMark(cm, vim, markName, cm.getCursor());\n },\n replace: function(cm, actionArgs, vim) {\n var replaceWith = actionArgs.selectedCharacter;\n var curStart = cm.getCursor();\n var replaceTo;\n var curEnd;\n if (vim.visualMode){\n curStart=cm.getCursor('start');\n curEnd=cm.getCursor('end');\n // workaround to catch the character under the cursor\n // existing workaround doesn't cover actions\n curEnd=cm.clipPos(Pos(curEnd.line, curEnd.ch+1));\n }else{\n var line = cm.getLine(curStart.line);\n replaceTo = curStart.ch + actionArgs.repeat;\n if (replaceTo > line.length) {\n replaceTo=line.length;\n }\n curEnd = Pos(curStart.line, replaceTo);\n }\n if (replaceWith=='\\n'){\n if (!vim.visualMode) cm.replaceRange('', curStart, curEnd);\n // special case, where vim help says to replace by just one line-break\n (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);\n }else {\n var replaceWithStr=cm.getRange(curStart, curEnd);\n //replace all characters in range by selected, but keep linebreaks\n replaceWithStr=replaceWithStr.replace(/[^\\n]/g,replaceWith);\n cm.replaceRange(replaceWithStr, curStart, curEnd);\n if (vim.visualMode){\n cm.setCursor(curStart);\n exitVisualMode(cm);\n }else{\n cm.setCursor(offsetCursor(curEnd, 0, -1));\n }\n }\n },\n incrementNumberToken: function(cm, actionArgs) {\n var cur = cm.getCursor();\n var lineStr = cm.getLine(cur.line);\n var re = /-?\\d+/g;\n var match;\n var start;\n var end;\n var numberStr;\n var token;\n while ((match = re.exec(lineStr)) !== null) {\n token = match[0];\n start = match.index;\n end = start + token.length;\n if (cur.ch < end)break;\n }\n if (!actionArgs.backtrack && (end <= cur.ch))return;\n if (token) {\n var increment = actionArgs.increase ? 1 : -1;\n var number = parseInt(token) + (increment * actionArgs.repeat);\n var from = Pos(cur.line, start);\n var to = Pos(cur.line, end);\n numberStr = number.toString();\n cm.replaceRange(numberStr, from, to);\n } else {\n return;\n }\n cm.setCursor(Pos(cur.line, start + numberStr.length - 1));\n },\n repeatLastEdit: function(cm, actionArgs, vim) {\n var lastEditInputState = vim.lastEditInputState;\n if (!lastEditInputState) { return; }\n var repeat = actionArgs.repeat;\n if (repeat && actionArgs.repeatIsExplicit) {\n vim.lastEditInputState.repeatOverride = repeat;\n } else {\n repeat = vim.lastEditInputState.repeatOverride || repeat;\n }\n repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);\n },\n changeCase: function(cm, actionArgs, vim) {\n var selectedAreaRange = getSelectedAreaRange(cm, vim);\n var selectionStart = selectedAreaRange[0];\n var selectionEnd = selectedAreaRange[1];\n var toLower = actionArgs.toLower;\n if (cursorIsBefore(selectionEnd, selectionStart)) {\n var tmp = selectionStart;\n selectionStart = selectionEnd;\n selectionEnd = tmp;\n } else {\n selectionEnd = cm.clipPos(Pos(selectionEnd.line, selectionEnd.ch+1));\n }\n var text = cm.getRange(selectionStart, selectionEnd);\n cm.replaceRange(toLower ? text.toLowerCase() : text.toUpperCase(), selectionStart, selectionEnd);\n cm.setCursor(selectionStart);\n }\n };\n\n /*\n * Below are miscellaneous utility functions used by vim.js\n */\n\n /**\n * Clips cursor to ensure that line is within the buffer's range\n * If includeLineBreak is true, then allow cur.ch == lineLength.\n */\n function clipCursorToContent(cm, cur, includeLineBreak) {\n var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );\n var maxCh = lineLength(cm, line) - 1;\n maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;\n var ch = Math.min(Math.max(0, cur.ch), maxCh);\n return Pos(line, ch);\n }\n function copyArgs(args) {\n var ret = {};\n for (var prop in args) {\n if (args.hasOwnProperty(prop)) {\n ret[prop] = args[prop];\n }\n }\n return ret;\n }\n function offsetCursor(cur, offsetLine, offsetCh) {\n return Pos(cur.line + offsetLine, cur.ch + offsetCh);\n }\n function matchKeysPartial(pressed, mapped) {\n for (var i = 0; i < pressed.length; i++) {\n // 'character' means any character. For mark, register commads, etc.\n if (pressed[i] != mapped[i] && mapped[i] != 'character') {\n return false;\n }\n }\n return true;\n }\n function repeatFn(cm, fn, repeat) {\n return function() {\n for (var i = 0; i < repeat; i++) {\n fn(cm);\n }\n };\n }\n function copyCursor(cur) {\n return Pos(cur.line, cur.ch);\n }\n function cursorEqual(cur1, cur2) {\n return cur1.ch == cur2.ch && cur1.line == cur2.line;\n }\n function cursorIsBefore(cur1, cur2) {\n if (cur1.line < cur2.line) {\n return true;\n }\n if (cur1.line == cur2.line && cur1.ch < cur2.ch) {\n return true;\n }\n return false;\n }\n function cusrorIsBetween(cur1, cur2, cur3) {\n // returns true if cur2 is between cur1 and cur3.\n var cur1before2 = cursorIsBefore(cur1, cur2);\n var cur2before3 = cursorIsBefore(cur2, cur3);\n return cur1before2 && cur2before3;\n }\n function lineLength(cm, lineNum) {\n return cm.getLine(lineNum).length;\n }\n function reverse(s){\n return s.split('').reverse().join('');\n }\n function trim(s) {\n if (s.trim) {\n return s.trim();\n }\n return s.replace(/^\\s+|\\s+$/g, '');\n }\n function escapeRegex(s) {\n return s.replace(/([.?*+$\\[\\]\\/\\\\(){}|\\-])/g, '\\\\$1');\n }\n function getSelectedAreaRange(cm, vim) {\n var selectionStart = cm.getCursor('anchor');\n var selectionEnd = cm.getCursor('head');\n var lastSelection = vim.lastSelection;\n if (!vim.visualMode) {\n var line = lastSelection.curEnd.line - lastSelection.curStart.line;\n var ch = line ? lastSelection.curEnd.ch : lastSelection.curEnd.ch - lastSelection.curStart.ch;\n selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch};\n if (lastSelection.visualLine) {\n return [{line: selectionStart.line, ch: 0}, {line: selectionEnd.line, ch: lineLength(cm, selectionEnd.line)}];\n }\n } else {\n exitVisualMode(cm);\n }\n return [selectionStart, selectionEnd];\n }\n\n function exitVisualMode(cm) {\n cm.off('mousedown', exitVisualMode);\n var vim = cm.state.vim;\n // can't use selection state here because yank has already reset its cursor\n vim.lastSelection = {'curStart': vim.marks['<'].find(),\n 'curEnd': vim.marks['>'].find(), 'visualMode': vim.visualMode,\n 'visualLine': vim.visualLine};\n vim.visualMode = false;\n vim.visualLine = false;\n var selectionStart = cm.getCursor('anchor');\n var selectionEnd = cm.getCursor('head');\n if (!cursorEqual(selectionStart, selectionEnd)) {\n // Clear the selection and set the cursor only if the selection has not\n // already been cleared. Otherwise we risk moving the cursor somewhere\n // it's not supposed to be.\n cm.setCursor(clipCursorToContent(cm, selectionEnd));\n }\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"normal\"});\n }\n\n // Remove any trailing newlines from the selection. For\n // example, with the caret at the start of the last word on the line,\n // 'dw' should word, but not the newline, while 'w' should advance the\n // caret to the first character of the next line.\n function clipToLine(cm, curStart, curEnd) {\n var selection = cm.getRange(curStart, curEnd);\n // Only clip if the selection ends with trailing newline + whitespace\n if (/\\n\\s*$/.test(selection)) {\n var lines = selection.split('\\n');\n // We know this is all whitepsace.\n lines.pop();\n\n // Cases:\n // 1. Last word is an empty line - do not clip the trailing '\\n'\n // 2. Last word is not an empty line - clip the trailing '\\n'\n var line;\n // Find the line containing the last word, and clip all whitespace up\n // to it.\n for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {\n curEnd.line--;\n curEnd.ch = 0;\n }\n // If the last word is not an empty line, clip an additional newline\n if (line) {\n curEnd.line--;\n curEnd.ch = lineLength(cm, curEnd.line);\n } else {\n curEnd.ch = 0;\n }\n }\n }\n\n // Expand the selection to line ends.\n function expandSelectionToLine(_cm, curStart, curEnd) {\n curStart.ch = 0;\n curEnd.ch = 0;\n curEnd.line++;\n }\n\n function findFirstNonWhiteSpaceCharacter(text) {\n if (!text) {\n return 0;\n }\n var firstNonWS = text.search(/\\S/);\n return firstNonWS == -1 ? text.length : firstNonWS;\n }\n\n function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {\n var cur = cm.getCursor();\n var line = cm.getLine(cur.line);\n var idx = cur.ch;\n\n // Seek to first word or non-whitespace character, depending on if\n // noSymbol is true.\n var textAfterIdx = line.substring(idx);\n var firstMatchedChar;\n if (noSymbol) {\n firstMatchedChar = textAfterIdx.search(/\\w/);\n } else {\n firstMatchedChar = textAfterIdx.search(/\\S/);\n }\n if (firstMatchedChar == -1) {\n return null;\n }\n idx += firstMatchedChar;\n textAfterIdx = line.substring(idx);\n var textBeforeIdx = line.substring(0, idx);\n\n var matchRegex;\n // Greedy matchers for the \"word\" we are trying to expand.\n if (bigWord) {\n matchRegex = /^\\S+/;\n } else {\n if ((/\\w/).test(line.charAt(idx))) {\n matchRegex = /^\\w+/;\n } else {\n matchRegex = /^[^\\w\\s]+/;\n }\n }\n\n var wordAfterRegex = matchRegex.exec(textAfterIdx);\n var wordStart = idx;\n var wordEnd = idx + wordAfterRegex[0].length;\n // TODO: Find a better way to do this. It will be slow on very long lines.\n var revTextBeforeIdx = reverse(textBeforeIdx);\n var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx);\n if (wordBeforeRegex) {\n wordStart -= wordBeforeRegex[0].length;\n }\n\n if (inclusive) {\n // If present, trim all whitespace after word.\n // Otherwise, trim all whitespace before word.\n var textAfterWordEnd = line.substring(wordEnd);\n var whitespacesAfterWord = textAfterWordEnd.match(/^\\s*/)[0].length;\n if (whitespacesAfterWord > 0) {\n wordEnd += whitespacesAfterWord;\n } else {\n var revTrim = revTextBeforeIdx.length - wordStart;\n var textBeforeWordStart = revTextBeforeIdx.substring(revTrim);\n var whitespacesBeforeWord = textBeforeWordStart.match(/^\\s*/)[0].length;\n wordStart -= whitespacesBeforeWord;\n }\n }\n\n return { start: Pos(cur.line, wordStart),\n end: Pos(cur.line, wordEnd) };\n }\n\n function recordJumpPosition(cm, oldCur, newCur) {\n if (!cursorEqual(oldCur, newCur)) {\n vimGlobalState.jumpList.add(cm, oldCur, newCur);\n }\n }\n\n function recordLastCharacterSearch(increment, args) {\n vimGlobalState.lastChararacterSearch.increment = increment;\n vimGlobalState.lastChararacterSearch.forward = args.forward;\n vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter;\n }\n\n var symbolToMode = {\n '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',\n '[': 'section', ']': 'section',\n '*': 'comment', '/': 'comment',\n 'm': 'method', 'M': 'method',\n '#': 'preprocess'\n };\n var findSymbolModes = {\n bracket: {\n isComplete: function(state) {\n if (state.nextCh === state.symb) {\n state.depth++;\n if (state.depth >= 1)return true;\n } else if (state.nextCh === state.reverseSymb) {\n state.depth--;\n }\n return false;\n }\n },\n section: {\n init: function(state) {\n state.curMoveThrough = true;\n state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';\n },\n isComplete: function(state) {\n return state.index === 0 && state.nextCh === state.symb;\n }\n },\n comment: {\n isComplete: function(state) {\n var found = state.lastCh === '*' && state.nextCh === '/';\n state.lastCh = state.nextCh;\n return found;\n }\n },\n // TODO: The original Vim implementation only operates on level 1 and 2.\n // The current implementation doesn't check for code block level and\n // therefore it operates on any levels.\n method: {\n init: function(state) {\n state.symb = (state.symb === 'm' ? '{' : '}');\n state.reverseSymb = state.symb === '{' ? '}' : '{';\n },\n isComplete: function(state) {\n if (state.nextCh === state.symb)return true;\n return false;\n }\n },\n preprocess: {\n init: function(state) {\n state.index = 0;\n },\n isComplete: function(state) {\n if (state.nextCh === '#') {\n var token = state.lineText.match(/#(\\w+)/)[1];\n if (token === 'endif') {\n if (state.forward && state.depth === 0) {\n return true;\n }\n state.depth++;\n } else if (token === 'if') {\n if (!state.forward && state.depth === 0) {\n return true;\n }\n state.depth--;\n }\n if (token === 'else' && state.depth === 0)return true;\n }\n return false;\n }\n }\n };\n function findSymbol(cm, repeat, forward, symb) {\n var cur = copyCursor(cm.getCursor());\n var increment = forward ? 1 : -1;\n var endLine = forward ? cm.lineCount() : -1;\n var curCh = cur.ch;\n var line = cur.line;\n var lineText = cm.getLine(line);\n var state = {\n lineText: lineText,\n nextCh: lineText.charAt(curCh),\n lastCh: null,\n index: curCh,\n symb: symb,\n reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],\n forward: forward,\n depth: 0,\n curMoveThrough: false\n };\n var mode = symbolToMode[symb];\n if (!mode)return cur;\n var init = findSymbolModes[mode].init;\n var isComplete = findSymbolModes[mode].isComplete;\n if (init) { init(state); }\n while (line !== endLine && repeat) {\n state.index += increment;\n state.nextCh = state.lineText.charAt(state.index);\n if (!state.nextCh) {\n line += increment;\n state.lineText = cm.getLine(line) || '';\n if (increment > 0) {\n state.index = 0;\n } else {\n var lineLen = state.lineText.length;\n state.index = (lineLen > 0) ? (lineLen-1) : 0;\n }\n state.nextCh = state.lineText.charAt(state.index);\n }\n if (isComplete(state)) {\n cur.line = line;\n cur.ch = state.index;\n repeat--;\n }\n }\n if (state.nextCh || state.curMoveThrough) {\n return Pos(line, state.index);\n }\n return cur;\n }\n\n /*\n * Returns the boundaries of the next word. If the cursor in the middle of\n * the word, then returns the boundaries of the current word, starting at\n * the cursor. If the cursor is at the start/end of a word, and we are going\n * forward/backward, respectively, find the boundaries of the next word.\n *\n * @param {CodeMirror} cm CodeMirror object.\n * @param {Cursor} cur The cursor position.\n * @param {boolean} forward True to search forward. False to search\n * backward.\n * @param {boolean} bigWord True if punctuation count as part of the word.\n * False if only [a-zA-Z0-9] characters count as part of the word.\n * @param {boolean} emptyLineIsWord True if empty lines should be treated\n * as words.\n * @return {Object{from:number, to:number, line: number}} The boundaries of\n * the word, or null if there are no more words.\n */\n function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {\n var lineNum = cur.line;\n var pos = cur.ch;\n var line = cm.getLine(lineNum);\n var dir = forward ? 1 : -1;\n var regexps = bigWord ? bigWordRegexp : wordRegexp;\n\n if (emptyLineIsWord && line == '') {\n lineNum += dir;\n line = cm.getLine(lineNum);\n if (!isLine(cm, lineNum)) {\n return null;\n }\n pos = (forward) ? 0 : line.length;\n }\n\n while (true) {\n if (emptyLineIsWord && line == '') {\n return { from: 0, to: 0, line: lineNum };\n }\n var stop = (dir > 0) ? line.length : -1;\n var wordStart = stop, wordEnd = stop;\n // Find bounds of next word.\n while (pos != stop) {\n var foundWord = false;\n for (var i = 0; i < regexps.length && !foundWord; ++i) {\n if (regexps[i].test(line.charAt(pos))) {\n wordStart = pos;\n // Advance to end of word.\n while (pos != stop && regexps[i].test(line.charAt(pos))) {\n pos += dir;\n }\n wordEnd = pos;\n foundWord = wordStart != wordEnd;\n if (wordStart == cur.ch && lineNum == cur.line &&\n wordEnd == wordStart + dir) {\n // We started at the end of a word. Find the next one.\n continue;\n } else {\n return {\n from: Math.min(wordStart, wordEnd + 1),\n to: Math.max(wordStart, wordEnd),\n line: lineNum };\n }\n }\n }\n if (!foundWord) {\n pos += dir;\n }\n }\n // Advance to next/prev line.\n lineNum += dir;\n if (!isLine(cm, lineNum)) {\n return null;\n }\n line = cm.getLine(lineNum);\n pos = (dir > 0) ? 0 : line.length;\n }\n // Should never get here.\n throw new Error('The impossible happened.');\n }\n\n /**\n * @param {CodeMirror} cm CodeMirror object.\n * @param {int} repeat Number of words to move past.\n * @param {boolean} forward True to search forward. False to search\n * backward.\n * @param {boolean} wordEnd True to move to end of word. False to move to\n * beginning of word.\n * @param {boolean} bigWord True if punctuation count as part of the word.\n * False if only alphabet characters count as part of the word.\n * @return {Cursor} The position the cursor should move to.\n */\n function moveToWord(cm, repeat, forward, wordEnd, bigWord) {\n var cur = cm.getCursor();\n var curStart = copyCursor(cur);\n var words = [];\n if (forward && !wordEnd || !forward && wordEnd) {\n repeat++;\n }\n // For 'e', empty lines are not considered words, go figure.\n var emptyLineIsWord = !(forward && wordEnd);\n for (var i = 0; i < repeat; i++) {\n var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);\n if (!word) {\n var eodCh = lineLength(cm, cm.lastLine());\n words.push(forward\n ? {line: cm.lastLine(), from: eodCh, to: eodCh}\n : {line: 0, from: 0, to: 0});\n break;\n }\n words.push(word);\n cur = Pos(word.line, forward ? (word.to - 1) : word.from);\n }\n var shortCircuit = words.length != repeat;\n var firstWord = words[0];\n var lastWord = words.pop();\n if (forward && !wordEnd) {\n // w\n if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {\n // We did not start in the middle of a word. Discard the extra word at the end.\n lastWord = words.pop();\n }\n return Pos(lastWord.line, lastWord.from);\n } else if (forward && wordEnd) {\n return Pos(lastWord.line, lastWord.to - 1);\n } else if (!forward && wordEnd) {\n // ge\n if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {\n // We did not start in the middle of a word. Discard the extra word at the end.\n lastWord = words.pop();\n }\n return Pos(lastWord.line, lastWord.to);\n } else {\n // b\n return Pos(lastWord.line, lastWord.from);\n }\n }\n\n function moveToCharacter(cm, repeat, forward, character) {\n var cur = cm.getCursor();\n var start = cur.ch;\n var idx;\n for (var i = 0; i < repeat; i ++) {\n var line = cm.getLine(cur.line);\n idx = charIdxInLine(start, line, character, forward, true);\n if (idx == -1) {\n return null;\n }\n start = idx;\n }\n return Pos(cm.getCursor().line, idx);\n }\n\n function moveToColumn(cm, repeat) {\n // repeat is always >= 1, so repeat - 1 always corresponds\n // to the column we want to go to.\n var line = cm.getCursor().line;\n return clipCursorToContent(cm, Pos(line, repeat - 1));\n }\n\n function updateMark(cm, vim, markName, pos) {\n if (!inArray(markName, validMarks)) {\n return;\n }\n if (vim.marks[markName]) {\n vim.marks[markName].clear();\n }\n vim.marks[markName] = cm.setBookmark(pos);\n }\n\n function charIdxInLine(start, line, character, forward, includeChar) {\n // Search for char in line.\n // motion_options: {forward, includeChar}\n // If includeChar = true, include it too.\n // If forward = true, search forward, else search backwards.\n // If char is not found on this line, do nothing\n var idx;\n if (forward) {\n idx = line.indexOf(character, start + 1);\n if (idx != -1 && !includeChar) {\n idx -= 1;\n }\n } else {\n idx = line.lastIndexOf(character, start - 1);\n if (idx != -1 && !includeChar) {\n idx += 1;\n }\n }\n return idx;\n }\n\n // TODO: perhaps this finagling of start and end positions belonds\n // in codmirror/replaceRange?\n function selectCompanionObject(cm, symb, inclusive) {\n var cur = cm.getCursor(), start, end;\n\n var bracketRegexp = ({\n '(': /[()]/, ')': /[()]/,\n '[': /[[\\]]/, ']': /[[\\]]/,\n '{': /[{}]/, '}': /[{}]/})[symb];\n var openSym = ({\n '(': '(', ')': '(',\n '[': '[', ']': '[',\n '{': '{', '}': '{'})[symb];\n var curChar = cm.getLine(cur.line).charAt(cur.ch);\n // Due to the behavior of scanForBracket, we need to add an offset if the\n // cursor is on a matching open bracket.\n var offset = curChar === openSym ? 1 : 0;\n\n start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp});\n end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp});\n\n if (!start || !end) {\n return { start: cur, end: cur };\n }\n\n start = start.pos;\n end = end.pos;\n\n if ((start.line == end.line && start.ch > end.ch)\n || (start.line > end.line)) {\n var tmp = start;\n start = end;\n end = tmp;\n }\n\n if (inclusive) {\n end.ch += 1;\n } else {\n start.ch += 1;\n }\n\n return { start: start, end: end };\n }\n\n // Takes in a symbol and a cursor and tries to simulate text objects that\n // have identical opening and closing symbols\n // TODO support across multiple lines\n function findBeginningAndEnd(cm, symb, inclusive) {\n var cur = copyCursor(cm.getCursor());\n var line = cm.getLine(cur.line);\n var chars = line.split('');\n var start, end, i, len;\n var firstIndex = chars.indexOf(symb);\n\n // the decision tree is to always look backwards for the beginning first,\n // but if the cursor is in front of the first instance of the symb,\n // then move the cursor forward\n if (cur.ch < firstIndex) {\n cur.ch = firstIndex;\n // Why is this line even here???\n // cm.setCursor(cur.line, firstIndex+1);\n }\n // otherwise if the cursor is currently on the closing symbol\n else if (firstIndex < cur.ch && chars[cur.ch] == symb) {\n end = cur.ch; // assign end to the current cursor\n --cur.ch; // make sure to look backwards\n }\n\n // if we're currently on the symbol, we've got a start\n if (chars[cur.ch] == symb && !end) {\n start = cur.ch + 1; // assign start to ahead of the cursor\n } else {\n // go backwards to find the start\n for (i = cur.ch; i > -1 && !start; i--) {\n if (chars[i] == symb) {\n start = i + 1;\n }\n }\n }\n\n // look forwards for the end symbol\n if (start && !end) {\n for (i = start, len = chars.length; i < len && !end; i++) {\n if (chars[i] == symb) {\n end = i;\n }\n }\n }\n\n // nothing found\n if (!start || !end) {\n return { start: cur, end: cur };\n }\n\n // include the symbols\n if (inclusive) {\n --start; ++end;\n }\n\n return {\n start: Pos(cur.line, start),\n end: Pos(cur.line, end)\n };\n }\n\n // Search functions\n defineOption('pcre', true, 'boolean');\n function SearchState() {}\n SearchState.prototype = {\n getQuery: function() {\n return vimGlobalState.query;\n },\n setQuery: function(query) {\n vimGlobalState.query = query;\n },\n getOverlay: function() {\n return this.searchOverlay;\n },\n setOverlay: function(overlay) {\n this.searchOverlay = overlay;\n },\n isReversed: function() {\n return vimGlobalState.isReversed;\n },\n setReversed: function(reversed) {\n vimGlobalState.isReversed = reversed;\n }\n };\n function getSearchState(cm) {\n var vim = cm.state.vim;\n return vim.searchState_ || (vim.searchState_ = new SearchState());\n }\n function dialog(cm, template, shortText, onClose, options) {\n if (cm.openDialog) {\n cm.openDialog(template, onClose, { bottom: true, value: options.value,\n onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp });\n }\n else {\n onClose(prompt(shortText, ''));\n }\n }\n\n function findUnescapedSlashes(str) {\n var escapeNextChar = false;\n var slashes = [];\n for (var i = 0; i < str.length; i++) {\n var c = str.charAt(i);\n if (!escapeNextChar && c == '/') {\n slashes.push(i);\n }\n escapeNextChar = !escapeNextChar && (c == '\\\\');\n }\n return slashes;\n }\n\n // Translates a search string from ex (vim) syntax into javascript form.\n function translateRegex(str) {\n // When these match, add a '\\' if unescaped or remove one if escaped.\n var specials = '|(){';\n // Remove, but never add, a '\\' for these.\n var unescape = '}';\n var escapeNextChar = false;\n var out = [];\n for (var i = -1; i < str.length; i++) {\n var c = str.charAt(i) || '';\n var n = str.charAt(i+1) || '';\n var specialComesNext = (n && specials.indexOf(n) != -1);\n if (escapeNextChar) {\n if (c !== '\\\\' || !specialComesNext) {\n out.push(c);\n }\n escapeNextChar = false;\n } else {\n if (c === '\\\\') {\n escapeNextChar = true;\n // Treat the unescape list as special for removing, but not adding '\\'.\n if (n && unescape.indexOf(n) != -1) {\n specialComesNext = true;\n }\n // Not passing this test means removing a '\\'.\n if (!specialComesNext || n === '\\\\') {\n out.push(c);\n }\n } else {\n out.push(c);\n if (specialComesNext && n !== '\\\\') {\n out.push('\\\\');\n }\n }\n }\n }\n return out.join('');\n }\n\n // Translates the replace part of a search and replace from ex (vim) syntax into\n // javascript form. Similar to translateRegex, but additionally fixes back references\n // (translates '\\[0..9]' to '$[0..9]') and follows different rules for escaping '$'.\n function translateRegexReplace(str) {\n var escapeNextChar = false;\n var out = [];\n for (var i = -1; i < str.length; i++) {\n var c = str.charAt(i) || '';\n var n = str.charAt(i+1) || '';\n if (escapeNextChar) {\n // At any point in the loop, escapeNextChar is true if the previous\n // character was a '\\' and was not escaped.\n out.push(c);\n escapeNextChar = false;\n } else {\n if (c === '\\\\') {\n escapeNextChar = true;\n if ((isNumber(n) || n === '$')) {\n out.push('$');\n } else if (n !== '/' && n !== '\\\\') {\n out.push('\\\\');\n }\n } else {\n if (c === '$') {\n out.push('$');\n }\n out.push(c);\n if (n === '/') {\n out.push('\\\\');\n }\n }\n }\n }\n return out.join('');\n }\n\n // Unescape \\ and / in the replace part, for PCRE mode.\n function unescapeRegexReplace(str) {\n var stream = new CodeMirror.StringStream(str);\n var output = [];\n while (!stream.eol()) {\n // Search for \\.\n while (stream.peek() && stream.peek() != '\\\\') {\n output.push(stream.next());\n }\n if (stream.match('\\\\/', true)) {\n // \\/ => /\n output.push('/');\n } else if (stream.match('\\\\\\\\', true)) {\n // \\\\ => \\\n output.push('\\\\');\n } else {\n // Don't change anything\n output.push(stream.next());\n }\n }\n return output.join('');\n }\n\n /**\n * Extract the regular expression from the query and return a Regexp object.\n * Returns null if the query is blank.\n * If ignoreCase is passed in, the Regexp object will have the 'i' flag set.\n * If smartCase is passed in, and the query contains upper case letters,\n * then ignoreCase is overridden, and the 'i' flag will not be set.\n * If the query contains the /i in the flag part of the regular expression,\n * then both ignoreCase and smartCase are ignored, and 'i' will be passed\n * through to the Regex object.\n */\n function parseQuery(query, ignoreCase, smartCase) {\n // Check if the query is already a regex.\n if (query instanceof RegExp) { return query; }\n // First try to extract regex + flags from the input. If no flags found,\n // extract just the regex. IE does not accept flags directly defined in\n // the regex string in the form /regex/flags\n var slashes = findUnescapedSlashes(query);\n var regexPart;\n var forceIgnoreCase;\n if (!slashes.length) {\n // Query looks like 'regexp'\n regexPart = query;\n } else {\n // Query looks like 'regexp/...'\n regexPart = query.substring(0, slashes[0]);\n var flagsPart = query.substring(slashes[0]);\n forceIgnoreCase = (flagsPart.indexOf('i') != -1);\n }\n if (!regexPart) {\n return null;\n }\n if (!getOption('pcre')) {\n regexPart = translateRegex(regexPart);\n }\n if (smartCase) {\n ignoreCase = (/^[^A-Z]*$/).test(regexPart);\n }\n var regexp = new RegExp(regexPart,\n (ignoreCase || forceIgnoreCase) ? 'i' : undefined);\n return regexp;\n }\n function showConfirm(cm, text) {\n if (cm.openNotification) {\n cm.openNotification('<span style=\"color: red\">' + text + '</span>',\n {bottom: true, duration: 5000});\n } else {\n alert(text);\n }\n }\n function makePrompt(prefix, desc) {\n var raw = '';\n if (prefix) {\n raw += '<span style=\"font-family: monospace\">' + prefix + '</span>';\n }\n raw += '<input type=\"text\"/> ' +\n '<span style=\"color: #888\">';\n if (desc) {\n raw += '<span style=\"color: #888\">';\n raw += desc;\n raw += '</span>';\n }\n return raw;\n }\n var searchPromptDesc = '(Javascript regexp)';\n function showPrompt(cm, options) {\n var shortText = (options.prefix || '') + ' ' + (options.desc || '');\n var prompt = makePrompt(options.prefix, options.desc);\n dialog(cm, prompt, shortText, options.onClose, options);\n }\n function regexEqual(r1, r2) {\n if (r1 instanceof RegExp && r2 instanceof RegExp) {\n var props = ['global', 'multiline', 'ignoreCase', 'source'];\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n if (r1[prop] !== r2[prop]) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n // Returns true if the query is valid.\n function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {\n if (!rawQuery) {\n return;\n }\n var state = getSearchState(cm);\n var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);\n if (!query) {\n return;\n }\n highlightSearchMatches(cm, query);\n if (regexEqual(query, state.getQuery())) {\n return query;\n }\n state.setQuery(query);\n return query;\n }\n function searchOverlay(query) {\n if (query.source.charAt(0) == '^') {\n var matchSol = true;\n }\n return {\n token: function(stream) {\n if (matchSol && !stream.sol()) {\n stream.skipToEnd();\n return;\n }\n var match = stream.match(query, false);\n if (match) {\n if (match[0].length == 0) {\n // Matched empty string, skip to next.\n stream.next();\n return 'searching';\n }\n if (!stream.sol()) {\n // Backtrack 1 to match \\b\n stream.backUp(1);\n if (!query.exec(stream.next() + match[0])) {\n stream.next();\n return null;\n }\n }\n stream.match(query);\n return 'searching';\n }\n while (!stream.eol()) {\n stream.next();\n if (stream.match(query, false)) break;\n }\n },\n query: query\n };\n }\n function highlightSearchMatches(cm, query) {\n var overlay = getSearchState(cm).getOverlay();\n if (!overlay || query != overlay.query) {\n if (overlay) {\n cm.removeOverlay(overlay);\n }\n overlay = searchOverlay(query);\n cm.addOverlay(overlay);\n getSearchState(cm).setOverlay(overlay);\n }\n }\n function findNext(cm, prev, query, repeat) {\n if (repeat === undefined) { repeat = 1; }\n return cm.operation(function() {\n var pos = cm.getCursor();\n var cursor = cm.getSearchCursor(query, pos);\n for (var i = 0; i < repeat; i++) {\n var found = cursor.find(prev);\n if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }\n if (!found) {\n // SearchCursor may have returned null because it hit EOF, wrap\n // around and try again.\n cursor = cm.getSearchCursor(query,\n (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );\n if (!cursor.find(prev)) {\n return;\n }\n }\n }\n return cursor.from();\n });\n }\n function clearSearchHighlight(cm) {\n cm.removeOverlay(getSearchState(cm).getOverlay());\n getSearchState(cm).setOverlay(null);\n }\n /**\n * Check if pos is in the specified range, INCLUSIVE.\n * Range can be specified with 1 or 2 arguments.\n * If the first range argument is an array, treat it as an array of line\n * numbers. Match pos against any of the lines.\n * If the first range argument is a number,\n * if there is only 1 range argument, check if pos has the same line\n * number\n * if there are 2 range arguments, then check if pos is in between the two\n * range arguments.\n */\n function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (end) {\n return (pos >= start && pos <= end);\n } else {\n return pos == start;\n }\n }\n }\n function getUserVisibleLines(cm) {\n var scrollInfo = cm.getScrollInfo();\n var occludeToleranceTop = 6;\n var occludeToleranceBottom = 10;\n var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local');\n var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top;\n var to = cm.coordsChar({left:0, top: bottomY}, 'local');\n return {top: from.line, bottom: to.line};\n }\n\n // Ex command handling\n // Care must be taken when adding to the default Ex command map. For any\n // pair of commands that have a shared prefix, at least one of their\n // shortNames must not match the prefix of the other command.\n var defaultExCommandMap = [\n { name: 'map' },\n { name: 'nmap', shortName: 'nm' },\n { name: 'vmap', shortName: 'vm' },\n { name: 'unmap' },\n { name: 'write', shortName: 'w' },\n { name: 'undo', shortName: 'u' },\n { name: 'redo', shortName: 'red' },\n { name: 'set', shortName: 'set' },\n { name: 'sort', shortName: 'sor' },\n { name: 'substitute', shortName: 's' },\n { name: 'nohlsearch', shortName: 'noh' },\n { name: 'delmarks', shortName: 'delm' },\n { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }\n ];\n Vim.ExCommandDispatcher = function() {\n this.buildCommandMap_();\n };\n Vim.ExCommandDispatcher.prototype = {\n processCommand: function(cm, input) {\n var vim = cm.state.vim;\n var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');\n var previousCommand = commandHistoryRegister.toString();\n if (vim.visualMode) {\n exitVisualMode(cm);\n }\n var inputStream = new CodeMirror.StringStream(input);\n // update \": with the latest command whether valid or invalid\n commandHistoryRegister.setText(input);\n var params = {};\n params.input = input;\n try {\n this.parseInput_(cm, inputStream, params);\n } catch(e) {\n showConfirm(cm, e);\n throw e;\n }\n var commandName;\n if (!params.commandName) {\n // If only a line range is defined, move to the line.\n if (params.line !== undefined) {\n commandName = 'move';\n }\n } else {\n var command = this.matchCommand_(params.commandName);\n if (command) {\n commandName = command.name;\n if (command.excludeFromCommandHistory) {\n commandHistoryRegister.setText(previousCommand);\n }\n this.parseCommandArgs_(inputStream, params, command);\n if (command.type == 'exToKey') {\n // Handle Ex to Key mapping.\n for (var i = 0; i < command.toKeys.length; i++) {\n CodeMirror.Vim.handleKey(cm, command.toKeys[i]);\n }\n return;\n } else if (command.type == 'exToEx') {\n // Handle Ex to Ex mapping.\n this.processCommand(cm, command.toInput);\n return;\n }\n }\n }\n if (!commandName) {\n showConfirm(cm, 'Not an editor command \":' + input + '\"');\n return;\n }\n try {\n exCommands[commandName](cm, params);\n } catch(e) {\n showConfirm(cm, e);\n throw e;\n }\n },\n parseInput_: function(cm, inputStream, result) {\n inputStream.eatWhile(':');\n // Parse range.\n if (inputStream.eat('%')) {\n result.line = cm.firstLine();\n result.lineEnd = cm.lastLine();\n } else {\n result.line = this.parseLineSpec_(cm, inputStream);\n if (result.line !== undefined && inputStream.eat(',')) {\n result.lineEnd = this.parseLineSpec_(cm, inputStream);\n }\n }\n\n // Parse command name.\n var commandMatch = inputStream.match(/^(\\w+)/);\n if (commandMatch) {\n result.commandName = commandMatch[1];\n } else {\n result.commandName = inputStream.match(/.*/)[0];\n }\n\n return result;\n },\n parseLineSpec_: function(cm, inputStream) {\n var numberMatch = inputStream.match(/^(\\d+)/);\n if (numberMatch) {\n return parseInt(numberMatch[1], 10) - 1;\n }\n switch (inputStream.next()) {\n case '.':\n return cm.getCursor().line;\n case '$':\n return cm.lastLine();\n case '\\'':\n var mark = cm.state.vim.marks[inputStream.next()];\n if (mark && mark.find()) {\n return mark.find().line;\n }\n throw new Error('Mark not set');\n default:\n inputStream.backUp(1);\n return undefined;\n }\n },\n parseCommandArgs_: function(inputStream, params, command) {\n if (inputStream.eol()) {\n return;\n }\n params.argString = inputStream.match(/.*/)[0];\n // Parse command-line arguments\n var delim = command.argDelimiter || /\\s+/;\n var args = trim(params.argString).split(delim);\n if (args.length && args[0]) {\n params.args = args;\n }\n },\n matchCommand_: function(commandName) {\n // Return the command in the command map that matches the shortest\n // prefix of the passed in command name. The match is guaranteed to be\n // unambiguous if the defaultExCommandMap's shortNames are set up\n // correctly. (see @code{defaultExCommandMap}).\n for (var i = commandName.length; i > 0; i--) {\n var prefix = commandName.substring(0, i);\n if (this.commandMap_[prefix]) {\n var command = this.commandMap_[prefix];\n if (command.name.indexOf(commandName) === 0) {\n return command;\n }\n }\n }\n return null;\n },\n buildCommandMap_: function() {\n this.commandMap_ = {};\n for (var i = 0; i < defaultExCommandMap.length; i++) {\n var command = defaultExCommandMap[i];\n var key = command.shortName || command.name;\n this.commandMap_[key] = command;\n }\n },\n map: function(lhs, rhs, ctx) {\n if (lhs != ':' && lhs.charAt(0) == ':') {\n if (ctx) { throw Error('Mode not supported for ex mappings'); }\n var commandName = lhs.substring(1);\n if (rhs != ':' && rhs.charAt(0) == ':') {\n // Ex to Ex mapping\n this.commandMap_[commandName] = {\n name: commandName,\n type: 'exToEx',\n toInput: rhs.substring(1),\n user: true\n };\n } else {\n // Ex to key mapping\n this.commandMap_[commandName] = {\n name: commandName,\n type: 'exToKey',\n toKeys: parseKeyString(rhs),\n user: true\n };\n }\n } else {\n if (rhs != ':' && rhs.charAt(0) == ':') {\n // Key to Ex mapping.\n var mapping = {\n keys: parseKeyString(lhs),\n type: 'keyToEx',\n exArgs: { input: rhs.substring(1) },\n user: true};\n if (ctx) { mapping.context = ctx; }\n defaultKeymap.unshift(mapping);\n } else {\n // Key to key mapping\n var mapping = {\n keys: parseKeyString(lhs),\n type: 'keyToKey',\n toKeys: parseKeyString(rhs),\n user: true\n };\n if (ctx) { mapping.context = ctx; }\n defaultKeymap.unshift(mapping);\n }\n }\n },\n unmap: function(lhs, ctx) {\n var arrayEquals = function(a, b) {\n if (a === b) return true;\n if (a == null || b == null) return true;\n if (a.length != b.length) return false;\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n };\n if (lhs != ':' && lhs.charAt(0) == ':') {\n // Ex to Ex or Ex to key mapping\n if (ctx) { throw Error('Mode not supported for ex mappings'); }\n var commandName = lhs.substring(1);\n if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {\n delete this.commandMap_[commandName];\n return;\n }\n } else {\n // Key to Ex or key to key mapping\n var keys = parseKeyString(lhs);\n for (var i = 0; i < defaultKeymap.length; i++) {\n if (arrayEquals(keys, defaultKeymap[i].keys)\n && defaultKeymap[i].context === ctx\n && defaultKeymap[i].user) {\n defaultKeymap.splice(i, 1);\n return;\n }\n }\n }\n throw Error('No such mapping.');\n }\n };\n\n // Converts a key string sequence of the form a<C-w>bd<Left> into Vim's\n // keymap representation.\n function parseKeyString(str) {\n var key, match;\n var keys = [];\n while (str) {\n match = (/<\\w+-.+?>|<\\w+>|./).exec(str);\n if (match === null)break;\n key = match[0];\n str = str.substring(match.index + key.length);\n keys.push(key);\n }\n return keys;\n }\n\n var exCommands = {\n map: function(cm, params, ctx) {\n var mapArgs = params.args;\n if (!mapArgs || mapArgs.length < 2) {\n if (cm) {\n showConfirm(cm, 'Invalid mapping: ' + params.input);\n }\n return;\n }\n exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx);\n },\n nmap: function(cm, params) { this.map(cm, params, 'normal'); },\n vmap: function(cm, params) { this.map(cm, params, 'visual'); },\n unmap: function(cm, params, ctx) {\n var mapArgs = params.args;\n if (!mapArgs || mapArgs.length < 1) {\n if (cm) {\n showConfirm(cm, 'No such mapping: ' + params.input);\n }\n return;\n }\n exCommandDispatcher.unmap(mapArgs[0], ctx);\n },\n move: function(cm, params) {\n commandDispatcher.processCommand(cm, cm.state.vim, {\n type: 'motion',\n motion: 'moveToLineOrEdgeOfDocument',\n motionArgs: { forward: false, explicitRepeat: true,\n linewise: true },\n repeatOverride: params.line+1});\n },\n set: function(cm, params) {\n var setArgs = params.args;\n if (!setArgs || setArgs.length < 1) {\n if (cm) {\n showConfirm(cm, 'Invalid mapping: ' + params.input);\n }\n return;\n }\n var expr = setArgs[0].split('=');\n var optionName = expr[0];\n var value = expr[1];\n var forceGet = false;\n\n if (optionName.charAt(optionName.length - 1) == '?') {\n // If post-fixed with ?, then the set is actually a get.\n if (value) { throw Error('Trailing characters: ' + params.argString); }\n optionName = optionName.substring(0, optionName.length - 1);\n forceGet = true;\n }\n if (value === undefined && optionName.substring(0, 2) == 'no') {\n // To set boolean options to false, the option name is prefixed with\n // 'no'.\n optionName = optionName.substring(2);\n value = false;\n }\n var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';\n if (optionIsBoolean && value == undefined) {\n // Calling set with a boolean option sets it to true.\n value = true;\n }\n if (!optionIsBoolean && !value || forceGet) {\n var oldValue = getOption(optionName);\n // If no value is provided, then we assume this is a get.\n if (oldValue === true || oldValue === false) {\n showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);\n } else {\n showConfirm(cm, ' ' + optionName + '=' + oldValue);\n }\n } else {\n setOption(optionName, value);\n }\n },\n registers: function(cm,params) {\n var regArgs = params.args;\n var registers = vimGlobalState.registerController.registers;\n var regInfo = '----------Registers----------<br><br>';\n if (!regArgs) {\n for (var registerName in registers) {\n var text = registers[registerName].toString();\n if (text.length) {\n regInfo += '\"' + registerName + ' ' + text + '<br>';\n }\n }\n } else {\n var registerName;\n regArgs = regArgs.join('');\n for (var i = 0; i < regArgs.length; i++) {\n registerName = regArgs.charAt(i);\n if (!vimGlobalState.registerController.isValidRegister(registerName)) {\n continue;\n }\n var register = registers[registerName] || new Register();\n regInfo += '\"' + registerName + ' ' + register.toString() + '<br>';\n }\n }\n showConfirm(cm, regInfo);\n },\n sort: function(cm, params) {\n var reverse, ignoreCase, unique, number;\n function parseArgs() {\n if (params.argString) {\n var args = new CodeMirror.StringStream(params.argString);\n if (args.eat('!')) { reverse = true; }\n if (args.eol()) { return; }\n if (!args.eatSpace()) { return 'Invalid arguments'; }\n var opts = args.match(/[a-z]+/);\n if (opts) {\n opts = opts[0];\n ignoreCase = opts.indexOf('i') != -1;\n unique = opts.indexOf('u') != -1;\n var decimal = opts.indexOf('d') != -1 && 1;\n var hex = opts.indexOf('x') != -1 && 1;\n var octal = opts.indexOf('o') != -1 && 1;\n if (decimal + hex + octal > 1) { return 'Invalid arguments'; }\n number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';\n }\n if (args.eatSpace() && args.match(/\\/.*\\//)) { 'patterns not supported'; }\n }\n }\n var err = parseArgs();\n if (err) {\n showConfirm(cm, err + ': ' + params.argString);\n return;\n }\n var lineStart = params.line || cm.firstLine();\n var lineEnd = params.lineEnd || params.line || cm.lastLine();\n if (lineStart == lineEnd) { return; }\n var curStart = Pos(lineStart, 0);\n var curEnd = Pos(lineEnd, lineLength(cm, lineEnd));\n var text = cm.getRange(curStart, curEnd).split('\\n');\n var numberRegex = (number == 'decimal') ? /(-?)([\\d]+)/ :\n (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :\n (number == 'octal') ? /([0-7]+)/ : null;\n var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;\n var numPart = [], textPart = [];\n if (number) {\n for (var i = 0; i < text.length; i++) {\n if (numberRegex.exec(text[i])) {\n numPart.push(text[i]);\n } else {\n textPart.push(text[i]);\n }\n }\n } else {\n textPart = text;\n }\n function compareFn(a, b) {\n if (reverse) { var tmp; tmp = a; a = b; b = tmp; }\n if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); }\n var anum = number && numberRegex.exec(a);\n var bnum = number && numberRegex.exec(b);\n if (!anum) { return a < b ? -1 : 1; }\n anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);\n bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);\n return anum - bnum;\n }\n numPart.sort(compareFn);\n textPart.sort(compareFn);\n text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);\n if (unique) { // Remove duplicate lines\n var textOld = text;\n var lastLine;\n text = [];\n for (var i = 0; i < textOld.length; i++) {\n if (textOld[i] != lastLine) {\n text.push(textOld[i]);\n }\n lastLine = textOld[i];\n }\n }\n cm.replaceRange(text.join('\\n'), curStart, curEnd);\n },\n substitute: function(cm, params) {\n if (!cm.getSearchCursor) {\n throw new Error('Search feature not available. Requires searchcursor.js or ' +\n 'any other getSearchCursor implementation.');\n }\n var argString = params.argString;\n var slashes = argString ? findUnescapedSlashes(argString) : [];\n var replacePart = '';\n if (slashes.length) {\n if (slashes[0] !== 0) {\n showConfirm(cm, 'Substitutions should be of the form ' +\n ':s/pattern/replace/');\n return;\n }\n var regexPart = argString.substring(slashes[0] + 1, slashes[1]);\n var flagsPart;\n var count;\n var confirm = false; // Whether to confirm each replace.\n if (slashes[1]) {\n replacePart = argString.substring(slashes[1] + 1, slashes[2]);\n if (getOption('pcre')) {\n replacePart = unescapeRegexReplace(replacePart);\n } else {\n replacePart = translateRegexReplace(replacePart);\n }\n vimGlobalState.lastSubstituteReplacePart = replacePart;\n }\n if (slashes[2]) {\n // After the 3rd slash, we can have flags followed by a space followed\n // by count.\n var trailing = argString.substring(slashes[2] + 1).split(' ');\n flagsPart = trailing[0];\n count = parseInt(trailing[1]);\n }\n if (flagsPart) {\n if (flagsPart.indexOf('c') != -1) {\n confirm = true;\n flagsPart.replace('c', '');\n }\n regexPart = regexPart + '/' + flagsPart;\n }\n }\n if (regexPart) {\n // If regex part is empty, then use the previous query. Otherwise use\n // the regex part as the new query.\n try {\n updateSearchQuery(cm, regexPart, true /** ignoreCase */,\n true /** smartCase */);\n } catch (e) {\n showConfirm(cm, 'Invalid regex: ' + regexPart);\n return;\n }\n }\n replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;\n if (replacePart === undefined) {\n showConfirm(cm, 'No previous substitute regular expression');\n return;\n }\n var state = getSearchState(cm);\n var query = state.getQuery();\n var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;\n var lineEnd = params.lineEnd || lineStart;\n if (count) {\n lineStart = lineEnd;\n lineEnd = lineStart + count - 1;\n }\n var startPos = clipCursorToContent(cm, Pos(lineStart, 0));\n var cursor = cm.getSearchCursor(query, startPos);\n doReplace(cm, confirm, lineStart, lineEnd, cursor, query, replacePart);\n },\n redo: CodeMirror.commands.redo,\n undo: CodeMirror.commands.undo,\n write: function(cm) {\n if (CodeMirror.commands.save) {\n // If a save command is defined, call it.\n CodeMirror.commands.save(cm);\n } else {\n // Saves to text area if no save command is defined.\n cm.save();\n }\n },\n nohlsearch: function(cm) {\n clearSearchHighlight(cm);\n },\n delmarks: function(cm, params) {\n if (!params.argString || !trim(params.argString)) {\n showConfirm(cm, 'Argument required');\n return;\n }\n\n var state = cm.state.vim;\n var stream = new CodeMirror.StringStream(trim(params.argString));\n while (!stream.eol()) {\n stream.eatSpace();\n\n // Record the streams position at the beginning of the loop for use\n // in error messages.\n var count = stream.pos;\n\n if (!stream.match(/[a-zA-Z]/, false)) {\n showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n return;\n }\n\n var sym = stream.next();\n // Check if this symbol is part of a range\n if (stream.match('-', true)) {\n // This symbol is part of a range.\n\n // The range must terminate at an alphabetic character.\n if (!stream.match(/[a-zA-Z]/, false)) {\n showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n return;\n }\n\n var startMark = sym;\n var finishMark = stream.next();\n // The range must terminate at an alphabetic character which\n // shares the same case as the start of the range.\n if (isLowerCase(startMark) && isLowerCase(finishMark) ||\n isUpperCase(startMark) && isUpperCase(finishMark)) {\n var start = startMark.charCodeAt(0);\n var finish = finishMark.charCodeAt(0);\n if (start >= finish) {\n showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));\n return;\n }\n\n // Because marks are always ASCII values, and we have\n // determined that they are the same case, we can use\n // their char codes to iterate through the defined range.\n for (var j = 0; j <= finish - start; j++) {\n var mark = String.fromCharCode(start + j);\n delete state.marks[mark];\n }\n } else {\n showConfirm(cm, 'Invalid argument: ' + startMark + '-');\n return;\n }\n } else {\n // This symbol is a valid mark, and is not part of a range.\n delete state.marks[sym];\n }\n }\n }\n };\n\n var exCommandDispatcher = new Vim.ExCommandDispatcher();\n\n /**\n * @param {CodeMirror} cm CodeMirror instance we are in.\n * @param {boolean} confirm Whether to confirm each replace.\n * @param {Cursor} lineStart Line to start replacing from.\n * @param {Cursor} lineEnd Line to stop replacing at.\n * @param {RegExp} query Query for performing matches with.\n * @param {string} replaceWith Text to replace matches with. May contain $1,\n * $2, etc for replacing captured groups using Javascript replace.\n */\n function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,\n replaceWith) {\n // Set up all the functions.\n cm.state.vim.exMode = true;\n var done = false;\n var lastPos = searchCursor.from();\n function replaceAll() {\n cm.operation(function() {\n while (!done) {\n replace();\n next();\n }\n stop();\n });\n }\n function replace() {\n var text = cm.getRange(searchCursor.from(), searchCursor.to());\n var newText = text.replace(query, replaceWith);\n searchCursor.replace(newText);\n }\n function next() {\n var found = searchCursor.findNext();\n if (!found) {\n done = true;\n } else if (isInRange(searchCursor.from(), lineStart, lineEnd)) {\n cm.scrollIntoView(searchCursor.from(), 30);\n cm.setSelection(searchCursor.from(), searchCursor.to());\n lastPos = searchCursor.from();\n done = false;\n } else {\n done = true;\n }\n }\n function stop(close) {\n if (close) { close(); }\n cm.focus();\n if (lastPos) {\n cm.setCursor(lastPos);\n var vim = cm.state.vim;\n vim.exMode = false;\n vim.lastHPos = vim.lastHSPos = lastPos.ch;\n }\n }\n function onPromptKeyDown(e, _value, close) {\n // Swallow all keys.\n CodeMirror.e_stop(e);\n var keyName = CodeMirror.keyName(e);\n switch (keyName) {\n case 'Y':\n replace(); next(); break;\n case 'N':\n next(); break;\n case 'A':\n cm.operation(replaceAll); break;\n case 'L':\n replace();\n // fall through and exit.\n case 'Q':\n case 'Esc':\n case 'Ctrl-C':\n case 'Ctrl-[':\n stop(close);\n break;\n }\n if (done) { stop(close); }\n }\n\n // Actually do replace.\n next();\n if (done) {\n showConfirm(cm, 'No matches for ' + query.source);\n return;\n }\n if (!confirm) {\n replaceAll();\n return;\n }\n showPrompt(cm, {\n prefix: 'replace with <strong>' + replaceWith + '</strong> (y/n/a/q/l)',\n onKeyDown: onPromptKeyDown\n });\n }\n\n // Register Vim with CodeMirror\n function buildVimKeyMap() {\n /**\n * Handle the raw key event from CodeMirror. Translate the\n * Shift + key modifier to the resulting letter, while preserving other\n * modifers.\n */\n function cmKeyToVimKey(key, modifier) {\n var vimKey = key;\n if (isUpperCase(vimKey) && modifier == 'Ctrl') {\n vimKey = vimKey.toLowerCase();\n }\n if (modifier) {\n // Vim will parse modifier+key combination as a single key.\n vimKey = modifier.charAt(0) + '-' + vimKey;\n }\n var specialKey = ({Enter:'CR',Backspace:'BS',Delete:'Del'})[vimKey];\n vimKey = specialKey ? specialKey : vimKey;\n vimKey = vimKey.length > 1 ? '<'+ vimKey + '>' : vimKey;\n return vimKey;\n }\n\n // Closure to bind CodeMirror, key, modifier.\n function keyMapper(vimKey) {\n return function(cm) {\n CodeMirror.Vim.handleKey(cm, vimKey);\n };\n }\n\n var cmToVimKeymap = {\n 'nofallthrough': true,\n 'style': 'fat-cursor'\n };\n function bindKeys(keys, modifier) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!modifier && key.length == 1) {\n // Wrap all keys without modifiers with '' to identify them by their\n // key characters instead of key identifiers.\n key = \"'\" + key + \"'\";\n }\n var vimKey = cmKeyToVimKey(keys[i], modifier);\n var cmKey = modifier ? modifier + '-' + key : key;\n cmToVimKeymap[cmKey] = keyMapper(vimKey);\n }\n }\n bindKeys(upperCaseAlphabet);\n bindKeys(lowerCaseAlphabet);\n bindKeys(upperCaseAlphabet, 'Ctrl');\n bindKeys(specialSymbols);\n bindKeys(specialSymbols, 'Ctrl');\n bindKeys(numbers);\n bindKeys(numbers, 'Ctrl');\n bindKeys(specialKeys);\n bindKeys(specialKeys, 'Ctrl');\n return cmToVimKeymap;\n }\n CodeMirror.keyMap.vim = buildVimKeyMap();\n\n function exitInsertMode(cm) {\n var vim = cm.state.vim;\n var macroModeState = vimGlobalState.macroModeState;\n var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');\n var isPlaying = macroModeState.isPlaying;\n if (!isPlaying) {\n cm.off('change', onChange);\n CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);\n }\n if (!isPlaying && vim.insertModeRepeat > 1) {\n // Perform insert mode repeat for commands like 3,a and 3,o.\n repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,\n true /** repeatForInsert */);\n vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;\n }\n delete vim.insertModeRepeat;\n vim.insertMode = false;\n cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1);\n cm.setOption('keyMap', 'vim');\n cm.setOption('disableInput', true);\n cm.toggleOverwrite(false); // exit replace mode if we were in it.\n // update the \". register before exiting insert mode\n insertModeChangeRegister.setText(macroModeState.lastInsertModeChanges.changes.join(''));\n CodeMirror.signal(cm, \"vim-mode-change\", {mode: \"normal\"});\n if (macroModeState.isRecording) {\n logInsertModeChange(macroModeState);\n }\n }\n\n CodeMirror.keyMap['vim-insert'] = {\n // TODO: override navigation keys so that Esc will cancel automatic\n // indentation from o, O, i_<CR>\n 'Esc': exitInsertMode,\n 'Ctrl-[': exitInsertMode,\n 'Ctrl-C': exitInsertMode,\n 'Ctrl-N': 'autocomplete',\n 'Ctrl-P': 'autocomplete',\n 'Enter': function(cm) {\n var fn = CodeMirror.commands.newlineAndIndentContinueComment ||\n CodeMirror.commands.newlineAndIndent;\n fn(cm);\n },\n fallthrough: ['default']\n };\n\n CodeMirror.keyMap['vim-replace'] = {\n 'Backspace': 'goCharLeft',\n fallthrough: ['vim-insert']\n };\n\n function executeMacroRegister(cm, vim, macroModeState, registerName) {\n var register = vimGlobalState.registerController.getRegister(registerName);\n var keyBuffer = register.keyBuffer;\n var imc = 0;\n macroModeState.isPlaying = true;\n macroModeState.replaySearchQueries = register.searchQueries.slice(0);\n for (var i = 0; i < keyBuffer.length; i++) {\n var text = keyBuffer[i];\n var match, key;\n while (text) {\n // Pull off one command key, which is either a single character\n // or a special sequence wrapped in '<' and '>', e.g. '<Space>'.\n match = (/<\\w+-.+?>|<\\w+>|./).exec(text);\n key = match[0];\n text = text.substring(match.index + key.length);\n CodeMirror.Vim.handleKey(cm, key);\n if (vim.insertMode) {\n repeatInsertModeChanges(\n cm, register.insertModeChanges[imc++].changes, 1);\n exitInsertMode(cm);\n }\n }\n };\n macroModeState.isPlaying = false;\n }\n\n function logKey(macroModeState, key) {\n if (macroModeState.isPlaying) { return; }\n var registerName = macroModeState.latestRegister;\n var register = vimGlobalState.registerController.getRegister(registerName);\n if (register) {\n register.pushText(key);\n }\n }\n\n function logInsertModeChange(macroModeState) {\n if (macroModeState.isPlaying) { return; }\n var registerName = macroModeState.latestRegister;\n var register = vimGlobalState.registerController.getRegister(registerName);\n if (register) {\n register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);\n }\n }\n\n function logSearchQuery(macroModeState, query) {\n if (macroModeState.isPlaying) { return; }\n var registerName = macroModeState.latestRegister;\n var register = vimGlobalState.registerController.getRegister(registerName);\n if (register) {\n register.pushSearchQuery(query);\n }\n }\n\n /**\n * Listens for changes made in insert mode.\n * Should only be active in insert mode.\n */\n function onChange(_cm, changeObj) {\n var macroModeState = vimGlobalState.macroModeState;\n var lastChange = macroModeState.lastInsertModeChanges;\n if (!macroModeState.isPlaying) {\n while(changeObj) {\n lastChange.expectCursorActivityForChange = true;\n if (changeObj.origin == '+input' || changeObj.origin == 'paste'\n || changeObj.origin === undefined /* only in testing */) {\n var text = changeObj.text.join('\\n');\n lastChange.changes.push(text);\n }\n // Change objects may be chained with next.\n changeObj = changeObj.next;\n }\n }\n }\n\n /**\n * Listens for any kind of cursor activity on CodeMirror.\n */\n function onCursorActivity(cm) {\n var vim = cm.state.vim;\n if (vim.insertMode) {\n // Tracking cursor activity in insert mode (for macro support).\n var macroModeState = vimGlobalState.macroModeState;\n if (macroModeState.isPlaying) { return; }\n var lastChange = macroModeState.lastInsertModeChanges;\n if (lastChange.expectCursorActivityForChange) {\n lastChange.expectCursorActivityForChange = false;\n } else {\n // Cursor moved outside the context of an edit. Reset the change.\n lastChange.changes = [];\n }\n } else if (cm.doc.history.lastSelOrigin == '*mouse') {\n // Reset lastHPos if mouse click was done in normal mode.\n vim.lastHPos = cm.doc.getCursor().ch;\n }\n }\n\n /** Wrapper for special keys pressed in insert mode */\n function InsertModeKey(keyName) {\n this.keyName = keyName;\n }\n\n /**\n * Handles raw key down events from the text area.\n * - Should only be active in insert mode.\n * - For recording deletes in insert mode.\n */\n function onKeyEventTargetKeyDown(e) {\n var macroModeState = vimGlobalState.macroModeState;\n var lastChange = macroModeState.lastInsertModeChanges;\n var keyName = CodeMirror.keyName(e);\n function onKeyFound() {\n lastChange.changes.push(new InsertModeKey(keyName));\n return true;\n }\n if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {\n CodeMirror.lookupKey(keyName, ['vim-insert'], onKeyFound);\n }\n }\n\n /**\n * Repeats the last edit, which includes exactly 1 command and at most 1\n * insert. Operator and motion commands are read from lastEditInputState,\n * while action commands are read from lastEditActionCommand.\n *\n * If repeatForInsert is true, then the function was called by\n * exitInsertMode to repeat the insert mode changes the user just made. The\n * corresponding enterInsertMode call was made with a count.\n */\n function repeatLastEdit(cm, vim, repeat, repeatForInsert) {\n var macroModeState = vimGlobalState.macroModeState;\n macroModeState.isPlaying = true;\n var isAction = !!vim.lastEditActionCommand;\n var cachedInputState = vim.inputState;\n function repeatCommand() {\n if (isAction) {\n commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);\n } else {\n commandDispatcher.evalInput(cm, vim);\n }\n }\n function repeatInsert(repeat) {\n if (macroModeState.lastInsertModeChanges.changes.length > 0) {\n // For some reason, repeat cw in desktop VIM does not repeat\n // insert mode changes. Will conform to that behavior.\n repeat = !vim.lastEditActionCommand ? 1 : repeat;\n var changeObject = macroModeState.lastInsertModeChanges;\n // This isn't strictly necessary, but since lastInsertModeChanges is\n // supposed to be immutable during replay, this helps catch bugs.\n macroModeState.lastInsertModeChanges = {};\n repeatInsertModeChanges(cm, changeObject.changes, repeat);\n macroModeState.lastInsertModeChanges = changeObject;\n }\n }\n vim.inputState = vim.lastEditInputState;\n if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {\n // o and O repeat have to be interlaced with insert repeats so that the\n // insertions appear on separate lines instead of the last line.\n for (var i = 0; i < repeat; i++) {\n repeatCommand();\n repeatInsert(1);\n }\n } else {\n if (!repeatForInsert) {\n // Hack to get the cursor to end up at the right place. If I is\n // repeated in insert mode repeat, cursor will be 1 insert\n // change set left of where it should be.\n repeatCommand();\n }\n repeatInsert(repeat);\n }\n vim.inputState = cachedInputState;\n if (vim.insertMode && !repeatForInsert) {\n // Don't exit insert mode twice. If repeatForInsert is set, then we\n // were called by an exitInsertMode call lower on the stack.\n exitInsertMode(cm);\n }\n macroModeState.isPlaying = false;\n };\n\n function repeatInsertModeChanges(cm, changes, repeat) {\n function keyHandler(binding) {\n if (typeof binding == 'string') {\n CodeMirror.commands[binding](cm);\n } else {\n binding(cm);\n }\n return true;\n }\n for (var i = 0; i < repeat; i++) {\n for (var j = 0; j < changes.length; j++) {\n var change = changes[j];\n if (change instanceof InsertModeKey) {\n CodeMirror.lookupKey(change.keyName, ['vim-insert'], keyHandler);\n } else {\n var cur = cm.getCursor();\n cm.replaceRange(change, cur, cur);\n }\n }\n }\n }\n\n resetVimGlobalState();\n return vimApi;\n };\n // Initialize Vim and make it available as an API.\n CodeMirror.Vim = Vim();\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/keymap/sublime.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/sublime.js",
"module-type": "library",
"text": "// A rough approximation of Sublime Text's keybindings\n// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/edit/matchbrackets\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var map = CodeMirror.keyMap.sublime = {fallthrough: \"default\"};\n var cmds = CodeMirror.commands;\n var Pos = CodeMirror.Pos;\n var ctrl = CodeMirror.keyMap[\"default\"] == CodeMirror.keyMap.pcDefault ? \"Ctrl-\" : \"Cmd-\";\n\n // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.\n function findPosSubword(doc, start, dir) {\n if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));\n var line = doc.getLine(start.line);\n if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));\n var state = \"start\", type;\n for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {\n var next = line.charAt(dir < 0 ? pos - 1 : pos);\n var cat = next != \"_\" && CodeMirror.isWordChar(next) ? \"w\" : \"o\";\n if (cat == \"w\" && next.toUpperCase() == next) cat = \"W\";\n if (state == \"start\") {\n if (cat != \"o\") { state = \"in\"; type = cat; }\n } else if (state == \"in\") {\n if (type != cat) {\n if (type == \"w\" && cat == \"W\" && dir < 0) pos--;\n if (type == \"W\" && cat == \"w\" && dir > 0) { type = \"w\"; continue; }\n break;\n }\n }\n }\n return Pos(start.line, pos);\n }\n\n function moveSubword(cm, dir) {\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosSubword(cm.doc, range.head, dir);\n else\n return dir < 0 ? range.from() : range.to();\n });\n }\n\n cmds[map[\"Alt-Left\"] = \"goSubwordLeft\"] = function(cm) { moveSubword(cm, -1); };\n cmds[map[\"Alt-Right\"] = \"goSubwordRight\"] = function(cm) { moveSubword(cm, 1); };\n\n cmds[map[ctrl + \"Up\"] = \"scrollLineUp\"] = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, \"local\");\n if (cm.getCursor().line >= visibleBottomLine)\n cm.execCommand(\"goLineUp\");\n }\n cm.scrollTo(null, info.top - cm.defaultTextHeight());\n };\n cmds[map[ctrl + \"Down\"] = \"scrollLineDown\"] = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleTopLine = cm.lineAtHeight(info.top, \"local\")+1;\n if (cm.getCursor().line <= visibleTopLine)\n cm.execCommand(\"goLineDown\");\n }\n cm.scrollTo(null, info.top + cm.defaultTextHeight());\n };\n\n cmds[map[\"Shift-\" + ctrl + \"L\"] = \"splitSelectionByLine\"] = function(cm) {\n var ranges = cm.listSelections(), lineRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n for (var line = from.line; line <= to.line; ++line)\n if (!(to.line > from.line && line == to.line && to.ch == 0))\n lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),\n head: line == to.line ? to : Pos(line)});\n }\n cm.setSelections(lineRanges, 0);\n };\n\n map[\"Shift-Tab\"] = \"indentLess\";\n\n cmds[map[\"Esc\"] = \"singleSelectionTop\"] = function(cm) {\n var range = cm.listSelections()[0];\n cm.setSelection(range.anchor, range.head, {scroll: false});\n };\n\n cmds[map[ctrl + \"L\"] = \"selectLine\"] = function(cm) {\n var ranges = cm.listSelections(), extended = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n extended.push({anchor: Pos(range.from().line, 0),\n head: Pos(range.to().line + 1, 0)});\n }\n cm.setSelections(extended);\n };\n\n map[\"Shift-\" + ctrl + \"K\"] = \"deleteLine\";\n\n function insertLine(cm, above) {\n cm.operation(function() {\n var len = cm.listSelections().length, newSelection = [], last = -1;\n for (var i = 0; i < len; i++) {\n var head = cm.listSelections()[i].head;\n if (head.line <= last) continue;\n var at = Pos(head.line + (above ? 0 : 1), 0);\n cm.replaceRange(\"\\n\", at, null, \"+insertLine\");\n cm.indentLine(at.line, null, true);\n newSelection.push({head: at, anchor: at});\n last = head.line + 1;\n }\n cm.setSelections(newSelection);\n });\n }\n\n cmds[map[ctrl + \"Enter\"] = \"insertLineAfter\"] = function(cm) { insertLine(cm, false); };\n\n cmds[map[\"Shift-\" + ctrl + \"Enter\"] = \"insertLineBefore\"] = function(cm) { insertLine(cm, true); };\n\n function wordAt(cm, pos) {\n var start = pos.ch, end = start, line = cm.getLine(pos.line);\n while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;\n while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;\n return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};\n }\n\n cmds[map[ctrl + \"D\"] = \"selectNextOccurrence\"] = function(cm) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n cm.setSelection(word.from, word.to);\n fullWord = true;\n } else {\n var text = cm.getRange(from, to);\n var query = fullWord ? new RegExp(\"\\\\b\" + text + \"\\\\b\") : text;\n var cur = cm.getSearchCursor(query, to);\n if (cur.findNext()) {\n cm.addSelection(cur.from(), cur.to());\n } else {\n cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));\n if (cur.findNext())\n cm.addSelection(cur.from(), cur.to());\n }\n }\n if (fullWord)\n cm.state.sublimeFindFullWord = cm.doc.sel;\n };\n\n var mirror = \"(){}[]\";\n function selectBetweenBrackets(cm) {\n var pos = cm.getCursor(), opening = cm.scanForBracket(pos, -1);\n if (!opening) return;\n for (;;) {\n var closing = cm.scanForBracket(pos, 1);\n if (!closing) return;\n if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {\n cm.setSelection(Pos(opening.pos.line, opening.pos.ch + 1), closing.pos, false);\n return true;\n }\n pos = Pos(closing.pos.line, closing.pos.ch + 1);\n }\n }\n\n cmds[map[\"Shift-\" + ctrl + \"Space\"] = \"selectScope\"] = function(cm) {\n selectBetweenBrackets(cm) || cm.execCommand(\"selectAll\");\n };\n cmds[map[\"Shift-\" + ctrl + \"M\"] = \"selectBetweenBrackets\"] = function(cm) {\n if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;\n };\n\n cmds[map[ctrl + \"M\"] = \"goToBracket\"] = function(cm) {\n cm.extendSelectionsBy(function(range) {\n var next = cm.scanForBracket(range.head, 1);\n if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;\n var prev = cm.scanForBracket(range.head, -1);\n return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;\n });\n };\n\n cmds[map[\"Shift-\" + ctrl + \"Up\"] = \"swapLineUp\"] = function(cm) {\n var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from().line - 1, to = range.to().line;\n if (from > at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = 0; i < linesToMove.length; i += 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n if (to > cm.lastLine()) {\n cm.replaceRange(\"\\n\" + line, Pos(cm.lastLine()), null, \"+swapLine\");\n var sels = cm.listSelections(), last = sels[sels.length - 1];\n var head = last.head.line == to ? Pos(to - 1) : last.head;\n var anchor = last.anchor.line == to ? Pos(to - 1) : last.anchor;\n cm.setSelections(sels.slice(0, sels.length - 1).concat([{head: head, anchor: anchor}]));\n } else {\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n }\n cm.scrollIntoView();\n });\n };\n\n cmds[map[\"Shift-\" + ctrl + \"Down\"] = \"swapLineDown\"] = function(cm) {\n var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var range = ranges[i], from = range.to().line + 1, to = range.from().line;\n if (from < at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = linesToMove.length - 2; i >= 0; i -= 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n if (from == cm.lastLine())\n cm.replaceRange(\"\", Pos(from - 1), Pos(from), \"+swapLine\");\n else\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n cm.scrollIntoView();\n });\n };\n\n map[ctrl + \"/\"] = \"toggleComment\";\n\n cmds[map[ctrl + \"J\"] = \"joinLines\"] = function(cm) {\n var ranges = cm.listSelections(), joined = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from();\n var start = from.line, end = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == end)\n end = ranges[++i].to().line;\n joined.push({start: start, end: end, anchor: !range.empty() && from});\n }\n cm.operation(function() {\n var offset = 0, ranges = [];\n for (var i = 0; i < joined.length; i++) {\n var obj = joined[i];\n var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;\n for (var line = obj.start; line <= obj.end; line++) {\n var actual = line - offset;\n if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);\n if (actual < cm.lastLine()) {\n cm.replaceRange(\" \", Pos(actual), Pos(actual + 1, /^\\s*/.exec(cm.getLine(actual + 1))[0].length));\n ++offset;\n }\n }\n ranges.push({anchor: anchor || head, head: head});\n }\n cm.setSelections(ranges, 0);\n });\n };\n\n cmds[map[\"Shift-\" + ctrl + \"D\"] = \"duplicateLine\"] = function(cm) {\n cm.operation(function() {\n var rangeCount = cm.listSelections().length;\n for (var i = 0; i < rangeCount; i++) {\n var range = cm.listSelections()[i];\n if (range.empty())\n cm.replaceRange(cm.getLine(range.head.line) + \"\\n\", Pos(range.head.line, 0));\n else\n cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());\n }\n cm.scrollIntoView();\n });\n };\n\n map[ctrl + \"T\"] = \"transposeChars\";\n\n function sortLines(cm, caseSensitive) {\n var ranges = cm.listSelections(), toSort = [], selected;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) continue;\n var from = range.from().line, to = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == to)\n to = range[++i].to().line;\n toSort.push(from, to);\n }\n if (toSort.length) selected = true;\n else toSort.push(cm.firstLine(), cm.lastLine());\n\n cm.operation(function() {\n var ranges = [];\n for (var i = 0; i < toSort.length; i += 2) {\n var from = toSort[i], to = toSort[i + 1];\n var start = Pos(from, 0), end = Pos(to);\n var lines = cm.getRange(start, end, false);\n if (caseSensitive)\n lines.sort();\n else\n lines.sort(function(a, b) {\n var au = a.toUpperCase(), bu = b.toUpperCase();\n if (au != bu) { a = au; b = bu; }\n return a < b ? -1 : a == b ? 0 : 1;\n });\n cm.replaceRange(lines, start, end);\n if (selected) ranges.push({anchor: start, head: end});\n }\n if (selected) cm.setSelections(ranges, 0);\n });\n }\n\n cmds[map[\"F9\"] = \"sortLines\"] = function(cm) { sortLines(cm, true); };\n cmds[map[ctrl + \"F9\"] = \"sortLinesInsensitive\"] = function(cm) { sortLines(cm, false); };\n\n cmds[map[\"F2\"] = \"nextBookmark\"] = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n var current = marks.shift();\n var found = current.find();\n if (found) {\n marks.push(current);\n return cm.setSelection(found.from, found.to);\n }\n }\n };\n\n cmds[map[\"Shift-F2\"] = \"prevBookmark\"] = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n marks.unshift(marks.pop());\n var found = marks[marks.length - 1].find();\n if (!found)\n marks.pop();\n else\n return cm.setSelection(found.from, found.to);\n }\n };\n\n cmds[map[ctrl + \"F2\"] = \"toggleBookmark\"] = function(cm) {\n var ranges = cm.listSelections();\n var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n var found = cm.findMarks(from, to);\n for (var j = 0; j < found.length; j++) {\n if (found[j].sublimeBookmark) {\n found[j].clear();\n for (var k = 0; k < marks.length; k++)\n if (marks[k] == found[j])\n marks.splice(k--, 1);\n break;\n }\n }\n if (j == found.length)\n marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));\n }\n };\n\n cmds[map[\"Shift-\" + ctrl + \"F2\"] = \"clearBookmarks\"] = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();\n marks.length = 0;\n };\n\n cmds[map[\"Alt-F2\"] = \"selectBookmarks\"] = function(cm) {\n var marks = cm.state.sublimeBookmarks, ranges = [];\n if (marks) for (var i = 0; i < marks.length; i++) {\n var found = marks[i].find();\n if (!found)\n marks.splice(i--, 0);\n else\n ranges.push({anchor: found.from, head: found.to});\n }\n if (ranges.length)\n cm.setSelections(ranges, 0);\n };\n\n map[\"Alt-Q\"] = \"wrapLines\";\n\n var mapK = CodeMirror.keyMap[\"sublime-Ctrl-K\"] = {auto: \"sublime\", nofallthrough: true};\n\n map[ctrl + \"K\"] = function(cm) {cm.setOption(\"keyMap\", \"sublime-Ctrl-K\");};\n\n function modifyWordOrSelection(cm, mod) {\n cm.operation(function() {\n var ranges = cm.listSelections(), indices = [], replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) { indices.push(i); replacements.push(\"\"); }\n else replacements.push(mod(cm.getRange(range.from(), range.to())));\n }\n cm.replaceSelections(replacements, \"around\", \"case\");\n for (var i = indices.length - 1, at; i >= 0; i--) {\n var range = ranges[indices[i]];\n if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;\n var word = wordAt(cm, range.head);\n at = word.from;\n cm.replaceRange(mod(word.word), word.from, word.to);\n }\n });\n }\n\n mapK[ctrl + \"Backspace\"] = \"delLineLeft\";\n\n cmds[mapK[ctrl + \"K\"] = \"delLineRight\"] = function(cm) {\n cm.operation(function() {\n var ranges = cm.listSelections();\n for (var i = ranges.length - 1; i >= 0; i--)\n cm.replaceRange(\"\", ranges[i].anchor, Pos(ranges[i].to().line), \"+delete\");\n cm.scrollIntoView();\n });\n };\n\n cmds[mapK[ctrl + \"U\"] = \"upcaseAtCursor\"] = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });\n };\n cmds[mapK[ctrl + \"L\"] = \"downcaseAtCursor\"] = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });\n };\n\n cmds[mapK[ctrl + \"Space\"] = \"setSublimeMark\"] = function(cm) {\n if (cm.state.sublimeMark) cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n };\n cmds[mapK[ctrl + \"A\"] = \"selectToSublimeMark\"] = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) cm.setSelection(cm.getCursor(), found);\n };\n cmds[mapK[ctrl + \"W\"] = \"deleteToSublimeMark\"] = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n var from = cm.getCursor(), to = found;\n if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }\n cm.state.sublimeKilled = cm.getRange(from, to);\n cm.replaceRange(\"\", from, to);\n }\n };\n cmds[mapK[ctrl + \"X\"] = \"swapWithSublimeMark\"] = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n cm.setCursor(found);\n }\n };\n cmds[mapK[ctrl + \"Y\"] = \"sublimeYank\"] = function(cm) {\n if (cm.state.sublimeKilled != null)\n cm.replaceSelection(cm.state.sublimeKilled, null, \"paste\");\n };\n\n mapK[ctrl + \"G\"] = \"clearBookmarks\";\n cmds[mapK[ctrl + \"C\"] = \"showInCenter\"] = function(cm) {\n var pos = cm.cursorCoords(null, \"local\");\n cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);\n };\n\n cmds[map[\"Shift-Alt-Up\"] = \"selectLinesUpward\"] = function(cm) {\n cm.operation(function() {\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.head.line > cm.firstLine())\n cm.addSelection(Pos(range.head.line - 1, range.head.ch));\n }\n });\n };\n cmds[map[\"Shift-Alt-Down\"] = \"selectLinesDownward\"] = function(cm) {\n cm.operation(function() {\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.head.line < cm.lastLine())\n cm.addSelection(Pos(range.head.line + 1, range.head.ch));\n }\n });\n };\n\n function findAndGoTo(cm, forward) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n from = word.from;\n to = word.to;\n }\n\n var query = cm.getRange(from, to);\n var cur = cm.getSearchCursor(query, forward ? to : from);\n\n if (forward ? cur.findNext() : cur.findPrevious()) {\n cm.setSelection(cur.from(), cur.to());\n } else {\n cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)\n : cm.clipPos(Pos(cm.lastLine())));\n if (forward ? cur.findNext() : cur.findPrevious())\n cm.setSelection(cur.from(), cur.to());\n else if (word)\n cm.setSelection(from, to);\n }\n };\n cmds[map[ctrl + \"F3\"] = \"findUnder\"] = function(cm) { findAndGoTo(cm, true); };\n cmds[map[\"Shift-\" + ctrl + \"F3\"] = \"findUnderPrevious\"] = function(cm) { findAndGoTo(cm,false); };\n\n map[\"Shift-\" + ctrl + \"[\"] = \"fold\";\n map[\"Shift-\" + ctrl + \"]\"] = \"unfold\";\n mapK[ctrl + \"0\"] = mapK[ctrl + \"j\"] = \"unfoldAll\";\n\n map[ctrl + \"I\"] = \"findIncremental\";\n map[\"Shift-\" + ctrl + \"I\"] = \"findIncrementalReverse\";\n map[ctrl + \"H\"] = \"replace\";\n map[\"F3\"] = \"findNext\";\n map[\"Shift-F3\"] = \"findPrev\";\n\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/keymap/emacs.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/emacs.js",
"module-type": "library",
"text": "(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }\n\n // Kill 'ring'\n\n var killRing = [];\n function addToRing(str) {\n killRing.push(str);\n if (killRing.length > 50) killRing.shift();\n }\n function growRingTop(str) {\n if (!killRing.length) return addToRing(str);\n killRing[killRing.length - 1] += str;\n }\n function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || \"\"; }\n function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }\n\n var lastKill = null;\n\n function kill(cm, from, to, mayGrow, text) {\n if (text == null) text = cm.getRange(from, to);\n\n if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))\n growRingTop(text);\n else\n addToRing(text);\n cm.replaceRange(\"\", from, to, \"+delete\");\n\n if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};\n else lastKill = null;\n }\n\n // Boundaries of various units\n\n function byChar(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"char\", true);\n }\n\n function byWord(cm, pos, dir) {\n return cm.findPosH(pos, dir, \"word\", true);\n }\n\n function byLine(cm, pos, dir) {\n return cm.findPosV(pos, dir, \"line\", cm.doc.sel.goalColumn);\n }\n\n function byPage(cm, pos, dir) {\n return cm.findPosV(pos, dir, \"page\", cm.doc.sel.goalColumn);\n }\n\n function byParagraph(cm, pos, dir) {\n var no = pos.line, line = cm.getLine(no);\n var sawText = /\\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));\n var fst = cm.firstLine(), lst = cm.lastLine();\n for (;;) {\n no += dir;\n if (no < fst || no > lst)\n return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));\n line = cm.getLine(no);\n var hasText = /\\S/.test(line);\n if (hasText) sawText = true;\n else if (sawText) return Pos(no, 0);\n }\n }\n\n function bySentence(cm, pos, dir) {\n var line = pos.line, ch = pos.ch;\n var text = cm.getLine(pos.line), sawWord = false;\n for (;;) {\n var next = text.charAt(ch + (dir < 0 ? -1 : 0));\n if (!next) { // End/beginning of line reached\n if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);\n text = cm.getLine(line + dir);\n if (!/\\S/.test(text)) return Pos(line, ch);\n line += dir;\n ch = dir < 0 ? text.length : 0;\n continue;\n }\n if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));\n if (!sawWord) sawWord = /\\w/.test(next);\n ch += dir;\n }\n }\n\n function byExpr(cm, pos, dir) {\n var wrap;\n if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))\n && wrap.match && (wrap.forward ? 1 : -1) == dir)\n return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;\n\n for (var first = true;; first = false) {\n var token = cm.getTokenAt(pos);\n var after = Pos(pos.line, dir < 0 ? token.start : token.end);\n if (first && dir > 0 && token.end == pos.ch || !/\\w/.test(token.string)) {\n var newPos = cm.findPosH(after, dir, \"char\");\n if (posEq(after, newPos)) return pos;\n else pos = newPos;\n } else {\n return after;\n }\n }\n }\n\n // Prefixes (only crudely supported)\n\n function getPrefix(cm, precise) {\n var digits = cm.state.emacsPrefix;\n if (!digits) return precise ? null : 1;\n clearPrefix(cm);\n return digits == \"-\" ? -1 : Number(digits);\n }\n\n function repeated(cmd) {\n var f = typeof cmd == \"string\" ? function(cm) { cm.execCommand(cmd); } : cmd;\n return function(cm) {\n var prefix = getPrefix(cm);\n f(cm);\n for (var i = 1; i < prefix; ++i) f(cm);\n };\n }\n\n function findEnd(cm, by, dir) {\n var pos = cm.getCursor(), prefix = getPrefix(cm);\n if (prefix < 0) { dir = -dir; prefix = -prefix; }\n for (var i = 0; i < prefix; ++i) {\n var newPos = by(cm, pos, dir);\n if (posEq(newPos, pos)) break;\n pos = newPos;\n }\n return pos;\n }\n\n function move(by, dir) {\n var f = function(cm) {\n cm.extendSelection(findEnd(cm, by, dir));\n };\n f.motion = true;\n return f;\n }\n\n function killTo(cm, by, dir) {\n kill(cm, cm.getCursor(), findEnd(cm, by, dir), true);\n }\n\n function addPrefix(cm, digit) {\n if (cm.state.emacsPrefix) {\n if (digit != \"-\") cm.state.emacsPrefix += digit;\n return;\n }\n // Not active yet\n cm.state.emacsPrefix = digit;\n cm.on(\"keyHandled\", maybeClearPrefix);\n cm.on(\"inputRead\", maybeDuplicateInput);\n }\n\n var prefixPreservingKeys = {\"Alt-G\": true, \"Ctrl-X\": true, \"Ctrl-Q\": true, \"Ctrl-U\": true};\n\n function maybeClearPrefix(cm, arg) {\n if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))\n clearPrefix(cm);\n }\n\n function clearPrefix(cm) {\n cm.state.emacsPrefix = null;\n cm.off(\"keyHandled\", maybeClearPrefix);\n cm.off(\"inputRead\", maybeDuplicateInput);\n }\n\n function maybeDuplicateInput(cm, event) {\n var dup = getPrefix(cm);\n if (dup > 1 && event.origin == \"+input\") {\n var one = event.text.join(\"\\n\"), txt = \"\";\n for (var i = 1; i < dup; ++i) txt += one;\n cm.replaceSelection(txt);\n }\n }\n\n function addPrefixMap(cm) {\n cm.state.emacsPrefixMap = true;\n cm.addKeyMap(prefixMap);\n cm.on(\"keyHandled\", maybeRemovePrefixMap);\n cm.on(\"inputRead\", maybeRemovePrefixMap);\n }\n\n function maybeRemovePrefixMap(cm, arg) {\n if (typeof arg == \"string\" && (/^\\d$/.test(arg) || arg == \"Ctrl-U\")) return;\n cm.removeKeyMap(prefixMap);\n cm.state.emacsPrefixMap = false;\n cm.off(\"keyHandled\", maybeRemovePrefixMap);\n cm.off(\"inputRead\", maybeRemovePrefixMap);\n }\n\n // Utilities\n\n function setMark(cm) {\n cm.setCursor(cm.getCursor());\n cm.setExtending(!cm.getExtending());\n cm.on(\"change\", function() { cm.setExtending(false); });\n }\n\n function clearMark(cm) {\n cm.setExtending(false);\n cm.setCursor(cm.getCursor());\n }\n\n function getInput(cm, msg, f) {\n if (cm.openDialog)\n cm.openDialog(msg + \": <input type=\\\"text\\\" style=\\\"width: 10em\\\"/>\", f, {bottom: true});\n else\n f(prompt(msg, \"\"));\n }\n\n function operateOnWord(cm, op) {\n var start = cm.getCursor(), end = cm.findPosH(start, 1, \"word\");\n cm.replaceRange(op(cm.getRange(start, end)), start, end);\n cm.setCursor(end);\n }\n\n function toEnclosingExpr(cm) {\n var pos = cm.getCursor(), line = pos.line, ch = pos.ch;\n var stack = [];\n while (line >= cm.firstLine()) {\n var text = cm.getLine(line);\n for (var i = ch == null ? text.length : ch; i > 0;) {\n var ch = text.charAt(--i);\n if (ch == \")\")\n stack.push(\"(\");\n else if (ch == \"]\")\n stack.push(\"[\");\n else if (ch == \"}\")\n stack.push(\"{\");\n else if (/[\\(\\{\\[]/.test(ch) && (!stack.length || stack.pop() != ch))\n return cm.extendSelection(Pos(line, i));\n }\n --line; ch = null;\n }\n }\n\n function quit(cm) {\n cm.execCommand(\"clearSearch\");\n clearMark(cm);\n }\n\n // Actual keymap\n\n var keyMap = CodeMirror.keyMap.emacs = {\n \"Ctrl-W\": function(cm) {kill(cm, cm.getCursor(\"start\"), cm.getCursor(\"end\"));},\n \"Ctrl-K\": repeated(function(cm) {\n var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));\n var text = cm.getRange(start, end);\n if (!/\\S/.test(text)) {\n text += \"\\n\";\n end = Pos(start.line + 1, 0);\n }\n kill(cm, start, end, true, text);\n }),\n \"Alt-W\": function(cm) {\n addToRing(cm.getSelection());\n clearMark(cm);\n },\n \"Ctrl-Y\": function(cm) {\n var start = cm.getCursor();\n cm.replaceRange(getFromRing(getPrefix(cm)), start, start, \"paste\");\n cm.setSelection(start, cm.getCursor());\n },\n \"Alt-Y\": function(cm) {cm.replaceSelection(popFromRing(), \"around\", \"paste\");},\n\n \"Ctrl-Space\": setMark, \"Ctrl-Shift-2\": setMark,\n\n \"Ctrl-F\": move(byChar, 1), \"Ctrl-B\": move(byChar, -1),\n \"Right\": move(byChar, 1), \"Left\": move(byChar, -1),\n \"Ctrl-D\": function(cm) { killTo(cm, byChar, 1); },\n \"Delete\": function(cm) { killTo(cm, byChar, 1); },\n \"Ctrl-H\": function(cm) { killTo(cm, byChar, -1); },\n \"Backspace\": function(cm) { killTo(cm, byChar, -1); },\n\n \"Alt-F\": move(byWord, 1), \"Alt-B\": move(byWord, -1),\n \"Alt-D\": function(cm) { killTo(cm, byWord, 1); },\n \"Alt-Backspace\": function(cm) { killTo(cm, byWord, -1); },\n\n \"Ctrl-N\": move(byLine, 1), \"Ctrl-P\": move(byLine, -1),\n \"Down\": move(byLine, 1), \"Up\": move(byLine, -1),\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStart\",\n\n \"Alt-V\": move(byPage, -1), \"Ctrl-V\": move(byPage, 1),\n \"PageUp\": move(byPage, -1), \"PageDown\": move(byPage, 1),\n\n \"Ctrl-Up\": move(byParagraph, -1), \"Ctrl-Down\": move(byParagraph, 1),\n\n \"Alt-A\": move(bySentence, -1), \"Alt-E\": move(bySentence, 1),\n \"Alt-K\": function(cm) { killTo(cm, bySentence, 1); },\n\n \"Ctrl-Alt-K\": function(cm) { killTo(cm, byExpr, 1); },\n \"Ctrl-Alt-Backspace\": function(cm) { killTo(cm, byExpr, -1); },\n \"Ctrl-Alt-F\": move(byExpr, 1), \"Ctrl-Alt-B\": move(byExpr, -1),\n\n \"Shift-Ctrl-Alt-2\": function(cm) {\n cm.setSelection(findEnd(cm, byExpr, 1), cm.getCursor());\n },\n \"Ctrl-Alt-T\": function(cm) {\n var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);\n var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);\n cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +\n cm.getRange(leftStart, leftEnd), leftStart, rightEnd);\n },\n \"Ctrl-Alt-U\": repeated(toEnclosingExpr),\n\n \"Alt-Space\": function(cm) {\n var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);\n while (from && /\\s/.test(text.charAt(from - 1))) --from;\n while (to < text.length && /\\s/.test(text.charAt(to))) ++to;\n cm.replaceRange(\" \", Pos(pos.line, from), Pos(pos.line, to));\n },\n \"Ctrl-O\": repeated(function(cm) { cm.replaceSelection(\"\\n\", \"start\"); }),\n \"Ctrl-T\": repeated(function(cm) {\n cm.execCommand(\"transposeChars\");\n }),\n\n \"Alt-C\": repeated(function(cm) {\n operateOnWord(cm, function(w) {\n var letter = w.search(/\\w/);\n if (letter == -1) return w;\n return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();\n });\n }),\n \"Alt-U\": repeated(function(cm) {\n operateOnWord(cm, function(w) { return w.toUpperCase(); });\n }),\n \"Alt-L\": repeated(function(cm) {\n operateOnWord(cm, function(w) { return w.toLowerCase(); });\n }),\n\n \"Alt-;\": \"toggleComment\",\n\n \"Ctrl-/\": repeated(\"undo\"), \"Shift-Ctrl--\": repeated(\"undo\"),\n \"Ctrl-Z\": repeated(\"undo\"), \"Cmd-Z\": repeated(\"undo\"),\n \"Shift-Alt-,\": \"goDocStart\", \"Shift-Alt-.\": \"goDocEnd\",\n \"Ctrl-S\": \"findNext\", \"Ctrl-R\": \"findPrev\", \"Ctrl-G\": quit, \"Shift-Alt-5\": \"replace\",\n \"Alt-/\": \"autocomplete\",\n \"Ctrl-J\": \"newlineAndIndent\", \"Enter\": false, \"Tab\": \"indentAuto\",\n\n \"Alt-G\": function(cm) {cm.setOption(\"keyMap\", \"emacs-Alt-G\");},\n \"Ctrl-X\": function(cm) {cm.setOption(\"keyMap\", \"emacs-Ctrl-X\");},\n \"Ctrl-Q\": function(cm) {cm.setOption(\"keyMap\", \"emacs-Ctrl-Q\");},\n \"Ctrl-U\": addPrefixMap\n };\n\n CodeMirror.keyMap[\"emacs-Ctrl-X\"] = {\n \"Tab\": function(cm) {\n cm.indentSelection(getPrefix(cm, true) || cm.getOption(\"indentUnit\"));\n },\n \"Ctrl-X\": function(cm) {\n cm.setSelection(cm.getCursor(\"head\"), cm.getCursor(\"anchor\"));\n },\n\n \"Ctrl-S\": \"save\", \"Ctrl-W\": \"save\", \"S\": \"saveAll\", \"F\": \"open\", \"U\": repeated(\"undo\"), \"K\": \"close\",\n \"Delete\": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },\n auto: \"emacs\", nofallthrough: true, disableInput: true\n };\n\n CodeMirror.keyMap[\"emacs-Alt-G\"] = {\n \"G\": function(cm) {\n var prefix = getPrefix(cm, true);\n if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);\n\n getInput(cm, \"Goto line\", function(str) {\n var num;\n if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0)\n cm.setCursor(num - 1);\n });\n },\n auto: \"emacs\", nofallthrough: true, disableInput: true\n };\n\n CodeMirror.keyMap[\"emacs-Ctrl-Q\"] = {\n \"Tab\": repeated(\"insertTab\"),\n auto: \"emacs\", nofallthrough: true\n };\n\n var prefixMap = {\"Ctrl-G\": clearPrefix};\n function regPrefix(d) {\n prefixMap[d] = function(cm) { addPrefix(cm, d); };\n keyMap[\"Ctrl-\" + d] = function(cm) { addPrefix(cm, d); };\n prefixPreservingKeys[\"Ctrl-\" + d] = true;\n }\n for (var i = 0; i < 10; ++i) regPrefix(String(i));\n regPrefix(\"-\");\n});\n"
},
"$:/plugins/tiddlywiki/codemirror/readme": {
"title": "$:/plugins/tiddlywiki/codemirror/readme",
"text": "The CodeMirror plugin brings many features:\n\n* Code colouring for many languages (see [[the official documentation here|http://codemirror.net/mode/index.html]])\n* Auto closing brackets and tags\n* Folding brackets, comments, and tags\n* Auto-completion \n\n! Setting ~CodeMirror Content Types\n\nYou can determine which tiddler content types are edited by the ~CodeMirror widget by creating or modifying special tiddlers whose prefix is comprised of the string `$:/config/EditorTypeMappings/` concatenated with the content type. The text of that tiddler gives the editor type to be used (eg, ''text'', ''bitmap'', ''codemirror'').\n\nThe current editor type mappings are shown in [[$:/ControlPanel]] under the \"Advanced\" tab.\n\n! ~CodeMirror Configuration\n\nYou can configure the ~CodeMirror plugin by creating a tiddler called [[$:/config/CodeMirror]] containing a JSON configuration object. The configuration tiddler must have its type field set to `application/json` to take effect.\n\nSee http://codemirror.net/ for details of available configuration options.\n\nFor example:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js\",\n \"$:/plugins/tiddlywiki/codemirror/keymap/vim.js\",\n \"$:/plugins/tiddlywiki/codemirror/keymap/emacs.js\"\n ],\n \"configuration\": {\n \"keyMap\": \"vim\",\n \"matchBrackets\":true,\n \"showCursorWhenSelecting\": true\n }\n}\n```\n\n!! Basic working configuration\n\n# Create a tiddler called `$:/config/CodeMirror`\n\n# The type of the tiddler has to be set to `application/json`\n\n# The text of the tiddler is the following: \n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js\"\n ],\n \"configuration\": {\n \"matchBrackets\":true,\n \"showCursorWhenSelecting\": true\n }\n}\n\n```\n\n# You should see line numbers when editing a tiddler\n# When editing a tiddler, no matter what the type of the tiddler is set to, you should see matching brackets being highlighted whenever the cursor is next to one of them\n# If you edit a tiddler with the type `application/javascript` or `application/json` you should see the code being syntax highlighted\n\n!! Add HTML syntax highlighting\n\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/xml/xml.js]]\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js\"\n ],\n \"configuration\": {\n \"showCursorWhenSelecting\": true,\n \"matchBrackets\":true\n }\n}\n```\n# Edit a tiddler with the type `text/html` and write some html code. You should see your code being coloured\n\n!! Add a non-existing language mode\n\nHere's an example of adding a new language mode - in this case, the language C.\n\n\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/mode/clike/clike.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js]]\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/mode/clike/clike.js\"\n ],\n \"configuration\": {\n \"showCursorWhenSelecting\": true\n }\n}\n```\n\n# Add the correct ~EditorTypeMappings tiddler\n## Find the matching MIME type. If you go on the [[CodeMirror documentation for language modes|http://codemirror.net/mode/index.html]] you can see the [[documentation for the c-like mode|http://codemirror.net/mode/clike/index.html]]. In this documentation, at the end you will be told the MIME types defined. Here it's ''text/x-csrc''\n## Add the tiddler: `$:/config/EditorTypeMappings/text/x-csrc` and fill the text field with : ''codemirror''\n\nIf you edit a tiddler with the type `text/x-csrc` and write some code in C, you should see your text being coloured.\n\n!! Add matching tags\n\n# Add XML and HTML colouring\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/edit/matchtags.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[http://codemirror.net/addon/edit/matchtags.js]]\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/matchtags.js\",\n \"$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js\"\n ],\n \"configuration\": {\n \"showCursorWhenSelecting\": true,\n \"matchTags\": {\"bothTags\": true},\n \"extraKeys\": {\"Ctrl-J\": \"toMatchingTag\"}\n }\n}\n```\n\nEdit a tiddler that has the type :`text/htm` and write this code:\n\n```\n<html>\n <div id=\"click here and press CTRL+J\">\n <ul>\n <li>\n </li>\n </ul>\n </div>\n</html>\n```\n\nIf you click on a tag and press CTRL+J, your cursor will select the matching tag. Supposedly, it should highlight the pair when clicking a tag. However, that part doesn't work.\n\n!! Adding closing tags\n\n# Add the xml mode (see \"Add XML and HTML colouring\")\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/edit/closetags.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[http://codemirror.net/addon/edit/closetag.js]]\n\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/closetags.js\"\n ],\n \"configuration\": {\n \"showCursorWhenSelecting\": true,\n \"autoCloseTags\":true\n }\n}\n```\n\nIf you edit a tiddler with the type`text/html` and write:\n\n```\n<html>\n```\n\nThen the closing tag ''</html>'' should automatically appear.\n\n!! Add closing brackets\n\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/edit/closebrackets.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[http://codemirror.net/addon/edit/closebrackets.js]]\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/edit/closebrackets.js\"\n ],\n\n \"configuration\": {\n\n \"showCursorWhenSelecting\": true,\n \"matchBrackets\":true,\n \"autoCloseBrackets\":true\n }\n}\n```\n\n# If you try to edit any tiddler and write `if(` you should see the bracket closing itself automatically (you will get \"if()\"). It works with (), [], and {}\n# If you try and edit a tiddler with the type `application/javascript`, it will auto-close `()`,`[]`,`{}`,`''` and `\"\"`\n\n!! Adding folding tags\n\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/fold/foldcode.js`\n## Add a field `module-type` and set it to ''library''\n## Set the field `type` to ''application/javascript''\n## Set the text field of the tiddler with the javascript code from this link : [[http://codemirror.net/addon/fold/foldcode.js]]\n# Repeat the above process for the following tiddlers, but replace the code with the one from the given link:\n## Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/fold/xml-fold.js`, the code can be found here [[https://raw.githubusercontent.com/codemirror/CodeMirror/master/addon/fold/xml-fold.js]]\n## Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/fold/foldgutter.js`, the code can be found here [[http://codemirror.net/addon/fold/foldgutter.js]]\n# Create a tiddler `$:/plugins/tiddlywiki/codemirror/addon/fold/foldgutter.css`\n## Add the tag ''$:/tags/Stylesheet''\n## Set the text field of the tiddler with the css code from this link : [[http://codemirror.net/addon/fold/foldgutter.css]]\n\n# Set the text field of the tiddler `$:/config/CodeMirror` to:\n\n```\n{\n \"require\": [\n \"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js\",\n \"$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/fold/foldcode.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/fold/xml-fold.js\",\n \"$:/plugins/tiddlywiki/codemirror/addon/fold/foldgutter.js\"\n ],\n \"configuration\": {\n \"showCursorWhenSelecting\": true,\n \"matchTags\": {\"bothTags\": true},\n \"foldGutter\": true,\n \"gutters\": [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\"]\n }\n}\n\n```\n\nNow if you type the below code in a tiddler with the type `text/html`:\n\n```\n<html>\n <div>\n <ul>\n\n </ul>\n </div>\n</html>\n```\n\nYou should see little arrows just next to the line numbers. Clicking on it will have the effect to fold the code (or unfold it).\n"
},
"$:/plugins/tiddlywiki/codemirror/styles": {
"title": "$:/plugins/tiddlywiki/codemirror/styles",
"tags": "[[$:/tags/Stylesheet]]",
"text": "/* Make the editor resize to fit its content */\n\n.CodeMirror {\n\theight: auto;\n\tborder: 1px solid #ddd;\n\tline-height: 1.5;\n\tfont-family: \"Monaco\", monospace;\n}\n\n.CodeMirror-scroll {\n\toverflow-x: auto;\n\toverflow-y: hidden;\t\n}\n"
}
}
}
{
"tiddlers": {
"$:/plugins/tiddlywiki/highlight/highlight.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/highlight/highlight.js",
"module-type": "library",
"text": "!function(e){\"undefined\"!=typeof exports?e(exports):(window.hljs=e({}),\"function\"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,\"&\").replace(/</gm,\"<\").replace(/>/gm,\">\")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+\" \"+(e.parentNode?e.parentNode.className:\"\")).split(/\\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,\"\")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:\"start\",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:\"stop\",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset<r[0].offset?e:r:\"start\"==r[0].event?e:r:e.length?e:r}function i(e){function r(e){return\" \"+e.nodeName+'=\"'+n(e.value)+'\"'}l+=\"<\"+t(e)+Array.prototype.map.call(e.attributes,r).join(\"\")+\">\"}function c(e){l+=\"</\"+t(e)+\">\"}function u(e){(\"start\"==e.event?i:c)(e.node)}for(var s=0,l=\"\",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else\"start\"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),\"m\"+(e.cI?\"i\":\"\")+(r?\"g\":\"\"))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(\" \").forEach(function(e){var t=e.split(\"|\");c[t[0]]=[n,t[1]?Number(t[1]):1]})};\"string\"==typeof a.k?u(\"keyword\",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\\b[A-Za-z0-9_]+\\b/,!0),i&&(a.bK&&(a.b=\"\\\\b(\"+a.bK.split(\" \").join(\"|\")+\")\\\\b\"),a.b||(a.b=/\\B|\\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\\B|\\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||\"\",a.eW&&i.tE&&(a.tE+=(a.e?\"|\":\"\")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push(\"self\"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?\"\\\\.?(\"+e.b+\")\\\\.?\":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join(\"|\"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t<n.c.length;t++)if(r(n.c[t].bR,e))return n.c[t]}function c(e,n){return r(e.eR,n)?e:e.eW?c(e.parent,n):void 0}function f(e,n){return!a&&r(n.iR,e)}function g(e,n){var t=x.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?\"\":E.classPrefix,o='<span class=\"'+a,i=t?\"\":\"</span>\";return o+=e+'\">',o+n+i}function d(){if(!w.k)return n(y);var e=\"\",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),\"continuous\"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,\"\",!0):\"\";e.rB?(M+=r,y=\"\"):e.eB?(M+=n(t)+r,y=\"\"):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+=\"</span>\"),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y=\"\",a.starts&&b(a.starts,\"\"),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme \"'+t+'\" for mode \"'+(w.cN||\"<unnamed>\")+'\"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: \"'+e+'\"');u(x);for(var w=o||x,L={},M=\"\",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,\"\",!0)+M);var y=\"\",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+=\"</span>\");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf(\"Illegal\"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\\t)+)/gm,function(e,n){return n.replace(/\\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\\n/g,\"<br>\")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\\s|^)hljs(\\s|$)/)||a.push(\"hljs\"),r&&a.push(r),a.join(\" \").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),t.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll(\"pre code\");Array.prototype.forEach.call(e,p)}}function v(){addEventListener(\"DOMContentLoaded\",h,!1),addEventListener(\"load\",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:\"hljs-\",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR=\"[a-zA-Z][a-zA-Z0-9_]*\",e.UIR=\"[a-zA-Z_][a-zA-Z0-9_]*\",e.NR=\"\\\\b\\\\d+(\\\\.\\\\d+)?\",e.CNR=\"(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)\",e.BNR=\"\\\\b(0b[01]+)\",e.RSR=\"!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~\",e.BE={b:\"\\\\\\\\[\\\\s\\\\S]\",r:0},e.ASM={cN:\"string\",b:\"'\",e:\"'\",i:\"\\\\n\",c:[e.BE]},e.QSM={cN:\"string\",b:'\"',e:'\"',i:\"\\\\n\",c:[e.BE]},e.PWM={b:/\\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\\b/},e.CLCM={cN:\"comment\",b:\"//\",e:\"$\",c:[e.PWM]},e.CBCM={cN:\"comment\",b:\"/\\\\*\",e:\"\\\\*/\",c:[e.PWM]},e.HCM={cN:\"comment\",b:\"#\",e:\"$\",c:[e.PWM]},e.NM={cN:\"number\",b:e.NR,r:0},e.CNM={cN:\"number\",b:e.CNR,r:0},e.BNM={cN:\"number\",b:e.BNR,r:0},e.CSSNM={cN:\"number\",b:e.NR+\"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\",r:0},e.RM={cN:\"regexp\",b:/\\//,e:/\\/[gimuy]*/,i:/\\n/,c:[e.BE,{b:/\\[/,e:/\\]/,r:0,c:[e.BE]}]},e.TM={cN:\"title\",b:e.IR,r:0},e.UTM={cN:\"title\",b:e.UIR,r:0},e});\n"
},
"$:/plugins/tiddlywiki/highlight/registerlanguages.js": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/highlight/registerlanguages.js",
"module-type": "library",
"text": "var hljs = require(\"$:/plugins/tiddlywiki/highlight/highlight.js\");\nhljs.registerLanguage(\"xml\",function(){var t=\"[A-Za-z0-9\\\\._:-]+\",e={b:/<\\?(php)?(?!\\w)/,e:/\\?>/,sL:\"php\",subLanguageMode:\"continuous\"},c={eW:!0,i:/</,r:0,c:[e,{cN:\"attribute\",b:t,r:0},{b:\"=\",r:0,c:[{cN:\"value\",c:[e],v:[{b:/\"/,e:/\"/},{b:/'/,e:/'/},{b:/[^\\s\\/>]+/}]}]}]};return{aliases:[\"html\",\"xhtml\",\"rss\",\"atom\",\"xsl\",\"plist\"],cI:!0,c:[{cN:\"doctype\",b:\"<!DOCTYPE\",e:\">\",r:10,c:[{b:\"\\\\[\",e:\"\\\\]\"}]},{cN:\"comment\",b:\"<!--\",e:\"-->\",r:10},{cN:\"cdata\",b:\"<\\\\!\\\\[CDATA\\\\[\",e:\"\\\\]\\\\]>\",r:10},{cN:\"tag\",b:\"<style(?=\\\\s|>|$)\",e:\">\",k:{title:\"style\"},c:[c],starts:{e:\"</style>\",rE:!0,sL:\"css\"}},{cN:\"tag\",b:\"<script(?=\\\\s|>|$)\",e:\">\",k:{title:\"script\"},c:[c],starts:{e:\"</script>\",rE:!0,sL:\"javascript\"}},e,{cN:\"pi\",b:/<\\?\\w+/,e:/\\?>/,r:10},{cN:\"tag\",b:\"</?\",e:\"/?>\",c:[{cN:\"title\",b:/[^ \\/><\\n\\t]+/,r:0},c]}]}});hljs.registerLanguage(\"cpp\",function(t){var i={keyword:\"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginaryintmax_t uintmax_t int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_tint_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_tint_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_tuint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t atomic_bool atomic_char atomic_scharatomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llongatomic_ullong atomic_wchar_t atomic_char16_t atomic_char32_t atomic_intmax_t atomic_uintmax_tatomic_intptr_t atomic_uintptr_t atomic_size_t atomic_ptrdiff_t atomic_int_least8_t atomic_int_least16_tatomic_int_least32_t atomic_int_least64_t atomic_uint_least8_t atomic_uint_least16_t atomic_uint_least32_tatomic_uint_least64_t atomic_int_fast8_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_tatomic_uint_fast8_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t\",built_in:\"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf\"};return{aliases:[\"c\",\"h\",\"c++\",\"h++\"],k:i,i:\"</\",c:[t.CLCM,t.CBCM,t.QSM,{cN:\"string\",b:\"'\\\\\\\\?.\",e:\"'\",i:\".\"},{cN:\"number\",b:\"\\\\b(\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)(u|U|l|L|ul|UL|f|F)\"},t.CNM,{cN:\"preprocessor\",b:\"#\",e:\"$\",k:\"if else elif endif define undef warning error line pragma\",c:[{b:'include\\\\s*[<\"]',e:'[>\"]',k:\"include\",i:\"\\\\n\"},t.CLCM]},{cN:\"stl_container\",b:\"\\\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<\",e:\">\",k:i,c:[\"self\"]},{b:t.IR+\"::\"},{bK:\"new throw return\",r:0},{cN:\"function\",b:\"(\"+t.IR+\"\\\\s+)+\"+t.IR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:t.IR+\"\\\\s*\\\\(\",rB:!0,c:[t.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,k:i,r:0,c:[t.CBCM]},t.CLCM,t.CBCM]}]}});hljs.registerLanguage(\"bash\",function(e){var t={cN:\"variable\",v:[{b:/\\$[\\w\\d#@][\\w\\d_]*/},{b:/\\$\\{(.*?)\\}/}]},s={cN:\"string\",b:/\"/,e:/\"/,c:[e.BE,t,{cN:\"variable\",b:/\\$\\(/,e:/\\)/,c:[e.BE]}]},a={cN:\"string\",b:/'/,e:/'/};return{aliases:[\"sh\",\"zsh\"],l:/-?[a-z\\.]+/,k:{keyword:\"if then else elif fi for while in do done case esac function\",literal:\"true false\",built_in:\"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp\",operator:\"-ne -eq -lt -gt -f -d -e -s -l -a\"},c:[{cN:\"shebang\",b:/^#![^\\n]+sh\\s*$/,r:10},{cN:\"function\",b:/\\w[\\w\\d_]*\\s*\\(\\s*\\)\\s*\\{/,rB:!0,c:[e.inherit(e.TM,{b:/\\w[\\w\\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage(\"java\",function(e){var a=e.UIR+\"(<\"+e.UIR+\">)?\",t=\"false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private\",c=\"(\\\\b(0b[01_]+)|\\\\b0[xX][a-fA-F0-9_]+|(\\\\b[\\\\d_]+(\\\\.[\\\\d_]*)?|\\\\.[\\\\d_]+)([eE][-+]?\\\\d+)?)[lLfF]?\",r={cN:\"number\",b:c,r:0};return{aliases:[\"jsp\"],k:t,i:/<\\//,c:[{cN:\"javadoc\",b:\"/\\\\*\\\\*\",e:\"\\\\*/\",r:0,c:[{cN:\"javadoctag\",b:\"(^|\\\\s)@[A-Za-z]+\"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:\"class\",bK:\"class interface\",e:/[{;=]/,eE:!0,k:\"class interface\",i:/[:\"\\[\\]]/,c:[{bK:\"extends implements\"},e.UTM]},{bK:\"new throw return\",r:0},{cN:\"function\",b:\"(\"+a+\"\\\\s+)+\"+e.UIR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.UIR+\"\\\\s*\\\\(\",rB:!0,r:0,c:[e.UTM]},{cN:\"params\",b:/\\(/,e:/\\)/,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},r,{cN:\"annotation\",b:\"@[A-Za-z]+\"}]}});hljs.registerLanguage(\"ini\",function(e){return{cI:!0,i:/\\S/,c:[{cN:\"comment\",b:\";\",e:\"$\"},{cN:\"title\",b:\"^\\\\[\",e:\"\\\\]\"},{cN:\"setting\",b:\"^[a-z0-9\\\\[\\\\]_-]+[ \\\\t]*=[ \\\\t]*\",e:\"$\",c:[{cN:\"value\",eW:!0,k:\"on off true false yes no\",c:[e.QSM,e.NM],r:0}]}]}});hljs.registerLanguage(\"objectivec\",function(e){var t={keyword:\"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required\",literal:\"false true FALSE TRUE nil YES NO NULL\",built_in:\"NSString NSData NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once\"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,a=\"@interface @class @protocol @implementation\";return{aliases:[\"m\",\"mm\",\"objc\",\"obj-c\"],k:t,l:o,i:\"</\",c:[e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:\"string\",v:[{b:'@\"',e:'\"',i:\"\\\\n\",c:[e.BE]},{b:\"'\",e:\"[^\\\\\\\\]'\",i:\"[^\\\\\\\\][^']\"}]},{cN:\"preprocessor\",b:\"#\",e:\"$\",c:[{cN:\"title\",v:[{b:'\"',e:'\"'},{b:\"<\",e:\">\"}]}]},{cN:\"class\",b:\"(\"+a.split(\" \").join(\"|\")+\")\\\\b\",e:\"({|$)\",eE:!0,k:a,l:o,c:[e.UTM]},{cN:\"variable\",b:\"\\\\.\"+e.UIR,r:0}]}});hljs.registerLanguage(\"php\",function(e){var c={cN:\"variable\",b:\"\\\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*\"},i={cN:\"preprocessor\",b:/<\\?(php)?|\\?>/},a={cN:\"string\",c:[e.BE,i],v:[{b:'b\"',e:'\"'},{b:\"b'\",e:\"'\"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:[\"php3\",\"php4\",\"php5\",\"php6\"],cI:!0,k:\"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally\",c:[e.CLCM,e.HCM,{cN:\"comment\",b:\"/\\\\*\",e:\"\\\\*/\",c:[{cN:\"phpdoc\",b:\"\\\\s@[A-Za-z]+\"},i]},{cN:\"comment\",b:\"__halt_compiler.+?;\",eW:!0,k:\"__halt_compiler\",l:e.UIR},{cN:\"string\",b:\"<<<['\\\"]?\\\\w+['\\\"]?$\",e:\"^\\\\w+;\",c:[e.BE]},i,c,{b:/->+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/},{cN:\"function\",bK:\"function\",e:/[;{]/,eE:!0,i:\"\\\\$|\\\\[|%\",c:[e.UTM,{cN:\"params\",b:\"\\\\(\",e:\"\\\\)\",c:[\"self\",c,e.CBCM,a,n]}]},{cN:\"class\",bK:\"class interface\",e:\"{\",eE:!0,i:/[:\\(\\$\"]/,c:[{bK:\"extends implements\"},e.UTM]},{bK:\"namespace\",e:\";\",i:/[\\.']/,c:[e.UTM]},{bK:\"use\",e:\";\",c:[e.UTM]},{b:\"=>\"},a,n]}});hljs.registerLanguage(\"coffeescript\",function(e){var c={keyword:\"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not\",literal:\"true false null undefined yes no on off\",reserved:\"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf\",built_in:\"npm require console print module global window document\"},n=\"[A-Za-z$_][0-9A-Za-z$_]*\",t={cN:\"subst\",b:/#\\{/,e:/}/,k:c},r=[e.BNM,e.inherit(e.CNM,{starts:{e:\"(\\\\s*/)?\",r:0}}),{cN:\"string\",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/\"\"\"/,e:/\"\"\"/,c:[e.BE,t]},{b:/\"/,e:/\"/,c:[e.BE,t]}]},{cN:\"regexp\",v:[{b:\"///\",e:\"///\",c:[t,e.HCM]},{b:\"//[gim]*\",r:0},{b:/\\/(?![ *])(\\\\\\/|.)*?\\/[gim]*(?=\\W|$)/}]},{cN:\"property\",b:\"@\"+n},{b:\"`\",e:\"`\",eB:!0,eE:!0,sL:\"javascript\"}];t.c=r;var i=e.inherit(e.TM,{b:n}),s=\"(\\\\(.*\\\\))?\\\\s*\\\\B[-=]>\",o={cN:\"params\",b:\"\\\\([^\\\\(]\",rB:!0,c:[{b:/\\(/,e:/\\)/,k:c,c:[\"self\"].concat(r)}]};return{aliases:[\"coffee\",\"cson\",\"iced\"],k:c,i:/\\/\\*/,c:r.concat([{cN:\"comment\",b:\"###\",e:\"###\",c:[e.PWM]},e.HCM,{cN:\"function\",b:\"^\\\\s*\"+n+\"\\\\s*=\\\\s*\"+s,e:\"[-=]>\",rB:!0,c:[i,o]},{b:/[:\\(,=]\\s*/,r:0,c:[{cN:\"function\",b:s,e:\"[-=]>\",rB:!0,c:[o]}]},{cN:\"class\",bK:\"class\",e:\"$\",i:/[:=\"\\[\\]]/,c:[{bK:\"extends\",eW:!0,i:/[:=\"\\[\\]]/,c:[i]},i]},{cN:\"attribute\",b:n+\":\",e:\":\",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage(\"sql\",function(e){var t={cN:\"comment\",b:\"--\",e:\"$\"};return{cI:!0,i:/[<>]/,c:[{cN:\"operator\",bK:\"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup\",e:/;/,eW:!0,k:{keyword:\"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon\",literal:\"true false null\",built_in:\"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text\"},c:[{cN:\"string\",b:\"'\",e:\"'\",c:[e.BE,{b:\"''\"}]},{cN:\"string\",b:'\"',e:'\"',c:[e.BE,{b:'\"\"'}]},{cN:\"string\",b:\"`\",e:\"`\",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage(\"http\",function(){return{i:\"\\\\S\",c:[{cN:\"status\",b:\"^HTTP/[0-9\\\\.]+\",e:\"$\",c:[{cN:\"number\",b:\"\\\\b\\\\d{3}\\\\b\"}]},{cN:\"request\",b:\"^[A-Z]+ (.*?) HTTP/[0-9\\\\.]+$\",rB:!0,e:\"$\",c:[{cN:\"string\",b:\" \",e:\" \",eB:!0,eE:!0}]},{cN:\"attribute\",b:\"^\\\\w\",e:\": \",eE:!0,i:\"\\\\n|\\\\s|=\",starts:{cN:\"string\",e:\"$\"}},{b:\"\\\\n\\\\n\",starts:{sL:\"\",eW:!0}}]}});hljs.registerLanguage(\"makefile\",function(e){var a={cN:\"variable\",b:/\\$\\(/,e:/\\)/,c:[e.BE]};return{aliases:[\"mk\",\"mak\"],c:[e.HCM,{b:/^\\w+\\s*\\W*=/,rB:!0,r:0,starts:{cN:\"constant\",e:/\\s*\\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:\"title\",b:/^[\\w]+:\\s*$/},{cN:\"phony\",b:/^\\.PHONY:/,e:/$/,k:\".PHONY\",l:/[\\.\\w]+/},{b:/^\\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage(\"perl\",function(e){var t=\"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when\",r={cN:\"subst\",b:\"[$@]\\\\{\",e:\"\\\\}\",k:t},s={b:\"->{\",e:\"}\"},n={cN:\"variable\",v:[{b:/\\$\\d/},{b:/[\\$\\%\\@](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|{\\w+}|\\w+(\\:\\:\\w*)*)/},{b:/[\\$\\%\\@][^\\s\\w{]/,r:0}]},o={cN:\"comment\",b:\"^(__END__|__DATA__)\",e:\"\\\\n$\",r:5},i=[e.BE,r,n],c=[n,e.HCM,o,{cN:\"comment\",b:\"^\\\\=\\\\w\",e:\"\\\\=cut\",eW:!0},s,{cN:\"string\",c:i,v:[{b:\"q[qwxr]?\\\\s*\\\\(\",e:\"\\\\)\",r:5},{b:\"q[qwxr]?\\\\s*\\\\[\",e:\"\\\\]\",r:5},{b:\"q[qwxr]?\\\\s*\\\\{\",e:\"\\\\}\",r:5},{b:\"q[qwxr]?\\\\s*\\\\|\",e:\"\\\\|\",r:5},{b:\"q[qwxr]?\\\\s*\\\\<\",e:\"\\\\>\",r:5},{b:\"qw\\\\s+q\",e:\"q\",r:5},{b:\"'\",e:\"'\",c:[e.BE]},{b:'\"',e:'\"'},{b:\"`\",e:\"`\",c:[e.BE]},{b:\"{\\\\w+}\",c:[],r:0},{b:\"-?\\\\w+\\\\s*\\\\=\\\\>\",c:[],r:0}]},{cN:\"number\",b:\"(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b\",r:0},{b:\"(\\\\/\\\\/|\"+e.RSR+\"|\\\\b(split|return|print|reverse|grep)\\\\b)\\\\s*\",k:\"split return print reverse grep\",r:0,c:[e.HCM,o,{cN:\"regexp\",b:\"(s|tr|y)/(\\\\\\\\.|[^/])*/(\\\\\\\\.|[^/])*/[a-z]*\",r:10},{cN:\"regexp\",b:\"(m|qr)?/\",e:\"/[a-z]*\",c:[e.BE],r:0}]},{cN:\"sub\",bK:\"sub\",e:\"(\\\\s*\\\\(.*?\\\\))?[;{]\",r:5},{cN:\"operator\",b:\"-\\\\w\\\\b\",r:0}];return r.c=c,s.c=c,{aliases:[\"pl\"],k:t,c:c}});hljs.registerLanguage(\"ruby\",function(e){var b=\"[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?\",r=\"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor\",c={cN:\"yardoctag\",b:\"@[A-Za-z]+\"},a={cN:\"value\",b:\"#<\",e:\">\"},s={cN:\"comment\",v:[{b:\"#\",e:\"$\",c:[c]},{b:\"^\\\\=begin\",e:\"^\\\\=end\",c:[c],r:10},{b:\"^__END__\",e:\"\\\\n$\"}]},n={cN:\"subst\",b:\"#\\\\{\",e:\"}\",k:r},t={cN:\"string\",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/\"/,e:/\"/},{b:/`/,e:/`/},{b:\"%[qQwWx]?\\\\(\",e:\"\\\\)\"},{b:\"%[qQwWx]?\\\\[\",e:\"\\\\]\"},{b:\"%[qQwWx]?{\",e:\"}\"},{b:\"%[qQwWx]?<\",e:\">\"},{b:\"%[qQwWx]?/\",e:\"/\"},{b:\"%[qQwWx]?%\",e:\"%\"},{b:\"%[qQwWx]?-\",e:\"-\"},{b:\"%[qQwWx]?\\\\|\",e:\"\\\\|\"},{b:/\\B\\?(\\\\\\d{1,3}|\\\\x[A-Fa-f0-9]{1,2}|\\\\u[A-Fa-f0-9]{4}|\\\\?\\S)\\b/}]},i={cN:\"params\",b:\"\\\\(\",e:\"\\\\)\",k:r},d=[t,a,s,{cN:\"class\",bK:\"class module\",e:\"$|;\",i:/=/,c:[e.inherit(e.TM,{b:\"[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?\"}),{cN:\"inheritance\",b:\"<\\\\s*\",c:[{cN:\"parent\",b:\"(\"+e.IR+\"::)?\"+e.IR}]},s]},{cN:\"function\",bK:\"def\",e:\" |$|;\",r:0,c:[e.inherit(e.TM,{b:b}),i,s]},{cN:\"constant\",b:\"(::)?(\\\\b[A-Z]\\\\w*(::)?)+\",r:0},{cN:\"symbol\",b:e.UIR+\"(\\\\!|\\\\?)?:\",r:0},{cN:\"symbol\",b:\":\",c:[t,{b:b}],r:0},{cN:\"number\",b:\"(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b\",r:0},{cN:\"variable\",b:\"(\\\\$\\\\W)|((\\\\$|\\\\@\\\\@?)(\\\\w+))\"},{b:\"(\"+e.RSR+\")\\\\s*\",c:[a,s,{cN:\"regexp\",c:[e.BE,n],i:/\\n/,v:[{b:\"/\",e:\"/[a-z]*\"},{b:\"%r{\",e:\"}[a-z]*\"},{b:\"%r\\\\(\",e:\"\\\\)[a-z]*\"},{b:\"%r!\",e:\"![a-z]*\"},{b:\"%r\\\\[\",e:\"\\\\][a-z]*\"}]}],r:0}];n.c=d,i.c=d;var l=\"[>?]>\",u=\"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\",N=\"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d(p\\\\d+)?[^>]+>\",o=[{b:/^\\s*=>/,cN:\"status\",starts:{e:\"$\",c:d}},{cN:\"prompt\",b:\"^(\"+l+\"|\"+u+\"|\"+N+\")\",starts:{e:\"$\",c:d}}];return{aliases:[\"rb\",\"gemspec\",\"podspec\",\"thor\",\"irb\"],k:r,c:[s].concat(o).concat(d)}});hljs.registerLanguage(\"apache\",function(e){var r={cN:\"number\",b:\"[\\\\$%]\\\\d+\"};return{aliases:[\"apacheconf\"],cI:!0,c:[e.HCM,{cN:\"tag\",b:\"</?\",e:\">\"},{cN:\"keyword\",b:/\\w+/,r:0,k:{common:\"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername\"},starts:{e:/$/,r:0,k:{literal:\"on off all\"},c:[{cN:\"sqbracket\",b:\"\\\\s\\\\[\",e:\"\\\\]$\"},{cN:\"cbracket\",b:\"[\\\\$%]\\\\{\",e:\"\\\\}\",c:[\"self\",r]},r,e.QSM]}}],i:/\\S/}});hljs.registerLanguage(\"json\",function(e){var t={literal:\"true false null\"},i=[e.QSM,e.CNM],l={cN:\"value\",e:\",\",eW:!0,eE:!0,c:i,k:t},c={b:\"{\",e:\"}\",c:[{cN:\"attribute\",b:'\\\\s*\"',e:'\"\\\\s*:\\\\s*',eB:!0,eE:!0,c:[e.BE],i:\"\\\\n\",starts:l}],i:\"\\\\S\"},n={b:\"\\\\[\",e:\"\\\\]\",c:[e.inherit(l,{cN:null})],i:\"\\\\S\"};return i.splice(i.length,0,c,n),{c:i,k:t,i:\"\\\\S\"}});hljs.registerLanguage(\"css\",function(e){var c=\"[a-zA-Z-][a-zA-Z0-9_-]*\",a={cN:\"function\",b:c+\"\\\\(\",rB:!0,eE:!0,e:\"\\\\(\"};return{cI:!0,i:\"[=/|']\",c:[e.CBCM,{cN:\"id\",b:\"\\\\#[A-Za-z0-9_-]+\"},{cN:\"class\",b:\"\\\\.[A-Za-z0-9_-]+\",r:0},{cN:\"attr_selector\",b:\"\\\\[\",e:\"\\\\]\",i:\"$\"},{cN:\"pseudo\",b:\":(:)?[a-zA-Z0-9\\\\_\\\\-\\\\+\\\\(\\\\)\\\\\\\"\\\\']+\"},{cN:\"at_rule\",b:\"@(font-face|page)\",l:\"[a-z-]+\",k:\"font-face page\"},{cN:\"at_rule\",b:\"@\",e:\"[{;]\",c:[{cN:\"keyword\",b:/\\S+/},{b:/\\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:\"tag\",b:c,r:0},{cN:\"rules\",b:\"{\",e:\"}\",i:\"[^\\\\s]\",r:0,c:[e.CBCM,{cN:\"rule\",b:\"[^\\\\s]\",rB:!0,e:\";\",eW:!0,c:[{cN:\"attribute\",b:\"[A-Z\\\\_\\\\.\\\\-]+\",e:\":\",eE:!0,i:\"[^\\\\s]\",starts:{cN:\"value\",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:\"hexcolor\",b:\"#[0-9A-Fa-f]+\"},{cN:\"important\",b:\"!important\"}]}}]}]}]}});hljs.registerLanguage(\"nginx\",function(e){var r={cN:\"variable\",v:[{b:/\\$\\d+/},{b:/\\$\\{/,e:/}/},{b:\"[\\\\$\\\\@]\"+e.UIR}]},b={eW:!0,l:\"[a-z/_]+\",k:{built_in:\"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll\"},r:0,i:\"=>\",c:[e.HCM,{cN:\"string\",c:[e.BE,r],v:[{b:/\"/,e:/\"/},{b:/'/,e:/'/}]},{cN:\"url\",b:\"([a-z]+):/\",e:\"\\\\s\",eW:!0,eE:!0,c:[r]},{cN:\"regexp\",c:[e.BE,r],v:[{b:\"\\\\s\\\\^\",e:\"\\\\s|{|;\",rE:!0},{b:\"~\\\\*?\\\\s+\",e:\"\\\\s|{|;\",rE:!0},{b:\"\\\\*(\\\\.[a-z\\\\-]+)+\"},{b:\"([a-z\\\\-]+\\\\.)+\\\\*\"}]},{cN:\"number\",b:\"\\\\b\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}(:\\\\d{1,5})?\\\\b\"},{cN:\"number\",b:\"\\\\b\\\\d+[kKmMgGdshdwy]*\\\\b\",r:0},r]};return{aliases:[\"nginxconf\"],c:[e.HCM,{b:e.UIR+\"\\\\s\",e:\";|{\",rB:!0,c:[{cN:\"title\",b:e.UIR,starts:b}],r:0}],i:\"[^\\\\s\\\\}]\"}});hljs.registerLanguage(\"cs\",function(e){var r=\"abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield\",t=e.IR+\"(<\"+e.IR+\">)?\";return{aliases:[\"csharp\"],k:r,i:/::/,c:[{cN:\"comment\",b:\"///\",e:\"$\",rB:!0,c:[{cN:\"xmlDocTag\",v:[{b:\"///\",r:0},{b:\"<!--|-->\"},{b:\"</?\",e:\">\"}]}]},e.CLCM,e.CBCM,{cN:\"preprocessor\",b:\"#\",e:\"$\",k:\"if else elif endif define undef warning error line region endregion pragma checksum\"},{cN:\"string\",b:'@\"',e:'\"',c:[{b:'\"\"'}]},e.ASM,e.QSM,e.CNM,{bK:\"class namespace interface\",e:/[{;=]/,i:/[^\\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:\"new return throw await\",r:0},{cN:\"function\",b:\"(\"+t+\"\\\\s+)+\"+e.IR+\"\\\\s*\\\\(\",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.IR+\"\\\\s*\\\\(\",rB:!0,c:[e.TM],r:0},{cN:\"params\",b:/\\(/,e:/\\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage(\"markdown\",function(){return{aliases:[\"md\",\"mkdown\",\"mkd\"],c:[{cN:\"header\",v:[{b:\"^#{1,6}\",e:\"$\"},{b:\"^.+?\\\\n[=-]{2,}$\"}]},{b:\"<\",e:\">\",sL:\"xml\",r:0},{cN:\"bullet\",b:\"^([*+-]|(\\\\d+\\\\.))\\\\s+\"},{cN:\"strong\",b:\"[*_]{2}.+?[*_]{2}\"},{cN:\"emphasis\",v:[{b:\"\\\\*.+?\\\\*\"},{b:\"_.+?_\",r:0}]},{cN:\"blockquote\",b:\"^>\\\\s+\",e:\"$\"},{cN:\"code\",v:[{b:\"`.+?`\"},{b:\"^( {4}|\t)\",e:\"$\",r:0}]},{cN:\"horizontal_rule\",b:\"^[-\\\\*]{3,}\",e:\"$\"},{b:\"\\\\[.+?\\\\][\\\\(\\\\[].*?[\\\\)\\\\]]\",rB:!0,c:[{cN:\"link_label\",b:\"\\\\[\",e:\"\\\\]\",eB:!0,rE:!0,r:0},{cN:\"link_url\",b:\"\\\\]\\\\(\",e:\"\\\\)\",eB:!0,eE:!0},{cN:\"link_reference\",b:\"\\\\]\\\\[\",e:\"\\\\]\",eB:!0,eE:!0}],r:10},{b:\"^\\\\[.+\\\\]:\",rB:!0,c:[{cN:\"link_reference\",b:\"\\\\[\",e:\"\\\\]:\",eB:!0,eE:!0,starts:{cN:\"link_url\",e:\"$\"}}]}]}});hljs.registerLanguage(\"diff\",function(){return{aliases:[\"patch\"],c:[{cN:\"chunk\",r:10,v:[{b:/^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$/},{b:/^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$/},{b:/^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$/}]},{cN:\"header\",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\\-\\-\\-/,e:/$/},{b:/^\\*{3} /,e:/$/},{b:/^\\+\\+\\+/,e:/$/},{b:/\\*{5}/,e:/\\*{5}$/}]},{cN:\"addition\",b:\"^\\\\+\",e:\"$\"},{cN:\"deletion\",b:\"^\\\\-\",e:\"$\"},{cN:\"change\",b:\"^\\\\!\",e:\"$\"}]}});hljs.registerLanguage(\"javascript\",function(r){return{aliases:[\"js\"],k:{keyword:\"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class\",literal:\"true false null undefined NaN Infinity\",built_in:\"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document\"},c:[{cN:\"pi\",r:10,v:[{b:/^\\s*('|\")use strict('|\")/},{b:/^\\s*('|\")use asm('|\")/}]},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:\"(\"+r.RSR+\"|\\\\b(case|return|throw)\\\\b)\\\\s*\",k:\"return throw case\",c:[r.CLCM,r.CBCM,r.RM,{b:/</,e:/>;/,r:0,sL:\"xml\"}],r:0},{cN:\"function\",bK:\"function\",e:/\\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:\"params\",b:/\\(/,e:/\\)/,c:[r.CLCM,r.CBCM],i:/[\"'\\(]/}],i:/\\[|%/},{b:/\\$[(.]/},{b:\"\\\\.\"+r.IR,r:0}]}});hljs.registerLanguage(\"python\",function(e){var r={cN:\"prompt\",b:/^(>>>|\\.\\.\\.) /},b={cN:\"string\",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?\"\"\"/,e:/\"\"\"/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)\"/,e:/\"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)\"/,e:/\"/},e.ASM,e.QSM]},l={cN:\"number\",r:0,v:[{b:e.BNR+\"[lLjJ]?\"},{b:\"\\\\b(0o[0-7]+)[lLjJ]?\"},{b:e.CNR+\"[lLjJ]?\"}]},c={cN:\"params\",b:/\\(/,e:/\\)/,c:[\"self\",r,l,b]};return{aliases:[\"py\",\"gyp\"],k:{keyword:\"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False\",built_in:\"Ellipsis NotImplemented\"},i:/(<\\/|->|\\?)/,c:[r,l,b,e.HCM,{v:[{cN:\"function\",bK:\"def\",r:10},{cN:\"class\",bK:\"class\"}],e:/:/,i:/[${=;\\n]/,c:[e.UTM,c]},{cN:\"decorator\",b:/@/,e:/$/},{b:/\\b(print|exec)\\(/}]}});\n\nexports.hljs = hljs;\n"
},
"$:/plugins/tiddlywiki/highlight/highlight.css": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/highlight/highlight.css",
"tags": "[[$:/tags/Stylesheet]]",
"text": ".hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0;-webkit-text-size-adjust:none}.hljs,.hljs-subst,.hljs-tag .hljs-title,.nginx .hljs-title{color:#000}.hljs-string,.hljs-title,.hljs-constant,.hljs-parent,.hljs-tag .hljs-value,.hljs-rules .hljs-value,.hljs-preprocessor,.hljs-pragma,.haml .hljs-symbol,.ruby .hljs-symbol,.ruby .hljs-symbol .hljs-string,.hljs-template_tag,.django .hljs-variable,.smalltalk .hljs-class,.hljs-addition,.hljs-flow,.hljs-stream,.bash .hljs-variable,.apache .hljs-tag,.apache .hljs-cbracket,.tex .hljs-command,.tex .hljs-special,.erlang_repl .hljs-function_or_atom,.asciidoc .hljs-header,.markdown .hljs-header,.coffeescript .hljs-attribute{color:#800}.smartquote,.hljs-comment,.hljs-annotation,.diff .hljs-header,.hljs-chunk,.asciidoc .hljs-blockquote,.markdown .hljs-blockquote{color:#888}.hljs-number,.hljs-date,.hljs-regexp,.hljs-literal,.hljs-hexcolor,.smalltalk .hljs-symbol,.smalltalk .hljs-char,.go .hljs-constant,.hljs-change,.lasso .hljs-variable,.makefile .hljs-variable,.asciidoc .hljs-bullet,.markdown .hljs-bullet,.asciidoc .hljs-link_url,.markdown .hljs-link_url{color:#080}.hljs-label,.hljs-javadoc,.ruby .hljs-string,.hljs-decorator,.hljs-filter .hljs-argument,.hljs-localvars,.hljs-array,.hljs-attr_selector,.hljs-important,.hljs-pseudo,.hljs-pi,.haml .hljs-bullet,.hljs-doctype,.hljs-deletion,.hljs-envvar,.hljs-shebang,.apache .hljs-sqbracket,.nginx .hljs-built_in,.tex .hljs-formula,.erlang_repl .hljs-reserved,.hljs-prompt,.asciidoc .hljs-link_label,.markdown .hljs-link_label,.vhdl .hljs-attribute,.clojure .hljs-attribute,.asciidoc .hljs-attribute,.lasso .hljs-attribute,.coffeescript .hljs-property,.hljs-phony{color:#88f}.hljs-keyword,.hljs-id,.hljs-title,.hljs-built_in,.css .hljs-tag,.hljs-javadoctag,.hljs-phpdoc,.hljs-dartdoc,.hljs-yardoctag,.smalltalk .hljs-class,.hljs-winutils,.bash .hljs-variable,.apache .hljs-tag,.hljs-type,.hljs-typename,.tex .hljs-command,.asciidoc .hljs-strong,.markdown .hljs-strong,.hljs-request,.hljs-status{font-weight:bold}.asciidoc .hljs-emphasis,.markdown .hljs-emphasis{font-style:italic}.nginx .hljs-built_in{font-weight:normal}.coffeescript .javascript,.javascript .xml,.lasso .markup,.tex .hljs-formula,.xml .javascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:.5}"
},
"$:/plugins/tiddlywiki/highlight/highlightblock.js": {
"text": "/*\\\ntitle: $:/plugins/tiddlywiki/highlight/highlightblock.js\ntype: application/javascript\nmodule-type: widget\n\nWraps up the fenced code blocks parser for highlight and use in TiddlyWiki5\n\n\\*/\n(function() {\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CodeBlockWidget = require(\"$:/core/modules/widgets/codeblock.js\").codeblock;\n//register languages requires hljs for us\nvar hljs = require(\"$:/plugins/tiddlywiki/highlight/registerlanguages.js\").hljs;\nhljs.configure({tabReplace: \" \"});\t\n\nCodeBlockWidget.prototype.postRender = function() {\n\tvar domNode = this.domNodes[0];\n\tif($tw.browser && this.document !== $tw.fakeDocument && this.language) {\n\t\tdomNode.className = this.language.toLowerCase();\n\t\thljs.highlightBlock(domNode);\n\t}\n\telse if(!$tw.browser && this.language && this.language.indexOf(\"/\") == -1 ){\n\t\ttry{\n\t\t\tdomNode.className = this.language.toLowerCase() + \" hljs\";\n\t\t\tdomNode.children[0].innerHTML = hljs.fixMarkup(hljs.highlight(this.language, this.getAttribute(\"code\")).value);\n\t\t}\n\t\tcatch(err) {\n\t\t\t//can't easily tell if a language is registered or not in the packed version of hightlight.js\n\t\t\t//so we silently fail and the codeblock remains unchanged\n\t\t}\n\t}\t\n};\n\n})();\n",
"title": "$:/plugins/tiddlywiki/highlight/highlightblock.js",
"type": "application/javascript",
"module-type": "widget"
},
"$:/plugins/tiddlywiki/highlight/license": {
"title": "$:/plugins/tiddlywiki/highlight/license",
"type": "text/plain",
"text": "Copyright (c) 2006, Ivan Sagalaev\nAll rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * Neither the name of highlight.js nor the names of its contributors\n may be used to endorse or promote products derived from this software\n without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
},
"$:/plugins/tiddlywiki/highlight/styles": {
"title": "$:/plugins/tiddlywiki/highlight/styles",
"tags": "[[$:/tags/Stylesheet]]",
"text": "\n/* Tomorrow Night Theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */\n\n/* Tomorrow Comment */\n.hljs-comment {\n color: #969896;\n}\n\n/* Tomorrow Red */\n.hljs-variable,\n.hljs-attribute,\n.hljs-tag,\n.hljs-regexp,\n.ruby .hljs-constant,\n.xml .hljs-tag .hljs-title,\n.xml .hljs-pi,\n.xml .hljs-doctype,\n.html .hljs-doctype,\n.css .hljs-id,\n.css .hljs-class,\n.css .hljs-pseudo {\n color: #cc6666;\n}\n\n/* Tomorrow Orange */\n.hljs-number,\n.hljs-preprocessor,\n.hljs-pragma,\n.hljs-built_in,\n.hljs-literal,\n.hljs-params,\n.hljs-constant {\n color: #de935f;\n}\n\n/* Tomorrow Yellow */\n.ruby .hljs-class .hljs-title,\n.css .hljs-rules .hljs-attribute {\n color: #f0c674;\n}\n\n/* Tomorrow Green */\n.hljs-string,\n.hljs-value,\n.hljs-inheritance,\n.hljs-header,\n.ruby .hljs-symbol,\n.xml .hljs-cdata {\n color: #b5bd68;\n}\n\n/* Tomorrow Aqua */\n.hljs-title,\n.css .hljs-hexcolor {\n color: #8abeb7;\n}\n\n/* Tomorrow Blue */\n.hljs-function,\n.python .hljs-decorator,\n.python .hljs-title,\n.ruby .hljs-function .hljs-title,\n.ruby .hljs-title .hljs-keyword,\n.perl .hljs-sub,\n.javascript .hljs-title,\n.coffeescript .hljs-title {\n color: #81a2be;\n}\n\n/* Tomorrow Purple */\n.hljs-keyword,\n.javascript .hljs-function {\n color: #b294bb;\n}\n\n.hljs {\n display: block;\n overflow-x: auto;\n background: #1d1f21;\n color: #c5c8c6;\n padding: 0.5em;\n -webkit-text-size-adjust: none;\n}\n\n.coffeescript .javascript,\n.javascript .xml,\n.tex .hljs-formula,\n.xml .javascript,\n.xml .vbscript,\n.xml .css,\n.xml .hljs-cdata {\n opacity: 0.5;\n}"
}
}
}
$:/core/ui/ControlPanel/Saving
{
"tiddlers": {
"$:/info/browser": {
"title": "$:/info/browser",
"text": "yes"
},
"$:/info/node": {
"title": "$:/info/node",
"text": "no"
}
}
}
{
"tiddlers": {
"$:/themes/tiddlywiki/snowwhite/base": {
"title": "$:/themes/tiddlywiki/snowwhite/base",
"tags": "[[$:/tags/Stylesheet]]",
"text": "\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\n\n.tc-sidebar-header {\n\ttext-shadow: 0 1px 0 <<colour sidebar-foreground-shadow>>;\n}\n\n.tc-tiddler-title {\n position: -webkit-sticky;\n position: -moz-sticky;\n position: -o-sticky;\n position: -ms-sticky;\n position: sticky;\n top: 0px;\n background: <<colour tiddler-background>>;\n z-index: 500;\n}\n\n.tc-tiddler-info {\n\t<<box-shadow \"inset 1px 2px 3px rgba(0,0,0,0.1)\">>\n}\n\n@media screen {\n\t.tc-tiddler-frame {\n\t\t<<box-shadow \"5px 5px 5px rgba(0, 0, 0, 0.1)\">>\n\t}\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\t<<box-shadow none>>\n\t}\n}\n\n.tc-page-controls button svg, .tc-tiddler-controls button svg, .tc-topbar button svg {\n\t<<transition \"fill 150ms ease-in-out\">>\n}\n\n.tc-tiddler-controls button.tc-selected svg {\n\t<<filter \"drop-shadow(0px -1px 2px rgba(0,0,0,0.25))\">>\n}\n\n.tc-tiddler-frame input.tc-edit-texteditor {\n\t<<box-shadow \"inset 0 1px 8px rgba(0, 0, 0, 0.15)\">>\n}\n\n.tc-edit-tags {\n\t<<box-shadow \"inset 0 1px 8px rgba(0, 0, 0, 0.15)\">>\n}\n\n.tc-tiddler-frame .tc-edit-tags input.tc-edit-texteditor {\n\t<<box-shadow \"none\">>\n\tborder: none;\n\toutline: none;\n}\n\ncanvas.tc-edit-bitmapeditor {\n\t<<box-shadow \"2px 2px 5px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-drop-down {\n\tborder-radius: 4px;\n\t<<box-shadow \"2px 2px 10px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-block-dropdown {\n\tborder-radius: 4px;\n\t<<box-shadow \"2px 2px 10px rgba(0, 0, 0, 0.5)\">>\n}\n\n.tc-modal-displayed {\n\t-webkit-filter: blur(4px);\n}\n\n.tc-modal {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.3)\">>\n}\n\n.tc-modal-footer {\n\tborder-radius: 0 0 6px 6px;\n\t<<box-shadow \"inset 0 1px 0 #fff\">>;\n}\n\n\n.tc-alert {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.6)\">>\n}\n\n.tc-notification {\n\tborder-radius: 6px;\n\t<<box-shadow \"0 3px 7px rgba(0,0,0,0.3)\">>\n\ttext-shadow: 0 1px 0 rgba(255,255,255, 0.8);\n}\n\n.tc-sidebar-lists .tc-tab-divider {\n\t<<background-linear-gradient \"left, rgb(216,216,216) 0%, rgb(236,236,236) 250px\">>\n}\n\n.tc-more-sidebar .tc-tab-buttons button {\n\t<<background-linear-gradient \"left, rgb(236,236,236) 0%, rgb(224,224,224) 100%\">>\n}\n\n.tc-more-sidebar .tc-tab-buttons button.tc-tab-selected {\n\t<<background-linear-gradient \"left, rgb(236,236,236) 0%, rgb(248,248,248) 100%\">>\n}\n\n.tc-message-box img {\n\t<<box-shadow \"1px 1px 3px rgba(0,0,0,0.5)\">>\n}\n\n.tc-plugin-info {\n\t<<box-shadow \"2px 2px 4px rgba(0,0,0,0.2)\">>\n}\n"
}
}
}
{
"tiddlers": {
"$:/themes/tiddlywiki/vanilla/themetweaks": {
"title": "$:/themes/tiddlywiki/vanilla/themetweaks",
"tags": "$:/tags/ControlPanel/Appearance",
"caption": "Theme Tweaks",
"text": "You can tweak certain aspects of the ''Vanilla'' theme.\n\n! Settings\n\n* [[Font family|$:/themes/tiddlywiki/vanilla/settings/fontfamily]]: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/settings/fontfamily\" default=\"\" tag=\"input\"/>\n\n! Sizes\n\n* [[Font size|$:/themes/tiddlywiki/vanilla/metrics/fontsize]]: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/fontsize\" default=\"\" tag=\"input\"/>\n* [[Line height|$:/themes/tiddlywiki/vanilla/metrics/lineheight]]: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/lineheight\" default=\"\" tag=\"input\"/>\n* [[Font size for tiddler body|$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize]]: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize\" default=\"\" tag=\"input\"/>\n* [[Line height for tiddler body|$:/themes/tiddlywiki/vanilla/metrics/bodylineheight]]: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/bodylineheight\" default=\"\" tag=\"input\"/>\n* [[Story left position|$:/themes/tiddlywiki/vanilla/metrics/storyleft]] //(the distance between the left of the screen and the left margin of the story river or tiddler area)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storyleft\" default=\"\" tag=\"input\"/>\n* [[Story top position|$:/themes/tiddlywiki/vanilla/metrics/storytop]] //(the distance between the top of the screen and the top margin of the story river or tiddler area)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storytop\" default=\"\" tag=\"input\"/>\n* [[Story right|$:/themes/tiddlywiki/vanilla/metrics/storyright]] //(the distance between the left side of the screen and the left margin of the sidebar area)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storyright\" default=\"\" tag=\"input\"/>\n* [[Story width|$:/themes/tiddlywiki/vanilla/metrics/storywidth]] //(the width of the story river or tiddler area)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/storywidth\" default=\"\" tag=\"input\"/>\n* [[Tiddler width|$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth]] //(the width of individual tiddlers -- used for zoomin storyview)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth\" default=\"\" tag=\"input\"/>\n* [[Sidebar breakpoint|$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint]] //(the minimum width for the sidebar to be displayed alongside the story river)//: <$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint\" default=\"\" tag=\"input\"/>\n"
},
"$:/themes/tiddlywiki/vanilla/base": {
"title": "$:/themes/tiddlywiki/vanilla/base",
"tags": "[[$:/tags/Stylesheet]]",
"text": "\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline\n/*\n** Start with the normalize CSS reset, and then belay some of its effects\n*/\n\n{{$:/themes/tiddlywiki/vanilla/reset}}\n\n*, input[type=\"search\"] {\n\tbox-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\t-webkit-box-sizing: border-box;\n}\n\nhtml button {\n\tline-height: 1.2;\n}\n\n/*\n** Basic element styles\n*/\n\nhtml {\n\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/fontfamily}};\n\ttext-rendering: optimizeLegibility; /* Enables kerning and ligatures etc. */\t\n}\n\nhtml:-webkit-full-screen {\n\tbackground-color: <<colour page-background>>;\n}\n\nbody.tc-body {\n\tfont-size: {{$:/themes/tiddlywiki/vanilla/metrics/fontsize}};\n\tline-height: {{$:/themes/tiddlywiki/vanilla/metrics/lineheight}};\n\tcolor: <<colour foreground>>;\n\tbackground-color: <<colour page-background>>;\n\tword-wrap: break-word;\n}\n\nh1, h2, h3, h4, h5, h6 {\n\tline-height: 1.2;\n\tfont-weight: 300;\n}\n\npre {\n\tdisplay: block;\n\tpadding: 14px;\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n\tword-break: normal;\n\tword-wrap: break-word;\n\twhite-space: pre;\n\twhite-space: pre-wrap;\n\tbackground-color: <<colour pre-background>>;\n\tborder: 1px solid <<colour pre-border>>;\n\tpadding: 0 3px 2px;\n\tborder-radius: 3px;\n}\n\ncode {\n\tcolor: <<colour code-foreground>>;\n\tbackground-color: <<colour code-background>>;\n\tborder: 1px solid <<colour code-border>>;\n white-space: pre-wrap;\n\tpadding: 0 3px 2px;\n\tborder-radius: 3px;\n}\n\nblockquote {\n\tborder-left: 5px solid <<colour blockquote-bar>>;\n\tmargin-left: 25px;\n\tpadding-left: 10px;\n}\n\ndl dt {\n\tfont-weight: bold;\n\tmargin-top: 6px;\n}\n\n.tc-muted {\n\tcolor: <<colour muted-foreground>>;\n}\n\n/*\nMarkdown likes putting code elements inside pre elements\n*/\npre > code {\n\tpadding: 0;\n\tborder: none;\n\tbackground-color: inherit;\n\tcolor: inherit;\n}\n\ntable {\n\tborder: 1px solid <<colour table-border>>;\n\twidth: auto;\n\tmax-width: 100%;\n\tcaption-side: bottom;\n\tmargin-top: 1em;\n\tmargin-bottom: 1em;\n}\n\ntable th, table td {\n\tpadding: 0 7px 0 7px;\n\tborder-top: 1px solid <<colour table-border>>;\n\tborder-left: 1px solid <<colour table-border>>;\n}\n\ntable thead tr td, table th {\n\tbackground-color: <<colour table-header-background>>;\n\tfont-weight: bold;\n}\n\ntable tfoot tr td {\n\tbackground-color: <<colour table-footer-background>>;\n}\n\n.tc-csv-table {\n\twhite-space: nowrap;\n}\n\n.tc-tiddler-frame img,\n.tc-tiddler-frame svg,\n.tc-tiddler-frame canvas,\n.tc-tiddler-frame embed,\n.tc-tiddler-frame iframe {\n\tmax-width: 100%;\n}\n\n.tc-tiddler-body > embed,\n.tc-tiddler-body > iframe {\n\twidth: 100%;\n\theight: 600px;\n}\n\n/*\n** Links\n*/\n\nbutton.tc-tiddlylink,\na.tc-tiddlylink {\n\ttext-decoration: none;\n\tfont-weight: normal;\n\tcolor: <<colour tiddler-link-foreground>>;\n\t-webkit-user-select: inherit; /* Otherwise the draggable attribute makes links impossible to select */\n}\n\n.tc-sidebar-lists a.tc-tiddlylink {\n\tcolor: <<colour sidebar-tiddler-link-foreground>>;\n}\n\n.tc-sidebar-lists a.tc-tiddlylink:hover {\n\tcolor: <<colour sidebar-tiddler-link-foreground-hover>>;\n}\n\nbutton.tc-tiddlylink:hover,\na.tc-tiddlylink:hover {\n\ttext-decoration: underline;\n}\n\na.tc-tiddlylink-resolves {\n}\n\na.tc-tiddlylink-shadow {\n\tfont-weight: bold;\n}\n\na.tc-tiddlylink-shadow.tc-tiddlylink-resolves {\n\tfont-weight: normal;\n}\n\na.tc-tiddlylink-missing {\n\tfont-style: italic;\n}\n\na.tc-tiddlylink-external {\n\ttext-decoration: underline;\n\tcolor: <<colour external-link-foreground>>;\n\tbackground-color: <<colour external-link-background>>;\n}\n\na.tc-tiddlylink-external:visited {\n\tcolor: <<colour external-link-foreground-visited>>;\n\tbackground-color: <<colour external-link-background-visited>>;\n}\n\na.tc-tiddlylink-external:hover {\n\tcolor: <<colour external-link-foreground-hover>>;\n\tbackground-color: <<colour external-link-background-hover>>;\n}\n\n/*\n** Drag and drop styles\n*/\n\n.tc-tiddler-dragger {\n\tposition: relative;\n\tz-index: -10000;\n}\n\n.tc-tiddler-dragger-inner {\n\tposition: absolute;\n\tdisplay: inline-block;\n\tpadding: 8px 20px;\n\tfont-size: 16.9px;\n\tfont-weight: bold;\n\tline-height: 20px;\n\tcolor: <<colour dragger-foreground>>;\n\ttext-shadow: 0 1px 0 rgba(0, 0, 0, 1);\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n\tbackground-color: <<colour dragger-background>>;\n\tborder-radius: 20px;\n}\n\n.tc-tiddler-dragger-cover {\n\tposition: absolute;\n\tbackground-color: <<colour page-background>>;\n}\n\n.tc-dropzone {\n\tposition: relative;\n}\n\n.tc-dropzone.tc-dragover:before {\n\tz-index: 10000;\n\tdisplay: block;\n\tposition: absolute;\n\tposition: -webkit-sticky;\n\tposition: -moz-sticky;\n\tposition: -o-sticky;\n\tposition: -ms-sticky;\n\tposition: sticky;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbackground: <<colour dropzone-background>>;\n\ttext-align: center;\n\tcontent: \"<<lingo DropMessage>>\";\n}\n\n/*\n** Buttons\n*/\n\nbutton svg, button img {\n\tvertical-align: middle;\n}\n\n.tc-btn-invisible {\n\tpadding: 0;\n\tmargin: 0;\n\tbackground: none;\n\tborder: none;\n}\n\n.tc-btn-icon svg {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-btn-text {\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.tc-btn-big-green {\n\tpadding: 8px;\n\tmargin: 4px 8px 4px 8px;\n\tbackground: <<colour download-background>>;\n\tcolor: <<colour download-foreground>>;\n\tfill: <<colour download-foreground>>;\n\tborder: none;\n\tfont-size: 1.2em;\n\tline-height: 1.4em;\n}\n\n.tc-sidebar-lists input {\n\tcolor: <<colour foreground>>;\n}\n\n.tc-sidebar-lists button {\n\tcolor: <<colour sidebar-button-foreground>>;\n\tfill: <<colour sidebar-button-foreground>>;\n}\n\n.tc-sidebar-lists button.tc-btn-mini {\n\tcolor: <<colour sidebar-muted-foreground>>;\n}\n\n.tc-sidebar-lists button.tc-btn-mini:hover {\n\tcolor: <<colour sidebar-muted-foreground-hover>>;\n}\n\nbutton svg.tc-image-button, button .tc-image-button img {\n\theight: 1em;\n\twidth: 1em;\n}\n\n/*\n** Tags and missing tiddlers\n*/\n\n.tc-tag-list-item {\n\tposition: relative;\n\tdisplay: inline-block;\n\tmargin-right: 7px;\n}\n\n.tc-tags-wrapper {\n\tmargin: 4px 0 14px 0;\n}\n\n.tc-missing-tiddler-label {\n\tfont-style: italic;\n\tfont-weight: normal;\n\tdisplay: inline-block;\n\tfont-size: 11.844px;\n\tline-height: 14px;\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n}\n\nbutton.tc-tag-label, span.tc-tag-label {\n\tdisplay: inline-block;\n\tpadding: 0.16em 0.7em;\n\tfont-size: 0.9em;\n\tfont-weight: 300;\n\tline-height: 1.2em;\n\tcolor: <<colour tag-foreground>>;\n\twhite-space: nowrap;\n\tvertical-align: baseline;\n\tbackground-color: <<colour tag-background>>;\n\tborder-radius: 1em;\n}\n\n.tc-untagged-separator {\n\twidth: 10em;\n\tleft: 0;\n\tmargin-left: 0;\n\tborder: 0;\n\theight: 1px;\n\tbackground: <<colour tab-divider>>;\n}\n\nbutton.tc-untagged-label {\n\tbackground-color: <<colour untagged-background>>;\n}\n\n.tc-tag-label svg, .tc-tag-label img {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour tag-foreground>>;\n}\n\n.tc-tag-manager-table .tc-tag-label {\n\twhite-space: normal;\n}\n\n.tc-tag-manager-tag {\n\twidth: 100%;\n}\n\n/*\n** Page layout\n*/\n\n.tc-topbar {\n\tposition: fixed;\n\tz-index: 1200;\n}\n\n.tc-topbar-left {\n\tleft: 29px;\n\ttop: 5px;\n}\n\n.tc-topbar-right {\n\ttop: 5px;\n\tright: 29px;\n}\n\n.tc-topbar button {\n\tpadding: 8px;\n}\n\n.tc-topbar svg {\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-topbar button:hover svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-sidebar-header {\n\tcolor: <<colour sidebar-foreground>>;\n\tfill: <<colour sidebar-foreground>>;\n}\n\n.tc-sidebar-header .tc-title a.tc-tiddlylink-resolves {\n\tfont-weight: 300;\n}\n\n.tc-sidebar-header .tc-sidebar-lists p {\n\tmargin-top: 3px;\n\tmargin-bottom: 3px;\n}\n\n.tc-sidebar-header .tc-missing-tiddler-label {\n\tcolor: <<colour sidebar-foreground>>;\n}\n\n.tc-advanced-search input {\n\twidth: 60%;\n}\n\n.tc-search a svg {\n\twidth: 1.2em;\n\theight: 1.2em;\n\tvertical-align: middle;\n}\n\n.tc-search-results {\n\tpadding-top: 14px;\n}\n\n.tc-page-controls {\n\tmargin-top: 14px;\n\tfont-size: 1.5em;\n}\n\n.tc-page-controls button {\n\tmargin-right: 0.5em;\n}\n\n.tc-page-controls a.tc-tiddlylink:hover {\n\ttext-decoration: none;\n}\n\n.tc-page-controls img {\n\twidth: 1em;\n}\n\n.tc-page-controls svg,\n.tc-search svg {\n\tfill: <<colour sidebar-controls-foreground>>;\n}\n\n.tc-page-controls button:hover svg, .tc-page-controls a:hover svg,\n.tc-search button:hover svg, .tc-search a:hover svg {\n\tfill: <<colour sidebar-controls-foreground-hover>>;\n}\n\n.tc-menu-list-item {\n\twhite-space: nowrap;\n}\n\n.tc-menu-list-count {\n\tfont-weight: bold;\n}\n\n.tc-menu-list-subitem {\n\tpadding-left: 7px;\n}\n\n.tc-story-river {\n\tposition: relative;\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-sidebar-header {\n\t\tpadding: 14px;\n\t\tmin-height: 32px;\n\t\tmargin-top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t}\n\n\t.tc-story-river {\n\t\tposition: relative;\n\t\tpadding: 0;\n\t}\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\n\t.tc-message-box {\n\t\tmargin: 21px -21px 21px -21px;\n\t}\n\n\t.tc-sidebar-scrollable {\n\t\tposition: fixed;\n\t\ttop: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t\tleft: {{$:/themes/tiddlywiki/vanilla/metrics/storyright}};\n\t\tbottom: 0;\n\t\tright: 0;\n\t\toverflow-y: auto;\n\t\toverflow-x: auto;\n\t\t-webkit-overflow-scrolling: touch;\n\t\tmargin: 0 0 0 -42px;\n\t\tpadding: 71px 0 28px 42px;\n\t}\n\n\t.tc-story-river {\n\t\tposition: relative;\n\t\tleft: {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}};\n\t\ttop: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};\n\t\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}};\n\t\tpadding: 42px 42px 42px 42px;\n\t}\n\n<<if-no-sidebar \"\n\n\t.tc-story-river {\n\t\twidth: auto;\n\t}\n\n\">>\n\n}\n\n@media print {\n\n\tbody.tc-body {\n\t\tbackground-color: transparent;\n\t}\n\n\t.tc-sidebar-header, .tc-topbar {\n\t\tdisplay: none;\n\t}\n\n\t.tc-story-river {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\t.tc-story-river .tc-tiddler-frame {\n\t\tmargin: 0;\n\t\tborder: none;\n\t\tpadding: 28px;\n\t}\n}\n\n/*\n** Tiddler styles\n*/\n\n.tc-tiddler-frame {\n\tmargin-bottom: 28px;\n\tbackground-color: <<colour tiddler-background>>;\n\tborder: 1px solid <<colour tiddler-border>>;\n}\n\n.tc-tiddler-info {\n\tpadding: 14px 42px 14px 42px;\n\tbackground-color: <<colour tiddler-info-background>>;\n\tborder-top: 1px solid <<colour tiddler-info-border>>;\n\tborder-bottom: 1px solid <<colour tiddler-info-border>>;\n}\n\n.tc-tiddler-info p {\n\tmargin-top: 3px;\n\tmargin-bottom: 3px;\n}\n\n.tc-tiddler-info .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour tiddler-info-tab-background>>;\n\tborder-bottom: 1px solid <<colour tiddler-info-tab-background>>;\n}\n\n.tc-view-field-table {\n\twidth: 100%;\n}\n\n.tc-view-field-name {\n\twidth: 1%; /* Makes this column be as narrow as possible */\n\ttext-align: right;\n\tfont-style: italic;\n\tfont-weight: 200;\n}\n\n.tc-view-field-value {\n}\n\n@media (max-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\tpadding: 14px 14px 14px 14px;\n\t}\n\n\t.tc-tiddler-info {\n\t\tmargin: 0 -14px 0 -14px;\n\t}\n}\n\n@media (min-width: {{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}}) {\n\t.tc-tiddler-frame {\n\t\tpadding: 28px 42px 42px 42px;\n\t\twidth: {{$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth}};\n\t\tborder-radius: 2px;\n\t}\n\n<<if-no-sidebar \"\n\n\t.tc-tiddler-frame {\n\t\twidth: 100%;\n\t}\n\n\">>\n\n\t.tc-tiddler-info {\n\t\tmargin: 0 -42px 0 -42px;\n\t}\n}\n\n.tc-site-title,\n.tc-titlebar {\n\tfont-weight: 300;\n\tfont-size: 2.35em;\n\tline-height: 1.2em;\n\tcolor: <<colour tiddler-title-foreground>>;\n\tmargin: 0;\n}\n\n.tc-tiddler-title-icon {\n\tvertical-align: middle;\n}\n\n.tc-system-title-prefix {\n\tcolor: <<colour muted-foreground>>;\n}\n\n.tc-titlebar h2 {\n\tfont-size: 1em;\n\tdisplay: inline;\n}\n\n.tc-titlebar img {\n\theight: 1em;\n}\n\n.tc-subtitle {\n\tfont-size: 0.9em;\n\tcolor: <<colour tiddler-subtitle-foreground>>;\n\tfont-weight: 300;\n}\n\n.tc-tiddler-missing .tc-title {\n font-style: italic;\n font-weight: normal;\n}\n\n.tc-tiddler-frame .tc-tiddler-controls {\n\tfloat: right;\n}\n\n.tc-tiddler-controls .tc-drop-down {\n\tfont-size: 0.6em;\n}\n\n.tc-tiddler-controls .tc-drop-down .tc-drop-down {\n\tfont-size: 1em;\n}\n\n.tc-tiddler-controls > span > button {\n\tvertical-align: baseline;\n\tmargin-left:5px;\n}\n\n.tc-tiddler-controls button svg, .tc-tiddler-controls button img {\n\theight: 0.75em;\n\tfill: <<colour tiddler-controls-foreground>>;\n}\n\n.tc-tiddler-controls button.tc-selected svg {\n\tfill: <<colour tiddler-controls-foreground-selected>>;\n}\n\n.tc-tiddler-controls button.tc-btn-invisible:hover svg {\n\tfill: <<colour tiddler-controls-foreground-hover>>;\n}\n\n@media print {\n\t.tc-tiddler-controls {\n\t\tdisplay: none;\n\t}\n}\n\n.tc-tiddler-help { /* Help prompts within tiddler template */\n\tcolor: <<colour muted-foreground>>;\n\tmargin-top: 14px;\n}\n\n.tc-tiddler-help a.tc-tiddlylink {\n\tcolor: <<colour very-muted-foreground>>;\n}\n\n.tc-tiddler-frame input.tc-edit-texteditor, .tc-tiddler-frame textarea.tc-edit-texteditor {\n\twidth: 100%;\n\tpadding: 3px 3px 3px 3px;\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tline-height: 1.3em;\n\t-webkit-appearance: none;\n\tmargin: 4px 0 4px 0;\n}\n\n.tc-tiddler-frame .tc-binary-warning {\n\twidth: 100%;\n\theight: 5em;\n\ttext-align: center;\n\tpadding: 3em 3em 6em 3em;\n\tbackground: <<colour alert-background>>;\n\tborder: 1px solid <<colour alert-border>>;\n}\n\n.tc-tiddler-frame input.tc-edit-texteditor {\n\tbackground-color: <<colour tiddler-editor-background>>;\n}\n\ncanvas.tc-edit-bitmapeditor {\n\tborder: 6px solid <<colour tiddler-editor-border-image>>;\n\tcursor: crosshair;\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tmargin-top: 6px;\n\tmargin-bottom: 6px;\n}\n\n.tc-edit-bitmapeditor-width {\n\tdisplay: block;\n}\n\n.tc-edit-bitmapeditor-height {\n\tdisplay: block;\n}\n\n.tc-tiddler-frame .tc-tiddler-body {\n\tfont-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}};\n\tline-height: {{$:/themes/tiddlywiki/vanilla/metrics/bodylineheight}};\n}\n\n.tc-titlebar, .tc-tiddler-edit-title {\n\toverflow: hidden; /* https://github.com/Jermolene/TiddlyWiki5/issues/282 */\n}\n\n/*\n** Toolbar buttons\n*/\n\n.tc-page-controls svg.tc-image-new-button {\n fill: <<colour toolbar-new-button>>;\n}\n\n.tc-page-controls svg.tc-image-options-button {\n fill: <<colour toolbar-options-button>>;\n}\n\n.tc-page-controls svg.tc-image-save-button {\n fill: <<colour toolbar-save-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-info-button {\n fill: <<colour toolbar-info-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-edit-button {\n fill: <<colour toolbar-edit-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-close-button {\n fill: <<colour toolbar-close-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-delete-button {\n fill: <<colour toolbar-delete-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-cancel-button {\n fill: <<colour toolbar-cancel-button>>;\n}\n\n.tc-tiddler-controls button svg.tc-image-done-button {\n fill: <<colour toolbar-done-button>>;\n}\n\n/*\n** Tiddler edit mode\n*/\n\n.tc-tiddler-edit-frame em.tc-edit {\n\tcolor: <<colour muted-foreground>>;\n\tfont-style: normal;\n}\n\n.tc-edit-type-dropdown a.tc-tiddlylink-missing {\n\tfont-style: normal;\n}\n\n.tc-edit-tags {\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tpadding: 4px 8px 4px 8px;\n}\n\n.tc-edit-add-tag {\n\tdisplay: inline-block;\n}\n\n.tc-edit-add-tag .tc-add-tag-name input {\n\twidth: 50%;\n}\n\n.tc-edit-tags .tc-tag-label {\n\tdisplay: inline-block;\n}\n\n.tc-edit-tags-list {\n\tmargin: 14px 0 14px 0;\n}\n\n.tc-remove-tag-button {\n\tpadding-left: 4px;\n}\n\n.tc-tiddler-preview {\n\toverflow: auto;\n}\n\n.tc-tiddler-preview-preview {\n\tfloat: right;\n\twidth: 48%;\n\tborder: 1px solid <<colour tiddler-editor-border>>;\n\tmargin: 4px 3px 3px 3px;\n\tpadding: 3px 3px 3px 3px;\n}\n\n.tc-tiddler-preview-edit {\n\twidth: 48%;\n}\n\n.tc-edit-fields {\n\twidth: 100%;\n}\n\n\n.tc-edit-fields table, .tc-edit-fields tr, .tc-edit-fields td {\n\tborder: none;\n\tpadding: 4px;\n}\n\n.tc-edit-fields > tbody > .tc-edit-field:nth-child(odd) {\n\tbackground-color: <<colour tiddler-editor-fields-odd>>;\n}\n\n.tc-edit-fields > tbody > .tc-edit-field:nth-child(even) {\n\tbackground-color: <<colour tiddler-editor-fields-even>>;\n}\n\n.tc-edit-field-name {\n\ttext-align: right;\n}\n\n.tc-edit-field-value input {\n\twidth: 100%;\n}\n\n.tc-edit-field-remove {\n}\n\n.tc-edit-field-remove svg {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n\tvertical-align: middle;\n}\n\n.tc-edit-field-add-name {\n\tdisplay: inline-block;\n\twidth: 15%;\n}\n\n.tc-edit-field-add-value {\n\tdisplay: inline-block;\n\twidth: 40%;\n}\n\n.tc-edit-field-add-button {\n\tdisplay: inline-block;\n\twidth: 10%;\n}\n\n/*\n** Storyview Classes\n*/\n\n.tc-storyview-zoomin-tiddler {\n\tposition: absolute;\n\tdisplay: block;\n\twidth: 100%;\n\twidth: calc(100% - 84px);\n}\n\n/*\n** Dropdowns\n*/\n\n.tc-btn-dropdown {\n\ttext-align: left;\n}\n\n.tc-btn-dropdown svg, .tc-btn-dropdown img {\n\theight: 1em;\n\twidth: 1em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-drop-down-wrapper {\n\tposition: relative;\n}\n\n.tc-drop-down {\n\tmin-width: 380px;\n\tborder: 1px solid <<colour dropdown-border>>;\n\tbackground-color: <<colour dropdown-background>>;\n\tpadding: 7px 0 7px 0;\n\tmargin: 4px 0 0 0;\n\twhite-space: nowrap;\n\ttext-shadow: none;\n\tline-height: 1.4;\n}\n\n.tc-drop-down .tc-drop-down {\n\tmargin-left: 14px;\n}\n\n.tc-drop-down button svg, .tc-drop-down a svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-drop-down button.tc-btn-invisible:hover svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-drop-down p {\n\tpadding: 0 14px 0 14px;\n}\n\n.tc-drop-down svg {\n\twidth: 1em;\n\theight: 1em;\n}\n\n.tc-drop-down img {\n\twidth: 1em;\n}\n\n.tc-drop-down-language-chooser img {\n\twidth: 2em;\n\tvertical-align: baseline;\n}\n\n.tc-drop-down a, .tc-drop-down button {\n\tdisplay: block;\n\tpadding: 0 14px 0 14px;\n\twidth: 100%;\n\ttext-align: left;\n\tcolor: <<colour foreground>>;\n\tline-height: 1.4;\n}\n\n.tc-drop-down .tc-file-input-wrapper {\n\twidth: 100%;\n}\n\n.tc-drop-down .tc-file-input-wrapper button {\n\tcolor: <<colour foreground>>;\n}\n\n.tc-drop-down a:hover, .tc-drop-down button:hover, .tc-drop-down .tc-file-input-wrapper:hover button {\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n\ttext-decoration: none;\n}\n\n.tc-drop-down .tc-tab-buttons button {\n\tbackground-color: <<colour dropdown-tab-background>>;\n}\n\n.tc-drop-down .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour dropdown-tab-background-selected>>;\n\tborder-bottom: 1px solid <<colour dropdown-tab-background-selected>>;\n}\n\n.tc-drop-down-bullet {\n\tdisplay: inline-block;\n\twidth: 0.5em;\n}\n\n.tc-drop-down .tc-tab-contents a {\n\tpadding: 0 0.5em 0 0.5em;\n}\n\n.tc-block-dropdown-wrapper {\n\tposition: relative;\n}\n\n.tc-block-dropdown {\n\tposition: absolute;\n\tmin-width: 220px;\n\tborder: 1px solid <<colour dropdown-border>>;\n\tbackground-color: <<colour dropdown-background>>;\n\tpadding: 7px 0;\n\tmargin: 4px 0 0 0;\n\twhite-space: nowrap;\n\tz-index: 1000;\n}\n\n.tc-block-dropdown a {\n\tdisplay: block;\n\tpadding: 4px 14px 4px 14px;\n}\n\n.tc-drop-down .tc-dropdown-item,\n.tc-block-dropdown .tc-dropdown-item {\n\tpadding: 4px 14px 4px 7px;\n\tcolor: <<colour muted-foreground>>;\n}\n\n.tc-block-dropdown a:hover {\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n\ttext-decoration: none;\n}\n\n/*\n** Modals\n*/\n\n.tc-modal-wrapper {\n\tposition: fixed;\n\toverflow: auto;\n\toverflow-y: scroll;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n}\n\n.tc-modal-backdrop {\n\tposition: fixed;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tz-index: 1000;\n\tbackground-color: <<colour modal-backdrop>>;\n}\n\n.tc-modal {\n\tz-index: 1100;\n\tbackground-color: <<colour modal-background>>;\n\tborder: 1px solid <<colour modal-border>>;\n}\n\n@media (max-width: 55em) {\n\t.tc-modal {\n\t\tposition: fixed;\n\t\ttop: 1em;\n\t\tleft: 1em;\n\t\tright: 1em;\n\t}\n\n\t.tc-modal-body {\n\t\toverflow-y: auto;\n\t\tmax-height: 400px;\n\t}\n}\n\n@media (min-width: 55em) {\n\t.tc-modal {\n\t\tposition: relative;\n\t\twidth: 50%;\n\t\tmargin: 30px auto;\n\t}\n}\n\n.tc-modal-header {\n\tpadding: 9px 15px;\n\tborder-bottom: 1px solid <<colour modal-header-border>>;\n}\n\n.tc-modal-header h3 {\n\tmargin: 0;\n\tline-height: 30px;\n}\n\n.tc-modal-body {\n\tpadding: 15px;\n}\n\n.tc-modal-footer {\n\tpadding: 14px 15px 15px;\n\tmargin-bottom: 0;\n\ttext-align: right;\n\tbackground-color: <<colour modal-footer-background>>;\n\tborder-top: 1px solid <<colour modal-footer-border>>;\n}\n\n/*\n** Notifications\n*/\n\n.tc-notification {\n\tposition: fixed;\n\ttop: 14px;\n\tright: 42px;\n\tz-index: 1300;\n\tmax-width: 280px;\n\tpadding: 0 14px 0 14px;\n\tbackground-color: <<colour notification-background>>;\n\tborder: 1px solid <<colour notification-border>>;\n}\n\n/*\n** Tabs\n*/\n\n.tc-tab-set.tc-vertical {\n\tdisplay: -webkit-flex;\n\tdisplay: flex;\n}\n\n.tc-tab-buttons {\n\tfont-size: 0.85em;\n\tpadding-top: 1em;\n\tmargin-bottom: -2px;\n}\n\n.tc-tab-buttons.tc-vertical {\n\tz-index: 100;\n\tdisplay: block;\n\tpadding-top: 14px;\n\tvertical-align: top;\n\ttext-align: right;\n\tmargin-bottom: inherit;\n\tmargin-right: -1px;\n\tmax-width: 33%;\n\t-webkit-flex: 0 0 auto;\n\tflex: 0 0 auto;\n}\n\n.tc-tab-buttons button.tc-tab-selected {\n\tcolor: <<colour tab-foreground-selected>>;\n\tbackground-color: <<colour tab-background-selected>>;\n\tborder-left: 1px solid <<colour tab-border-selected>>;\n\tborder-top: 1px solid <<colour tab-border-selected>>;\n\tborder-right: 1px solid <<colour tab-border-selected>>;\n}\n\n.tc-tab-buttons button {\n\tcolor: <<colour tab-foreground>>;\n\tpadding: 3px 5px 3px 5px;\n\tfont-weight: 300;\n\tborder: none;\n\tbackground: inherit;\n\tbackground-color: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-right: 1px solid <<colour tab-border>>;\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tc-tab-buttons.tc-vertical button {\n\tdisplay: block;\n\twidth: 100%;\n\tmargin-top: 3px;\n\ttext-align: right;\n\tbackground-color: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tborder-right: none;\n\tborder-top-left-radius: 2px;\n\tborder-bottom-left-radius: 2px;\n}\n\n.tc-tab-buttons.tc-vertical button.tc-tab-selected {\n\tbackground-color: <<colour tab-background-selected>>;\n\tborder-right: 1px solid <<colour tab-background-selected>>;\n}\n\n.tc-tab-divider {\n\tborder-top: 1px solid <<colour tab-divider>>;\n}\n\n.tc-tab-divider.tc-vertical {\n\tdisplay: none;\n}\n\n.tc-tab-content {\n\tmargin-top: 14px;\n}\n\n.tc-tab-content.tc-vertical {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tpadding-top: 0;\n\tpadding-left: 14px;\n\tborder-left: 1px solid <<colour tab-border>>;\n\t-webkit-flex: 1 0 70%;\n\tflex: 1 0 70%;\n}\n\n.tc-sidebar-lists .tc-tab-buttons {\n\tmargin-bottom: -1px;\n}\n\n.tc-sidebar-lists .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour sidebar-tab-background-selected>>;\n\tcolor: <<colour sidebar-tab-foreground-selected>>;\n\tborder-left: 1px solid <<colour sidebar-tab-border-selected>>;\n\tborder-top: 1px solid <<colour sidebar-tab-border-selected>>;\n\tborder-right: 1px solid <<colour sidebar-tab-border-selected>>;\n}\n\n.tc-sidebar-lists .tc-tab-buttons button {\n\tbackground-color: <<colour sidebar-tab-background>>;\n\tcolor: <<colour sidebar-tab-foreground>>;\n\tborder-left: 1px solid <<colour sidebar-tab-border>>;\n\tborder-top: 1px solid <<colour sidebar-tab-border>>;\n\tborder-right: 1px solid <<colour sidebar-tab-border>>;\n}\n\n.tc-sidebar-lists .tc-tab-divider {\n\tborder-top: 1px solid <<colour sidebar-tab-divider>>;\n}\n\n.tc-more-sidebar .tc-tab-buttons button {\n\tbackground-color: <<colour sidebar-tab-background>>;\n\tborder-top: none;\n\tborder-left: none;\n\tborder-bottom: none;\n\tborder-right: 1px solid #ccc;\n\tmargin-bottom: inherit;\n}\n\n.tc-more-sidebar .tc-tab-buttons button.tc-tab-selected {\n\tbackground-color: <<colour sidebar-tab-background-selected>>;\n\tborder: none;\n}\n\n/*\n** Alerts\n*/\n\n.tc-alerts {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tmax-width: 500px;\n\tz-index: 20000;\n}\n\n.tc-alert {\n\tposition: relative;\n\tmargin: 28px;\n\tpadding: 14px 14px 14px 14px;\n\tborder: 2px solid <<colour alert-border>>;\n\tbackground-color: <<colour alert-background>>;\n}\n\n.tc-alert-toolbar {\n\tposition: absolute;\n\ttop: 14px;\n\tright: 14px;\n}\n\n.tc-alert-toolbar svg {\n\tfill: <<colour alert-muted-foreground>>;\n}\n\n.tc-alert-subtitle {\n\tcolor: <<colour alert-muted-foreground>>;\n\tfont-weight: bold;\n}\n\n.tc-alert-highlight {\n\tcolor: <<colour alert-highlight>>;\t\n}\n\n.tc-static-alert {\n\tposition: relative;\n}\n\n.tc-static-alert-inner {\n\tpadding: 0 2px 2px 42px;\n\tcolor: <<colour static-alert-foreground>>;\n\tposition: absolute;\n}\n\n/*\n** Control panel\n*/\n\n.tc-control-panel td {\n\tpadding: 4px;\n}\n\n.tc-control-panel table, .tc-control-panel table input, .tc-control-panel table textarea {\n\twidth: 100%;\n}\n\n.tc-plugin-info {\n\tdisplay: block;\n\tborder: 1px solid <<colour muted-foreground>>;\n\tbackground-colour: <<colour background>>;\n\tmargin: 1em 0 1em 0;\n\tpadding: 8px;\n}\n\n.tc-plugin-info-disabled {\n\tbackground: -webkit-repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);\n\tbackground: repeating-linear-gradient(45deg, #ff0, #ff0 10px, #eee 10px, #eee 20px);\n}\n\n.tc-plugin-info-disabled:hover {\n\tbackground: -webkit-repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px);\n\tbackground: repeating-linear-gradient(45deg, #aa0, #aa0 10px, #888 10px, #888 20px);\n}\n\na.tc-tiddlylink.tc-plugin-info:hover {\n\ttext-decoration: none;\n\tbackground-color: <<colour primary>>;\n\tcolor: <<colour background>>;\n\tfill: <<colour foreground>>;\n}\n\na.tc-tiddlylink.tc-plugin-info:hover svg {\n\tfill: <<colour foreground>>;\n}\n\n.tc-plugin-info-chunk {\n\tdisplay: inline-block;\n\tvertical-align: middle;\t\n}\n\na.tc-plugin-info img, a.tc-plugin-info svg {\n\twidth: 2em;\n\theight: 2em;\n\tfill: <<colour muted-foreground>>;\n}\n\n.tc-plugin-info-dropdown {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tpadding: 1em 1em 1em 1em;\n\tmargin-top: -1em;\n}\n\n/*\n** Message boxes\n*/\n\n.tc-message-box {\n\tborder: 1px solid <<colour message-border>>;\n\tbackground: <<colour message-background>>;\n\tpadding: 0px 21px 0px 21px;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tcolor: <<colour message-foreground>>;\n}\n\n/*\n** Pictures\n*/\n\n.tc-bordered-image {\n\tborder: 1px solid <<colour muted-foreground>>;\n\tpadding: 5px;\n\tmargin: 5px;\n}\n\n/*\n** Floats\n*/\n\n.tc-float-right {\n\tfloat: right;\n}\n\n/*\n** Chooser\n*/\n\n.tc-chooser {\n\tborder: 1px solid <<colour table-border>>;\n}\n\n.tc-chooser-item {\n\tborder: 8px;\n}\n\n.tc-chooser-item a.tc-tiddlylink {\n\tdisplay: block;\n\ttext-decoration: none;\n\tcolor: <<colour tiddler-link-foreground>>;\n\tbackground-color: <<colour tiddler-link-background>>;\n\tmargin: 4px;\n}\n\n.tc-chooser-item a.tc-tiddlylink:hover {\n\ttext-decoration: none;\n\tcolor: <<colour tiddler-link-background>>;\n\tbackground-color: <<colour tiddler-link-foreground>>;\n}\n\n/*\n** Palette swatches\n*/\n\n.tc-swatches-horiz {\n}\n\n.tc-swatches-horiz .tc-swatch {\n\tdisplay: inline-block;\n}\n\n.tc-swatch {\n\twidth: 2em;\n\theight: 2em;\n\tmargin: 4px;\n\tborder: 1px solid #000;\n}\n\n/*\n** Table of contents\n*/\n\n.tc-sidebar-lists .tc-table-of-contents {\n\twhite-space: nowrap;\n}\n\n.tc-table-of-contents button {\n\tcolor: <<colour sidebar-foreground>>;\n}\n\n.tc-table-of-contents svg {\n\twidth: 0.7em;\n\theight: 0.7em;\n\tvertical-align: middle;\n\tfill: <<colour sidebar-foreground>>;\n}\n\n.tc-table-of-contents ol {\n\tlist-style-type: none;\n\tpadding-left: 0;\n}\n\n.tc-table-of-contents ol ol {\n\tpadding-left: 1em;\n}\n\n.tc-table-of-contents li {\n\tfont-size: 1.0em;\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li a {\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li li {\n\tfont-size: 0.95em;\n\tfont-weight: normal;\n\tline-height: 1.4;\n}\n\n.tc-table-of-contents li li a {\n\tfont-weight: normal;\n}\n\n.tc-table-of-contents li li li {\n\tfont-size: 0.95em;\n\tfont-weight: 200;\n\tline-height: 1.5;\n}\n\n.tc-table-of-contents li li li a {\n\tfont-weight: bold;\n}\n\n.tc-table-of-contents li li li li {\n\tfont-size: 0.95em;\n\tfont-weight: 200;\n}\n\n.tc-tabbed-table-of-contents {\n\tdisplay: -webkit-flex;\n\tdisplay: flex;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents {\n\tz-index: 100;\n\tdisplay: inline-block;\n\tpadding-left: 1em;\n\tmax-width: 50%;\n\t-webkit-flex: 0 0 auto;\n\tflex: 0 0 auto;\n\tbackground: <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a,\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a {\n\tdisplay: block;\n\tpadding: 0.12em 1em 0.12em 0.25em;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a {\n\tborder-top: 1px solid <<colour tab-background>>;\n\tborder-left: 1px solid <<colour tab-background>>;\n\tborder-bottom: 1px solid <<colour tab-background>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item > a:hover {\n\ttext-decoration: none;\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tbackground: <<colour tab-border>>;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a {\n\tborder-top: 1px solid <<colour tab-border>>;\n\tborder-left: 1px solid <<colour tab-border>>;\n\tborder-bottom: 1px solid <<colour tab-border>>;\n\tbackground: <<colour background>>;\n\tmargin-right: -1px;\n}\n\n.tc-tabbed-table-of-contents .tc-table-of-contents .toc-item-selected > a:hover {\n\ttext-decoration: none;\n}\n\n.tc-tabbed-table-of-contents .tc-tabbed-table-of-contents-content {\n\tdisplay: inline-block;\n\tvertical-align: top;\n\tpadding-left: 1.5em;\n\tpadding-right: 1.5em;\n\tborder: 1px solid <<colour tab-border>>;\n\t-webkit-flex: 1 0 50%;\n\tflex: 1 0 50%;\n}\n\n/*\n** Dirty indicator\n*/\n\nbody.tc-dirty span.tc-dirty-indicator, body.tc-dirty span.tc-dirty-indicator svg {\n\tfill: <<colour dirty-indicator>>;\n\tcolor: <<colour dirty-indicator>>;\n}\n\n/*\n** File inputs\n*/\n\n.tc-file-input-wrapper {\n\tposition: relative;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n\n.tc-file-input-wrapper input[type=file] {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tfont-size: 999px;\n\tmax-width: 100%;\n\tmax-height: 100%;\n\tfilter: alpha(opacity=0);\n\topacity: 0;\n\toutline: none;\n\tbackground: white;\n\tcursor: pointer;\n\tdisplay: inline-block;\n}\n\n/*\n** Errors\n*/\n\n.tc-error {\n\tbackground: #f00;\n\tcolor: #fff;\n}\n"
},
"$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize",
"text": "15px"
},
"$:/themes/tiddlywiki/vanilla/metrics/bodylineheight": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/bodylineheight",
"text": "22px"
},
"$:/themes/tiddlywiki/vanilla/metrics/fontsize": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/fontsize",
"text": "14px"
},
"$:/themes/tiddlywiki/vanilla/metrics/lineheight": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/lineheight",
"text": "20px"
},
"$:/themes/tiddlywiki/vanilla/metrics/storyleft": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/storyleft",
"text": "0px"
},
"$:/themes/tiddlywiki/vanilla/metrics/storytop": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/storytop",
"text": "0px"
},
"$:/themes/tiddlywiki/vanilla/metrics/storyright": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/storyright",
"text": "770px"
},
"$:/themes/tiddlywiki/vanilla/metrics/storywidth": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/storywidth",
"text": "770px"
},
"$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth",
"text": "686px"
},
"$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint": {
"title": "$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint",
"text": "960px"
},
"$:/themes/tiddlywiki/vanilla/reset": {
"title": "$:/themes/tiddlywiki/vanilla/reset",
"type": "text/plain",
"text": "/*! normalize.css v3.0.0 | MIT License | git.io/normalize */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n * user zoom.\n */\n\nhtml {\n font-family: sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n margin: 0;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Correct `block` display not defined in IE 8/9.\n */\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9.\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n\n[hidden],\ntemplate {\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n background: transparent;\n}\n\n/**\n * Improve readability when focused and also mouse hovered in all browsers.\n */\n\na:active,\na:hover {\n outline: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9, Safari 5, and Chrome.\n */\n\nabbr[title] {\n border-bottom: 1px dotted;\n}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\n\nb,\nstrong {\n font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\n\ndfn {\n font-style: italic;\n}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari 5, and Chrome.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n\nmark {\n background: #ff0;\n color: #000;\n}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9.\n */\n\nimg {\n border: 0;\n}\n\n/**\n * Correct overflow displayed oddly in IE 9.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari 5.\n */\n\nfigure {\n margin: 1em 40px;\n}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n * Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit; /* 1 */\n font: inherit; /* 2 */\n margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10.\n */\n\nbutton {\n overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8+, and Opera\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n * and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n * (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box; /* 2 */\n box-sizing: content-box;\n}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n border: 0; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n\noptgroup {\n font-weight: bold;\n}\n\n/* Tables\n ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n"
},
"$:/themes/tiddlywiki/vanilla/settings/fontfamily": {
"title": "$:/themes/tiddlywiki/vanilla/settings/fontfamily",
"text": "\"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", sans-serif"
}
}
}
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:t:I:f:1
cell:B1:t:l
cell:C1:t: :f:1
cell:D1:t:p
cell:E1:t:l:f:1
cell:F1:t:e
cell:G1:t:u
cell:H1:t:t
cell:I1:t:
cell:J1:t:d
cell:K1:t:e
cell:L1:t:s
cell:M1:t:
cell:N1:t:v
cell:O1:t:o
cell:P1:t:i
cell:Q1:t:x
cell:R1:t:
cell:S1:t:d
cell:T1:t:e
cell:U1:t:
cell:V1:t:f
cell:W1:t:e
cell:X1:t:m
cell:Y1:t:m
cell:Z1:t:e
cell:AA1:t:s
cell:AB1:t:
cell:AC1:t:c
cell:AD1:t:o
cell:AE1:t:m
cell:AF1:t:m
cell:AG1:t:e
cell:AH1:t:
cell:AI1:t:s
cell:AJ1:t:i
cell:AK1:t:
cell:AL1:t:e
cell:AM1:t:l
cell:AN1:t:l
cell:AO1:t:e
cell:AP1:t:s
cell:AQ1:t:
cell:AR1:t:é
cell:AS1:t:t
cell:AT1:t:a
cell:AU1:t:i
cell:AV1:t:e
cell:AW1:t:n
cell:AX1:t:t
cell:AY1:t:
cell:AZ1:t:m
cell:BA1:t:o
cell:BB1:t:r
cell:BC1:t:t
cell:BD1:t:e
cell:BE1:t:s
cell:BF1:t:
cell:BG1:t:m
cell:BH1:t:ê
cell:BI1:t:m
cell:BJ1:t:e
cell:BK1:t:
cell:BL1:t:d
cell:BM1:t:a
cell:BN1:t:n
cell:BO1:t:s
cell:BP1:t:
cell:BQ1:t:l
cell:BR1:t:e
cell:BS1:t:
cell:BT1:t:s
cell:BU1:t:o
cell:BV1:t:u
cell:BW1:t:v
cell:BX1:t:e
cell:BY1:t:n
cell:BZ1:t:i
cell:CA1:t:r
cell:A2:t:c
cell:B2:t:'
cell:C2:t:e
cell:D2:t:s
cell:E2:t:t
cell:F2:t:
cell:G2:t:v
cell:H2:t:o
cell:I2:t:u
cell:J2:t:s
cell:K2:t:
cell:L2:t:a
cell:M2:t:u
cell:N2:t:s
cell:O2:t:s
cell:P2:t:i
cell:Q2:t:
cell:R2:t:q
cell:S2:t:u
cell:T2:t:'
cell:U2:t:i
cell:V2:t:l
cell:W2:t:
cell:X2:t:p
cell:Y2:t:l
cell:Z2:t:e
cell:AA2:t:u
cell:AB2:t:t
cell:AC2:t:
cell:AD2:t:m
cell:AE2:t:e
cell:AF2:t:r
cell:AG2:t:v
cell:AH2:t:e
cell:AI2:t:i
cell:AJ2:t:l
cell:AK2:t:l
cell:AL2:t:e
cell:AM2:t:u
cell:AN2:t:s
cell:AO2:t:e
cell:AP2:t:s
cell:AQ2:t:
cell:AR2:t:r
cell:AS2:t:e
cell:AT2:t:n
cell:AU2:t:c
cell:AV2:t:o
cell:AW2:t:n
cell:AX2:t:t
cell:AY2:t:r
cell:AZ2:t:e
cell:BA2:t:s
cell:BB2:t:
cell:BC2:t:d
cell:BD2:t:e
cell:BE2:t:
cell:BF2:t:m
cell:BG2:t:a
cell:BH2:t:
cell:BI2:t:v
cell:BJ2:t:i
cell:BK2:t:e
cell:BL2:t:
cell:BM2:t:ô
cell:BN2:t:
cell:BO2:t:g
cell:BP2:t:o
cell:BQ2:t:u
cell:BR2:t:t
cell:BS2:t:t
cell:BT2:t:e
cell:BU2:t:l
cell:BV2:t:e
cell:BW2:t:t
cell:BX2:t:t
cell:BY2:t:e
cell:BZ2:t:s
cell:CA2:t:
cell:CB2:t:
cell:A3:t:e
cell:B3:t:t
cell:C3:t:
cell:D3:t:c
cell:E3:t:e
cell:F3:t:s
cell:G3:t:
cell:H3:t:n
cell:I3:t:u
cell:J3:t:a
cell:K3:t:g
cell:L3:t:e
cell:M3:t:s
cell:N3:t:
cell:O3:t:c
cell:P3:t:a
cell:Q3:t:b
cell:R3:t:r
cell:S3:t:é
cell:T3:t:s
cell:U3:t:
cell:V3:t:s
cell:W3:t:e
cell:X3:t:
cell:Y3:t:p
cell:Z3:t:r
cell:AA3:t:e
cell:AB3:t:n
cell:AC3:t:n
cell:AD3:t:e
cell:AE3:t:n
cell:AF3:t:t
cell:AG3:t:
cell:AH3:t:à
cell:AI3:t:
cell:AJ3:t:h
cell:AK3:t:e
cell:AL3:t:n
cell:AM3:t:n
cell:AN3:t:i
cell:AO3:t:r
cell:AP3:t:
cell:AQ3:t:t
cell:AR3:t:o
cell:AS3:t:u
cell:AT3:t:t
cell:AU3:t:
cell:AV3:t:u
cell:AW3:t:n
cell:AX3:t:
cell:AY3:t:u
cell:AZ3:t:n
cell:BA3:t:i
cell:BB3:t:v
cell:BC3:t:e
cell:BD3:t:r
cell:BE3:t:s
cell:BF3:t:
cell:BG3:t:d
cell:BH3:t:e
cell:BI3:t:
cell:BJ3:t:v
cell:BK3:t:i
cell:BL3:t:l
cell:BM3:t:l
cell:BN3:t:e
cell:BO3:t:s
cell:BP3:t:
cell:BQ3:t:a
cell:BR3:t:u
cell:BS3:t:r
cell:BT3:t:i
cell:BU3:t:c
cell:BV3:t:u
cell:BW3:t:l
cell:BX3:t:a
cell:BY3:t:i
cell:BZ3:t:r
cell:CA3:t:e
cell:CB3:t:s
cell:A4:t:é
cell:B4:t:c
cell:C4:t:o
cell:D4:t:u
cell:E4:t:t
cell:F4:t:e
cell:G4:t:
cell:H4:t:s
cell:I4:t:'
cell:J4:t:i
cell:K4:t:l
cell:L4:t:
cell:M4:t:p
cell:N4:t:l
cell:O4:t:e
cell:P4:t:u
cell:Q4:t:t
cell:R4:t:
cell:S4:t:t
cell:T4:t:a
cell:U4:t:n
cell:V4:t:d
cell:W4:t:i
cell:X4:t:s
cell:Y4:t:
cell:Z4:t:q
cell:AA4:t:u
cell:AB4:t:e
cell:AC4:t:
cell:AD4:t:l
cell:AE4:t:e
cell:AF4:t:
cell:AG4:t:r
cell:AH4:t:e
cell:AI4:t:g
cell:AJ4:t:r
cell:AK4:t:e
cell:AL4:t:t
cell:AM4:t:
cell:AN4:t:e
cell:AO4:t:t
cell:AP4:t:
cell:AQ4:t:l
cell:AR4:t:e
cell:AS4:t:
cell:AT4:t:d
cell:AU4:t:é
cell:AV4:t:d
cell:AW4:t:a
cell:AX4:t:i
cell:AY4:t:n
cell:AZ4:t:
cell:BA4:t:p
cell:BB4:t:l
cell:BC4:t:e
cell:BD4:t:u
cell:BE4:t:r
cell:BF4:t:e
cell:BG4:t:n
cell:BH4:t:t
cell:BI4:t:
cell:BJ4:t:u
cell:BK4:t:n
cell:BL4:t:e
cell:BM4:t:
cell:BN4:t:a
cell:BO4:t:n
cell:BP4:t:c
cell:BQ4:t:i
cell:BR4:t:e
cell:BS4:t:n
cell:BT4:t:n
cell:BU4:t:e
cell:BV4:t:
cell:BW4:t:m
cell:BX4:t:u
cell:BY4:t:s
cell:BZ4:t:i
cell:CA4:t:q
cell:CB4:t:u
cell:CC4:t:e
cell:A5:t:é
cell:B5:t:c
cell:C5:t:o
cell:D5:t:u
cell:E5:t:t
cell:F5:t:e
cell:G5:t:
cell:H5:t:t
cell:I5:t:o
cell:J5:t:m
cell:K5:t:b
cell:L5:t:e
cell:M5:t:r
cell:N5:t:
cell:O5:t:l
cell:P5:t:e
cell:Q5:t:s
cell:R5:t:
cell:S5:t:l
cell:T5:t:i
cell:U5:t:e
cell:V5:t:n
cell:W5:t:s
cell:X5:t:
cell:Y5:t:q
cell:Z5:t:u
cell:AA5:t:i
cell:AB5:t:
cell:AC5:t:t
cell:AD5:t:e
cell:AE5:t:
cell:AF5:t:r
cell:AG5:t:e
cell:AH5:t:t
cell:AI5:t:i
cell:AJ5:t:e
cell:AK5:t:n
cell:AL5:t:n
cell:AM5:t:e
cell:AN5:t:n
cell:AO5:t:t
cell:AP5:t:
cell:AQ5:t:e
cell:AR5:t:n
cell:AS5:t:
cell:AT5:t:h
cell:AU5:t:a
cell:AV5:t:u
cell:AW5:t:t
cell:AX5:t:
cell:AY5:t:e
cell:AZ5:t:t
cell:BA5:t:
cell:BB5:t:e
cell:BC5:t:n
cell:BD5:t:
cell:BE5:t:b
cell:BF5:t:a
cell:BG5:t:s
cell:E8:vtf:t:I:a1:f:1
cell:F8:f:1
cell:G8:f:1
cell:H8:f:1
cell:I8:f:1
cell:J8:f:1
cell:K8:f:1
cell:L8:f:1
cell:M8:f:1
cell:N8:f:1
cell:O8:f:1
cell:P8:f:1
cell:Q8:vtf:t:c:a2:f:1
cell:R8:f:1
cell:S8:f:1
cell:T8:f:1
cell:U8:f:1
cell:V8:vtf:t:e:a3:f:1
cell:W8:f:1
cell:X8:f:1
cell:Y8:f:1
cell:Z8:f:1
cell:AA8:vtf:t:é:a4:f:1
cell:AB8:f:1
cell:AC8:f:1
cell:AD8:f:1
cell:AE8:f:1
cell:AF8:vtf:t:é:a5:f:1
cell:AG8:f:1
cell:AH8:f:1
cell:AI8:f:1
cell:AJ8:f:1
cell:AK8:f:1
cell:AL8:f:1
cell:AM8:f:1
cell:AN8:f:1
cell:AO8:f:1
cell:AP8:f:1
cell:AQ8:f:1
cell:AR8:f:1
cell:AS8:f:1
cell:AT8:f:1
cell:AU8:f:1
cell:AV8:f:1
cell:AW8:f:1
cell:AX8:f:1
cell:AY8:f:1
cell:AZ8:f:1
cell:BA8:f:1
cell:BB8:f:1
cell:BC8:f:1
cell:BD8:f:1
cell:BE8:f:1
cell:BF8:f:1
cell:BG8:f:1
cell:BH8:f:1
cell:BI8:f:1
cell:BJ8:f:1
cell:BK8:f:1
cell:BL8:f:1
cell:BM8:f:1
cell:BN8:f:1
cell:BO8:f:1
cell:BP8:f:1
cell:BQ8:f:1
cell:BR8:f:1
cell:BS8:f:1
cell:BT8:f:1
cell:BU8:f:1
cell:BV8:f:1
cell:BW8:f:1
cell:BX8:f:1
cell:BY8:f:1
cell:BZ8:f:1
cell:CA8:f:1
cell:CB8:f:1
cell:CC8:f:1
cell:E9:f:1
cell:F9:vtf:t:l:b1:f:1
cell:G9:f:1
cell:H9:f:1
cell:I9:f:1
cell:J9:f:1
cell:K9:f:1
cell:L9:f:1
cell:M9:f:1
cell:N9:f:1
cell:O9:f:1
cell:P9:f:1
cell:Q9:vtf:t:':b2:f:1
cell:R9:f:1
cell:S9:f:1
cell:T9:f:1
cell:U9:f:1
cell:V9:f:1
cell:W9:vtf:t:t:b3:f:1
cell:X9:f:1
cell:Y9:f:1
cell:Z9:f:1
cell:AA9:f:1
cell:AB9:vtf:t:c:b4:f:1
cell:AC9:f:1
cell:AD9:f:1
cell:AE9:f:1
cell:AF9:vtf:t:c:b5:f:1
cell:AG9:f:1
cell:AH9:f:1
cell:AI9:f:1
cell:AJ9:f:1
cell:AK9:f:1
cell:AL9:f:1
cell:AM9:f:1
cell:AN9:f:1
cell:AO9:f:1
cell:AP9:f:1
cell:AQ9:f:1
cell:AR9:f:1
cell:AS9:f:1
cell:AT9:f:1
cell:AU9:f:1
cell:AV9:f:1
cell:AW9:f:1
cell:AX9:f:1
cell:AY9:f:1
cell:AZ9:f:1
cell:BA9:f:1
cell:BB9:f:1
cell:BC9:f:1
cell:BD9:f:1
cell:BE9:f:1
cell:BF9:f:1
cell:BG9:f:1
cell:BH9:f:1
cell:BI9:f:1
cell:BJ9:f:1
cell:BK9:f:1
cell:BL9:f:1
cell:BM9:f:1
cell:BN9:f:1
cell:BO9:f:1
cell:BP9:f:1
cell:BQ9:f:1
cell:BR9:f:1
cell:BS9:f:1
cell:BT9:f:1
cell:BU9:f:1
cell:BV9:f:1
cell:BW9:f:1
cell:BX9:f:1
cell:BY9:f:1
cell:BZ9:f:1
cell:CA9:f:1
cell:CB9:f:1
cell:CC9:f:1
cell:E10:f:1
cell:F10:f:1
cell:G10:vtf:t: :c1:f:1
cell:H10:f:1
cell:I10:f:1
cell:J10:f:1
cell:K10:f:1
cell:L10:f:1
cell:M10:f:1
cell:N10:f:1
cell:O10:f:1
cell:P10:f:1
cell:Q10:f:1
cell:R10:vtf:t:e:c2:f:1
cell:S10:f:1
cell:T10:f:1
cell:U10:f:1
cell:V10:f:1
cell:W10:f:1
cell:X10:vtf:t: :c3:f:1
cell:Y10:f:1
cell:Z10:f:1
cell:AA10:f:1
cell:AB10:vtf:t:o:c4:f:1
cell:AC10:f:1
cell:AD10:f:1
cell:AE10:f:1
cell:AF10:f:1
cell:AG10:vtf:t:o:c5:f:1
cell:AH10:f:1
cell:AI10:f:1
cell:AJ10:f:1
cell:AK10:f:1
cell:AL10:f:1
cell:AM10:f:1
cell:AN10:f:1
cell:AO10:f:1
cell:AP10:f:1
cell:AQ10:f:1
cell:AR10:f:1
cell:AS10:f:1
cell:AT10:f:1
cell:AU10:f:1
cell:AV10:f:1
cell:AW10:f:1
cell:AX10:f:1
cell:AY10:f:1
cell:AZ10:f:1
cell:BA10:f:1
cell:BB10:f:1
cell:BC10:f:1
cell:BD10:f:1
cell:BE10:f:1
cell:BF10:f:1
cell:BG10:f:1
cell:BH10:f:1
cell:BI10:f:1
cell:BJ10:f:1
cell:BK10:f:1
cell:BL10:f:1
cell:BM10:f:1
cell:BN10:f:1
cell:BO10:f:1
cell:BP10:f:1
cell:BQ10:f:1
cell:BR10:f:1
cell:BS10:f:1
cell:BT10:f:1
cell:BU10:f:1
cell:BV10:f:1
cell:BW10:f:1
cell:BX10:f:1
cell:BY10:f:1
cell:BZ10:f:1
cell:CA10:f:1
cell:CB10:f:1
cell:CC10:f:1
cell:E11:f:1
cell:F11:f:1
cell:G11:vtf:t:p:d1:f:1
cell:H11:f:1
cell:I11:f:1
cell:J11:f:1
cell:K11:f:1
cell:L11:f:1
cell:M11:f:1
cell:N11:f:1
cell:O11:f:1
cell:P11:f:1
cell:Q11:f:1
cell:R11:vtf:t:s:d2:f:1
cell:S11:f:1
cell:T11:f:1
cell:U11:f:1
cell:V11:f:1
cell:W11:f:1
cell:X11:vtf:t:c:d3:f:1
cell:Y11:f:1
cell:Z11:f:1
cell:AA11:f:1
cell:AB11:f:1
cell:AC11:vtf:t:u:d4:f:1
cell:AD11:f:1
cell:AE11:f:1
cell:AF11:f:1
cell:AG11:f:1
cell:AH11:vtf:t:u:d5:f:1
cell:AI11:f:1
cell:AJ11:f:1
cell:AK11:f:1
cell:AL11:f:1
cell:AM11:f:1
cell:AN11:f:1
cell:AO11:f:1
cell:AP11:f:1
cell:AQ11:f:1
cell:AR11:f:1
cell:AS11:f:1
cell:AT11:f:1
cell:AU11:f:1
cell:AV11:f:1
cell:AW11:f:1
cell:AX11:f:1
cell:AY11:f:1
cell:AZ11:f:1
cell:BA11:f:1
cell:BB11:f:1
cell:BC11:f:1
cell:BD11:f:1
cell:BE11:f:1
cell:BF11:f:1
cell:BG11:f:1
cell:BH11:f:1
cell:BI11:f:1
cell:BJ11:f:1
cell:BK11:f:1
cell:BL11:f:1
cell:BM11:f:1
cell:BN11:f:1
cell:BO11:f:1
cell:BP11:f:1
cell:BQ11:f:1
cell:BR11:f:1
cell:BS11:f:1
cell:BT11:f:1
cell:BU11:f:1
cell:BV11:f:1
cell:BW11:f:1
cell:BX11:f:1
cell:BY11:f:1
cell:BZ11:f:1
cell:CA11:f:1
cell:CB11:f:1
cell:CC11:f:1
cell:E12:f:1
cell:F12:f:1
cell:G12:f:1
cell:H12:vtf:t:l:e1:f:1
cell:I12:f:1
cell:J12:f:1
cell:K12:f:1
cell:L12:f:1
cell:M12:f:1
cell:N12:f:1
cell:O12:f:1
cell:P12:f:1
cell:Q12:f:1
cell:R12:f:1
cell:S12:vtf:t:t:e2:f:1
cell:T12:f:1
cell:U12:f:1
cell:V12:f:1
cell:W12:f:1
cell:X12:f:1
cell:Y12:vtf:t:e:e3:f:1
cell:Z12:f:1
cell:AA12:f:1
cell:AB12:f:1
cell:AC12:vtf:t:t:e4:f:1
cell:AD12:f:1
cell:AE12:f:1
cell:AF12:f:1
cell:AG12:f:1
cell:AH12:f:1
cell:AI12:vtf:t:t:e5:f:1
cell:AJ12:f:1
cell:AK12:f:1
cell:AL12:f:1
cell:AM12:f:1
cell:AN12:f:1
cell:AO12:f:1
cell:AP12:f:1
cell:AQ12:f:1
cell:AR12:f:1
cell:AS12:f:1
cell:AT12:f:1
cell:AU12:f:1
cell:AV12:f:1
cell:AW12:f:1
cell:AX12:f:1
cell:AY12:f:1
cell:AZ12:f:1
cell:BA12:f:1
cell:BB12:f:1
cell:BC12:f:1
cell:BD12:f:1
cell:BE12:f:1
cell:BF12:f:1
cell:BG12:f:1
cell:BH12:f:1
cell:BI12:f:1
cell:BJ12:f:1
cell:BK12:f:1
cell:BL12:f:1
cell:BM12:f:1
cell:BN12:f:1
cell:BO12:f:1
cell:BP12:f:1
cell:BQ12:f:1
cell:BR12:f:1
cell:BS12:f:1
cell:BT12:f:1
cell:BU12:f:1
cell:BV12:f:1
cell:BW12:f:1
cell:BX12:f:1
cell:BY12:f:1
cell:BZ12:f:1
cell:CA12:f:1
cell:CB12:f:1
cell:CC12:f:1
cell:E13:f:1
cell:F13:f:1
cell:G13:f:1
cell:H13:f:1
cell:I13:vtf:t:e:f1:f:1
cell:J13:f:1
cell:K13:f:1
cell:L13:f:1
cell:M13:f:1
cell:N13:f:1
cell:O13:f:1
cell:P13:f:1
cell:Q13:f:1
cell:R13:f:1
cell:S13:vtf:t: :f2:f:1
cell:T13:f:1
cell:U13:f:1
cell:V13:f:1
cell:W13:f:1
cell:X13:f:1
cell:Y13:vtf:t:s:f3:f:1
cell:Z13:f:1
cell:AA13:f:1
cell:AB13:f:1
cell:AC13:f:1
cell:AD13:vtf:t:e:f4:f:1
cell:AE13:f:1
cell:AF13:f:1
cell:AG13:f:1
cell:AH13:f:1
cell:AI13:vtf:t:e:f5:f:1
cell:AJ13:f:1
cell:AK13:f:1
cell:AL13:f:1
cell:AM13:f:1
cell:AN13:f:1
cell:AO13:f:1
cell:AP13:f:1
cell:AQ13:f:1
cell:AR13:f:1
cell:AS13:f:1
cell:AT13:f:1
cell:AU13:f:1
cell:AV13:f:1
cell:AW13:f:1
cell:AX13:f:1
cell:AY13:f:1
cell:AZ13:f:1
cell:BA13:f:1
cell:BB13:f:1
cell:BC13:f:1
cell:BD13:f:1
cell:BE13:f:1
cell:BF13:f:1
cell:BG13:f:1
cell:BH13:f:1
cell:BI13:f:1
cell:BJ13:f:1
cell:BK13:f:1
cell:BL13:f:1
cell:BM13:f:1
cell:BN13:f:1
cell:BO13:f:1
cell:BP13:f:1
cell:BQ13:f:1
cell:BR13:f:1
cell:BS13:f:1
cell:BT13:f:1
cell:BU13:f:1
cell:BV13:f:1
cell:BW13:f:1
cell:BX13:f:1
cell:BY13:f:1
cell:BZ13:f:1
cell:CA13:f:1
cell:CB13:f:1
cell:CC13:f:1
cell:E14:f:1
cell:F14:f:1
cell:G14:f:1
cell:H14:f:1
cell:I14:vtf:t:u:g1:f:1
cell:J14:f:1
cell:K14:f:1
cell:L14:f:1
cell:M14:f:1
cell:N14:f:1
cell:O14:f:1
cell:P14:f:1
cell:Q14:f:1
cell:R14:f:1
cell:S14:f:1
cell:T14:vtf:t:v:g2:f:1
cell:U14:f:1
cell:V14:f:1
cell:W14:f:1
cell:X14:f:1
cell:Y14:f:1
cell:Z14:vtf:t: :g3:f:1
cell:AA14:f:1
cell:AB14:f:1
cell:AC14:f:1
cell:AD14:f:1
cell:AE14:vtf:t: :g4:f:1
cell:AF14:f:1
cell:AG14:f:1
cell:AH14:f:1
cell:AI14:f:1
cell:AJ14:vtf:t: :g5:f:1
cell:AK14:f:1
cell:AL14:f:1
cell:AM14:f:1
cell:AN14:f:1
cell:AO14:f:1
cell:AP14:f:1
cell:AQ14:f:1
cell:AR14:f:1
cell:AS14:f:1
cell:AT14:f:1
cell:AU14:f:1
cell:AV14:f:1
cell:AW14:f:1
cell:AX14:f:1
cell:AY14:f:1
cell:AZ14:f:1
cell:BA14:f:1
cell:BB14:f:1
cell:BC14:f:1
cell:BD14:f:1
cell:BE14:f:1
cell:BF14:f:1
cell:BG14:f:1
cell:BH14:f:1
cell:BI14:f:1
cell:BJ14:f:1
cell:BK14:f:1
cell:BL14:f:1
cell:BM14:f:1
cell:BN14:f:1
cell:BO14:f:1
cell:BP14:f:1
cell:BQ14:f:1
cell:BR14:f:1
cell:BS14:f:1
cell:BT14:f:1
cell:BU14:f:1
cell:BV14:f:1
cell:BW14:f:1
cell:BX14:f:1
cell:BY14:f:1
cell:BZ14:f:1
cell:CA14:f:1
cell:CB14:f:1
cell:CC14:f:1
cell:E15:f:1
cell:F15:f:1
cell:G15:f:1
cell:H15:f:1
cell:I15:f:1
cell:J15:vtf:t:t:h1:f:1
cell:K15:f:1
cell:L15:f:1
cell:M15:f:1
cell:N15:f:1
cell:O15:f:1
cell:P15:f:1
cell:Q15:f:1
cell:R15:f:1
cell:S15:f:1
cell:T15:vtf:t:o:h2:f:1
cell:U15:f:1
cell:V15:f:1
cell:W15:f:1
cell:X15:f:1
cell:Y15:f:1
cell:Z15:vtf:t:n:h3:f:1
cell:AA15:f:1
cell:AB15:f:1
cell:AC15:f:1
cell:AD15:f:1
cell:AE15:vtf:t:s:h4:f:1
cell:AF15:f:1
cell:AG15:f:1
cell:AH15:f:1
cell:AI15:f:1
cell:AJ15:f:1
cell:AK15:vtf:t:t:h5:f:1
cell:AL15:f:1
cell:AM15:f:1
cell:AN15:f:1
cell:AO15:f:1
cell:AP15:f:1
cell:AQ15:f:1
cell:AR15:f:1
cell:AS15:f:1
cell:AT15:f:1
cell:AU15:f:1
cell:AV15:f:1
cell:AW15:f:1
cell:AX15:f:1
cell:AY15:f:1
cell:AZ15:f:1
cell:BA15:f:1
cell:BB15:f:1
cell:BC15:f:1
cell:BD15:f:1
cell:BE15:f:1
cell:BF15:f:1
cell:BG15:f:1
cell:BH15:f:1
cell:BI15:f:1
cell:BJ15:f:1
cell:BK15:f:1
cell:BL15:f:1
cell:BM15:f:1
cell:BN15:f:1
cell:BO15:f:1
cell:BP15:f:1
cell:BQ15:f:1
cell:BR15:f:1
cell:BS15:f:1
cell:BT15:f:1
cell:BU15:f:1
cell:BV15:f:1
cell:BW15:f:1
cell:BX15:f:1
cell:BY15:f:1
cell:BZ15:f:1
cell:CA15:f:1
cell:CB15:f:1
cell:CC15:f:1
cell:E16:f:1
cell:F16:f:1
cell:G16:f:1
cell:H16:f:1
cell:I16:f:1
cell:J16:vtf:t: :i1:f:1
cell:K16:f:1
cell:L16:f:1
cell:M16:f:1
cell:N16:f:1
cell:O16:f:1
cell:P16:f:1
cell:Q16:f:1
cell:R16:f:1
cell:S16:f:1
cell:T16:f:1
cell:U16:vtf:t:u:i2:f:1
cell:V16:f:1
cell:W16:f:1
cell:X16:f:1
cell:Y16:f:1
cell:Z16:vtf:t:u:i3:f:1
cell:AA16:f:1
cell:AB16:f:1
cell:AC16:f:1
cell:AD16:f:1
cell:AE16:f:1
cell:AF16:vtf:t:':i4:f:1
cell:AG16:f:1
cell:AH16:f:1
cell:AI16:f:1
cell:AJ16:f:1
cell:AK16:f:1
cell:AL16:vtf:t:o:i5:f:1
cell:AM16:f:1
cell:AN16:f:1
cell:AO16:f:1
cell:AP16:f:1
cell:AQ16:f:1
cell:AR16:f:1
cell:AS16:f:1
cell:AT16:f:1
cell:AU16:f:1
cell:AV16:f:1
cell:AW16:f:1
cell:AX16:f:1
cell:AY16:f:1
cell:AZ16:f:1
cell:BA16:f:1
cell:BB16:f:1
cell:BC16:f:1
cell:BD16:f:1
cell:BE16:f:1
cell:BF16:f:1
cell:BG16:f:1
cell:BH16:f:1
cell:BI16:f:1
cell:BJ16:f:1
cell:BK16:f:1
cell:BL16:f:1
cell:BM16:f:1
cell:BN16:f:1
cell:BO16:f:1
cell:BP16:f:1
cell:BQ16:f:1
cell:BR16:f:1
cell:BS16:f:1
cell:BT16:f:1
cell:BU16:f:1
cell:BV16:f:1
cell:BW16:f:1
cell:BX16:f:1
cell:BY16:f:1
cell:BZ16:f:1
cell:CA16:f:1
cell:CB16:f:1
cell:CC16:f:1
cell:E17:f:1
cell:F17:f:1
cell:G17:f:1
cell:H17:f:1
cell:I17:f:1
cell:J17:vtf:t:d:j1:f:1
cell:K17:f:1
cell:L17:f:1
cell:M17:f:1
cell:N17:f:1
cell:O17:f:1
cell:P17:f:1
cell:Q17:f:1
cell:R17:f:1
cell:S17:f:1
cell:T17:f:1
cell:U17:vtf:t:s:j2:f:1
cell:V17:f:1
cell:W17:f:1
cell:X17:f:1
cell:Y17:f:1
cell:Z17:f:1
cell:AA17:vtf:t:a:j3:f:1
cell:AB17:f:1
cell:AC17:f:1
cell:AD17:f:1
cell:AE17:f:1
cell:AF17:vtf:t:i:j4:f:1
cell:AG17:f:1
cell:AH17:f:1
cell:AI17:f:1
cell:AJ17:f:1
cell:AK17:f:1
cell:AL17:f:1
cell:AM17:vtf:t:m:j5:f:1
cell:AN17:f:1
cell:AO17:f:1
cell:AP17:f:1
cell:AQ17:f:1
cell:AR17:f:1
cell:AS17:f:1
cell:AT17:f:1
cell:AU17:f:1
cell:AV17:f:1
cell:AW17:f:1
cell:AX17:f:1
cell:AY17:f:1
cell:AZ17:f:1
cell:BA17:f:1
cell:BB17:f:1
cell:BC17:f:1
cell:BD17:f:1
cell:BE17:f:1
cell:BF17:f:1
cell:BG17:f:1
cell:BH17:f:1
cell:BI17:f:1
cell:BJ17:f:1
cell:BK17:f:1
cell:BL17:f:1
cell:BM17:f:1
cell:BN17:f:1
cell:BO17:f:1
cell:BP17:f:1
cell:BQ17:f:1
cell:BR17:f:1
cell:BS17:f:1
cell:BT17:f:1
cell:BU17:f:1
cell:BV17:f:1
cell:BW17:f:1
cell:BX17:f:1
cell:BY17:f:1
cell:BZ17:f:1
cell:CA17:f:1
cell:CB17:f:1
cell:CC17:f:1
cell:E18:f:1
cell:F18:f:1
cell:G18:f:1
cell:H18:f:1
cell:I18:f:1
cell:J18:vtf:t:e:k1:f:1
cell:K18:f:1
cell:L18:f:1
cell:M18:f:1
cell:N18:f:1
cell:O18:f:1
cell:P18:f:1
cell:Q18:f:1
cell:R18:f:1
cell:S18:f:1
cell:T18:f:1
cell:U18:f:1
cell:V18:vtf:t: :k2:f:1
cell:W18:f:1
cell:X18:f:1
cell:Y18:f:1
cell:Z18:f:1
cell:AA18:f:1
cell:AB18:vtf:t:g:k3:f:1
cell:AC18:f:1
cell:AD18:f:1
cell:AE18:f:1
cell:AF18:f:1
cell:AG18:vtf:t:l:k4:f:1
cell:AH18:f:1
cell:AI18:f:1
cell:AJ18:f:1
cell:AK18:f:1
cell:AL18:f:1
cell:AM18:f:1
cell:AN18:vtf:t:b:k5:f:1
cell:AO18:f:1
cell:AP18:f:1
cell:AQ18:f:1
cell:AR18:f:1
cell:AS18:f:1
cell:AT18:f:1
cell:AU18:f:1
cell:AV18:f:1
cell:AW18:f:1
cell:AX18:f:1
cell:AY18:f:1
cell:AZ18:f:1
cell:BA18:f:1
cell:BB18:f:1
cell:BC18:f:1
cell:BD18:f:1
cell:BE18:f:1
cell:BF18:f:1
cell:BG18:f:1
cell:BH18:f:1
cell:BI18:f:1
cell:BJ18:f:1
cell:BK18:f:1
cell:BL18:f:1
cell:BM18:f:1
cell:BN18:f:1
cell:BO18:f:1
cell:BP18:f:1
cell:BQ18:f:1
cell:BR18:f:1
cell:BS18:f:1
cell:BT18:f:1
cell:BU18:f:1
cell:BV18:f:1
cell:BW18:f:1
cell:BX18:f:1
cell:BY18:f:1
cell:BZ18:f:1
cell:CA18:f:1
cell:CB18:f:1
cell:CC18:f:1
cell:E19:f:1
cell:F19:f:1
cell:G19:f:1
cell:H19:f:1
cell:I19:f:1
cell:J19:f:1
cell:K19:vtf:t:s:l1:f:1
cell:L19:f:1
cell:M19:f:1
cell:N19:f:1
cell:O19:f:1
cell:P19:f:1
cell:Q19:f:1
cell:R19:f:1
cell:S19:f:1
cell:T19:f:1
cell:U19:f:1
cell:V19:vtf:t:a:l2:f:1
cell:W19:f:1
cell:X19:f:1
cell:Y19:f:1
cell:Z19:f:1
cell:AA19:f:1
cell:AB19:f:1
cell:AC19:vtf:t:e:l3:f:1
cell:AD19:f:1
cell:AE19:f:1
cell:AF19:f:1
cell:AG19:vtf:t: :l4:f:1
cell:AH19:f:1
cell:AI19:f:1
cell:AJ19:f:1
cell:AK19:f:1
cell:AL19:f:1
cell:AM19:f:1
cell:AN19:vtf:t:e:l5:f:1
cell:AO19:f:1
cell:AP19:f:1
cell:AQ19:f:1
cell:AR19:f:1
cell:AS19:f:1
cell:AT19:f:1
cell:AU19:f:1
cell:AV19:f:1
cell:AW19:f:1
cell:AX19:f:1
cell:AY19:f:1
cell:AZ19:f:1
cell:BA19:f:1
cell:BB19:f:1
cell:BC19:f:1
cell:BD19:f:1
cell:BE19:f:1
cell:BF19:f:1
cell:BG19:f:1
cell:BH19:f:1
cell:BI19:f:1
cell:BJ19:f:1
cell:BK19:f:1
cell:BL19:f:1
cell:BM19:f:1
cell:BN19:f:1
cell:BO19:f:1
cell:BP19:f:1
cell:BQ19:f:1
cell:BR19:f:1
cell:BS19:f:1
cell:BT19:f:1
cell:BU19:f:1
cell:BV19:f:1
cell:BW19:f:1
cell:BX19:f:1
cell:BY19:f:1
cell:BZ19:f:1
cell:CA19:f:1
cell:CB19:f:1
cell:CC19:f:1
cell:E20:f:1
cell:F20:f:1
cell:G20:f:1
cell:H20:f:1
cell:I20:f:1
cell:J20:f:1
cell:K20:vtf:t: :m1:f:1
cell:L20:f:1
cell:M20:f:1
cell:N20:f:1
cell:O20:f:1
cell:P20:f:1
cell:Q20:f:1
cell:R20:f:1
cell:S20:f:1
cell:T20:f:1
cell:U20:f:1
cell:V20:vtf:t:u:m2:f:1
cell:W20:f:1
cell:X20:f:1
cell:Y20:f:1
cell:Z20:f:1
cell:AA20:f:1
cell:AB20:f:1
cell:AC20:vtf:t:s:m3:f:1
cell:AD20:f:1
cell:AE20:f:1
cell:AF20:f:1
cell:AG20:f:1
cell:AH20:vtf:t:p:m4:f:1
cell:AI20:f:1
cell:AJ20:f:1
cell:AK20:f:1
cell:AL20:f:1
cell:AM20:f:1
cell:AN20:f:1
cell:AO20:vtf:t:r:m5:f:1
cell:AP20:f:1
cell:AQ20:f:1
cell:AR20:f:1
cell:AS20:f:1
cell:AT20:f:1
cell:AU20:f:1
cell:AV20:f:1
cell:AW20:f:1
cell:AX20:f:1
cell:AY20:f:1
cell:AZ20:f:1
cell:BA20:f:1
cell:BB20:f:1
cell:BC20:f:1
cell:BD20:f:1
cell:BE20:f:1
cell:BF20:f:1
cell:BG20:f:1
cell:BH20:f:1
cell:BI20:f:1
cell:BJ20:f:1
cell:BK20:f:1
cell:BL20:f:1
cell:BM20:f:1
cell:BN20:f:1
cell:BO20:f:1
cell:BP20:f:1
cell:BQ20:f:1
cell:BR20:f:1
cell:BS20:f:1
cell:BT20:f:1
cell:BU20:f:1
cell:BV20:f:1
cell:BW20:f:1
cell:BX20:f:1
cell:BY20:f:1
cell:BZ20:f:1
cell:CA20:f:1
cell:CB20:f:1
cell:CC20:f:1
cell:E21:f:1
cell:F21:f:1
cell:G21:f:1
cell:H21:f:1
cell:I21:f:1
cell:J21:f:1
cell:K21:f:1
cell:L21:vtf:t:v:n1:f:1
cell:M21:f:1
cell:N21:f:1
cell:O21:f:1
cell:P21:f:1
cell:Q21:f:1
cell:R21:f:1
cell:S21:f:1
cell:T21:f:1
cell:U21:f:1
cell:V21:f:1
cell:W21:vtf:t:s:n2:f:1
cell:X21:f:1
cell:Y21:f:1
cell:Z21:f:1
cell:AA21:f:1
cell:AB21:f:1
cell:AC21:f:1
cell:AD21:vtf:t: :n3:f:1
cell:AE21:f:1
cell:AF21:f:1
cell:AG21:f:1
cell:AH21:f:1
cell:AI21:vtf:t:l:n4:f:1
cell:AJ21:f:1
cell:AK21:f:1
cell:AL21:f:1
cell:AM21:f:1
cell:AN21:f:1
cell:AO21:f:1
cell:AP21:vtf:t: :n5:f:1
cell:AQ21:f:1
cell:AR21:f:1
cell:AS21:f:1
cell:AT21:f:1
cell:AU21:f:1
cell:AV21:f:1
cell:AW21:f:1
cell:AX21:f:1
cell:AY21:f:1
cell:AZ21:f:1
cell:BA21:f:1
cell:BB21:f:1
cell:BC21:f:1
cell:BD21:f:1
cell:BE21:f:1
cell:BF21:f:1
cell:BG21:f:1
cell:BH21:f:1
cell:BI21:f:1
cell:BJ21:f:1
cell:BK21:f:1
cell:BL21:f:1
cell:BM21:f:1
cell:BN21:f:1
cell:BO21:f:1
cell:BP21:f:1
cell:BQ21:f:1
cell:BR21:f:1
cell:BS21:f:1
cell:BT21:f:1
cell:BU21:f:1
cell:BV21:f:1
cell:BW21:f:1
cell:BX21:f:1
cell:BY21:f:1
cell:BZ21:f:1
cell:CA21:f:1
cell:CB21:f:1
cell:CC21:f:1
cell:E22:f:1
cell:F22:f:1
cell:G22:f:1
cell:H22:f:1
cell:I22:f:1
cell:J22:f:1
cell:K22:f:1
cell:L22:vtf:t:o:o1:f:1
cell:M22:f:1
cell:N22:f:1
cell:O22:f:1
cell:P22:f:1
cell:Q22:f:1
cell:R22:f:1
cell:S22:f:1
cell:T22:f:1
cell:U22:f:1
cell:V22:f:1
cell:W22:vtf:t:s:o2:f:1
cell:X22:f:1
cell:Y22:f:1
cell:Z22:f:1
cell:AA22:f:1
cell:AB22:f:1
cell:AC22:f:1
cell:AD22:f:1
cell:AE22:vtf:t:c:o3:f:1
cell:AF22:f:1
cell:AG22:f:1
cell:AH22:f:1
cell:AI22:f:1
cell:AJ22:vtf:t:e:o4:f:1
cell:AK22:f:1
cell:AL22:f:1
cell:AM22:f:1
cell:AN22:f:1
cell:AO22:f:1
cell:AP22:f:1
cell:AQ22:vtf:t:l:o5:f:1
cell:AR22:f:1
cell:AS22:f:1
cell:AT22:f:1
cell:AU22:f:1
cell:AV22:f:1
cell:AW22:f:1
cell:AX22:f:1
cell:AY22:f:1
cell:AZ22:f:1
cell:BA22:f:1
cell:BB22:f:1
cell:BC22:f:1
cell:BD22:f:1
cell:BE22:f:1
cell:BF22:f:1
cell:BG22:f:1
cell:BH22:f:1
cell:BI22:f:1
cell:BJ22:f:1
cell:BK22:f:1
cell:BL22:f:1
cell:BM22:f:1
cell:BN22:f:1
cell:BO22:f:1
cell:BP22:f:1
cell:BQ22:f:1
cell:BR22:f:1
cell:BS22:f:1
cell:BT22:f:1
cell:BU22:f:1
cell:BV22:f:1
cell:BW22:f:1
cell:BX22:f:1
cell:BY22:f:1
cell:BZ22:f:1
cell:CA22:f:1
cell:CB22:f:1
cell:CC22:f:1
cell:E23:f:1
cell:F23:f:1
cell:G23:f:1
cell:H23:f:1
cell:I23:f:1
cell:J23:f:1
cell:K23:f:1
cell:L23:f:1
cell:M23:vtf:t:i:p1:f:1
cell:N23:f:1
cell:O23:f:1
cell:P23:f:1
cell:Q23:f:1
cell:R23:f:1
cell:S23:f:1
cell:T23:f:1
cell:U23:f:1
cell:V23:f:1
cell:W23:f:1
cell:X23:vtf:t:i:p2:f:1
cell:Y23:f:1
cell:Z23:f:1
cell:AA23:f:1
cell:AB23:f:1
cell:AC23:f:1
cell:AD23:f:1
cell:AE23:vtf:t:a:p3:f:1
cell:AF23:f:1
cell:AG23:f:1
cell:AH23:f:1
cell:AI23:f:1
cell:AJ23:vtf:t:u:p4:f:1
cell:AK23:f:1
cell:AL23:f:1
cell:AM23:f:1
cell:AN23:f:1
cell:AO23:f:1
cell:AP23:f:1
cell:AQ23:vtf:t:e:p5:f:1
cell:AR23:f:1
cell:AS23:f:1
cell:AT23:f:1
cell:AU23:f:1
cell:AV23:f:1
cell:AW23:f:1
cell:AX23:f:1
cell:AY23:f:1
cell:AZ23:f:1
cell:BA23:f:1
cell:BB23:f:1
cell:BC23:f:1
cell:BD23:f:1
cell:BE23:f:1
cell:BF23:f:1
cell:BG23:f:1
cell:BH23:f:1
cell:BI23:f:1
cell:BJ23:f:1
cell:BK23:f:1
cell:BL23:f:1
cell:BM23:f:1
cell:BN23:f:1
cell:BO23:f:1
cell:BP23:f:1
cell:BQ23:f:1
cell:BR23:f:1
cell:BS23:f:1
cell:BT23:f:1
cell:BU23:f:1
cell:BV23:f:1
cell:BW23:f:1
cell:BX23:f:1
cell:BY23:f:1
cell:BZ23:f:1
cell:CA23:f:1
cell:CB23:f:1
cell:CC23:f:1
cell:E24:f:1
cell:F24:f:1
cell:G24:f:1
cell:H24:f:1
cell:I24:f:1
cell:J24:f:1
cell:K24:f:1
cell:L24:f:1
cell:M24:f:1
cell:N24:vtf:t:x:q1:f:1
cell:O24:f:1
cell:P24:f:1
cell:Q24:f:1
cell:R24:f:1
cell:S24:f:1
cell:T24:f:1
cell:U24:f:1
cell:V24:f:1
cell:W24:f:1
cell:X24:vtf:t: :q2:f:1
cell:Y24:f:1
cell:Z24:f:1
cell:AA24:f:1
cell:AB24:f:1
cell:AC24:f:1
cell:AD24:f:1
cell:AE24:f:1
cell:AF24:vtf:t:b:q3:f:1
cell:AG24:f:1
cell:AH24:f:1
cell:AI24:f:1
cell:AJ24:f:1
cell:AK24:vtf:t:t:q4:f:1
cell:AL24:f:1
cell:AM24:f:1
cell:AN24:f:1
cell:AO24:f:1
cell:AP24:f:1
cell:AQ24:f:1
cell:AR24:vtf:t:s:q5:f:1
cell:AS24:f:1
cell:AT24:f:1
cell:AU24:f:1
cell:AV24:f:1
cell:AW24:f:1
cell:AX24:f:1
cell:AY24:f:1
cell:AZ24:f:1
cell:BA24:f:1
cell:BB24:f:1
cell:BC24:f:1
cell:BD24:f:1
cell:BE24:f:1
cell:BF24:f:1
cell:BG24:f:1
cell:BH24:f:1
cell:BI24:f:1
cell:BJ24:f:1
cell:BK24:f:1
cell:BL24:f:1
cell:BM24:f:1
cell:BN24:f:1
cell:BO24:f:1
cell:BP24:f:1
cell:BQ24:f:1
cell:BR24:f:1
cell:BS24:f:1
cell:BT24:f:1
cell:BU24:f:1
cell:BV24:f:1
cell:BW24:f:1
cell:BX24:f:1
cell:BY24:f:1
cell:BZ24:f:1
cell:CA24:f:1
cell:CB24:f:1
cell:CC24:f:1
cell:E25:f:1
cell:F25:f:1
cell:G25:f:1
cell:H25:f:1
cell:I25:f:1
cell:J25:f:1
cell:K25:f:1
cell:L25:f:1
cell:M25:f:1
cell:N25:vtf:t: :r1:f:1
cell:O25:f:1
cell:P25:f:1
cell:Q25:f:1
cell:R25:f:1
cell:S25:f:1
cell:T25:f:1
cell:U25:f:1
cell:V25:f:1
cell:W25:f:1
cell:X25:f:1
cell:Y25:vtf:t:q:r2:f:1
cell:Z25:f:1
cell:AA25:f:1
cell:AB25:f:1
cell:AC25:f:1
cell:AD25:f:1
cell:AE25:f:1
cell:AF25:f:1
cell:AG25:vtf:t:r:r3:f:1
cell:AH25:f:1
cell:AI25:f:1
cell:AJ25:f:1
cell:AK25:f:1
cell:AL25:vtf:t: :r4:f:1
cell:AM25:f:1
cell:AN25:f:1
cell:AO25:f:1
cell:AP25:f:1
cell:AQ25:f:1
cell:AR25:f:1
cell:AS25:vtf:t: :r5:f:1
cell:AT25:f:1
cell:AU25:f:1
cell:AV25:f:1
cell:AW25:f:1
cell:AX25:f:1
cell:AY25:f:1
cell:AZ25:f:1
cell:BA25:f:1
cell:BB25:f:1
cell:BC25:f:1
cell:BD25:f:1
cell:BE25:f:1
cell:BF25:f:1
cell:BG25:f:1
cell:BH25:f:1
cell:BI25:f:1
cell:BJ25:f:1
cell:BK25:f:1
cell:BL25:f:1
cell:BM25:f:1
cell:BN25:f:1
cell:BO25:f:1
cell:BP25:f:1
cell:BQ25:f:1
cell:BR25:f:1
cell:BS25:f:1
cell:BT25:f:1
cell:BU25:f:1
cell:BV25:f:1
cell:BW25:f:1
cell:BX25:f:1
cell:BY25:f:1
cell:BZ25:f:1
cell:CA25:f:1
cell:CB25:f:1
cell:CC25:f:1
cell:E26:f:1
cell:F26:f:1
cell:G26:f:1
cell:H26:f:1
cell:I26:f:1
cell:J26:f:1
cell:K26:f:1
cell:L26:f:1
cell:M26:f:1
cell:N26:f:1
cell:O26:vtf:t:d:s1:f:1
cell:P26:f:1
cell:Q26:f:1
cell:R26:f:1
cell:S26:f:1
cell:T26:f:1
cell:U26:f:1
cell:V26:f:1
cell:W26:f:1
cell:X26:f:1
cell:Y26:vtf:t:u:s2:f:1
cell:Z26:f:1
cell:AA26:f:1
cell:AB26:f:1
cell:AC26:f:1
cell:AD26:f:1
cell:AE26:f:1
cell:AF26:f:1
cell:AG26:vtf:t:é:s3:f:1
cell:AH26:f:1
cell:AI26:f:1
cell:AJ26:f:1
cell:AK26:f:1
cell:AL26:vtf:t:t:s4:f:1
cell:AM26:f:1
cell:AN26:f:1
cell:AO26:f:1
cell:AP26:f:1
cell:AQ26:f:1
cell:AR26:f:1
cell:AS26:f:1
cell:AT26:vtf:t:l:s5:f:1
cell:AU26:f:1
cell:AV26:f:1
cell:AW26:f:1
cell:AX26:f:1
cell:AY26:f:1
cell:AZ26:f:1
cell:BA26:f:1
cell:BB26:f:1
cell:BC26:f:1
cell:BD26:f:1
cell:BE26:f:1
cell:BF26:f:1
cell:BG26:f:1
cell:BH26:f:1
cell:BI26:f:1
cell:BJ26:f:1
cell:BK26:f:1
cell:BL26:f:1
cell:BM26:f:1
cell:BN26:f:1
cell:BO26:f:1
cell:BP26:f:1
cell:BQ26:f:1
cell:BR26:f:1
cell:BS26:f:1
cell:BT26:f:1
cell:BU26:f:1
cell:BV26:f:1
cell:BW26:f:1
cell:BX26:f:1
cell:BY26:f:1
cell:BZ26:f:1
cell:CA26:f:1
cell:CB26:f:1
cell:CC26:f:1
cell:E27:f:1
cell:F27:f:1
cell:G27:f:1
cell:H27:f:1
cell:I27:f:1
cell:J27:f:1
cell:K27:f:1
cell:L27:f:1
cell:M27:f:1
cell:N27:f:1
cell:O27:f:1
cell:P27:vtf:t:e:t1:f:1
cell:Q27:f:1
cell:R27:f:1
cell:S27:f:1
cell:T27:f:1
cell:U27:f:1
cell:V27:f:1
cell:W27:f:1
cell:X27:f:1
cell:Y27:f:1
cell:Z27:vtf:t:':t2:f:1
cell:AA27:f:1
cell:AB27:f:1
cell:AC27:f:1
cell:AD27:f:1
cell:AE27:f:1
cell:AF27:f:1
cell:AG27:f:1
cell:AH27:vtf:t:s:t3:f:1
cell:AI27:f:1
cell:AJ27:f:1
cell:AK27:f:1
cell:AL27:f:1
cell:AM27:vtf:t:a:t4:f:1
cell:AN27:f:1
cell:AO27:f:1
cell:AP27:f:1
cell:AQ27:f:1
cell:AR27:f:1
cell:AS27:f:1
cell:AT27:vtf:t:i:t5:f:1
cell:AU27:f:1
cell:AV27:f:1
cell:AW27:f:1
cell:AX27:f:1
cell:AY27:f:1
cell:AZ27:f:1
cell:BA27:f:1
cell:BB27:f:1
cell:BC27:f:1
cell:BD27:f:1
cell:BE27:f:1
cell:BF27:f:1
cell:BG27:f:1
cell:BH27:f:1
cell:BI27:f:1
cell:BJ27:f:1
cell:BK27:f:1
cell:BL27:f:1
cell:BM27:f:1
cell:BN27:f:1
cell:BO27:f:1
cell:BP27:f:1
cell:BQ27:f:1
cell:BR27:f:1
cell:BS27:f:1
cell:BT27:f:1
cell:BU27:f:1
cell:BV27:f:1
cell:BW27:f:1
cell:BX27:f:1
cell:BY27:f:1
cell:BZ27:f:1
cell:CA27:f:1
cell:CB27:f:1
cell:CC27:f:1
cell:E28:f:1
cell:F28:f:1
cell:G28:f:1
cell:H28:f:1
cell:I28:f:1
cell:J28:f:1
cell:K28:f:1
cell:L28:f:1
cell:M28:f:1
cell:N28:f:1
cell:O28:f:1
cell:P28:vtf:t: :u1:f:1
cell:Q28:vtf:t: :u1:f:1
cell:R28:f:1
cell:S28:f:1
cell:T28:f:1
cell:U28:f:1
cell:V28:f:1
cell:W28:f:1
cell:X28:f:1
cell:Y28:f:1
cell:Z28:vtf:t:i:u2:f:1
cell:AA28:f:1
cell:AB28:f:1
cell:AC28:f:1
cell:AD28:f:1
cell:AE28:f:1
cell:AF28:f:1
cell:AG28:f:1
cell:AH28:vtf:t: :u3:f:1
cell:AI28:f:1
cell:AJ28:f:1
cell:AK28:f:1
cell:AL28:f:1
cell:AM28:f:1
cell:AN28:vtf:t:n:u4:f:1
cell:AO28:f:1
cell:AP28:f:1
cell:AQ28:f:1
cell:AR28:f:1
cell:AS28:f:1
cell:AT28:f:1
cell:AU28:vtf:t:e:u5:f:1
cell:AV28:f:1
cell:AW28:f:1
cell:AX28:f:1
cell:AY28:f:1
cell:AZ28:f:1
cell:BA28:f:1
cell:BB28:f:1
cell:BC28:f:1
cell:BD28:f:1
cell:BE28:f:1
cell:BF28:f:1
cell:BG28:f:1
cell:BH28:f:1
cell:BI28:f:1
cell:BJ28:f:1
cell:BK28:f:1
cell:BL28:f:1
cell:BM28:f:1
cell:BN28:f:1
cell:BO28:f:1
cell:BP28:f:1
cell:BQ28:f:1
cell:BR28:f:1
cell:BS28:f:1
cell:BT28:f:1
cell:BU28:f:1
cell:BV28:f:1
cell:BW28:f:1
cell:BX28:f:1
cell:BY28:f:1
cell:BZ28:f:1
cell:CA28:f:1
cell:CB28:f:1
cell:CC28:f:1
cell:E29:f:1
cell:F29:f:1
cell:G29:f:1
cell:H29:f:1
cell:I29:f:1
cell:J29:f:1
cell:K29:f:1
cell:L29:f:1
cell:M29:f:1
cell:N29:f:1
cell:O29:f:1
cell:P29:f:1
cell:Q29:vtf:t:f:v1:f:1
cell:R29:f:1
cell:S29:f:1
cell:T29:f:1
cell:U29:f:1
cell:V29:f:1
cell:W29:f:1
cell:X29:f:1
cell:Y29:f:1
cell:Z29:f:1
cell:AA29:vtf:t:l:v2:f:1
cell:AB29:f:1
cell:AC29:f:1
cell:AD29:f:1
cell:AE29:f:1
cell:AF29:f:1
cell:AG29:f:1
cell:AH29:vtf:t:s:v3:f:1
cell:AI29:f:1
cell:AJ29:f:1
cell:AK29:f:1
cell:AL29:f:1
cell:AM29:f:1
cell:AN29:f:1
cell:AO29:vtf:t:d:v4:f:1
cell:AP29:f:1
cell:AQ29:f:1
cell:AR29:f:1
cell:AS29:f:1
cell:AT29:f:1
cell:AU29:f:1
cell:AV29:vtf:t:n:v5:f:1
cell:AW29:f:1
cell:AX29:f:1
cell:AY29:f:1
cell:AZ29:f:1
cell:BA29:f:1
cell:BB29:f:1
cell:BC29:f:1
cell:BD29:f:1
cell:BE29:f:1
cell:BF29:f:1
cell:BG29:f:1
cell:BH29:f:1
cell:BI29:f:1
cell:BJ29:f:1
cell:BK29:f:1
cell:BL29:f:1
cell:BM29:f:1
cell:BN29:f:1
cell:BO29:f:1
cell:BP29:f:1
cell:BQ29:f:1
cell:BR29:f:1
cell:BS29:f:1
cell:BT29:f:1
cell:BU29:f:1
cell:BV29:f:1
cell:BW29:f:1
cell:BX29:f:1
cell:BY29:f:1
cell:BZ29:f:1
cell:CA29:f:1
cell:CB29:f:1
cell:CC29:f:1
cell:E30:f:1
cell:F30:f:1
cell:G30:f:1
cell:H30:f:1
cell:I30:f:1
cell:J30:f:1
cell:K30:f:1
cell:L30:f:1
cell:M30:f:1
cell:N30:f:1
cell:O30:f:1
cell:P30:f:1
cell:Q30:f:1
cell:R30:vtf:t:e:w1:f:1
cell:S30:f:1
cell:T30:f:1
cell:U30:f:1
cell:V30:f:1
cell:W30:f:1
cell:X30:f:1
cell:Y30:f:1
cell:Z30:f:1
cell:AA30:vtf:t: :w2:f:1
cell:AB30:f:1
cell:AC30:f:1
cell:AD30:f:1
cell:AE30:f:1
cell:AF30:f:1
cell:AG30:f:1
cell:AH30:f:1
cell:AI30:vtf:t:e:w3:f:1
cell:AJ30:f:1
cell:AK30:f:1
cell:AL30:f:1
cell:AM30:f:1
cell:AN30:f:1
cell:AO30:f:1
cell:AP30:vtf:t:i:w4:f:1
cell:AQ30:f:1
cell:AR30:f:1
cell:AS30:f:1
cell:AT30:f:1
cell:AU30:f:1
cell:AV30:f:1
cell:AW30:vtf:t:s:w5:f:1
cell:AX30:f:1
cell:AY30:f:1
cell:AZ30:f:1
cell:BA30:f:1
cell:BB30:f:1
cell:BC30:f:1
cell:BD30:f:1
cell:BE30:f:1
cell:BF30:f:1
cell:BG30:f:1
cell:BH30:f:1
cell:BI30:f:1
cell:BJ30:f:1
cell:BK30:f:1
cell:BL30:f:1
cell:BM30:f:1
cell:BN30:f:1
cell:BO30:f:1
cell:BP30:f:1
cell:BQ30:f:1
cell:BR30:f:1
cell:BS30:f:1
cell:BT30:f:1
cell:BU30:f:1
cell:BV30:f:1
cell:BW30:f:1
cell:BX30:f:1
cell:BY30:f:1
cell:BZ30:f:1
cell:CA30:f:1
cell:CB30:f:1
cell:CC30:f:1
cell:E31:f:1
cell:F31:f:1
cell:G31:f:1
cell:H31:f:1
cell:I31:f:1
cell:J31:f:1
cell:K31:f:1
cell:L31:f:1
cell:M31:f:1
cell:N31:f:1
cell:O31:f:1
cell:P31:f:1
cell:Q31:f:1
cell:R31:vtf:t:m:x1:f:1
cell:S31:f:1
cell:T31:f:1
cell:U31:f:1
cell:V31:f:1
cell:W31:f:1
cell:X31:f:1
cell:Y31:f:1
cell:Z31:f:1
cell:AA31:f:1
cell:AB31:vtf:t:p:x2:f:1
cell:AC31:f:1
cell:AD31:f:1
cell:AE31:f:1
cell:AF31:f:1
cell:AG31:f:1
cell:AH31:f:1
cell:AI31:vtf:t: :x3:f:1
cell:AJ31:f:1
cell:AK31:f:1
cell:AL31:f:1
cell:AM31:f:1
cell:AN31:f:1
cell:AO31:f:1
cell:AP31:f:1
cell:AQ31:vtf:t:s:x4:f:1
cell:AR31:f:1
cell:AS31:f:1
cell:AT31:f:1
cell:AU31:f:1
cell:AV31:f:1
cell:AW31:f:1
cell:AX31:vtf:t: :x5:f:1
cell:AY31:f:1
cell:AZ31:f:1
cell:BA31:f:1
cell:BB31:f:1
cell:BC31:f:1
cell:BD31:f:1
cell:BE31:f:1
cell:BF31:f:1
cell:BG31:f:1
cell:BH31:f:1
cell:BI31:f:1
cell:BJ31:f:1
cell:BK31:f:1
cell:BL31:f:1
cell:BM31:f:1
cell:BN31:f:1
cell:BO31:f:1
cell:BP31:f:1
cell:BQ31:f:1
cell:BR31:f:1
cell:BS31:f:1
cell:BT31:f:1
cell:BU31:f:1
cell:BV31:f:1
cell:BW31:f:1
cell:BX31:f:1
cell:BY31:f:1
cell:BZ31:f:1
cell:CA31:f:1
cell:CB31:f:1
cell:CC31:f:1
cell:E32:f:1
cell:F32:f:1
cell:G32:f:1
cell:H32:f:1
cell:I32:f:1
cell:J32:f:1
cell:K32:f:1
cell:L32:f:1
cell:M32:f:1
cell:N32:f:1
cell:O32:f:1
cell:P32:f:1
cell:Q32:f:1
cell:R32:f:1
cell:S32:vtf:t:m:y1:f:1
cell:T32:f:1
cell:U32:f:1
cell:V32:f:1
cell:W32:f:1
cell:X32:f:1
cell:Y32:f:1
cell:Z32:f:1
cell:AA32:f:1
cell:AB32:vtf:t:l:y2:f:1
cell:AC32:f:1
cell:AD32:f:1
cell:AE32:f:1
cell:AF32:f:1
cell:AG32:f:1
cell:AH32:f:1
cell:AI32:f:1
cell:AJ32:vtf:t:p:y3:f:1
cell:AK32:f:1
cell:AL32:f:1
cell:AM32:f:1
cell:AN32:f:1
cell:AO32:f:1
cell:AP32:f:1
cell:AQ32:f:1
cell:AR32:vtf:t: :y4:f:1
cell:AS32:f:1
cell:AT32:f:1
cell:AU32:f:1
cell:AV32:f:1
cell:AW32:f:1
cell:AX32:vtf:t:q:y5:f:1
cell:AY32:f:1
cell:AZ32:f:1
cell:BA32:f:1
cell:BB32:f:1
cell:BC32:f:1
cell:BD32:f:1
cell:BE32:f:1
cell:BF32:f:1
cell:BG32:f:1
cell:BH32:f:1
cell:BI32:f:1
cell:BJ32:f:1
cell:BK32:f:1
cell:BL32:f:1
cell:BM32:f:1
cell:BN32:f:1
cell:BO32:f:1
cell:BP32:f:1
cell:BQ32:f:1
cell:BR32:f:1
cell:BS32:f:1
cell:BT32:f:1
cell:BU32:f:1
cell:BV32:f:1
cell:BW32:f:1
cell:BX32:f:1
cell:BY32:f:1
cell:BZ32:f:1
cell:CA32:f:1
cell:CB32:f:1
cell:CC32:f:1
cell:E33:f:1
cell:F33:f:1
cell:G33:f:1
cell:H33:f:1
cell:I33:f:1
cell:J33:f:1
cell:K33:f:1
cell:L33:f:1
cell:M33:f:1
cell:N33:f:1
cell:O33:f:1
cell:P33:f:1
cell:Q33:f:1
cell:R33:f:1
cell:S33:vtf:t:e:z1:f:1
cell:T33:f:1
cell:U33:f:1
cell:V33:f:1
cell:W33:f:1
cell:X33:f:1
cell:Y33:f:1
cell:Z33:f:1
cell:AA33:f:1
cell:AB33:f:1
cell:AC33:vtf:t:e:z2:f:1
cell:AD33:f:1
cell:AE33:f:1
cell:AF33:f:1
cell:AG33:f:1
cell:AH33:f:1
cell:AI33:f:1
cell:AJ33:f:1
cell:AK33:vtf:t:r:z3:f:1
cell:AL33:f:1
cell:AM33:f:1
cell:AN33:f:1
cell:AO33:f:1
cell:AP33:f:1
cell:AQ33:f:1
cell:AR33:vtf:t:q:z4:f:1
cell:AS33:f:1
cell:AT33:f:1
cell:AU33:f:1
cell:AV33:f:1
cell:AW33:f:1
cell:AX33:f:1
cell:AY33:vtf:t:u:z5:f:1
cell:AZ33:f:1
cell:BA33:f:1
cell:BB33:f:1
cell:BC33:f:1
cell:BD33:f:1
cell:BE33:f:1
cell:BF33:f:1
cell:BG33:f:1
cell:BH33:f:1
cell:BI33:f:1
cell:BJ33:f:1
cell:BK33:f:1
cell:BL33:f:1
cell:BM33:f:1
cell:BN33:f:1
cell:BO33:f:1
cell:BP33:f:1
cell:BQ33:f:1
cell:BR33:f:1
cell:BS33:f:1
cell:BT33:f:1
cell:BU33:f:1
cell:BV33:f:1
cell:BW33:f:1
cell:BX33:f:1
cell:BY33:f:1
cell:BZ33:f:1
cell:CA33:f:1
cell:CB33:f:1
cell:CC33:f:1
cell:E34:f:1
cell:F34:f:1
cell:G34:f:1
cell:H34:f:1
cell:I34:f:1
cell:J34:f:1
cell:K34:f:1
cell:L34:f:1
cell:M34:f:1
cell:N34:f:1
cell:O34:f:1
cell:P34:f:1
cell:Q34:f:1
cell:R34:f:1
cell:S34:f:1
cell:T34:vtf:t:s:aa1:f:1
cell:U34:f:1
cell:V34:f:1
cell:W34:f:1
cell:X34:f:1
cell:Y34:f:1
cell:Z34:f:1
cell:AA34:f:1
cell:AB34:f:1
cell:AC34:vtf:t:u:aa2:f:1
cell:AD34:f:1
cell:AE34:f:1
cell:AF34:f:1
cell:AG34:f:1
cell:AH34:f:1
cell:AI34:f:1
cell:AJ34:f:1
cell:AK34:vtf:t:e:aa3:f:1
cell:AL34:f:1
cell:AM34:f:1
cell:AN34:f:1
cell:AO34:f:1
cell:AP34:f:1
cell:AQ34:f:1
cell:AR34:f:1
cell:AS34:vtf:t:u:aa4:f:1
cell:AT34:f:1
cell:AU34:f:1
cell:AV34:f:1
cell:AW34:f:1
cell:AX34:f:1
cell:AY34:f:1
cell:AZ34:vtf:t:i:aa5:f:1
cell:BA34:f:1
cell:BB34:f:1
cell:BC34:f:1
cell:BD34:f:1
cell:BE34:f:1
cell:BF34:f:1
cell:BG34:f:1
cell:BH34:f:1
cell:BI34:f:1
cell:BJ34:f:1
cell:BK34:f:1
cell:BL34:f:1
cell:BM34:f:1
cell:BN34:f:1
cell:BO34:f:1
cell:BP34:f:1
cell:BQ34:f:1
cell:BR34:f:1
cell:BS34:f:1
cell:BT34:f:1
cell:BU34:f:1
cell:BV34:f:1
cell:BW34:f:1
cell:BX34:f:1
cell:BY34:f:1
cell:BZ34:f:1
cell:CA34:f:1
cell:CB34:f:1
cell:CC34:f:1
cell:E35:f:1
cell:F35:f:1
cell:G35:f:1
cell:H35:f:1
cell:I35:f:1
cell:J35:f:1
cell:K35:f:1
cell:L35:f:1
cell:M35:f:1
cell:N35:f:1
cell:O35:f:1
cell:P35:f:1
cell:Q35:f:1
cell:R35:f:1
cell:S35:f:1
cell:T35:f:1
cell:U35:vtf:t: :ab1:f:1
cell:V35:f:1
cell:W35:f:1
cell:X35:f:1
cell:Y35:f:1
cell:Z35:f:1
cell:AA35:f:1
cell:AB35:f:1
cell:AC35:f:1
cell:AD35:vtf:t:t:ab2:f:1
cell:AE35:f:1
cell:AF35:f:1
cell:AG35:f:1
cell:AH35:f:1
cell:AI35:f:1
cell:AJ35:f:1
cell:AK35:f:1
cell:AL35:vtf:t:n:ab3:f:1
cell:AM35:f:1
cell:AN35:f:1
cell:AO35:f:1
cell:AP35:f:1
cell:AQ35:f:1
cell:AR35:f:1
cell:AS35:f:1
cell:AT35:vtf:t:e:ab4:f:1
cell:AU35:f:1
cell:AV35:f:1
cell:AW35:f:1
cell:AX35:f:1
cell:AY35:f:1
cell:AZ35:f:1
cell:BA35:vtf:t: :ab5:f:1
cell:BB35:f:1
cell:BC35:f:1
cell:BD35:f:1
cell:BE35:f:1
cell:BF35:f:1
cell:BG35:f:1
cell:BH35:f:1
cell:BI35:f:1
cell:BJ35:f:1
cell:BK35:f:1
cell:BL35:f:1
cell:BM35:f:1
cell:BN35:f:1
cell:BO35:f:1
cell:BP35:f:1
cell:BQ35:f:1
cell:BR35:f:1
cell:BS35:f:1
cell:BT35:f:1
cell:BU35:f:1
cell:BV35:f:1
cell:BW35:f:1
cell:BX35:f:1
cell:BY35:f:1
cell:BZ35:f:1
cell:CA35:f:1
cell:CB35:f:1
cell:CC35:f:1
cell:E36:f:1
cell:F36:f:1
cell:G36:f:1
cell:H36:f:1
cell:I36:f:1
cell:J36:f:1
cell:K36:f:1
cell:L36:f:1
cell:M36:f:1
cell:N36:f:1
cell:O36:f:1
cell:P36:f:1
cell:Q36:f:1
cell:R36:f:1
cell:S36:f:1
cell:T36:f:1
cell:U36:vtf:t:c:ac1:f:1
cell:V36:f:1
cell:W36:f:1
cell:X36:f:1
cell:Y36:f:1
cell:Z36:f:1
cell:AA36:f:1
cell:AB36:f:1
cell:AC36:f:1
cell:AD36:f:1
cell:AE36:vtf:t: :ac2:f:1
cell:AF36:f:1
cell:AG36:f:1
cell:AH36:f:1
cell:AI36:f:1
cell:AJ36:f:1
cell:AK36:f:1
cell:AL36:vtf:t:n:ac3:f:1
cell:AM36:f:1
cell:AN36:f:1
cell:AO36:f:1
cell:AP36:f:1
cell:AQ36:f:1
cell:AR36:f:1
cell:AS36:f:1
cell:AT36:vtf:t: :ac4:f:1
cell:AU36:f:1
cell:AV36:f:1
cell:AW36:f:1
cell:AX36:f:1
cell:AY36:f:1
cell:AZ36:f:1
cell:BA36:f:1
cell:BB36:vtf:t:t:ac5:f:1
cell:BC36:f:1
cell:BD36:f:1
cell:BE36:f:1
cell:BF36:f:1
cell:BG36:f:1
cell:BH36:f:1
cell:BI36:f:1
cell:BJ36:f:1
cell:BK36:f:1
cell:BL36:f:1
cell:BM36:f:1
cell:BN36:f:1
cell:BO36:f:1
cell:BP36:f:1
cell:BQ36:f:1
cell:BR36:f:1
cell:BS36:f:1
cell:BT36:f:1
cell:BU36:f:1
cell:BV36:f:1
cell:BW36:f:1
cell:BX36:f:1
cell:BY36:f:1
cell:BZ36:f:1
cell:CA36:f:1
cell:CB36:f:1
cell:CC36:f:1
cell:E37:f:1
cell:F37:f:1
cell:G37:f:1
cell:H37:f:1
cell:I37:f:1
cell:J37:f:1
cell:K37:f:1
cell:L37:f:1
cell:M37:f:1
cell:N37:f:1
cell:O37:f:1
cell:P37:f:1
cell:Q37:f:1
cell:R37:f:1
cell:S37:f:1
cell:T37:f:1
cell:U37:f:1
cell:V37:vtf:t:o:ad1:f:1
cell:W37:f:1
cell:X37:f:1
cell:Y37:f:1
cell:Z37:f:1
cell:AA37:f:1
cell:AB37:f:1
cell:AC37:f:1
cell:AD37:f:1
cell:AE37:vtf:t:m:ad2:f:1
cell:AF37:f:1
cell:AG37:f:1
cell:AH37:f:1
cell:AI37:f:1
cell:AJ37:f:1
cell:AK37:f:1
cell:AL37:f:1
cell:AM37:vtf:t:e:ad3:f:1
cell:AN37:f:1
cell:AO37:f:1
cell:AP37:f:1
cell:AQ37:f:1
cell:AR37:f:1
cell:AS37:f:1
cell:AT37:f:1
cell:AU37:vtf:t:l:ad4:f:1
cell:AV37:f:1
cell:AW37:f:1
cell:AX37:f:1
cell:AY37:f:1
cell:AZ37:f:1
cell:BA37:f:1
cell:BB37:vtf:t:e:ad5:f:1
cell:BC37:f:1
cell:BD37:f:1
cell:BE37:f:1
cell:BF37:f:1
cell:BG37:f:1
cell:BH37:f:1
cell:BI37:f:1
cell:BJ37:f:1
cell:BK37:f:1
cell:BL37:f:1
cell:BM37:f:1
cell:BN37:f:1
cell:BO37:f:1
cell:BP37:f:1
cell:BQ37:f:1
cell:BR37:f:1
cell:BS37:f:1
cell:BT37:f:1
cell:BU37:f:1
cell:BV37:f:1
cell:BW37:f:1
cell:BX37:f:1
cell:BY37:f:1
cell:BZ37:f:1
cell:CA37:f:1
cell:CB37:f:1
cell:CC37:f:1
cell:E38:f:1
cell:F38:f:1
cell:G38:f:1
cell:H38:f:1
cell:I38:f:1
cell:J38:f:1
cell:K38:f:1
cell:L38:f:1
cell:M38:f:1
cell:N38:f:1
cell:O38:f:1
cell:P38:f:1
cell:Q38:f:1
cell:R38:f:1
cell:S38:f:1
cell:T38:f:1
cell:U38:f:1
cell:V38:vtf:t:m:ae1:f:1
cell:W38:f:1
cell:X38:f:1
cell:Y38:f:1
cell:Z38:f:1
cell:AA38:f:1
cell:AB38:f:1
cell:AC38:f:1
cell:AD38:f:1
cell:AE38:f:1
cell:AF38:vtf:t:e:ae2:f:1
cell:AG38:f:1
cell:AH38:f:1
cell:AI38:f:1
cell:AJ38:f:1
cell:AK38:f:1
cell:AL38:f:1
cell:AM38:f:1
cell:AN38:vtf:t:n:ae3:f:1
cell:AO38:f:1
cell:AP38:f:1
cell:AQ38:f:1
cell:AR38:f:1
cell:AS38:f:1
cell:AT38:f:1
cell:AU38:f:1
cell:AV38:vtf:t:e:ae4:f:1
cell:AW38:f:1
cell:AX38:f:1
cell:AY38:f:1
cell:AZ38:f:1
cell:BA38:f:1
cell:BB38:f:1
cell:BC38:vtf:t: :ae5:f:1
cell:BD38:f:1
cell:BE38:f:1
cell:BF38:f:1
cell:BG38:f:1
cell:BH38:f:1
cell:BI38:f:1
cell:BJ38:f:1
cell:BK38:f:1
cell:BL38:f:1
cell:BM38:f:1
cell:BN38:f:1
cell:BO38:f:1
cell:BP38:f:1
cell:BQ38:f:1
cell:BR38:f:1
cell:BS38:f:1
cell:BT38:f:1
cell:BU38:f:1
cell:BV38:f:1
cell:BW38:f:1
cell:BX38:f:1
cell:BY38:f:1
cell:BZ38:f:1
cell:CA38:f:1
cell:CB38:f:1
cell:CC38:f:1
cell:E39:f:1
cell:F39:f:1
cell:G39:f:1
cell:H39:f:1
cell:I39:f:1
cell:J39:f:1
cell:K39:f:1
cell:L39:f:1
cell:M39:f:1
cell:N39:f:1
cell:O39:f:1
cell:P39:f:1
cell:Q39:f:1
cell:R39:f:1
cell:S39:f:1
cell:T39:f:1
cell:U39:f:1
cell:V39:f:1
cell:W39:vtf:t:m:af1:f:1
cell:X39:f:1
cell:Y39:f:1
cell:Z39:f:1
cell:AA39:f:1
cell:AB39:f:1
cell:AC39:f:1
cell:AD39:f:1
cell:AE39:f:1
cell:AF39:vtf:t:r:af2:f:1
cell:AG39:f:1
cell:AH39:f:1
cell:AI39:f:1
cell:AJ39:f:1
cell:AK39:f:1
cell:AL39:f:1
cell:AM39:f:1
cell:AN39:vtf:t:t:af3:f:1
cell:AO39:f:1
cell:AP39:f:1
cell:AQ39:f:1
cell:AR39:f:1
cell:AS39:f:1
cell:AT39:f:1
cell:AU39:f:1
cell:AV39:vtf:t: :af4:f:1
cell:AW39:f:1
cell:AX39:f:1
cell:AY39:f:1
cell:AZ39:f:1
cell:BA39:f:1
cell:BB39:f:1
cell:BC39:f:1
cell:BD39:vtf:t:r:af5:f:1
cell:BE39:f:1
cell:BF39:f:1
cell:BG39:f:1
cell:BH39:f:1
cell:BI39:f:1
cell:BJ39:f:1
cell:BK39:f:1
cell:BL39:f:1
cell:BM39:f:1
cell:BN39:f:1
cell:BO39:f:1
cell:BP39:f:1
cell:BQ39:f:1
cell:BR39:f:1
cell:BS39:f:1
cell:BT39:f:1
cell:BU39:f:1
cell:BV39:f:1
cell:BW39:f:1
cell:BX39:f:1
cell:BY39:f:1
cell:BZ39:f:1
cell:CA39:f:1
cell:CB39:f:1
cell:CC39:f:1
cell:E40:f:1
cell:F40:f:1
cell:G40:f:1
cell:H40:f:1
cell:I40:f:1
cell:J40:f:1
cell:K40:f:1
cell:L40:f:1
cell:M40:f:1
cell:N40:f:1
cell:O40:f:1
cell:P40:f:1
cell:Q40:f:1
cell:R40:f:1
cell:S40:f:1
cell:T40:f:1
cell:U40:f:1
cell:V40:f:1
cell:W40:vtf:t:e:ag1:f:1
cell:X40:f:1
cell:Y40:f:1
cell:Z40:f:1
cell:AA40:f:1
cell:AB40:f:1
cell:AC40:f:1
cell:AD40:f:1
cell:AE40:f:1
cell:AF40:f:1
cell:AG40:vtf:t:v:ag2:f:1
cell:AH40:f:1
cell:AI40:f:1
cell:AJ40:f:1
cell:AK40:f:1
cell:AL40:f:1
cell:AM40:f:1
cell:AN40:f:1
cell:AO40:vtf:t: :ag3:f:1
cell:AP40:f:1
cell:AQ40:f:1
cell:AR40:f:1
cell:AS40:f:1
cell:AT40:f:1
cell:AU40:f:1
cell:AV40:f:1
cell:AW40:vtf:t:r:ag4:f:1
cell:AX40:f:1
cell:AY40:f:1
cell:AZ40:f:1
cell:BA40:f:1
cell:BB40:f:1
cell:BC40:f:1
cell:BD40:vtf:t:e:ag5:f:1
cell:BE40:f:1
cell:BF40:f:1
cell:BG40:f:1
cell:BH40:f:1
cell:BI40:f:1
cell:BJ40:f:1
cell:BK40:f:1
cell:BL40:f:1
cell:BM40:f:1
cell:BN40:f:1
cell:BO40:f:1
cell:BP40:f:1
cell:BQ40:f:1
cell:BR40:f:1
cell:BS40:f:1
cell:BT40:f:1
cell:BU40:f:1
cell:BV40:f:1
cell:BW40:f:1
cell:BX40:f:1
cell:BY40:f:1
cell:BZ40:f:1
cell:CA40:f:1
cell:CB40:f:1
cell:CC40:f:1
cell:E41:f:1
cell:F41:f:1
cell:G41:f:1
cell:H41:f:1
cell:I41:f:1
cell:J41:f:1
cell:K41:f:1
cell:L41:f:1
cell:M41:f:1
cell:N41:f:1
cell:O41:f:1
cell:P41:f:1
cell:Q41:f:1
cell:R41:f:1
cell:S41:f:1
cell:T41:f:1
cell:U41:f:1
cell:V41:f:1
cell:W41:f:1
cell:X41:vtf:t: :ah1:f:1
cell:Y41:f:1
cell:Z41:f:1
cell:AA41:f:1
cell:AB41:f:1
cell:AC41:f:1
cell:AD41:f:1
cell:AE41:f:1
cell:AF41:f:1
cell:AG41:f:1
cell:AH41:vtf:t:e:ah2:f:1
cell:AI41:f:1
cell:AJ41:f:1
cell:AK41:f:1
cell:AL41:f:1
cell:AM41:f:1
cell:AN41:f:1
cell:AO41:vtf:t:à:ah3:f:1
cell:AP41:f:1
cell:AQ41:f:1
cell:AR41:f:1
cell:AS41:f:1
cell:AT41:f:1
cell:AU41:f:1
cell:AV41:f:1
cell:AW41:vtf:t:e:ah4:f:1
cell:AX41:f:1
cell:AY41:f:1
cell:AZ41:f:1
cell:BA41:f:1
cell:BB41:f:1
cell:BC41:f:1
cell:BD41:f:1
cell:BE41:vtf:t:t:ah5:f:1
cell:BF41:f:1
cell:BG41:f:1
cell:BH41:f:1
cell:BI41:f:1
cell:BJ41:f:1
cell:BK41:f:1
cell:BL41:f:1
cell:BM41:f:1
cell:BN41:f:1
cell:BO41:f:1
cell:BP41:f:1
cell:BQ41:f:1
cell:BR41:f:1
cell:BS41:f:1
cell:BT41:f:1
cell:BU41:f:1
cell:BV41:f:1
cell:BW41:f:1
cell:BX41:f:1
cell:BY41:f:1
cell:BZ41:f:1
cell:CA41:f:1
cell:CB41:f:1
cell:CC41:f:1
cell:E42:f:1
cell:F42:f:1
cell:G42:f:1
cell:H42:f:1
cell:I42:f:1
cell:J42:f:1
cell:K42:f:1
cell:L42:f:1
cell:M42:f:1
cell:N42:f:1
cell:O42:f:1
cell:P42:f:1
cell:Q42:f:1
cell:R42:f:1
cell:S42:f:1
cell:T42:f:1
cell:U42:f:1
cell:V42:f:1
cell:W42:f:1
cell:X42:f:1
cell:Y42:vtf:t:s:ai1:f:1
cell:Z42:f:1
cell:AA42:f:1
cell:AB42:f:1
cell:AC42:f:1
cell:AD42:f:1
cell:AE42:f:1
cell:AF42:f:1
cell:AG42:f:1
cell:AH42:vtf:t:i:ai2:f:1
cell:AI42:f:1
cell:AJ42:f:1
cell:AK42:f:1
cell:AL42:f:1
cell:AM42:f:1
cell:AN42:f:1
cell:AO42:f:1
cell:AP42:vtf:t: :ai3:f:1
cell:AQ42:f:1
cell:AR42:f:1
cell:AS42:f:1
cell:AT42:f:1
cell:AU42:f:1
cell:AV42:f:1
cell:AW42:f:1
cell:AX42:vtf:t:g:ai4:f:1
cell:AY42:f:1
cell:AZ42:f:1
cell:BA42:f:1
cell:BB42:f:1
cell:BC42:f:1
cell:BD42:f:1
cell:BE42:f:1
cell:BF42:vtf:t:i:ai5:f:1
cell:BG42:f:1
cell:BH42:f:1
cell:BI42:f:1
cell:BJ42:f:1
cell:BK42:f:1
cell:BL42:f:1
cell:BM42:f:1
cell:BN42:f:1
cell:BO42:f:1
cell:BP42:f:1
cell:BQ42:f:1
cell:BR42:f:1
cell:BS42:f:1
cell:BT42:f:1
cell:BU42:f:1
cell:BV42:f:1
cell:BW42:f:1
cell:BX42:f:1
cell:BY42:f:1
cell:BZ42:f:1
cell:CA42:f:1
cell:CB42:f:1
cell:CC42:f:1
cell:E43:f:1
cell:F43:f:1
cell:G43:f:1
cell:H43:f:1
cell:I43:f:1
cell:J43:f:1
cell:K43:f:1
cell:L43:f:1
cell:M43:f:1
cell:N43:f:1
cell:O43:f:1
cell:P43:f:1
cell:Q43:f:1
cell:R43:f:1
cell:S43:f:1
cell:T43:f:1
cell:U43:f:1
cell:V43:f:1
cell:W43:f:1
cell:X43:f:1
cell:Y43:f:1
cell:Z43:vtf:t:i:aj1:f:1
cell:AA43:f:1
cell:AB43:f:1
cell:AC43:f:1
cell:AD43:f:1
cell:AE43:f:1
cell:AF43:f:1
cell:AG43:f:1
cell:AH43:f:1
cell:AI43:vtf:t:l:aj2:f:1
cell:AJ43:f:1
cell:AK43:f:1
cell:AL43:f:1
cell:AM43:f:1
cell:AN43:f:1
cell:AO43:f:1
cell:AP43:f:1
cell:AQ43:vtf:t:h:aj3:f:1
cell:AR43:f:1
cell:AS43:f:1
cell:AT43:f:1
cell:AU43:f:1
cell:AV43:f:1
cell:AW43:f:1
cell:AX43:vtf:t:r:aj4:f:1
cell:AY43:f:1
cell:AZ43:f:1
cell:BA43:f:1
cell:BB43:f:1
cell:BC43:f:1
cell:BD43:f:1
cell:BE43:f:1
cell:BF43:vtf:t:e:aj5:f:1
cell:BG43:f:1
cell:BH43:f:1
cell:BI43:f:1
cell:BJ43:f:1
cell:BK43:f:1
cell:BL43:f:1
cell:BM43:f:1
cell:BN43:f:1
cell:BO43:f:1
cell:BP43:f:1
cell:BQ43:f:1
cell:BR43:f:1
cell:BS43:f:1
cell:BT43:f:1
cell:BU43:f:1
cell:BV43:f:1
cell:BW43:f:1
cell:BX43:f:1
cell:BY43:f:1
cell:BZ43:f:1
cell:CA43:f:1
cell:CB43:f:1
cell:CC43:f:1
cell:E44:f:1
cell:F44:f:1
cell:G44:f:1
cell:H44:f:1
cell:I44:f:1
cell:J44:f:1
cell:K44:f:1
cell:L44:f:1
cell:M44:f:1
cell:N44:f:1
cell:O44:f:1
cell:P44:f:1
cell:Q44:f:1
cell:R44:f:1
cell:S44:f:1
cell:T44:f:1
cell:U44:f:1
cell:V44:f:1
cell:W44:f:1
cell:X44:f:1
cell:Y44:f:1
cell:Z44:vtf:t: :ak1:f:1
cell:AA44:f:1
cell:AB44:f:1
cell:AC44:f:1
cell:AD44:f:1
cell:AE44:f:1
cell:AF44:f:1
cell:AG44:f:1
cell:AH44:f:1
cell:AI44:f:1
cell:AJ44:vtf:t:l:ak2:f:1
cell:AK44:f:1
cell:AL44:f:1
cell:AM44:f:1
cell:AN44:f:1
cell:AO44:f:1
cell:AP44:f:1
cell:AQ44:f:1
cell:AR44:vtf:t:e:ak3:f:1
cell:AS44:f:1
cell:AT44:f:1
cell:AU44:f:1
cell:AV44:f:1
cell:AW44:f:1
cell:AX44:f:1
cell:AY44:vtf:t:e:ak4:f:1
cell:AZ44:f:1
cell:BA44:f:1
cell:BB44:f:1
cell:BC44:f:1
cell:BD44:f:1
cell:BE44:f:1
cell:BF44:f:1
cell:BG44:vtf:t:n:ak5:f:1
cell:BH44:f:1
cell:BI44:f:1
cell:BJ44:f:1
cell:BK44:f:1
cell:BL44:f:1
cell:BM44:f:1
cell:BN44:f:1
cell:BO44:f:1
cell:BP44:f:1
cell:BQ44:f:1
cell:BR44:f:1
cell:BS44:f:1
cell:BT44:f:1
cell:BU44:f:1
cell:BV44:f:1
cell:BW44:f:1
cell:BX44:f:1
cell:BY44:f:1
cell:BZ44:f:1
cell:CA44:f:1
cell:CB44:f:1
cell:CC44:f:1
cell:E45:f:1
cell:F45:f:1
cell:G45:f:1
cell:H45:f:1
cell:I45:f:1
cell:J45:f:1
cell:K45:f:1
cell:L45:f:1
cell:M45:f:1
cell:N45:f:1
cell:O45:f:1
cell:P45:f:1
cell:Q45:f:1
cell:R45:f:1
cell:S45:f:1
cell:T45:f:1
cell:U45:f:1
cell:V45:f:1
cell:W45:f:1
cell:X45:f:1
cell:Y45:f:1
cell:Z45:vtf:t:e:al1:f:1
cell:AA45:f:1
cell:AB45:f:1
cell:AC45:f:1
cell:AD45:f:1
cell:AE45:f:1
cell:AF45:f:1
cell:AG45:f:1
cell:AH45:f:1
cell:AI45:f:1
cell:AJ45:f:1
cell:AK45:vtf:t:e:al2:f:1
cell:AL45:f:1
cell:AM45:f:1
cell:AN45:f:1
cell:AO45:f:1
cell:AP45:f:1
cell:AQ45:f:1
cell:AR45:f:1
cell:AS45:vtf:t:n:al3:f:1
cell:AT45:f:1
cell:AU45:f:1
cell:AV45:f:1
cell:AW45:f:1
cell:AX45:f:1
cell:AY45:vtf:t:t:al4:f:1
cell:AZ45:f:1
cell:BA45:f:1
cell:BB45:f:1
cell:BC45:f:1
cell:BD45:f:1
cell:BE45:f:1
cell:BF45:f:1
cell:BG45:vtf:t:n:al5:f:1
cell:BH45:f:1
cell:BI45:f:1
cell:BJ45:f:1
cell:BK45:f:1
cell:BL45:f:1
cell:BM45:f:1
cell:BN45:f:1
cell:BO45:f:1
cell:BP45:f:1
cell:BQ45:f:1
cell:BR45:f:1
cell:BS45:f:1
cell:BT45:f:1
cell:BU45:f:1
cell:BV45:f:1
cell:BW45:f:1
cell:BX45:f:1
cell:BY45:f:1
cell:BZ45:f:1
cell:CA45:f:1
cell:CB45:f:1
cell:CC45:f:1
cell:E46:f:1
cell:F46:f:1
cell:G46:f:1
cell:H46:f:1
cell:I46:f:1
cell:J46:f:1
cell:K46:f:1
cell:L46:f:1
cell:M46:f:1
cell:N46:f:1
cell:O46:f:1
cell:P46:f:1
cell:Q46:f:1
cell:R46:f:1
cell:S46:f:1
cell:T46:f:1
cell:U46:f:1
cell:V46:f:1
cell:W46:f:1
cell:X46:f:1
cell:Y46:f:1
cell:Z46:f:1
cell:AA46:vtf:t:l:am1:f:1
cell:AB46:f:1
cell:AC46:f:1
cell:AD46:f:1
cell:AE46:f:1
cell:AF46:f:1
cell:AG46:f:1
cell:AH46:f:1
cell:AI46:f:1
cell:AJ46:f:1
cell:AK46:vtf:t:u:am2:f:1
cell:AL46:f:1
cell:AM46:f:1
cell:AN46:f:1
cell:AO46:f:1
cell:AP46:f:1
cell:AQ46:f:1
cell:AR46:f:1
cell:AS46:vtf:t:n:am3:f:1
cell:AT46:f:1
cell:AU46:f:1
cell:AV46:f:1
cell:AW46:f:1
cell:AX46:f:1
cell:AY46:f:1
cell:AZ46:vtf:t: :am4:f:1
cell:BA46:f:1
cell:BB46:f:1
cell:BC46:f:1
cell:BD46:f:1
cell:BE46:f:1
cell:BF46:f:1
cell:BG46:f:1
cell:BH46:vtf:t:e:am5:f:1
cell:BI46:f:1
cell:BJ46:f:1
cell:BK46:f:1
cell:BL46:f:1
cell:BM46:f:1
cell:BN46:f:1
cell:BO46:f:1
cell:BP46:f:1
cell:BQ46:f:1
cell:BR46:f:1
cell:BS46:f:1
cell:BT46:f:1
cell:BU46:f:1
cell:BV46:f:1
cell:BW46:f:1
cell:BX46:f:1
cell:BY46:f:1
cell:BZ46:f:1
cell:CA46:f:1
cell:CB46:f:1
cell:CC46:f:1
cell:E47:f:1
cell:F47:f:1
cell:G47:f:1
cell:H47:f:1
cell:I47:f:1
cell:J47:f:1
cell:K47:f:1
cell:L47:f:1
cell:M47:f:1
cell:N47:f:1
cell:O47:f:1
cell:P47:f:1
cell:Q47:f:1
cell:R47:f:1
cell:S47:f:1
cell:T47:f:1
cell:U47:f:1
cell:V47:f:1
cell:W47:f:1
cell:X47:f:1
cell:Y47:f:1
cell:Z47:f:1
cell:AA47:vtf:t:l:an1:f:1
cell:AB47:f:1
cell:AC47:f:1
cell:AD47:f:1
cell:AE47:f:1
cell:AF47:f:1
cell:AG47:f:1
cell:AH47:f:1
cell:AI47:f:1
cell:AJ47:f:1
cell:AK47:f:1
cell:AL47:vtf:t:s:an2:f:1
cell:AM47:f:1
cell:AN47:f:1
cell:AO47:f:1
cell:AP47:f:1
cell:AQ47:f:1
cell:AR47:f:1
cell:AS47:f:1
cell:AT47:vtf:t:i:an3:f:1
cell:AU47:f:1
cell:AV47:f:1
cell:AW47:f:1
cell:AX47:f:1
cell:AY47:f:1
cell:AZ47:vtf:t:e:an4:f:1
cell:BA47:f:1
cell:BB47:f:1
cell:BC47:f:1
cell:BD47:f:1
cell:BE47:f:1
cell:BF47:f:1
cell:BG47:f:1
cell:BH47:vtf:t:n:an5:f:1
cell:BI47:f:1
cell:BJ47:f:1
cell:BK47:f:1
cell:BL47:f:1
cell:BM47:f:1
cell:BN47:f:1
cell:BO47:f:1
cell:BP47:f:1
cell:BQ47:f:1
cell:BR47:f:1
cell:BS47:f:1
cell:BT47:f:1
cell:BU47:f:1
cell:BV47:f:1
cell:BW47:f:1
cell:BX47:f:1
cell:BY47:f:1
cell:BZ47:f:1
cell:CA47:f:1
cell:CB47:f:1
cell:CC47:f:1
cell:E48:f:1
cell:F48:f:1
cell:G48:f:1
cell:H48:f:1
cell:I48:f:1
cell:J48:f:1
cell:K48:f:1
cell:L48:f:1
cell:M48:f:1
cell:N48:f:1
cell:O48:f:1
cell:P48:f:1
cell:Q48:f:1
cell:R48:f:1
cell:S48:f:1
cell:T48:f:1
cell:U48:f:1
cell:V48:f:1
cell:W48:f:1
cell:X48:f:1
cell:Y48:f:1
cell:Z48:f:1
cell:AA48:f:1
cell:AB48:vtf:t:e:ao1:f:1
cell:AC48:f:1
cell:AD48:f:1
cell:AE48:f:1
cell:AF48:f:1
cell:AG48:f:1
cell:AH48:f:1
cell:AI48:f:1
cell:AJ48:f:1
cell:AK48:f:1
cell:AL48:vtf:t:e:ao2:f:1
cell:AM48:f:1
cell:AN48:f:1
cell:AO48:f:1
cell:AP48:f:1
cell:AQ48:f:1
cell:AR48:f:1
cell:AS48:f:1
cell:AT48:f:1
cell:AU48:vtf:t:r:ao3:f:1
cell:AV48:f:1
cell:AW48:f:1
cell:AX48:f:1
cell:AY48:f:1
cell:AZ48:f:1
cell:BA48:vtf:t:t:ao4:f:1
cell:BB48:f:1
cell:BC48:f:1
cell:BD48:f:1
cell:BE48:f:1
cell:BF48:f:1
cell:BG48:f:1
cell:BH48:f:1
cell:BI48:vtf:t:t:ao5:f:1
cell:BJ48:f:1
cell:BK48:f:1
cell:BL48:f:1
cell:BM48:f:1
cell:BN48:f:1
cell:BO48:f:1
cell:BP48:f:1
cell:BQ48:f:1
cell:BR48:f:1
cell:BS48:f:1
cell:BT48:f:1
cell:BU48:f:1
cell:BV48:f:1
cell:BW48:f:1
cell:BX48:f:1
cell:BY48:f:1
cell:BZ48:f:1
cell:CA48:f:1
cell:CB48:f:1
cell:CC48:f:1
cell:E49:f:1
cell:F49:f:1
cell:G49:f:1
cell:H49:f:1
cell:I49:f:1
cell:J49:f:1
cell:K49:f:1
cell:L49:f:1
cell:M49:f:1
cell:N49:f:1
cell:O49:f:1
cell:P49:f:1
cell:Q49:f:1
cell:R49:f:1
cell:S49:f:1
cell:T49:f:1
cell:U49:f:1
cell:V49:f:1
cell:W49:f:1
cell:X49:f:1
cell:Y49:f:1
cell:Z49:f:1
cell:AA49:f:1
cell:AB49:vtf:t:s:ap1:f:1
cell:AC49:f:1
cell:AD49:f:1
cell:AE49:f:1
cell:AF49:f:1
cell:AG49:f:1
cell:AH49:f:1
cell:AI49:f:1
cell:AJ49:f:1
cell:AK49:f:1
cell:AL49:f:1
cell:AM49:vtf:t:s:ap2:f:1
cell:AN49:f:1
cell:AO49:f:1
cell:AP49:f:1
cell:AQ49:f:1
cell:AR49:f:1
cell:AS49:f:1
cell:AT49:f:1
cell:AU49:f:1
cell:AV49:vtf:t: :ap3:f:1
cell:AW49:f:1
cell:AX49:f:1
cell:AY49:f:1
cell:AZ49:f:1
cell:BA49:f:1
cell:BB49:vtf:t: :ap4:f:1
cell:BC49:f:1
cell:BD49:f:1
cell:BE49:f:1
cell:BF49:f:1
cell:BG49:f:1
cell:BH49:f:1
cell:BI49:vtf:t: :ap5:f:1
cell:BJ49:f:1
cell:BK49:f:1
cell:BL49:f:1
cell:BM49:f:1
cell:BN49:f:1
cell:BO49:f:1
cell:BP49:f:1
cell:BQ49:f:1
cell:BR49:f:1
cell:BS49:f:1
cell:BT49:f:1
cell:BU49:f:1
cell:BV49:f:1
cell:BW49:f:1
cell:BX49:f:1
cell:BY49:f:1
cell:BZ49:f:1
cell:CA49:f:1
cell:CB49:f:1
cell:CC49:f:1
cell:E50:f:1
cell:F50:f:1
cell:G50:f:1
cell:H50:f:1
cell:I50:f:1
cell:J50:f:1
cell:K50:f:1
cell:L50:f:1
cell:M50:f:1
cell:N50:f:1
cell:O50:f:1
cell:P50:f:1
cell:Q50:f:1
cell:R50:f:1
cell:S50:f:1
cell:T50:f:1
cell:U50:f:1
cell:V50:f:1
cell:W50:f:1
cell:X50:f:1
cell:Y50:f:1
cell:Z50:f:1
cell:AA50:f:1
cell:AB50:f:1
cell:AC50:vtf:t: :aq1:f:1
cell:AD50:f:1
cell:AE50:f:1
cell:AF50:f:1
cell:AG50:f:1
cell:AH50:f:1
cell:AI50:f:1
cell:AJ50:f:1
cell:AK50:f:1
cell:AL50:f:1
cell:AM50:vtf:t: :aq2:f:1
cell:AN50:f:1
cell:AO50:f:1
cell:AP50:f:1
cell:AQ50:f:1
cell:AR50:f:1
cell:AS50:f:1
cell:AT50:f:1
cell:AU50:f:1
cell:AV50:vtf:t:t:aq3:f:1
cell:AW50:f:1
cell:AX50:f:1
cell:AY50:f:1
cell:AZ50:f:1
cell:BA50:f:1
cell:BB50:f:1
cell:BC50:vtf:t:l:aq4:f:1
cell:BD50:f:1
cell:BE50:f:1
cell:BF50:f:1
cell:BG50:f:1
cell:BH50:f:1
cell:BI50:vtf:t:e:aq5:f:1
cell:BJ50:f:1
cell:BK50:f:1
cell:BL50:f:1
cell:BM50:f:1
cell:BN50:f:1
cell:BO50:f:1
cell:BP50:f:1
cell:BQ50:f:1
cell:BR50:f:1
cell:BS50:f:1
cell:BT50:f:1
cell:BU50:f:1
cell:BV50:f:1
cell:BW50:f:1
cell:BX50:f:1
cell:BY50:f:1
cell:BZ50:f:1
cell:CA50:f:1
cell:CB50:f:1
cell:CC50:f:1
cell:E51:f:1
cell:F51:f:1
cell:G51:f:1
cell:H51:f:1
cell:I51:f:1
cell:J51:f:1
cell:K51:f:1
cell:L51:f:1
cell:M51:f:1
cell:N51:f:1
cell:O51:f:1
cell:P51:f:1
cell:Q51:f:1
cell:R51:f:1
cell:S51:f:1
cell:T51:f:1
cell:U51:f:1
cell:V51:f:1
cell:W51:f:1
cell:X51:f:1
cell:Y51:f:1
cell:Z51:f:1
cell:AA51:f:1
cell:AB51:f:1
cell:AC51:f:1
cell:AD51:vtf:t:é:ar1:f:1
cell:AE51:f:1
cell:AF51:f:1
cell:AG51:f:1
cell:AH51:f:1
cell:AI51:f:1
cell:AJ51:f:1
cell:AK51:f:1
cell:AL51:f:1
cell:AM51:f:1
cell:AN51:vtf:t:r:ar2:f:1
cell:AO51:f:1
cell:AP51:f:1
cell:AQ51:f:1
cell:AR51:f:1
cell:AS51:f:1
cell:AT51:f:1
cell:AU51:f:1
cell:AV51:f:1
cell:AW51:vtf:t:o:ar3:f:1
cell:AX51:f:1
cell:AY51:f:1
cell:AZ51:f:1
cell:BA51:f:1
cell:BB51:f:1
cell:BC51:f:1
cell:BD51:vtf:t:e:ar4:f:1
cell:BE51:f:1
cell:BF51:f:1
cell:BG51:f:1
cell:BH51:f:1
cell:BI51:f:1
cell:BJ51:vtf:t:n:ar5:f:1
cell:BK51:f:1
cell:BL51:f:1
cell:BM51:f:1
cell:BN51:f:1
cell:BO51:f:1
cell:BP51:f:1
cell:BQ51:f:1
cell:BR51:f:1
cell:BS51:f:1
cell:BT51:f:1
cell:BU51:f:1
cell:BV51:f:1
cell:BW51:f:1
cell:BX51:f:1
cell:BY51:f:1
cell:BZ51:f:1
cell:CA51:f:1
cell:CB51:f:1
cell:CC51:f:1
cell:E52:f:1
cell:F52:f:1
cell:G52:f:1
cell:H52:f:1
cell:I52:f:1
cell:J52:f:1
cell:K52:f:1
cell:L52:f:1
cell:M52:f:1
cell:N52:f:1
cell:O52:f:1
cell:P52:f:1
cell:Q52:f:1
cell:R52:f:1
cell:S52:f:1
cell:T52:f:1
cell:U52:f:1
cell:V52:f:1
cell:W52:f:1
cell:X52:f:1
cell:Y52:f:1
cell:Z52:f:1
cell:AA52:f:1
cell:AB52:f:1
cell:AC52:f:1
cell:AD52:f:1
cell:AE52:vtf:t:t:as1:f:1
cell:AF52:f:1
cell:AG52:f:1
cell:AH52:f:1
cell:AI52:f:1
cell:AJ52:f:1
cell:AK52:f:1
cell:AL52:f:1
cell:AM52:f:1
cell:AN52:vtf:t:e:as2:f:1
cell:AO52:f:1
cell:AP52:f:1
cell:AQ52:f:1
cell:AR52:f:1
cell:AS52:f:1
cell:AT52:f:1
cell:AU52:f:1
cell:AV52:f:1
cell:AW52:vtf:t:u:as3:f:1
cell:AX52:f:1
cell:AY52:f:1
cell:AZ52:f:1
cell:BA52:f:1
cell:BB52:f:1
cell:BC52:f:1
cell:BD52:f:1
cell:BE52:vtf:t: :as4:f:1
cell:BF52:f:1
cell:BG52:f:1
cell:BH52:f:1
cell:BI52:f:1
cell:BJ52:vtf:t: :as5:f:1
cell:BK52:f:1
cell:BL52:f:1
cell:BM52:f:1
cell:BN52:f:1
cell:BO52:f:1
cell:BP52:f:1
cell:BQ52:f:1
cell:BR52:f:1
cell:BS52:f:1
cell:BT52:f:1
cell:BU52:f:1
cell:BV52:f:1
cell:BW52:f:1
cell:BX52:f:1
cell:BY52:f:1
cell:BZ52:f:1
cell:CA52:f:1
cell:CB52:f:1
cell:CC52:f:1
cell:E53:f:1
cell:F53:f:1
cell:G53:f:1
cell:H53:f:1
cell:I53:f:1
cell:J53:f:1
cell:K53:f:1
cell:L53:f:1
cell:M53:f:1
cell:N53:f:1
cell:O53:f:1
cell:P53:f:1
cell:Q53:f:1
cell:R53:f:1
cell:S53:f:1
cell:T53:f:1
cell:U53:f:1
cell:V53:f:1
cell:W53:f:1
cell:X53:f:1
cell:Y53:f:1
cell:Z53:f:1
cell:AA53:f:1
cell:AB53:f:1
cell:AC53:f:1
cell:AD53:f:1
cell:AE53:f:1
cell:AF53:vtf:t:a:at1:f:1
cell:AG53:f:1
cell:AH53:f:1
cell:AI53:f:1
cell:AJ53:f:1
cell:AK53:f:1
cell:AL53:f:1
cell:AM53:f:1
cell:AN53:f:1
cell:AO53:vtf:t:n:at2:f:1
cell:AP53:f:1
cell:AQ53:f:1
cell:AR53:f:1
cell:AS53:f:1
cell:AT53:f:1
cell:AU53:f:1
cell:AV53:f:1
cell:AW53:f:1
cell:AX53:vtf:t:t:at3:f:1
cell:AY53:f:1
cell:AZ53:f:1
cell:BA53:f:1
cell:BB53:f:1
cell:BC53:f:1
cell:BD53:f:1
cell:BE53:f:1
cell:BF53:vtf:t:d:at4:f:1
cell:BG53:f:1
cell:BH53:f:1
cell:BI53:f:1
cell:BJ53:f:1
cell:BK53:vtf:t:h:at5:f:1
cell:BL53:f:1
cell:BM53:f:1
cell:BN53:f:1
cell:BO53:f:1
cell:BP53:f:1
cell:BQ53:f:1
cell:BR53:f:1
cell:BS53:f:1
cell:BT53:f:1
cell:BU53:f:1
cell:BV53:f:1
cell:BW53:f:1
cell:BX53:f:1
cell:BY53:f:1
cell:BZ53:f:1
cell:CA53:f:1
cell:CB53:f:1
cell:CC53:f:1
cell:E54:f:1
cell:F54:f:1
cell:G54:f:1
cell:H54:f:1
cell:I54:f:1
cell:J54:f:1
cell:K54:f:1
cell:L54:f:1
cell:M54:f:1
cell:N54:f:1
cell:O54:f:1
cell:P54:f:1
cell:Q54:f:1
cell:R54:f:1
cell:S54:f:1
cell:T54:f:1
cell:U54:f:1
cell:V54:f:1
cell:W54:f:1
cell:X54:f:1
cell:Y54:f:1
cell:Z54:f:1
cell:AA54:f:1
cell:AB54:f:1
cell:AC54:f:1
cell:AD54:f:1
cell:AE54:f:1
cell:AF54:vtf:t:i:au1:f:1
cell:AG54:f:1
cell:AH54:f:1
cell:AI54:f:1
cell:AJ54:f:1
cell:AK54:f:1
cell:AL54:f:1
cell:AM54:f:1
cell:AN54:f:1
cell:AO54:f:1
cell:AP54:vtf:t:c:au2:f:1
cell:AQ54:f:1
cell:AR54:f:1
cell:AS54:f:1
cell:AT54:f:1
cell:AU54:f:1
cell:AV54:f:1
cell:AW54:f:1
cell:AX54:vtf:t: :au3:f:1
cell:AY54:f:1
cell:AZ54:f:1
cell:BA54:f:1
cell:BB54:f:1
cell:BC54:f:1
cell:BD54:f:1
cell:BE54:f:1
cell:BF54:vtf:t:é:au4:f:1
cell:BG54:f:1
cell:BH54:f:1
cell:BI54:f:1
cell:BJ54:f:1
cell:BK54:vtf:t:a:au5:f:1
cell:BL54:f:1
cell:BM54:f:1
cell:BN54:f:1
cell:BO54:f:1
cell:BP54:f:1
cell:BQ54:f:1
cell:BR54:f:1
cell:BS54:f:1
cell:BT54:f:1
cell:BU54:f:1
cell:BV54:f:1
cell:BW54:f:1
cell:BX54:f:1
cell:BY54:f:1
cell:BZ54:f:1
cell:CA54:f:1
cell:CB54:f:1
cell:CC54:f:1
cell:E55:f:1
cell:F55:f:1
cell:G55:f:1
cell:H55:f:1
cell:I55:f:1
cell:J55:f:1
cell:K55:f:1
cell:L55:f:1
cell:M55:f:1
cell:N55:f:1
cell:O55:f:1
cell:P55:f:1
cell:Q55:f:1
cell:R55:f:1
cell:S55:f:1
cell:T55:f:1
cell:U55:f:1
cell:V55:f:1
cell:W55:f:1
cell:X55:f:1
cell:Y55:f:1
cell:Z55:f:1
cell:AA55:f:1
cell:AB55:f:1
cell:AC55:f:1
cell:AD55:f:1
cell:AE55:f:1
cell:AF55:f:1
cell:AG55:vtf:t:e:av1:f:1
cell:AH55:f:1
cell:AI55:f:1
cell:AJ55:f:1
cell:AK55:f:1
cell:AL55:f:1
cell:AM55:f:1
cell:AN55:f:1
cell:AO55:f:1
cell:AP55:vtf:t:o:av2:f:1
cell:AQ55:f:1
cell:AR55:f:1
cell:AS55:f:1
cell:AT55:f:1
cell:AU55:f:1
cell:AV55:f:1
cell:AW55:f:1
cell:AX55:f:1
cell:AY55:vtf:t:u:av3:f:1
cell:AZ55:f:1
cell:BA55:f:1
cell:BB55:f:1
cell:BC55:f:1
cell:BD55:f:1
cell:BE55:f:1
cell:BF55:f:1
cell:BG55:vtf:t:d:av4:f:1
cell:BH55:f:1
cell:BI55:f:1
cell:BJ55:f:1
cell:BK55:f:1
cell:BL55:vtf:t:u:av5:f:1
cell:BM55:f:1
cell:BN55:f:1
cell:BO55:f:1
cell:BP55:f:1
cell:BQ55:f:1
cell:BR55:f:1
cell:BS55:f:1
cell:BT55:f:1
cell:BU55:f:1
cell:BV55:f:1
cell:BW55:f:1
cell:BX55:f:1
cell:BY55:f:1
cell:BZ55:f:1
cell:CA55:f:1
cell:CB55:f:1
cell:CC55:f:1
cell:E56:f:1
cell:F56:f:1
cell:G56:f:1
cell:H56:f:1
cell:I56:f:1
cell:J56:f:1
cell:K56:f:1
cell:L56:f:1
cell:M56:f:1
cell:N56:f:1
cell:O56:f:1
cell:P56:f:1
cell:Q56:f:1
cell:R56:f:1
cell:S56:f:1
cell:T56:f:1
cell:U56:f:1
cell:V56:f:1
cell:W56:f:1
cell:X56:f:1
cell:Y56:f:1
cell:Z56:f:1
cell:AA56:f:1
cell:AB56:f:1
cell:AC56:f:1
cell:AD56:f:1
cell:AE56:f:1
cell:AF56:f:1
cell:AG56:vtf:t:n:aw1:f:1
cell:AH56:f:1
cell:AI56:f:1
cell:AJ56:f:1
cell:AK56:f:1
cell:AL56:f:1
cell:AM56:f:1
cell:AN56:f:1
cell:AO56:f:1
cell:AP56:f:1
cell:AQ56:vtf:t:n:aw2:f:1
cell:AR56:f:1
cell:AS56:f:1
cell:AT56:f:1
cell:AU56:f:1
cell:AV56:f:1
cell:AW56:f:1
cell:AX56:f:1
cell:AY56:vtf:t:n:aw3:f:1
cell:AZ56:f:1
cell:BA56:f:1
cell:BB56:f:1
cell:BC56:f:1
cell:BD56:f:1
cell:BE56:f:1
cell:BF56:f:1
cell:BG56:vtf:t:a:aw4:f:1
cell:BH56:f:1
cell:BI56:f:1
cell:BJ56:f:1
cell:BK56:f:1
cell:BL56:vtf:t:t:aw5:f:1
cell:BM56:f:1
cell:BN56:f:1
cell:BO56:f:1
cell:BP56:f:1
cell:BQ56:f:1
cell:BR56:f:1
cell:BS56:f:1
cell:BT56:f:1
cell:BU56:f:1
cell:BV56:f:1
cell:BW56:f:1
cell:BX56:f:1
cell:BY56:f:1
cell:BZ56:f:1
cell:CA56:f:1
cell:CB56:f:1
cell:CC56:f:1
cell:E57:f:1
cell:F57:f:1
cell:G57:f:1
cell:H57:f:1
cell:I57:f:1
cell:J57:f:1
cell:K57:f:1
cell:L57:f:1
cell:M57:f:1
cell:N57:f:1
cell:O57:f:1
cell:P57:f:1
cell:Q57:f:1
cell:R57:f:1
cell:S57:f:1
cell:T57:f:1
cell:U57:f:1
cell:V57:f:1
cell:W57:f:1
cell:X57:f:1
cell:Y57:f:1
cell:Z57:f:1
cell:AA57:f:1
cell:AB57:f:1
cell:AC57:f:1
cell:AD57:f:1
cell:AE57:f:1
cell:AF57:f:1
cell:AG57:f:1
cell:AH57:vtf:t:t:ax1:f:1
cell:AI57:f:1
cell:AJ57:f:1
cell:AK57:f:1
cell:AL57:f:1
cell:AM57:f:1
cell:AN57:f:1
cell:AO57:f:1
cell:AP57:f:1
cell:AQ57:f:1
cell:AR57:vtf:t:t:ax2:f:1
cell:AS57:f:1
cell:AT57:f:1
cell:AU57:f:1
cell:AV57:f:1
cell:AW57:f:1
cell:AX57:f:1
cell:AY57:f:1
cell:AZ57:vtf:t: :ax3:f:1
cell:BA57:f:1
cell:BB57:f:1
cell:BC57:f:1
cell:BD57:f:1
cell:BE57:f:1
cell:BF57:f:1
cell:BG57:f:1
cell:BH57:vtf:t:i:ax4:f:1
cell:BI57:f:1
cell:BJ57:f:1
cell:BK57:f:1
cell:BL57:vtf:t: :ax5:f:1
cell:BM57:f:1
cell:BN57:f:1
cell:BO57:f:1
cell:BP57:f:1
cell:BQ57:f:1
cell:BR57:f:1
cell:BS57:f:1
cell:BT57:f:1
cell:BU57:f:1
cell:BV57:f:1
cell:BW57:f:1
cell:BX57:f:1
cell:BY57:f:1
cell:BZ57:f:1
cell:CA57:f:1
cell:CB57:f:1
cell:CC57:f:1
cell:E58:f:1
cell:F58:f:1
cell:G58:f:1
cell:H58:f:1
cell:I58:f:1
cell:J58:f:1
cell:K58:f:1
cell:L58:f:1
cell:M58:f:1
cell:N58:f:1
cell:O58:f:1
cell:P58:f:1
cell:Q58:f:1
cell:R58:f:1
cell:S58:f:1
cell:T58:f:1
cell:U58:f:1
cell:V58:f:1
cell:W58:f:1
cell:X58:f:1
cell:Y58:f:1
cell:Z58:f:1
cell:AA58:f:1
cell:AB58:f:1
cell:AC58:f:1
cell:AD58:f:1
cell:AE58:f:1
cell:AF58:f:1
cell:AG58:f:1
cell:AH58:vtf:t: :ay1:f:1
cell:AI58:f:1
cell:AJ58:f:1
cell:AK58:f:1
cell:AL58:f:1
cell:AM58:f:1
cell:AN58:f:1
cell:AO58:f:1
cell:AP58:f:1
cell:AQ58:f:1
cell:AR58:f:1
cell:AS58:vtf:t:r:ay2:f:1
cell:AT58:f:1
cell:AU58:f:1
cell:AV58:f:1
cell:AW58:f:1
cell:AX58:f:1
cell:AY58:f:1
cell:AZ58:vtf:t:u:ay3:f:1
cell:BA58:f:1
cell:BB58:f:1
cell:BC58:f:1
cell:BD58:f:1
cell:BE58:f:1
cell:BF58:f:1
cell:BG58:f:1
cell:BH58:vtf:t:n:ay4:f:1
cell:BI58:f:1
cell:BJ58:f:1
cell:BK58:f:1
cell:BL58:f:1
cell:BM58:vtf:t:e:ay5:f:1
cell:BN58:f:1
cell:BO58:f:1
cell:BP58:f:1
cell:BQ58:f:1
cell:BR58:f:1
cell:BS58:f:1
cell:BT58:f:1
cell:BU58:f:1
cell:BV58:f:1
cell:BW58:f:1
cell:BX58:f:1
cell:BY58:f:1
cell:BZ58:f:1
cell:CA58:f:1
cell:CB58:f:1
cell:CC58:f:1
cell:E59:f:1
cell:F59:f:1
cell:G59:f:1
cell:H59:f:1
cell:I59:f:1
cell:J59:f:1
cell:K59:f:1
cell:L59:f:1
cell:M59:f:1
cell:N59:f:1
cell:O59:f:1
cell:P59:f:1
cell:Q59:f:1
cell:R59:f:1
cell:S59:f:1
cell:T59:f:1
cell:U59:f:1
cell:V59:f:1
cell:W59:f:1
cell:X59:f:1
cell:Y59:f:1
cell:Z59:f:1
cell:AA59:f:1
cell:AB59:f:1
cell:AC59:f:1
cell:AD59:f:1
cell:AE59:f:1
cell:AF59:f:1
cell:AG59:f:1
cell:AH59:f:1
cell:AI59:vtf:t:m:az1:f:1
cell:AJ59:f:1
cell:AK59:f:1
cell:AL59:f:1
cell:AM59:f:1
cell:AN59:f:1
cell:AO59:f:1
cell:AP59:f:1
cell:AQ59:f:1
cell:AR59:f:1
cell:AS59:f:1
cell:AT59:vtf:t:e:az2:f:1
cell:AU59:f:1
cell:AV59:f:1
cell:AW59:f:1
cell:AX59:f:1
cell:AY59:f:1
cell:AZ59:f:1
cell:BA59:vtf:t:n:az3:f:1
cell:BB59:f:1
cell:BC59:f:1
cell:BD59:f:1
cell:BE59:f:1
cell:BF59:f:1
cell:BG59:f:1
cell:BH59:f:1
cell:BI59:vtf:t: :az4:f:1
cell:BJ59:f:1
cell:BK59:f:1
cell:BL59:f:1
cell:BM59:f:1
cell:BN59:vtf:t:t:az5:f:1
cell:BO59:f:1
cell:BP59:f:1
cell:BQ59:f:1
cell:BR59:f:1
cell:BS59:f:1
cell:BT59:f:1
cell:BU59:f:1
cell:BV59:f:1
cell:BW59:f:1
cell:BX59:f:1
cell:BY59:f:1
cell:BZ59:f:1
cell:CA59:f:1
cell:CB59:f:1
cell:CC59:f:1
cell:E60:f:1
cell:F60:f:1
cell:G60:f:1
cell:H60:f:1
cell:I60:f:1
cell:J60:f:1
cell:K60:f:1
cell:L60:f:1
cell:M60:f:1
cell:N60:f:1
cell:O60:f:1
cell:P60:f:1
cell:Q60:f:1
cell:R60:f:1
cell:S60:f:1
cell:T60:f:1
cell:U60:f:1
cell:V60:f:1
cell:W60:f:1
cell:X60:f:1
cell:Y60:f:1
cell:Z60:f:1
cell:AA60:f:1
cell:AB60:f:1
cell:AC60:f:1
cell:AD60:f:1
cell:AE60:f:1
cell:AF60:f:1
cell:AG60:f:1
cell:AH60:f:1
cell:AI60:f:1
cell:AJ60:vtf:t:o:ba1:f:1
cell:AK60:f:1
cell:AL60:f:1
cell:AM60:f:1
cell:AN60:f:1
cell:AO60:f:1
cell:AP60:f:1
cell:AQ60:f:1
cell:AR60:f:1
cell:AS60:f:1
cell:AT60:f:1
cell:AU60:vtf:t:s:ba2:f:1
cell:AV60:f:1
cell:AW60:f:1
cell:AX60:f:1
cell:AY60:f:1
cell:AZ60:f:1
cell:BA60:vtf:t:i:ba3:f:1
cell:BB60:f:1
cell:BC60:f:1
cell:BD60:f:1
cell:BE60:f:1
cell:BF60:f:1
cell:BG60:f:1
cell:BH60:f:1
cell:BI60:f:1
cell:BJ60:vtf:t:p:ba4:f:1
cell:BK60:f:1
cell:BL60:f:1
cell:BM60:f:1
cell:BN60:f:1
cell:BO60:vtf:t: :ba5:f:1
cell:BP60:f:1
cell:BQ60:f:1
cell:BR60:f:1
cell:BS60:f:1
cell:BT60:f:1
cell:BU60:f:1
cell:BV60:f:1
cell:BW60:f:1
cell:BX60:f:1
cell:BY60:f:1
cell:BZ60:f:1
cell:CA60:f:1
cell:CB60:f:1
cell:CC60:f:1
cell:E61:f:1
cell:F61:f:1
cell:G61:f:1
cell:H61:f:1
cell:I61:f:1
cell:J61:f:1
cell:K61:f:1
cell:L61:f:1
cell:M61:f:1
cell:N61:f:1
cell:O61:f:1
cell:P61:f:1
cell:Q61:f:1
cell:R61:f:1
cell:S61:f:1
cell:T61:f:1
cell:U61:f:1
cell:V61:f:1
cell:W61:f:1
cell:X61:f:1
cell:Y61:f:1
cell:Z61:f:1
cell:AA61:f:1
cell:AB61:f:1
cell:AC61:f:1
cell:AD61:f:1
cell:AE61:f:1
cell:AF61:f:1
cell:AG61:f:1
cell:AH61:f:1
cell:AI61:f:1
cell:AJ61:f:1
cell:AK61:vtf:t:r:bb1:f:1
cell:AL61:f:1
cell:AM61:f:1
cell:AN61:f:1
cell:AO61:f:1
cell:AP61:f:1
cell:AQ61:f:1
cell:AR61:f:1
cell:AS61:f:1
cell:AT61:f:1
cell:AU61:vtf:t: :bb2:f:1
cell:AV61:f:1
cell:AW61:f:1
cell:AX61:f:1
cell:AY61:f:1
cell:AZ61:f:1
cell:BA61:f:1
cell:BB61:vtf:t:v:bb3:f:1
cell:BC61:f:1
cell:BD61:f:1
cell:BE61:f:1
cell:BF61:f:1
cell:BG61:f:1
cell:BH61:f:1
cell:BI61:f:1
cell:BJ61:vtf:t:l:bb4:f:1
cell:BK61:f:1
cell:BL61:f:1
cell:BM61:f:1
cell:BN61:f:1
cell:BO61:vtf:t:e:bb5:f:1
cell:BP61:f:1
cell:BQ61:f:1
cell:BR61:f:1
cell:BS61:f:1
cell:BT61:f:1
cell:BU61:f:1
cell:BV61:f:1
cell:BW61:f:1
cell:BX61:f:1
cell:BY61:f:1
cell:BZ61:f:1
cell:CA61:f:1
cell:CB61:f:1
cell:CC61:f:1
cell:E62:f:1
cell:F62:f:1
cell:G62:f:1
cell:H62:f:1
cell:I62:f:1
cell:J62:f:1
cell:K62:f:1
cell:L62:f:1
cell:M62:f:1
cell:N62:f:1
cell:O62:f:1
cell:P62:f:1
cell:Q62:f:1
cell:R62:f:1
cell:S62:f:1
cell:T62:f:1
cell:U62:f:1
cell:V62:f:1
cell:W62:f:1
cell:X62:f:1
cell:Y62:f:1
cell:Z62:f:1
cell:AA62:f:1
cell:AB62:f:1
cell:AC62:f:1
cell:AD62:f:1
cell:AE62:f:1
cell:AF62:f:1
cell:AG62:f:1
cell:AH62:f:1
cell:AI62:f:1
cell:AJ62:f:1
cell:AK62:vtf:t:t:bc1:f:1
cell:AL62:f:1
cell:AM62:f:1
cell:AN62:f:1
cell:AO62:f:1
cell:AP62:f:1
cell:AQ62:f:1
cell:AR62:f:1
cell:AS62:f:1
cell:AT62:f:1
cell:AU62:f:1
cell:AV62:vtf:t:d:bc2:f:1
cell:AW62:f:1
cell:AX62:f:1
cell:AY62:f:1
cell:AZ62:f:1
cell:BA62:f:1
cell:BB62:f:1
cell:BC62:vtf:t:e:bc3:f:1
cell:BD62:f:1
cell:BE62:f:1
cell:BF62:f:1
cell:BG62:f:1
cell:BH62:f:1
cell:BI62:f:1
cell:BJ62:f:1
cell:BK62:vtf:t:e:bc4:f:1
cell:BL62:f:1
cell:BM62:f:1
cell:BN62:f:1
cell:BO62:f:1
cell:BP62:vtf:t:n:bc5:f:1
cell:BQ62:f:1
cell:BR62:f:1
cell:BS62:f:1
cell:BT62:f:1
cell:BU62:f:1
cell:BV62:f:1
cell:BW62:f:1
cell:BX62:f:1
cell:BY62:f:1
cell:BZ62:f:1
cell:CA62:f:1
cell:CB62:f:1
cell:CC62:f:1
cell:E63:f:1
cell:F63:f:1
cell:G63:f:1
cell:H63:f:1
cell:I63:f:1
cell:J63:f:1
cell:K63:f:1
cell:L63:f:1
cell:M63:f:1
cell:N63:f:1
cell:O63:f:1
cell:P63:f:1
cell:Q63:f:1
cell:R63:f:1
cell:S63:f:1
cell:T63:f:1
cell:U63:f:1
cell:V63:f:1
cell:W63:f:1
cell:X63:f:1
cell:Y63:f:1
cell:Z63:f:1
cell:AA63:f:1
cell:AB63:f:1
cell:AC63:f:1
cell:AD63:f:1
cell:AE63:f:1
cell:AF63:f:1
cell:AG63:f:1
cell:AH63:f:1
cell:AI63:f:1
cell:AJ63:f:1
cell:AK63:f:1
cell:AL63:vtf:t:e:bd1:f:1
cell:AM63:f:1
cell:AN63:f:1
cell:AO63:f:1
cell:AP63:f:1
cell:AQ63:f:1
cell:AR63:f:1
cell:AS63:f:1
cell:AT63:f:1
cell:AU63:f:1
cell:AV63:f:1
cell:AW63:vtf:t:e:bd2:f:1
cell:AX63:f:1
cell:AY63:f:1
cell:AZ63:f:1
cell:BA63:f:1
cell:BB63:f:1
cell:BC63:f:1
cell:BD63:vtf:t:r:bd3:f:1
cell:BE63:f:1
cell:BF63:f:1
cell:BG63:f:1
cell:BH63:f:1
cell:BI63:f:1
cell:BJ63:f:1
cell:BK63:f:1
cell:BL63:vtf:t:u:bd4:f:1
cell:BM63:f:1
cell:BN63:f:1
cell:BO63:f:1
cell:BP63:f:1
cell:BQ63:vtf:t: :bd5:f:1
cell:BR63:f:1
cell:BS63:f:1
cell:BT63:f:1
cell:BU63:f:1
cell:BV63:f:1
cell:BW63:f:1
cell:BX63:f:1
cell:BY63:f:1
cell:BZ63:f:1
cell:CA63:f:1
cell:CB63:f:1
cell:CC63:f:1
cell:E64:f:1
cell:F64:f:1
cell:G64:f:1
cell:H64:f:1
cell:I64:f:1
cell:J64:f:1
cell:K64:f:1
cell:L64:f:1
cell:M64:f:1
cell:N64:f:1
cell:O64:f:1
cell:P64:f:1
cell:Q64:f:1
cell:R64:f:1
cell:S64:f:1
cell:T64:f:1
cell:U64:f:1
cell:V64:f:1
cell:W64:f:1
cell:X64:f:1
cell:Y64:f:1
cell:Z64:f:1
cell:AA64:f:1
cell:AB64:f:1
cell:AC64:f:1
cell:AD64:f:1
cell:AE64:f:1
cell:AF64:f:1
cell:AG64:f:1
cell:AH64:f:1
cell:AI64:f:1
cell:AJ64:f:1
cell:AK64:f:1
cell:AL64:f:1
cell:AM64:vtf:t:s:be1:f:1
cell:AN64:f:1
cell:AO64:f:1
cell:AP64:f:1
cell:AQ64:f:1
cell:AR64:f:1
cell:AS64:f:1
cell:AT64:f:1
cell:AU64:f:1
cell:AV64:f:1
cell:AW64:f:1
cell:AX64:vtf:t: :be2:f:1
cell:AY64:f:1
cell:AZ64:f:1
cell:BA64:f:1
cell:BB64:f:1
cell:BC64:f:1
cell:BD64:f:1
cell:BE64:vtf:t:s:be3:f:1
cell:BF64:f:1
cell:BG64:f:1
cell:BH64:f:1
cell:BI64:f:1
cell:BJ64:f:1
cell:BK64:f:1
cell:BL64:f:1
cell:BM64:vtf:t:r:be4:f:1
cell:BN64:f:1
cell:BO64:f:1
cell:BP64:f:1
cell:BQ64:vtf:t:b:be5:f:1
cell:BR64:f:1
cell:BS64:f:1
cell:BT64:f:1
cell:BU64:f:1
cell:BV64:f:1
cell:BW64:f:1
cell:BX64:f:1
cell:BY64:f:1
cell:BZ64:f:1
cell:CA64:f:1
cell:CB64:f:1
cell:CC64:f:1
cell:E65:f:1
cell:F65:f:1
cell:G65:f:1
cell:H65:f:1
cell:I65:f:1
cell:J65:f:1
cell:K65:f:1
cell:L65:f:1
cell:M65:f:1
cell:N65:f:1
cell:O65:f:1
cell:P65:f:1
cell:Q65:f:1
cell:R65:f:1
cell:S65:f:1
cell:T65:f:1
cell:U65:f:1
cell:V65:f:1
cell:W65:f:1
cell:X65:f:1
cell:Y65:f:1
cell:Z65:f:1
cell:AA65:f:1
cell:AB65:f:1
cell:AC65:f:1
cell:AD65:f:1
cell:AE65:f:1
cell:AF65:f:1
cell:AG65:f:1
cell:AH65:f:1
cell:AI65:f:1
cell:AJ65:f:1
cell:AK65:f:1
cell:AL65:f:1
cell:AM65:vtf:t: :bf1:f:1
cell:AN65:f:1
cell:AO65:f:1
cell:AP65:f:1
cell:AQ65:f:1
cell:AR65:f:1
cell:AS65:f:1
cell:AT65:f:1
cell:AU65:f:1
cell:AV65:f:1
cell:AW65:f:1
cell:AX65:vtf:t:m:bf2:f:1
cell:AY65:f:1
cell:AZ65:f:1
cell:BA65:f:1
cell:BB65:f:1
cell:BC65:f:1
cell:BD65:f:1
cell:BE65:vtf:t: :bf3:f:1
cell:BF65:f:1
cell:BG65:f:1
cell:BH65:f:1
cell:BI65:f:1
cell:BJ65:f:1
cell:BK65:f:1
cell:BL65:f:1
cell:BM65:vtf:t:e:bf4:f:1
cell:BN65:f:1
cell:BO65:f:1
cell:BP65:f:1
cell:BQ65:f:1
cell:BR65:vtf:t:a:bf5:f:1
cell:BS65:f:1
cell:BT65:f:1
cell:BU65:f:1
cell:BV65:f:1
cell:BW65:f:1
cell:BX65:f:1
cell:BY65:f:1
cell:BZ65:f:1
cell:CA65:f:1
cell:CB65:f:1
cell:CC65:f:1
cell:E66:f:1
cell:F66:f:1
cell:G66:f:1
cell:H66:f:1
cell:I66:f:1
cell:J66:f:1
cell:K66:f:1
cell:L66:f:1
cell:M66:f:1
cell:N66:f:1
cell:O66:f:1
cell:P66:f:1
cell:Q66:f:1
cell:R66:f:1
cell:S66:f:1
cell:T66:f:1
cell:U66:f:1
cell:V66:f:1
cell:W66:f:1
cell:X66:f:1
cell:Y66:f:1
cell:Z66:f:1
cell:AA66:f:1
cell:AB66:f:1
cell:AC66:f:1
cell:AD66:f:1
cell:AE66:f:1
cell:AF66:f:1
cell:AG66:f:1
cell:AH66:f:1
cell:AI66:f:1
cell:AJ66:f:1
cell:AK66:f:1
cell:AL66:f:1
cell:AM66:f:1
cell:AN66:vtf:t:m:bg1:f:1
cell:AO66:f:1
cell:AP66:f:1
cell:AQ66:f:1
cell:AR66:f:1
cell:AS66:f:1
cell:AT66:f:1
cell:AU66:f:1
cell:AV66:f:1
cell:AW66:f:1
cell:AX66:f:1
cell:AY66:vtf:t:a:bg2:f:1
cell:AZ66:f:1
cell:BA66:f:1
cell:BB66:f:1
cell:BC66:f:1
cell:BD66:f:1
cell:BE66:f:1
cell:BF66:vtf:t:d:bg3:f:1
cell:BG66:f:1
cell:BH66:f:1
cell:BI66:f:1
cell:BJ66:f:1
cell:BK66:f:1
cell:BL66:f:1
cell:BM66:f:1
cell:BN66:vtf:t:n:bg4:f:1
cell:BO66:f:1
cell:BP66:f:1
cell:BQ66:f:1
cell:BR66:f:1
cell:BS66:vtf:t:s:bg5:f:1
cell:BT66:f:1
cell:BU66:f:1
cell:BV66:f:1
cell:BW66:f:1
cell:BX66:f:1
cell:BY66:f:1
cell:BZ66:f:1
cell:CA66:f:1
cell:CB66:f:1
cell:CC66:f:1
cell:E67:f:1
cell:F67:f:1
cell:G67:f:1
cell:H67:f:1
cell:I67:f:1
cell:J67:f:1
cell:K67:f:1
cell:L67:f:1
cell:M67:f:1
cell:N67:f:1
cell:O67:f:1
cell:P67:f:1
cell:Q67:f:1
cell:R67:f:1
cell:S67:f:1
cell:T67:f:1
cell:U67:f:1
cell:V67:f:1
cell:W67:f:1
cell:X67:f:1
cell:Y67:f:1
cell:Z67:f:1
cell:AA67:f:1
cell:AB67:f:1
cell:AC67:f:1
cell:AD67:f:1
cell:AE67:f:1
cell:AF67:f:1
cell:AG67:f:1
cell:AH67:f:1
cell:AI67:f:1
cell:AJ67:f:1
cell:AK67:f:1
cell:AL67:f:1
cell:AM67:f:1
cell:AN67:vtf:t:ê:bh1:f:1
cell:AO67:f:1
cell:AP67:f:1
cell:AQ67:f:1
cell:AR67:f:1
cell:AS67:f:1
cell:AT67:f:1
cell:AU67:f:1
cell:AV67:f:1
cell:AW67:f:1
cell:AX67:f:1
cell:AY67:f:1
cell:AZ67:vtf:t: :bh2:f:1
cell:BA67:f:1
cell:BB67:f:1
cell:BC67:f:1
cell:BD67:f:1
cell:BE67:f:1
cell:BF67:f:1
cell:BG67:vtf:t:e:bh3:f:1
cell:BH67:f:1
cell:BI67:f:1
cell:BJ67:f:1
cell:BK67:f:1
cell:BL67:f:1
cell:BM67:f:1
cell:BN67:f:1
cell:BO67:vtf:t:t:bh4:f:1
cell:BP67:f:1
cell:BQ67:f:1
cell:BR67:f:1
cell:BS67:f:1
cell:BT67:f:1
cell:BU67:f:1
cell:BV67:f:1
cell:BW67:f:1
cell:BX67:f:1
cell:BY67:f:1
cell:BZ67:f:1
cell:CA67:f:1
cell:CB67:f:1
cell:CC67:f:1
cell:E68:f:1
cell:F68:f:1
cell:G68:f:1
cell:H68:f:1
cell:I68:f:1
cell:J68:f:1
cell:K68:f:1
cell:L68:f:1
cell:M68:f:1
cell:N68:f:1
cell:O68:f:1
cell:P68:f:1
cell:Q68:f:1
cell:R68:f:1
cell:S68:f:1
cell:T68:f:1
cell:U68:f:1
cell:V68:f:1
cell:W68:f:1
cell:X68:f:1
cell:Y68:f:1
cell:Z68:f:1
cell:AA68:f:1
cell:AB68:f:1
cell:AC68:f:1
cell:AD68:f:1
cell:AE68:f:1
cell:AF68:f:1
cell:AG68:f:1
cell:AH68:f:1
cell:AI68:f:1
cell:AJ68:f:1
cell:AK68:f:1
cell:AL68:f:1
cell:AM68:f:1
cell:AN68:f:1
cell:AO68:vtf:t:m:bi1:f:1
cell:AP68:f:1
cell:AQ68:f:1
cell:AR68:f:1
cell:AS68:f:1
cell:AT68:f:1
cell:AU68:f:1
cell:AV68:f:1
cell:AW68:f:1
cell:AX68:f:1
cell:AY68:f:1
cell:AZ68:f:1
cell:BA68:vtf:t:v:bi2:f:1
cell:BB68:f:1
cell:BC68:f:1
cell:BD68:f:1
cell:BE68:f:1
cell:BF68:f:1
cell:BG68:f:1
cell:BH68:vtf:t: :bi3:f:1
cell:BI68:f:1
cell:BJ68:f:1
cell:BK68:f:1
cell:BL68:f:1
cell:BM68:f:1
cell:BN68:f:1
cell:BO68:vtf:t: :bi4:f:1
cell:BP68:f:1
cell:BQ68:f:1
cell:BR68:f:1
cell:BS68:f:1
cell:BT68:f:1
cell:BU68:f:1
cell:BV68:f:1
cell:BW68:f:1
cell:BX68:f:1
cell:BY68:f:1
cell:BZ68:f:1
cell:CA68:f:1
cell:CB68:f:1
cell:CC68:f:1
cell:E69:f:1
cell:F69:f:1
cell:G69:f:1
cell:H69:f:1
cell:I69:f:1
cell:J69:f:1
cell:K69:f:1
cell:L69:f:1
cell:M69:f:1
cell:N69:f:1
cell:O69:f:1
cell:P69:f:1
cell:Q69:f:1
cell:R69:f:1
cell:S69:f:1
cell:T69:f:1
cell:U69:f:1
cell:V69:f:1
cell:W69:f:1
cell:X69:f:1
cell:Y69:f:1
cell:Z69:f:1
cell:AA69:f:1
cell:AB69:f:1
cell:AC69:f:1
cell:AD69:f:1
cell:AE69:f:1
cell:AF69:f:1
cell:AG69:f:1
cell:AH69:f:1
cell:AI69:f:1
cell:AJ69:f:1
cell:AK69:f:1
cell:AL69:f:1
cell:AM69:f:1
cell:AN69:f:1
cell:AO69:vtf:t:e:bj1:f:1
cell:AP69:f:1
cell:AQ69:f:1
cell:AR69:f:1
cell:AS69:f:1
cell:AT69:f:1
cell:AU69:f:1
cell:AV69:f:1
cell:AW69:f:1
cell:AX69:f:1
cell:AY69:f:1
cell:AZ69:f:1
cell:BA69:f:1
cell:BB69:vtf:t:i:bj2:f:1
cell:BC69:f:1
cell:BD69:f:1
cell:BE69:f:1
cell:BF69:f:1
cell:BG69:f:1
cell:BH69:vtf:t:v:bj3:f:1
cell:BI69:f:1
cell:BJ69:f:1
cell:BK69:f:1
cell:BL69:f:1
cell:BM69:f:1
cell:BN69:f:1
cell:BO69:f:1
cell:BP69:vtf:t:u:bj4:f:1
cell:BQ69:f:1
cell:BR69:f:1
cell:BS69:f:1
cell:BT69:f:1
cell:BU69:f:1
cell:BV69:f:1
cell:BW69:f:1
cell:BX69:f:1
cell:BY69:f:1
cell:BZ69:f:1
cell:CA69:f:1
cell:CB69:f:1
cell:CC69:f:1
cell:E70:f:1
cell:F70:f:1
cell:G70:f:1
cell:H70:f:1
cell:I70:f:1
cell:J70:f:1
cell:K70:f:1
cell:L70:f:1
cell:M70:f:1
cell:N70:f:1
cell:O70:f:1
cell:P70:f:1
cell:Q70:f:1
cell:R70:f:1
cell:S70:f:1
cell:T70:f:1
cell:U70:f:1
cell:V70:f:1
cell:W70:f:1
cell:X70:f:1
cell:Y70:f:1
cell:Z70:f:1
cell:AA70:f:1
cell:AB70:f:1
cell:AC70:f:1
cell:AD70:f:1
cell:AE70:f:1
cell:AF70:f:1
cell:AG70:f:1
cell:AH70:f:1
cell:AI70:f:1
cell:AJ70:f:1
cell:AK70:f:1
cell:AL70:f:1
cell:AM70:f:1
cell:AN70:f:1
cell:AO70:f:1
cell:AP70:vtf:t: :bk1:f:1
cell:AQ70:f:1
cell:AR70:f:1
cell:AS70:f:1
cell:AT70:f:1
cell:AU70:f:1
cell:AV70:f:1
cell:AW70:f:1
cell:AX70:f:1
cell:AY70:f:1
cell:AZ70:f:1
cell:BA70:f:1
cell:BB70:vtf:t:e:bk2:f:1
cell:BC70:f:1
cell:BD70:f:1
cell:BE70:f:1
cell:BF70:f:1
cell:BG70:f:1
cell:BH70:f:1
cell:BI70:vtf:t:i:bk3:f:1
cell:BJ70:f:1
cell:BK70:f:1
cell:BL70:f:1
cell:BM70:f:1
cell:BN70:f:1
cell:BO70:f:1
cell:BP70:f:1
cell:BQ70:vtf:t:n:bk4:f:1
cell:BR70:f:1
cell:BS70:f:1
cell:BT70:f:1
cell:BU70:f:1
cell:BV70:f:1
cell:BW70:f:1
cell:BX70:f:1
cell:BY70:f:1
cell:BZ70:f:1
cell:CA70:f:1
cell:CB70:f:1
cell:CC70:f:1
cell:E71:f:1
cell:F71:f:1
cell:G71:f:1
cell:H71:f:1
cell:I71:f:1
cell:J71:f:1
cell:K71:f:1
cell:L71:f:1
cell:M71:f:1
cell:N71:f:1
cell:O71:f:1
cell:P71:f:1
cell:Q71:f:1
cell:R71:f:1
cell:S71:f:1
cell:T71:f:1
cell:U71:f:1
cell:V71:f:1
cell:W71:f:1
cell:X71:f:1
cell:Y71:f:1
cell:Z71:f:1
cell:AA71:f:1
cell:AB71:f:1
cell:AC71:f:1
cell:AD71:f:1
cell:AE71:f:1
cell:AF71:f:1
cell:AG71:f:1
cell:AH71:f:1
cell:AI71:f:1
cell:AJ71:f:1
cell:AK71:f:1
cell:AL71:f:1
cell:AM71:f:1
cell:AN71:f:1
cell:AO71:f:1
cell:AP71:vtf:t:d:bl1:f:1
cell:AQ71:f:1
cell:AR71:f:1
cell:AS71:f:1
cell:AT71:f:1
cell:AU71:f:1
cell:AV71:f:1
cell:AW71:f:1
cell:AX71:f:1
cell:AY71:f:1
cell:AZ71:f:1
cell:BA71:f:1
cell:BB71:f:1
cell:BC71:vtf:t: :bl2:f:1
cell:BD71:f:1
cell:BE71:f:1
cell:BF71:f:1
cell:BG71:f:1
cell:BH71:f:1
cell:BI71:f:1
cell:BJ71:vtf:t:l:bl3:f:1
cell:BK71:f:1
cell:BL71:f:1
cell:BM71:f:1
cell:BN71:f:1
cell:BO71:f:1
cell:BP71:f:1
cell:BQ71:vtf:t:e:bl4:f:1
cell:BR71:f:1
cell:BS71:f:1
cell:BT71:f:1
cell:BU71:f:1
cell:BV71:f:1
cell:BW71:f:1
cell:BX71:f:1
cell:BY71:f:1
cell:BZ71:f:1
cell:CA71:f:1
cell:CB71:f:1
cell:CC71:f:1
cell:E72:f:1
cell:F72:f:1
cell:G72:f:1
cell:H72:f:1
cell:I72:f:1
cell:J72:f:1
cell:K72:f:1
cell:L72:f:1
cell:M72:f:1
cell:N72:f:1
cell:O72:f:1
cell:P72:f:1
cell:Q72:f:1
cell:R72:f:1
cell:S72:f:1
cell:T72:f:1
cell:U72:f:1
cell:V72:f:1
cell:W72:f:1
cell:X72:f:1
cell:Y72:f:1
cell:Z72:f:1
cell:AA72:f:1
cell:AB72:f:1
cell:AC72:f:1
cell:AD72:f:1
cell:AE72:f:1
cell:AF72:f:1
cell:AG72:f:1
cell:AH72:f:1
cell:AI72:f:1
cell:AJ72:f:1
cell:AK72:f:1
cell:AL72:f:1
cell:AM72:f:1
cell:AN72:f:1
cell:AO72:f:1
cell:AP72:f:1
cell:AQ72:vtf:t:a:bm1:f:1
cell:AR72:f:1
cell:AS72:f:1
cell:AT72:f:1
cell:AU72:f:1
cell:AV72:f:1
cell:AW72:f:1
cell:AX72:f:1
cell:AY72:f:1
cell:AZ72:f:1
cell:BA72:f:1
cell:BB72:f:1
cell:BC72:vtf:t:ô:bm2:f:1
cell:BD72:f:1
cell:BE72:f:1
cell:BF72:f:1
cell:BG72:f:1
cell:BH72:f:1
cell:BI72:f:1
cell:BJ72:f:1
cell:BK72:vtf:t:l:bm3:f:1
cell:BL72:f:1
cell:BM72:f:1
cell:BN72:f:1
cell:BO72:f:1
cell:BP72:f:1
cell:BQ72:f:1
cell:BR72:vtf:t: :bm4:f:1
cell:BS72:f:1
cell:BT72:f:1
cell:BU72:f:1
cell:BV72:f:1
cell:BW72:f:1
cell:BX72:f:1
cell:BY72:f:1
cell:BZ72:f:1
cell:CA72:f:1
cell:CB72:f:1
cell:CC72:f:1
cell:E73:f:1
cell:F73:f:1
cell:G73:f:1
cell:H73:f:1
cell:I73:f:1
cell:J73:f:1
cell:K73:f:1
cell:L73:f:1
cell:M73:f:1
cell:N73:f:1
cell:O73:f:1
cell:P73:f:1
cell:Q73:f:1
cell:R73:f:1
cell:S73:f:1
cell:T73:f:1
cell:U73:f:1
cell:V73:f:1
cell:W73:f:1
cell:X73:f:1
cell:Y73:f:1
cell:Z73:f:1
cell:AA73:f:1
cell:AB73:f:1
cell:AC73:f:1
cell:AD73:f:1
cell:AE73:f:1
cell:AF73:f:1
cell:AG73:f:1
cell:AH73:f:1
cell:AI73:f:1
cell:AJ73:f:1
cell:AK73:f:1
cell:AL73:f:1
cell:AM73:f:1
cell:AN73:f:1
cell:AO73:f:1
cell:AP73:f:1
cell:AQ73:vtf:t:n:bn1:f:1
cell:AR73:f:1
cell:AS73:f:1
cell:AT73:f:1
cell:AU73:f:1
cell:AV73:f:1
cell:AW73:f:1
cell:AX73:f:1
cell:AY73:f:1
cell:AZ73:f:1
cell:BA73:f:1
cell:BB73:f:1
cell:BC73:vtf:t: :bn2:f:1
cell:BD73:f:1
cell:BE73:f:1
cell:BF73:f:1
cell:BG73:f:1
cell:BH73:f:1
cell:BI73:f:1
cell:BJ73:f:1
cell:BK73:vtf:t:e:bn3:f:1
cell:BL73:f:1
cell:BM73:f:1
cell:BN73:f:1
cell:BO73:f:1
cell:BP73:f:1
cell:BQ73:f:1
cell:BR73:f:1
cell:BS73:vtf:t:a:bn4:f:1
cell:BT73:f:1
cell:BU73:f:1
cell:BV73:f:1
cell:BW73:f:1
cell:BX73:f:1
cell:BY73:f:1
cell:BZ73:f:1
cell:CA73:f:1
cell:CB73:f:1
cell:CC73:f:1
cell:E74:f:1
cell:F74:f:1
cell:G74:f:1
cell:H74:f:1
cell:I74:f:1
cell:J74:f:1
cell:K74:f:1
cell:L74:f:1
cell:M74:f:1
cell:N74:f:1
cell:O74:f:1
cell:P74:f:1
cell:Q74:f:1
cell:R74:f:1
cell:S74:f:1
cell:T74:f:1
cell:U74:f:1
cell:V74:f:1
cell:W74:f:1
cell:X74:f:1
cell:Y74:f:1
cell:Z74:f:1
cell:AA74:f:1
cell:AB74:f:1
cell:AC74:f:1
cell:AD74:f:1
cell:AE74:f:1
cell:AF74:f:1
cell:AG74:f:1
cell:AH74:f:1
cell:AI74:f:1
cell:AJ74:f:1
cell:AK74:f:1
cell:AL74:f:1
cell:AM74:f:1
cell:AN74:f:1
cell:AO74:f:1
cell:AP74:f:1
cell:AQ74:f:1
cell:AR74:vtf:t:s:bo1:f:1
cell:AS74:f:1
cell:AT74:f:1
cell:AU74:f:1
cell:AV74:f:1
cell:AW74:f:1
cell:AX74:f:1
cell:AY74:f:1
cell:AZ74:f:1
cell:BA74:f:1
cell:BB74:f:1
cell:BC74:vtf:t:g:bo2:f:1
cell:BD74:f:1
cell:BE74:f:1
cell:BF74:f:1
cell:BG74:f:1
cell:BH74:f:1
cell:BI74:f:1
cell:BJ74:f:1
cell:BK74:f:1
cell:BL74:vtf:t:s:bo3:f:1
cell:BM74:f:1
cell:BN74:f:1
cell:BO74:f:1
cell:BP74:f:1
cell:BQ74:f:1
cell:BR74:f:1
cell:BS74:f:1
cell:BT74:vtf:t:n:bo4:f:1
cell:BU74:f:1
cell:BV74:f:1
cell:BW74:f:1
cell:BX74:f:1
cell:BY74:f:1
cell:BZ74:f:1
cell:CA74:f:1
cell:CB74:f:1
cell:CC74:f:1
cell:E75:f:1
cell:F75:f:1
cell:G75:f:1
cell:H75:f:1
cell:I75:f:1
cell:J75:f:1
cell:K75:f:1
cell:L75:f:1
cell:M75:f:1
cell:N75:f:1
cell:O75:f:1
cell:P75:f:1
cell:Q75:f:1
cell:R75:f:1
cell:S75:f:1
cell:T75:f:1
cell:U75:f:1
cell:V75:f:1
cell:W75:f:1
cell:X75:f:1
cell:Y75:f:1
cell:Z75:f:1
cell:AA75:f:1
cell:AB75:f:1
cell:AC75:f:1
cell:AD75:f:1
cell:AE75:f:1
cell:AF75:f:1
cell:AG75:f:1
cell:AH75:f:1
cell:AI75:f:1
cell:AJ75:f:1
cell:AK75:f:1
cell:AL75:f:1
cell:AM75:f:1
cell:AN75:f:1
cell:AO75:f:1
cell:AP75:f:1
cell:AQ75:f:1
cell:AR75:vtf:t: :bp1:f:1
cell:AS75:f:1
cell:AT75:f:1
cell:AU75:f:1
cell:AV75:f:1
cell:AW75:f:1
cell:AX75:f:1
cell:AY75:f:1
cell:AZ75:f:1
cell:BA75:f:1
cell:BB75:f:1
cell:BC75:f:1
cell:BD75:vtf:t:o:bp2:f:1
cell:BE75:f:1
cell:BF75:f:1
cell:BG75:f:1
cell:BH75:f:1
cell:BI75:f:1
cell:BJ75:f:1
cell:BK75:f:1
cell:BL75:f:1
cell:BM75:vtf:t: :bp3:f:1
cell:BN75:f:1
cell:BO75:f:1
cell:BP75:f:1
cell:BQ75:f:1
cell:BR75:f:1
cell:BS75:f:1
cell:BT75:vtf:t:c:bp4:f:1
cell:BU75:f:1
cell:BV75:f:1
cell:BW75:f:1
cell:BX75:f:1
cell:BY75:f:1
cell:BZ75:f:1
cell:CA75:f:1
cell:CB75:f:1
cell:CC75:f:1
cell:E76:f:1
cell:F76:f:1
cell:G76:f:1
cell:H76:f:1
cell:I76:f:1
cell:J76:f:1
cell:K76:f:1
cell:L76:f:1
cell:M76:f:1
cell:N76:f:1
cell:O76:f:1
cell:P76:f:1
cell:Q76:f:1
cell:R76:f:1
cell:S76:f:1
cell:T76:f:1
cell:U76:f:1
cell:V76:f:1
cell:W76:f:1
cell:X76:f:1
cell:Y76:f:1
cell:Z76:f:1
cell:AA76:f:1
cell:AB76:f:1
cell:AC76:f:1
cell:AD76:f:1
cell:AE76:f:1
cell:AF76:f:1
cell:AG76:f:1
cell:AH76:f:1
cell:AI76:f:1
cell:AJ76:f:1
cell:AK76:f:1
cell:AL76:f:1
cell:AM76:f:1
cell:AN76:f:1
cell:AO76:f:1
cell:AP76:f:1
cell:AQ76:f:1
cell:AR76:f:1
cell:AS76:vtf:t:l:bq1:f:1
cell:AT76:f:1
cell:AU76:f:1
cell:AV76:f:1
cell:AW76:f:1
cell:AX76:f:1
cell:AY76:f:1
cell:AZ76:f:1
cell:BA76:f:1
cell:BB76:f:1
cell:BC76:f:1
cell:BD76:f:1
cell:BE76:vtf:t:u:bq2:f:1
cell:BF76:f:1
cell:BG76:f:1
cell:BH76:f:1
cell:BI76:f:1
cell:BJ76:f:1
cell:BK76:f:1
cell:BL76:f:1
cell:BM76:f:1
cell:BN76:vtf:t:a:bq3:f:1
cell:BO76:f:1
cell:BP76:f:1
cell:BQ76:f:1
cell:BR76:f:1
cell:BS76:f:1
cell:BT76:f:1
cell:BU76:vtf:t:i:bq4:f:1
cell:BV76:f:1
cell:BW76:f:1
cell:BX76:f:1
cell:BY76:f:1
cell:BZ76:f:1
cell:CA76:f:1
cell:CB76:f:1
cell:CC76:f:1
cell:E77:f:1
cell:F77:f:1
cell:G77:f:1
cell:H77:f:1
cell:I77:f:1
cell:J77:f:1
cell:K77:f:1
cell:L77:f:1
cell:M77:f:1
cell:N77:f:1
cell:O77:f:1
cell:P77:f:1
cell:Q77:f:1
cell:R77:f:1
cell:S77:f:1
cell:T77:f:1
cell:U77:f:1
cell:V77:f:1
cell:W77:f:1
cell:X77:f:1
cell:Y77:f:1
cell:Z77:f:1
cell:AA77:f:1
cell:AB77:f:1
cell:AC77:f:1
cell:AD77:f:1
cell:AE77:f:1
cell:AF77:f:1
cell:AG77:f:1
cell:AH77:f:1
cell:AI77:f:1
cell:AJ77:f:1
cell:AK77:f:1
cell:AL77:f:1
cell:AM77:f:1
cell:AN77:f:1
cell:AO77:f:1
cell:AP77:f:1
cell:AQ77:f:1
cell:AR77:f:1
cell:AS77:vtf:t:e:br1:f:1
cell:AT77:f:1
cell:AU77:f:1
cell:AV77:f:1
cell:AW77:f:1
cell:AX77:f:1
cell:AY77:f:1
cell:AZ77:f:1
cell:BA77:f:1
cell:BB77:f:1
cell:BC77:f:1
cell:BD77:f:1
cell:BE77:f:1
cell:BF77:vtf:t:t:br2:f:1
cell:BG77:f:1
cell:BH77:f:1
cell:BI77:f:1
cell:BJ77:f:1
cell:BK77:f:1
cell:BL77:f:1
cell:BM77:f:1
cell:BN77:vtf:t:u:br3:f:1
cell:BO77:f:1
cell:BP77:f:1
cell:BQ77:f:1
cell:BR77:f:1
cell:BS77:f:1
cell:BT77:f:1
cell:BU77:f:1
cell:BV77:vtf:t:e:br4:f:1
cell:BW77:f:1
cell:BX77:f:1
cell:BY77:f:1
cell:BZ77:f:1
cell:CA77:f:1
cell:CB77:f:1
cell:CC77:f:1
cell:E78:f:1
cell:F78:f:1
cell:G78:f:1
cell:H78:f:1
cell:I78:f:1
cell:J78:f:1
cell:K78:f:1
cell:L78:f:1
cell:M78:f:1
cell:N78:f:1
cell:O78:f:1
cell:P78:f:1
cell:Q78:f:1
cell:R78:f:1
cell:S78:f:1
cell:T78:f:1
cell:U78:f:1
cell:V78:f:1
cell:W78:f:1
cell:X78:f:1
cell:Y78:f:1
cell:Z78:f:1
cell:AA78:f:1
cell:AB78:f:1
cell:AC78:f:1
cell:AD78:f:1
cell:AE78:f:1
cell:AF78:f:1
cell:AG78:f:1
cell:AH78:f:1
cell:AI78:f:1
cell:AJ78:f:1
cell:AK78:f:1
cell:AL78:f:1
cell:AM78:f:1
cell:AN78:f:1
cell:AO78:f:1
cell:AP78:f:1
cell:AQ78:f:1
cell:AR78:f:1
cell:AS78:f:1
cell:AT78:vtf:t: :bs1:f:1
cell:AU78:f:1
cell:AV78:f:1
cell:AW78:f:1
cell:AX78:f:1
cell:AY78:f:1
cell:AZ78:f:1
cell:BA78:f:1
cell:BB78:f:1
cell:BC78:f:1
cell:BD78:f:1
cell:BE78:f:1
cell:BF78:f:1
cell:BG78:vtf:t:t:bs2:f:1
cell:BH78:f:1
cell:BI78:f:1
cell:BJ78:f:1
cell:BK78:f:1
cell:BL78:f:1
cell:BM78:f:1
cell:BN78:f:1
cell:BO78:vtf:t:r:bs3:f:1
cell:BP78:f:1
cell:BQ78:f:1
cell:BR78:f:1
cell:BS78:f:1
cell:BT78:f:1
cell:BU78:f:1
cell:BV78:vtf:t:n:bs4:f:1
cell:BW78:f:1
cell:BX78:f:1
cell:BY78:f:1
cell:BZ78:f:1
cell:CA78:f:1
cell:CB78:f:1
cell:CC78:f:1
cell:E79:f:1
cell:F79:f:1
cell:G79:f:1
cell:H79:f:1
cell:I79:f:1
cell:J79:f:1
cell:K79:f:1
cell:L79:f:1
cell:M79:f:1
cell:N79:f:1
cell:O79:f:1
cell:P79:f:1
cell:Q79:f:1
cell:R79:f:1
cell:S79:f:1
cell:T79:f:1
cell:U79:f:1
cell:V79:f:1
cell:W79:f:1
cell:X79:f:1
cell:Y79:f:1
cell:Z79:f:1
cell:AA79:f:1
cell:AB79:f:1
cell:AC79:f:1
cell:AD79:f:1
cell:AE79:f:1
cell:AF79:f:1
cell:AG79:f:1
cell:AH79:f:1
cell:AI79:f:1
cell:AJ79:f:1
cell:AK79:f:1
cell:AL79:f:1
cell:AM79:f:1
cell:AN79:f:1
cell:AO79:f:1
cell:AP79:f:1
cell:AQ79:f:1
cell:AR79:f:1
cell:AS79:f:1
cell:AT79:vtf:t:s:bt1:f:1
cell:AU79:f:1
cell:AV79:f:1
cell:AW79:f:1
cell:AX79:f:1
cell:AY79:f:1
cell:AZ79:f:1
cell:BA79:f:1
cell:BB79:f:1
cell:BC79:f:1
cell:BD79:f:1
cell:BE79:f:1
cell:BF79:f:1
cell:BG79:vtf:t:e:bt2:f:1
cell:BH79:f:1
cell:BI79:f:1
cell:BJ79:f:1
cell:BK79:f:1
cell:BL79:f:1
cell:BM79:f:1
cell:BN79:f:1
cell:BO79:vtf:t:i:bt3:f:1
cell:BP79:f:1
cell:BQ79:f:1
cell:BR79:f:1
cell:BS79:f:1
cell:BT79:f:1
cell:BU79:f:1
cell:BV79:vtf:t:n:bt4:f:1
cell:BW79:f:1
cell:BX79:f:1
cell:BY79:f:1
cell:BZ79:f:1
cell:CA79:f:1
cell:CB79:f:1
cell:CC79:f:1
cell:E80:f:1
cell:F80:f:1
cell:G80:f:1
cell:H80:f:1
cell:I80:f:1
cell:J80:f:1
cell:K80:f:1
cell:L80:f:1
cell:M80:f:1
cell:N80:f:1
cell:O80:f:1
cell:P80:f:1
cell:Q80:f:1
cell:R80:f:1
cell:S80:f:1
cell:T80:f:1
cell:U80:f:1
cell:V80:f:1
cell:W80:f:1
cell:X80:f:1
cell:Y80:f:1
cell:Z80:f:1
cell:AA80:f:1
cell:AB80:f:1
cell:AC80:f:1
cell:AD80:f:1
cell:AE80:f:1
cell:AF80:f:1
cell:AG80:f:1
cell:AH80:f:1
cell:AI80:f:1
cell:AJ80:f:1
cell:AK80:f:1
cell:AL80:f:1
cell:AM80:f:1
cell:AN80:f:1
cell:AO80:f:1
cell:AP80:f:1
cell:AQ80:f:1
cell:AR80:f:1
cell:AS80:f:1
cell:AT80:f:1
cell:AU80:vtf:t:o:bu1:f:1
cell:AV80:f:1
cell:AW80:f:1
cell:AX80:f:1
cell:AY80:f:1
cell:AZ80:f:1
cell:BA80:f:1
cell:BB80:f:1
cell:BC80:f:1
cell:BD80:f:1
cell:BE80:f:1
cell:BF80:f:1
cell:BG80:f:1
cell:BH80:vtf:t:l:bu2:f:1
cell:BI80:f:1
cell:BJ80:f:1
cell:BK80:f:1
cell:BL80:f:1
cell:BM80:f:1
cell:BN80:f:1
cell:BO80:f:1
cell:BP80:vtf:t:c:bu3:f:1
cell:BQ80:f:1
cell:BR80:f:1
cell:BS80:f:1
cell:BT80:f:1
cell:BU80:f:1
cell:BV80:f:1
cell:BW80:vtf:t:e:bu4:f:1
cell:BX80:f:1
cell:BY80:f:1
cell:BZ80:f:1
cell:CA80:f:1
cell:CB80:f:1
cell:CC80:f:1
cell:E81:f:1
cell:F81:f:1
cell:G81:f:1
cell:H81:f:1
cell:I81:f:1
cell:J81:f:1
cell:K81:f:1
cell:L81:f:1
cell:M81:f:1
cell:N81:f:1
cell:O81:f:1
cell:P81:f:1
cell:Q81:f:1
cell:R81:f:1
cell:S81:f:1
cell:T81:f:1
cell:U81:f:1
cell:V81:f:1
cell:W81:f:1
cell:X81:f:1
cell:Y81:f:1
cell:Z81:f:1
cell:AA81:f:1
cell:AB81:f:1
cell:AC81:f:1
cell:AD81:f:1
cell:AE81:f:1
cell:AF81:f:1
cell:AG81:f:1
cell:AH81:f:1
cell:AI81:f:1
cell:AJ81:f:1
cell:AK81:f:1
cell:AL81:f:1
cell:AM81:f:1
cell:AN81:f:1
cell:AO81:f:1
cell:AP81:f:1
cell:AQ81:f:1
cell:AR81:f:1
cell:AS81:f:1
cell:AT81:f:1
cell:AU81:vtf:t:u:bv1:f:1
cell:AV81:f:1
cell:AW81:f:1
cell:AX81:f:1
cell:AY81:f:1
cell:AZ81:f:1
cell:BA81:f:1
cell:BB81:f:1
cell:BC81:f:1
cell:BD81:f:1
cell:BE81:f:1
cell:BF81:f:1
cell:BG81:f:1
cell:BH81:vtf:t:e:bv2:f:1
cell:BI81:f:1
cell:BJ81:f:1
cell:BK81:f:1
cell:BL81:f:1
cell:BM81:f:1
cell:BN81:f:1
cell:BO81:f:1
cell:BP81:f:1
cell:BQ81:vtf:t:u:bv3:f:1
cell:BR81:f:1
cell:BS81:f:1
cell:BT81:f:1
cell:BU81:f:1
cell:BV81:f:1
cell:BW81:f:1
cell:BX81:vtf:t: :bv4:f:1
cell:BY81:f:1
cell:BZ81:f:1
cell:CA81:f:1
cell:CB81:f:1
cell:CC81:f:1
cell:E82:f:1
cell:F82:f:1
cell:G82:f:1
cell:H82:f:1
cell:I82:f:1
cell:J82:f:1
cell:K82:f:1
cell:L82:f:1
cell:M82:f:1
cell:N82:f:1
cell:O82:f:1
cell:P82:f:1
cell:Q82:f:1
cell:R82:f:1
cell:S82:f:1
cell:T82:f:1
cell:U82:f:1
cell:V82:f:1
cell:W82:f:1
cell:X82:f:1
cell:Y82:f:1
cell:Z82:f:1
cell:AA82:f:1
cell:AB82:f:1
cell:AC82:f:1
cell:AD82:f:1
cell:AE82:f:1
cell:AF82:f:1
cell:AG82:f:1
cell:AH82:f:1
cell:AI82:f:1
cell:AJ82:f:1
cell:AK82:f:1
cell:AL82:f:1
cell:AM82:f:1
cell:AN82:f:1
cell:AO82:f:1
cell:AP82:f:1
cell:AQ82:f:1
cell:AR82:f:1
cell:AS82:f:1
cell:AT82:f:1
cell:AU82:f:1
cell:AV82:vtf:t:v:bw1:f:1
cell:AW82:f:1
cell:AX82:f:1
cell:AY82:f:1
cell:AZ82:f:1
cell:BA82:f:1
cell:BB82:f:1
cell:BC82:f:1
cell:BD82:f:1
cell:BE82:f:1
cell:BF82:f:1
cell:BG82:f:1
cell:BH82:f:1
cell:BI82:vtf:t:t:bw2:f:1
cell:BJ82:f:1
cell:BK82:f:1
cell:BL82:f:1
cell:BM82:f:1
cell:BN82:f:1
cell:BO82:f:1
cell:BP82:f:1
cell:BQ82:f:1
cell:BR82:vtf:t:l:bw3:f:1
cell:BS82:f:1
cell:BT82:f:1
cell:BU82:f:1
cell:BV82:f:1
cell:BW82:f:1
cell:BX82:vtf:t:m:bw4:f:1
cell:BY82:f:1
cell:BZ82:f:1
cell:CA82:f:1
cell:CB82:f:1
cell:CC82:f:1
cell:E83:f:1
cell:F83:f:1
cell:G83:f:1
cell:H83:f:1
cell:I83:f:1
cell:J83:f:1
cell:K83:f:1
cell:L83:f:1
cell:M83:f:1
cell:N83:f:1
cell:O83:f:1
cell:P83:f:1
cell:Q83:f:1
cell:R83:f:1
cell:S83:f:1
cell:T83:f:1
cell:U83:f:1
cell:V83:f:1
cell:W83:f:1
cell:X83:f:1
cell:Y83:f:1
cell:Z83:f:1
cell:AA83:f:1
cell:AB83:f:1
cell:AC83:f:1
cell:AD83:f:1
cell:AE83:f:1
cell:AF83:f:1
cell:AG83:f:1
cell:AH83:f:1
cell:AI83:f:1
cell:AJ83:f:1
cell:AK83:f:1
cell:AL83:f:1
cell:AM83:f:1
cell:AN83:f:1
cell:AO83:f:1
cell:AP83:f:1
cell:AQ83:f:1
cell:AR83:f:1
cell:AS83:f:1
cell:AT83:f:1
cell:AU83:f:1
cell:AV83:vtf:t:e:bx1:f:1
cell:AW83:f:1
cell:AX83:f:1
cell:AY83:f:1
cell:AZ83:f:1
cell:BA83:f:1
cell:BB83:f:1
cell:BC83:f:1
cell:BD83:f:1
cell:BE83:f:1
cell:BF83:f:1
cell:BG83:f:1
cell:BH83:f:1
cell:BI83:vtf:t:t:bx2:f:1
cell:BJ83:f:1
cell:BK83:f:1
cell:BL83:f:1
cell:BM83:f:1
cell:BN83:f:1
cell:BO83:f:1
cell:BP83:f:1
cell:BQ83:f:1
cell:BR83:vtf:t:a:bx3:f:1
cell:BS83:f:1
cell:BT83:f:1
cell:BU83:f:1
cell:BV83:f:1
cell:BW83:f:1
cell:BX83:f:1
cell:BY83:vtf:t:u:bx4:f:1
cell:BZ83:f:1
cell:CA83:f:1
cell:CB83:f:1
cell:CC83:f:1
cell:E84:f:1
cell:F84:f:1
cell:G84:f:1
cell:H84:f:1
cell:I84:f:1
cell:J84:f:1
cell:K84:f:1
cell:L84:f:1
cell:M84:f:1
cell:N84:f:1
cell:O84:f:1
cell:P84:f:1
cell:Q84:f:1
cell:R84:f:1
cell:S84:f:1
cell:T84:f:1
cell:U84:f:1
cell:V84:f:1
cell:W84:f:1
cell:X84:f:1
cell:Y84:f:1
cell:Z84:f:1
cell:AA84:f:1
cell:AB84:f:1
cell:AC84:f:1
cell:AD84:f:1
cell:AE84:f:1
cell:AF84:f:1
cell:AG84:f:1
cell:AH84:f:1
cell:AI84:f:1
cell:AJ84:f:1
cell:AK84:f:1
cell:AL84:f:1
cell:AM84:f:1
cell:AN84:f:1
cell:AO84:f:1
cell:AP84:f:1
cell:AQ84:f:1
cell:AR84:f:1
cell:AS84:f:1
cell:AT84:f:1
cell:AU84:f:1
cell:AV84:f:1
cell:AW84:vtf:t:n:by1:f:1
cell:AX84:f:1
cell:AY84:f:1
cell:AZ84:f:1
cell:BA84:f:1
cell:BB84:f:1
cell:BC84:f:1
cell:BD84:f:1
cell:BE84:f:1
cell:BF84:f:1
cell:BG84:f:1
cell:BH84:f:1
cell:BI84:f:1
cell:BJ84:vtf:t:e:by2:f:1
cell:BK84:f:1
cell:BL84:f:1
cell:BM84:f:1
cell:BN84:f:1
cell:BO84:f:1
cell:BP84:f:1
cell:BQ84:f:1
cell:BR84:f:1
cell:BS84:vtf:t:i:by3:f:1
cell:BT84:f:1
cell:BU84:f:1
cell:BV84:f:1
cell:BW84:f:1
cell:BX84:f:1
cell:BY84:vtf:t:s:by4:f:1
cell:BZ84:f:1
cell:CA84:f:1
cell:CB84:f:1
cell:CC84:f:1
cell:E85:f:1
cell:F85:f:1
cell:G85:f:1
cell:H85:f:1
cell:I85:f:1
cell:J85:f:1
cell:K85:f:1
cell:L85:f:1
cell:M85:f:1
cell:N85:f:1
cell:O85:f:1
cell:P85:f:1
cell:Q85:f:1
cell:R85:f:1
cell:S85:f:1
cell:T85:f:1
cell:U85:f:1
cell:V85:f:1
cell:W85:f:1
cell:X85:f:1
cell:Y85:f:1
cell:Z85:f:1
cell:AA85:f:1
cell:AB85:f:1
cell:AC85:f:1
cell:AD85:f:1
cell:AE85:f:1
cell:AF85:f:1
cell:AG85:f:1
cell:AH85:f:1
cell:AI85:f:1
cell:AJ85:f:1
cell:AK85:f:1
cell:AL85:f:1
cell:AM85:f:1
cell:AN85:f:1
cell:AO85:f:1
cell:AP85:f:1
cell:AQ85:f:1
cell:AR85:f:1
cell:AS85:f:1
cell:AT85:f:1
cell:AU85:f:1
cell:AV85:f:1
cell:AW85:vtf:t:i:bz1:f:1
cell:AX85:f:1
cell:AY85:f:1
cell:AZ85:f:1
cell:BA85:f:1
cell:BB85:f:1
cell:BC85:f:1
cell:BD85:f:1
cell:BE85:f:1
cell:BF85:f:1
cell:BG85:f:1
cell:BH85:f:1
cell:BI85:f:1
cell:BJ85:f:1
cell:BK85:vtf:t:s:bz2:f:1
cell:BL85:f:1
cell:BM85:f:1
cell:BN85:f:1
cell:BO85:f:1
cell:BP85:f:1
cell:BQ85:f:1
cell:BR85:f:1
cell:BS85:vtf:t:r:bz3:f:1
cell:BT85:f:1
cell:BU85:f:1
cell:BV85:f:1
cell:BW85:f:1
cell:BX85:f:1
cell:BY85:f:1
cell:BZ85:vtf:t:i:bz4:f:1
cell:CA85:f:1
cell:CB85:f:1
cell:CC85:f:1
cell:E86:f:1
cell:F86:f:1
cell:G86:f:1
cell:H86:f:1
cell:I86:f:1
cell:J86:f:1
cell:K86:f:1
cell:L86:f:1
cell:M86:f:1
cell:N86:f:1
cell:O86:f:1
cell:P86:f:1
cell:Q86:f:1
cell:R86:f:1
cell:S86:f:1
cell:T86:f:1
cell:U86:f:1
cell:V86:f:1
cell:W86:f:1
cell:X86:f:1
cell:Y86:f:1
cell:Z86:f:1
cell:AA86:f:1
cell:AB86:f:1
cell:AC86:f:1
cell:AD86:f:1
cell:AE86:f:1
cell:AF86:f:1
cell:AG86:f:1
cell:AH86:f:1
cell:AI86:f:1
cell:AJ86:f:1
cell:AK86:f:1
cell:AL86:f:1
cell:AM86:f:1
cell:AN86:f:1
cell:AO86:f:1
cell:AP86:f:1
cell:AQ86:f:1
cell:AR86:f:1
cell:AS86:f:1
cell:AT86:f:1
cell:AU86:f:1
cell:AV86:f:1
cell:AW86:f:1
cell:AX86:vtf:t:r:ca1:f:1
cell:AY86:f:1
cell:AZ86:f:1
cell:BA86:f:1
cell:BB86:f:1
cell:BC86:f:1
cell:BD86:f:1
cell:BE86:f:1
cell:BF86:f:1
cell:BG86:f:1
cell:BH86:f:1
cell:BI86:f:1
cell:BJ86:f:1
cell:BK86:vtf:t: :ca2:f:1
cell:BL86:f:1
cell:BM86:f:1
cell:BN86:f:1
cell:BO86:f:1
cell:BP86:f:1
cell:BQ86:f:1
cell:BR86:f:1
cell:BS86:f:1
cell:BT86:vtf:t:e:ca3:f:1
cell:BU86:f:1
cell:BV86:f:1
cell:BW86:f:1
cell:BX86:f:1
cell:BY86:f:1
cell:BZ86:f:1
cell:CA86:vtf:t:q:ca4:f:1
cell:CB86:f:1
cell:CC86:f:1
cell:E87:f:1
cell:F87:f:1
cell:G87:f:1
cell:H87:f:1
cell:I87:f:1
cell:J87:f:1
cell:K87:f:1
cell:L87:f:1
cell:M87:f:1
cell:N87:f:1
cell:O87:f:1
cell:P87:f:1
cell:Q87:f:1
cell:R87:f:1
cell:S87:f:1
cell:T87:f:1
cell:U87:f:1
cell:V87:f:1
cell:W87:f:1
cell:X87:f:1
cell:Y87:f:1
cell:Z87:f:1
cell:AA87:f:1
cell:AB87:f:1
cell:AC87:f:1
cell:AD87:f:1
cell:AE87:f:1
cell:AF87:f:1
cell:AG87:f:1
cell:AH87:f:1
cell:AI87:f:1
cell:AJ87:f:1
cell:AK87:f:1
cell:AL87:f:1
cell:AM87:f:1
cell:AN87:f:1
cell:AO87:f:1
cell:AP87:f:1
cell:AQ87:f:1
cell:AR87:f:1
cell:AS87:f:1
cell:AT87:f:1
cell:AU87:f:1
cell:AV87:f:1
cell:AW87:f:1
cell:AX87:f:1
cell:AY87:f:1
cell:AZ87:f:1
cell:BA87:f:1
cell:BB87:f:1
cell:BC87:f:1
cell:BD87:f:1
cell:BE87:f:1
cell:BF87:f:1
cell:BG87:f:1
cell:BH87:f:1
cell:BI87:f:1
cell:BJ87:f:1
cell:BK87:f:1
cell:BL87:f:1
cell:BM87:f:1
cell:BN87:f:1
cell:BO87:f:1
cell:BP87:f:1
cell:BQ87:f:1
cell:BR87:f:1
cell:BS87:f:1
cell:BT87:vtf:t:s:cb3:f:1
cell:BU87:f:1
cell:BV87:f:1
cell:BW87:f:1
cell:BX87:f:1
cell:BY87:f:1
cell:BZ87:f:1
cell:CA87:vtf:t:u:cb4:f:1
cell:CB87:f:1
cell:CC87:f:1
cell:E88:f:1
cell:F88:f:1
cell:G88:f:1
cell:H88:f:1
cell:I88:f:1
cell:J88:f:1
cell:K88:f:1
cell:L88:f:1
cell:M88:f:1
cell:N88:f:1
cell:O88:f:1
cell:P88:f:1
cell:Q88:f:1
cell:R88:f:1
cell:S88:f:1
cell:T88:f:1
cell:U88:f:1
cell:V88:f:1
cell:W88:f:1
cell:X88:f:1
cell:Y88:f:1
cell:Z88:f:1
cell:AA88:f:1
cell:AB88:f:1
cell:AC88:f:1
cell:AD88:f:1
cell:AE88:f:1
cell:AF88:f:1
cell:AG88:f:1
cell:AH88:f:1
cell:AI88:f:1
cell:AJ88:f:1
cell:AK88:f:1
cell:AL88:f:1
cell:AM88:f:1
cell:AN88:f:1
cell:AO88:f:1
cell:AP88:f:1
cell:AQ88:f:1
cell:AR88:f:1
cell:AS88:f:1
cell:AT88:f:1
cell:AU88:f:1
cell:AV88:f:1
cell:AW88:f:1
cell:AX88:f:1
cell:AY88:f:1
cell:AZ88:f:1
cell:BA88:f:1
cell:BB88:f:1
cell:BC88:f:1
cell:BD88:f:1
cell:BE88:f:1
cell:BF88:f:1
cell:BG88:f:1
cell:BH88:f:1
cell:BI88:f:1
cell:BJ88:f:1
cell:BK88:f:1
cell:BL88:f:1
cell:BM88:f:1
cell:BN88:f:1
cell:BO88:f:1
cell:BP88:f:1
cell:BQ88:f:1
cell:BR88:f:1
cell:BS88:f:1
cell:BT88:f:1
cell:BU88:f:1
cell:BV88:f:1
cell:BW88:f:1
cell:BX88:f:1
cell:BY88:f:1
cell:BZ88:f:1
cell:CA88:f:1
cell:CB88:vtf:t:e:cc4:f:1
cell:CC88:f:1
cell:E89:f:1
cell:F89:f:1
cell:G89:f:1
cell:H89:f:1
cell:I89:f:1
cell:J89:f:1
cell:K89:f:1
cell:L89:f:1
cell:M89:f:1
cell:N89:f:1
cell:O89:f:1
cell:P89:f:1
cell:Q89:f:1
cell:R89:f:1
cell:S89:f:1
cell:T89:f:1
cell:U89:f:1
cell:V89:f:1
cell:W89:f:1
cell:X89:f:1
cell:Y89:f:1
cell:Z89:f:1
cell:AA89:f:1
cell:AB89:f:1
cell:AC89:f:1
cell:AD89:f:1
cell:AE89:f:1
cell:AF89:f:1
cell:AG89:f:1
cell:AH89:f:1
cell:AI89:f:1
cell:AJ89:f:1
cell:AK89:f:1
cell:AL89:f:1
cell:AM89:f:1
cell:AN89:f:1
cell:AO89:f:1
cell:AP89:f:1
cell:AQ89:f:1
cell:AR89:f:1
cell:AS89:f:1
cell:AT89:f:1
cell:AU89:f:1
cell:AV89:f:1
cell:AW89:f:1
cell:AX89:f:1
cell:AY89:f:1
cell:AZ89:f:1
cell:BA89:f:1
cell:BB89:f:1
cell:BC89:f:1
cell:BD89:f:1
cell:BE89:f:1
cell:BF89:f:1
cell:BG89:f:1
cell:BH89:f:1
cell:BI89:f:1
cell:BJ89:f:1
cell:BK89:f:1
cell:BL89:f:1
cell:BM89:f:1
cell:BN89:f:1
cell:BO89:f:1
cell:BP89:f:1
cell:BQ89:f:1
cell:BR89:f:1
cell:BS89:f:1
cell:BT89:f:1
cell:BU89:f:1
cell:BV89:f:1
cell:BW89:f:1
cell:BX89:f:1
cell:BY89:f:1
cell:BZ89:f:1
cell:CA89:f:1
cell:CB89:f:1
cell:CC89:f:1
col:A:w:14
col:B:w:14
col:C:w:14
col:D:w:14
col:E:w:14
col:F:w:14
col:G:w:14
col:H:w:14
col:I:w:14
col:J:w:14
col:K:w:14
col:L:w:14
col:M:w:14
col:N:w:14
col:O:w:14
col:P:w:14
col:Q:w:14
col:R:w:14
col:S:w:14
col:T:w:14
col:U:w:14
col:V:w:14
col:W:w:14
col:X:w:14
col:Y:w:14
col:Z:w:14
col:AA:w:14
col:AB:w:14
col:AC:w:14
col:AD:w:14
col:AE:w:14
col:AF:w:14
col:AG:w:14
col:AH:w:14
col:AI:w:14
col:AJ:w:14
col:AK:w:14
col:AL:w:14
col:AM:w:14
col:AN:w:14
col:AO:w:14
col:AP:w:14
col:AQ:w:14
col:AR:w:14
col:AS:w:14
col:AT:w:14
col:AU:w:14
col:AV:w:14
col:AW:w:14
col:AX:w:14
col:AY:w:14
col:AZ:w:14
col:BA:w:14
col:BB:w:14
col:BC:w:14
col:BD:w:14
col:BE:w:14
col:BF:w:14
col:BG:w:14
col:BH:w:14
col:BI:w:14
col:BJ:w:14
col:BK:w:14
col:BL:w:14
col:BM:w:14
col:BN:w:14
col:BO:w:14
col:BP:w:14
col:BQ:w:14
col:BR:w:14
col:BS:w:14
col:BT:w:14
col:BU:w:14
col:BV:w:14
col:BW:w:14
col:BX:w:14
col:BY:w:14
col:BZ:w:14
col:CA:w:14
col:CB:w:14
col:CC:w:14
row:1:hide:yes
row:2:hide:yes
row:3:hide:yes
row:4:hide:yes
row:5:hide:yes
sheet:c:81:r:89
font:1:normal bold * *
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:24
colpane:0:1:40
ecell:A6
sort::-1:down::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set E8:CC89 font normal bold * *
--SocialCalcSpreadsheetControlSave--
"""
''Il pleut'' by Guillaume Apollinaire. Calligrammes (1918).
[[English translation|SocialCalc/Demos/calligramme-in-english--demo]]
"""
<$edit-socialcalc tiddler="SocialCalc/Demos/calligramme" mode="view" grid="no" height=500/>
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:t:I:f:1
cell:B1:t:t
cell:C1:t:':f:1
cell:D1:t:s
cell:E1:t: :f:1
cell:F1:t:r
cell:G1:t:a
cell:H1:t:i
cell:I1:t:n
cell:J1:t:i
cell:K1:t:n
cell:L1:t:g
cell:M1:t:
cell:N1:t:w
cell:O1:t:o
cell:P1:t:m
cell:Q1:t:e
cell:R1:t:n
cell:S1:t:'
cell:T1:t:s
cell:U1:t:
cell:V1:t:v
cell:W1:t:o
cell:X1:t:i
cell:Y1:t:c
cell:Z1:t:e
cell:AA1:t:s
cell:AB1:t:
cell:AC1:t:a
cell:AD1:t:s
cell:AE1:t:
cell:AF1:t:i
cell:AG1:t:f
cell:AH1:t:
cell:AI1:t:t
cell:AJ1:t:h
cell:AK1:t:e
cell:AL1:t:y
cell:AM1:t:
cell:AN1:t:h
cell:AO1:t:a
cell:AP1:t:d
cell:AQ1:t:
cell:AR1:t:d
cell:AS1:t:i
cell:AT1:t:e
cell:AU1:t:d
cell:AV1:t:
cell:AW1:t:e
cell:AX1:t:v
cell:AY1:t:e
cell:AZ1:t:n
cell:BA1:t:
cell:BB1:t:i
cell:BC1:t:n
cell:BD1:t:
cell:BE1:t:m
cell:BF1:t:e
cell:BG1:t:m
cell:BH1:t:o
cell:BI1:t:r
cell:BJ1:t:y
cell:BK1:t:
cell:BL1:t:
cell:BM1:t:
cell:BN1:t:
cell:BO1:t:
cell:BP1:t:
cell:BQ1:t:
cell:BR1:t:
cell:BS1:t:
cell:BT1:t:
cell:BU1:t:
cell:BV1:t:
cell:BW1:t:
cell:BX1:t:
cell:BY1:t:
cell:BZ1:t:
cell:CA1:t:
cell:CB1:t:
cell:A2:t:A
cell:B2:t:n
cell:C2:t:d
cell:D2:t:
cell:E2:t:i
cell:F2:t:t
cell:G2:t:'
cell:H2:t:s
cell:I2:t:
cell:J2:t:r
cell:K2:t:a
cell:L2:t:i
cell:M2:t:n
cell:N2:t:i
cell:O2:t:n
cell:P2:t:g
cell:Q2:t:
cell:R2:t:y
cell:S2:t:o
cell:T2:t:u
cell:U2:t:
cell:V2:t:a
cell:W2:t:s
cell:X2:t:
cell:Y2:t:w
cell:Z2:t:e
cell:AA2:t:l
cell:AB2:t:l
cell:AC2:t:
cell:AD2:t:m
cell:AE2:t:a
cell:AF2:t:r
cell:AG2:t:v
cell:AH2:t:e
cell:AI2:t:l
cell:AJ2:t:l
cell:AK2:t:o
cell:AL2:t:u
cell:AM2:t:s
cell:AN2:t:
cell:AO2:t:e
cell:AP2:t:n
cell:AQ2:t:c
cell:AR2:t:o
cell:AS2:t:u
cell:AT2:t:n
cell:AU2:t:t
cell:AV2:t:e
cell:AW2:t:r
cell:AX2:t:s
cell:AY2:t:
cell:AZ2:t:o
cell:BA2:t:f
cell:BB2:t:
cell:BC2:t:m
cell:BD2:t:y
cell:BE2:t:
cell:BF2:t:l
cell:BG2:t:i
cell:BH2:t:f
cell:BI2:t:e
cell:BJ2:t:
cell:BK2:t:O
cell:BL2:t:
cell:BM2:t:l
cell:BN2:t:i
cell:BO2:t:t
cell:BP2:t:t
cell:BQ2:t:l
cell:BR2:t:e
cell:BS2:t:
cell:BT2:t:d
cell:BU2:t:r
cell:BV2:t:o
cell:BW2:t:p
cell:BX2:t:s
cell:BY2:t:
cell:BZ2:t:
cell:CA2:t:
cell:CB2:t:
cell:A3:t:T
cell:B3:t:h
cell:C3:t:o
cell:D3:t:s
cell:E3:t:e
cell:F3:t:
cell:G3:t:r
cell:H3:t:e
cell:I3:t:a
cell:J3:t:r
cell:K3:t:i
cell:L3:t:n
cell:M3:t:g
cell:N3:t:
cell:O3:t:c
cell:P3:t:l
cell:Q3:t:o
cell:R3:t:u
cell:S3:t:d
cell:T3:t:s
cell:U3:t:
cell:V3:t:b
cell:W3:t:e
cell:X3:t:g
cell:Y3:t:i
cell:Z3:t:n
cell:AA3:t:
cell:AB3:t:t
cell:AC3:t:o
cell:AD3:t:
cell:AE3:t:n
cell:AF3:t:e
cell:AG3:t:i
cell:AH3:t:g
cell:AI3:t:h
cell:AJ3:t:
cell:AK3:t:a
cell:AL3:t:
cell:AM3:t:w
cell:AN3:t:h
cell:AO3:t:o
cell:AP3:t:l
cell:AQ3:t:e
cell:AR3:t:
cell:AS3:t:u
cell:AT3:t:n
cell:AU3:t:i
cell:AV3:t:v
cell:AW3:t:e
cell:AX3:t:r
cell:AY3:t:s
cell:AZ3:t:e
cell:BA3:t:
cell:BB3:t:o
cell:BC3:t:f
cell:BD3:t:
cell:BE3:t:a
cell:BF3:t:u
cell:BG3:t:r
cell:BH3:t:i
cell:BI3:t:c
cell:BJ3:t:u
cell:BK3:t:l
cell:BL3:t:a
cell:BM3:t:r
cell:BN3:t:
cell:BO3:t:c
cell:BP3:t:i
cell:BQ3:t:t
cell:BR3:t:i
cell:BS3:t:e
cell:BT3:t:s
cell:BU3:t:
cell:BV3:t:
cell:BW3:t:
cell:BX3:t:
cell:BY3:t:
cell:BZ3:t:
cell:CA3:t:
cell:CB3:t:
cell:A4:t:L
cell:B4:t:i
cell:C4:t:s
cell:D4:t:t
cell:E4:t:e
cell:F4:t:n
cell:G4:t:
cell:H4:t:i
cell:I4:t:f
cell:J4:t:
cell:K4:t:i
cell:L4:t:t
cell:M4:t:
cell:N4:t:r
cell:O4:t:a
cell:P4:t:i
cell:Q4:t:n
cell:R4:t:s
cell:S4:t:
cell:T4:t:w
cell:U4:t:h
cell:V4:t:i
cell:W4:t:l
cell:X4:t:e
cell:Y4:t:
cell:Z4:t:r
cell:AA4:t:e
cell:AB4:t:g
cell:AC4:t:r
cell:AD4:t:e
cell:AE4:t:t
cell:AF4:t:
cell:AG4:t:a
cell:AH4:t:n
cell:AI4:t:d
cell:AJ4:t:
cell:AK4:t:d
cell:AL4:t:i
cell:AM4:t:s
cell:AN4:t:d
cell:AO4:t:a
cell:AP4:t:i
cell:AQ4:t:n
cell:AR4:t:
cell:AS4:t:w
cell:AT4:t:e
cell:AU4:t:e
cell:AV4:t:p
cell:AW4:t:
cell:AX4:t:t
cell:AY4:t:o
cell:AZ4:t:
cell:BA4:t:a
cell:BB4:t:n
cell:BC4:t:
cell:BD4:t:a
cell:BE4:t:n
cell:BF4:t:c
cell:BG4:t:i
cell:BH4:t:e
cell:BI4:t:n
cell:BJ4:t:t
cell:BK4:t:
cell:BL4:t:m
cell:BM4:t:u
cell:BN4:t:s
cell:BO4:t:i
cell:BP4:t:c
cell:BQ4:t:
cell:BR4:t:
cell:BS4:t:
cell:BT4:t:
cell:BU4:t:
cell:BV4:t:
cell:BW4:t:
cell:BX4:t:
cell:BY4:t:
cell:BZ4:t:
cell:CA4:t:
cell:CB4:t:
cell:CC4:t:
cell:A5:t:L
cell:B5:t:i
cell:C5:t:s
cell:D5:t:t
cell:E5:t:e
cell:F5:t:n
cell:G5:t:
cell:H5:t:t
cell:I5:t:o
cell:J5:t:
cell:K5:t:t
cell:L5:t:h
cell:M5:t:e
cell:N5:t:
cell:O5:t:b
cell:P5:t:o
cell:Q5:t:n
cell:R5:t:d
cell:S5:t:s
cell:T5:t:
cell:U5:t:f
cell:V5:t:a
cell:W5:t:l
cell:X5:t:l
cell:Y5:t:
cell:Z5:t:o
cell:AA5:t:f
cell:AB5:t:f
cell:AC5:t:
cell:AD5:t:w
cell:AE5:t:h
cell:AF5:t:i
cell:AG5:t:c
cell:AH5:t:h
cell:AI5:t:
cell:AJ5:t:h
cell:AK5:t:o
cell:AL5:t:l
cell:AM5:t:d
cell:AN5:t:
cell:AO5:t:y
cell:AP5:t:o
cell:AQ5:t:u
cell:AR5:t:
cell:AS5:t:a
cell:AT5:t:b
cell:AU5:t:o
cell:AV5:t:v
cell:AW5:t:e
cell:AX5:t:
cell:AY5:t:a
cell:AZ5:t:n
cell:BA5:t:d
cell:BB5:t:
cell:BC5:t:b
cell:BD5:t:e
cell:BE5:t:l
cell:BF5:t:o
cell:BG5:t:w
cell:E8:vtf:t:I:a1:f:1
cell:F8:f:1
cell:G8:f:1
cell:H8:f:1
cell:I8:f:1
cell:J8:f:1
cell:K8:f:1
cell:L8:f:1
cell:M8:f:1
cell:N8:f:1
cell:O8:f:1
cell:P8:f:1
cell:Q8:vtf:t:A:a2:f:1
cell:R8:f:1
cell:S8:f:1
cell:T8:f:1
cell:U8:f:1
cell:V8:vtf:t:T:a3:f:1
cell:W8:f:1
cell:X8:f:1
cell:Y8:f:1
cell:Z8:f:1
cell:AA8:vtf:t:L:a4:f:1
cell:AB8:f:1
cell:AC8:f:1
cell:AD8:f:1
cell:AE8:f:1
cell:AF8:vtf:t:L:a5:f:1
cell:AG8:f:1
cell:AH8:f:1
cell:AI8:f:1
cell:AJ8:f:1
cell:AK8:f:1
cell:AL8:f:1
cell:AM8:f:1
cell:AN8:f:1
cell:AO8:f:1
cell:AP8:f:1
cell:AQ8:f:1
cell:AR8:f:1
cell:AS8:f:1
cell:AT8:f:1
cell:AU8:f:1
cell:AV8:f:1
cell:AW8:f:1
cell:AX8:f:1
cell:AY8:f:1
cell:AZ8:f:1
cell:BA8:f:1
cell:BB8:f:1
cell:BC8:f:1
cell:BD8:f:1
cell:BE8:f:1
cell:BF8:f:1
cell:BG8:f:1
cell:BH8:f:1
cell:BI8:f:1
cell:BJ8:f:1
cell:BK8:f:1
cell:BL8:f:1
cell:BM8:f:1
cell:BN8:f:1
cell:BO8:f:1
cell:BP8:f:1
cell:BQ8:f:1
cell:BR8:f:1
cell:BS8:f:1
cell:BT8:f:1
cell:BU8:f:1
cell:BV8:f:1
cell:E9:f:1
cell:F9:vtf:t:t:b1:f:1
cell:G9:f:1
cell:H9:f:1
cell:I9:f:1
cell:J9:f:1
cell:K9:f:1
cell:L9:f:1
cell:M9:f:1
cell:N9:f:1
cell:O9:f:1
cell:P9:f:1
cell:Q9:vtf:t:n:b2:f:1
cell:R9:f:1
cell:S9:f:1
cell:T9:f:1
cell:U9:f:1
cell:V9:f:1
cell:W9:vtf:t:h:b3:f:1
cell:X9:f:1
cell:Y9:f:1
cell:Z9:f:1
cell:AA9:f:1
cell:AB9:vtf:t:i:b4:f:1
cell:AC9:f:1
cell:AD9:f:1
cell:AE9:f:1
cell:AF9:vtf:t:i:b5:f:1
cell:AG9:f:1
cell:AH9:f:1
cell:AI9:f:1
cell:AJ9:f:1
cell:AK9:f:1
cell:AL9:f:1
cell:AM9:f:1
cell:AN9:f:1
cell:AO9:f:1
cell:AP9:f:1
cell:AQ9:f:1
cell:AR9:f:1
cell:AS9:f:1
cell:AT9:f:1
cell:AU9:f:1
cell:AV9:f:1
cell:AW9:f:1
cell:AX9:f:1
cell:AY9:f:1
cell:AZ9:f:1
cell:BA9:f:1
cell:BB9:f:1
cell:BC9:f:1
cell:BD9:f:1
cell:BE9:f:1
cell:BF9:f:1
cell:BG9:f:1
cell:BH9:f:1
cell:BI9:f:1
cell:BJ9:f:1
cell:BK9:f:1
cell:BL9:f:1
cell:BM9:f:1
cell:BN9:f:1
cell:BO9:f:1
cell:BP9:f:1
cell:BQ9:f:1
cell:BR9:f:1
cell:BS9:f:1
cell:BT9:f:1
cell:BU9:f:1
cell:BV9:f:1
cell:E10:f:1
cell:F10:f:1
cell:G10:vtf:t:':c1:f:1
cell:H10:f:1
cell:I10:f:1
cell:J10:f:1
cell:K10:f:1
cell:L10:f:1
cell:M10:f:1
cell:N10:f:1
cell:O10:f:1
cell:P10:f:1
cell:Q10:f:1
cell:R10:vtf:t:d:c2:f:1
cell:S10:f:1
cell:T10:f:1
cell:U10:f:1
cell:V10:f:1
cell:W10:f:1
cell:X10:vtf:t:o:c3:f:1
cell:Y10:f:1
cell:Z10:f:1
cell:AA10:f:1
cell:AB10:vtf:t:s:c4:f:1
cell:AC10:f:1
cell:AD10:f:1
cell:AE10:f:1
cell:AF10:f:1
cell:AG10:vtf:t:s:c5:f:1
cell:AH10:f:1
cell:AI10:f:1
cell:AJ10:f:1
cell:AK10:f:1
cell:AL10:f:1
cell:AM10:f:1
cell:AN10:f:1
cell:AO10:f:1
cell:AP10:f:1
cell:AQ10:f:1
cell:AR10:f:1
cell:AS10:f:1
cell:AT10:f:1
cell:AU10:f:1
cell:AV10:f:1
cell:AW10:f:1
cell:AX10:f:1
cell:AY10:f:1
cell:AZ10:f:1
cell:BA10:f:1
cell:BB10:f:1
cell:BC10:f:1
cell:BD10:f:1
cell:BE10:f:1
cell:BF10:f:1
cell:BG10:f:1
cell:BH10:f:1
cell:BI10:f:1
cell:BJ10:f:1
cell:BK10:f:1
cell:BL10:f:1
cell:BM10:f:1
cell:BN10:f:1
cell:BO10:f:1
cell:BP10:f:1
cell:BQ10:f:1
cell:BR10:f:1
cell:BS10:f:1
cell:BT10:f:1
cell:BU10:f:1
cell:BV10:f:1
cell:E11:f:1
cell:F11:f:1
cell:G11:vtf:t:s:d1:f:1
cell:H11:f:1
cell:I11:f:1
cell:J11:f:1
cell:K11:f:1
cell:L11:f:1
cell:M11:f:1
cell:N11:f:1
cell:O11:f:1
cell:P11:f:1
cell:Q11:f:1
cell:R11:vtf:t: :d2:f:1
cell:S11:f:1
cell:T11:f:1
cell:U11:f:1
cell:V11:f:1
cell:W11:f:1
cell:X11:vtf:t:s:d3:f:1
cell:Y11:f:1
cell:Z11:f:1
cell:AA11:f:1
cell:AB11:f:1
cell:AC11:vtf:t:t:d4:f:1
cell:AD11:f:1
cell:AE11:f:1
cell:AF11:f:1
cell:AG11:f:1
cell:AH11:vtf:t:t:d5:f:1
cell:AI11:f:1
cell:AJ11:f:1
cell:AK11:f:1
cell:AL11:f:1
cell:AM11:f:1
cell:AN11:f:1
cell:AO11:f:1
cell:AP11:f:1
cell:AQ11:f:1
cell:AR11:f:1
cell:AS11:f:1
cell:AT11:f:1
cell:AU11:f:1
cell:AV11:f:1
cell:AW11:f:1
cell:AX11:f:1
cell:AY11:f:1
cell:AZ11:f:1
cell:BA11:f:1
cell:BB11:f:1
cell:BC11:f:1
cell:BD11:f:1
cell:BE11:f:1
cell:BF11:f:1
cell:BG11:f:1
cell:BH11:f:1
cell:BI11:f:1
cell:BJ11:f:1
cell:BK11:f:1
cell:BL11:f:1
cell:BM11:f:1
cell:BN11:f:1
cell:BO11:f:1
cell:BP11:f:1
cell:BQ11:f:1
cell:BR11:f:1
cell:BS11:f:1
cell:BT11:f:1
cell:BU11:f:1
cell:BV11:f:1
cell:E12:f:1
cell:F12:f:1
cell:G12:f:1
cell:H12:vtf:t: :e1:f:1
cell:I12:f:1
cell:J12:f:1
cell:K12:f:1
cell:L12:f:1
cell:M12:f:1
cell:N12:f:1
cell:O12:f:1
cell:P12:f:1
cell:Q12:f:1
cell:R12:f:1
cell:S12:vtf:t:i:e2:f:1
cell:T12:f:1
cell:U12:f:1
cell:V12:f:1
cell:W12:f:1
cell:X12:f:1
cell:Y12:vtf:t:e:e3:f:1
cell:Z12:f:1
cell:AA12:f:1
cell:AB12:f:1
cell:AC12:vtf:t:e:e4:f:1
cell:AD12:f:1
cell:AE12:f:1
cell:AF12:f:1
cell:AG12:f:1
cell:AH12:f:1
cell:AI12:vtf:t:e:e5:f:1
cell:AJ12:f:1
cell:AK12:f:1
cell:AL12:f:1
cell:AM12:f:1
cell:AN12:f:1
cell:AO12:f:1
cell:AP12:f:1
cell:AQ12:f:1
cell:AR12:f:1
cell:AS12:f:1
cell:AT12:f:1
cell:AU12:f:1
cell:AV12:f:1
cell:AW12:f:1
cell:AX12:f:1
cell:AY12:f:1
cell:AZ12:f:1
cell:BA12:f:1
cell:BB12:f:1
cell:BC12:f:1
cell:BD12:f:1
cell:BE12:f:1
cell:BF12:f:1
cell:BG12:f:1
cell:BH12:f:1
cell:BI12:f:1
cell:BJ12:f:1
cell:BK12:f:1
cell:BL12:f:1
cell:BM12:f:1
cell:BN12:f:1
cell:BO12:f:1
cell:BP12:f:1
cell:BQ12:f:1
cell:BR12:f:1
cell:BS12:f:1
cell:BT12:f:1
cell:BU12:f:1
cell:BV12:f:1
cell:E13:f:1
cell:F13:f:1
cell:G13:f:1
cell:H13:f:1
cell:I13:vtf:t:r:f1:f:1
cell:J13:f:1
cell:K13:f:1
cell:L13:f:1
cell:M13:f:1
cell:N13:f:1
cell:O13:f:1
cell:P13:f:1
cell:Q13:f:1
cell:R13:f:1
cell:S13:vtf:t:t:f2:f:1
cell:T13:f:1
cell:U13:f:1
cell:V13:f:1
cell:W13:f:1
cell:X13:f:1
cell:Y13:vtf:t: :f3:f:1
cell:Z13:f:1
cell:AA13:f:1
cell:AB13:f:1
cell:AC13:f:1
cell:AD13:vtf:t:n:f4:f:1
cell:AE13:f:1
cell:AF13:f:1
cell:AG13:f:1
cell:AH13:f:1
cell:AI13:vtf:t:n:f5:f:1
cell:AJ13:f:1
cell:AK13:f:1
cell:AL13:f:1
cell:AM13:f:1
cell:AN13:f:1
cell:AO13:f:1
cell:AP13:f:1
cell:AQ13:f:1
cell:AR13:f:1
cell:AS13:f:1
cell:AT13:f:1
cell:AU13:f:1
cell:AV13:f:1
cell:AW13:f:1
cell:AX13:f:1
cell:AY13:f:1
cell:AZ13:f:1
cell:BA13:f:1
cell:BB13:f:1
cell:BC13:f:1
cell:BD13:f:1
cell:BE13:f:1
cell:BF13:f:1
cell:BG13:f:1
cell:BH13:f:1
cell:BI13:f:1
cell:BJ13:f:1
cell:BK13:f:1
cell:BL13:f:1
cell:BM13:f:1
cell:BN13:f:1
cell:BO13:f:1
cell:BP13:f:1
cell:BQ13:f:1
cell:BR13:f:1
cell:BS13:f:1
cell:BT13:f:1
cell:BU13:f:1
cell:BV13:f:1
cell:E14:f:1
cell:F14:f:1
cell:G14:f:1
cell:H14:f:1
cell:I14:vtf:t:a:g1:f:1
cell:J14:f:1
cell:K14:f:1
cell:L14:f:1
cell:M14:f:1
cell:N14:f:1
cell:O14:f:1
cell:P14:f:1
cell:Q14:f:1
cell:R14:f:1
cell:S14:f:1
cell:T14:vtf:t:':g2:f:1
cell:U14:f:1
cell:V14:f:1
cell:W14:f:1
cell:X14:f:1
cell:Y14:f:1
cell:Z14:vtf:t:r:g3:f:1
cell:AA14:f:1
cell:AB14:f:1
cell:AC14:f:1
cell:AD14:f:1
cell:AE14:vtf:t: :g4:f:1
cell:AF14:f:1
cell:AG14:f:1
cell:AH14:f:1
cell:AI14:f:1
cell:AJ14:vtf:t: :g5:f:1
cell:AK14:f:1
cell:AL14:f:1
cell:AM14:f:1
cell:AN14:f:1
cell:AO14:f:1
cell:AP14:f:1
cell:AQ14:f:1
cell:AR14:f:1
cell:AS14:f:1
cell:AT14:f:1
cell:AU14:f:1
cell:AV14:f:1
cell:AW14:f:1
cell:AX14:f:1
cell:AY14:f:1
cell:AZ14:f:1
cell:BA14:f:1
cell:BB14:f:1
cell:BC14:f:1
cell:BD14:f:1
cell:BE14:f:1
cell:BF14:f:1
cell:BG14:f:1
cell:BH14:f:1
cell:BI14:f:1
cell:BJ14:f:1
cell:BK14:f:1
cell:BL14:f:1
cell:BM14:f:1
cell:BN14:f:1
cell:BO14:f:1
cell:BP14:f:1
cell:BQ14:f:1
cell:BR14:f:1
cell:BS14:f:1
cell:BT14:f:1
cell:BU14:f:1
cell:BV14:f:1
cell:E15:f:1
cell:F15:f:1
cell:G15:f:1
cell:H15:f:1
cell:I15:f:1
cell:J15:vtf:t:i:h1:f:1
cell:K15:f:1
cell:L15:f:1
cell:M15:f:1
cell:N15:f:1
cell:O15:f:1
cell:P15:f:1
cell:Q15:f:1
cell:R15:f:1
cell:S15:f:1
cell:T15:vtf:t:s:h2:f:1
cell:U15:f:1
cell:V15:f:1
cell:W15:f:1
cell:X15:f:1
cell:Y15:f:1
cell:Z15:vtf:t:e:h3:f:1
cell:AA15:f:1
cell:AB15:f:1
cell:AC15:f:1
cell:AD15:f:1
cell:AE15:vtf:t:i:h4:f:1
cell:AF15:f:1
cell:AG15:f:1
cell:AH15:f:1
cell:AI15:f:1
cell:AJ15:f:1
cell:AK15:vtf:t:t:h5:f:1
cell:AL15:f:1
cell:AM15:f:1
cell:AN15:f:1
cell:AO15:f:1
cell:AP15:f:1
cell:AQ15:f:1
cell:AR15:f:1
cell:AS15:f:1
cell:AT15:f:1
cell:AU15:f:1
cell:AV15:f:1
cell:AW15:f:1
cell:AX15:f:1
cell:AY15:f:1
cell:AZ15:f:1
cell:BA15:f:1
cell:BB15:f:1
cell:BC15:f:1
cell:BD15:f:1
cell:BE15:f:1
cell:BF15:f:1
cell:BG15:f:1
cell:BH15:f:1
cell:BI15:f:1
cell:BJ15:f:1
cell:BK15:f:1
cell:BL15:f:1
cell:BM15:f:1
cell:BN15:f:1
cell:BO15:f:1
cell:BP15:f:1
cell:BQ15:f:1
cell:BR15:f:1
cell:BS15:f:1
cell:BT15:f:1
cell:BU15:f:1
cell:BV15:f:1
cell:E16:f:1
cell:F16:f:1
cell:G16:f:1
cell:H16:f:1
cell:I16:f:1
cell:J16:vtf:t:n:i1:f:1
cell:K16:f:1
cell:L16:f:1
cell:M16:f:1
cell:N16:f:1
cell:O16:f:1
cell:P16:f:1
cell:Q16:f:1
cell:R16:f:1
cell:S16:f:1
cell:T16:f:1
cell:U16:vtf:t: :i2:f:1
cell:V16:f:1
cell:W16:f:1
cell:X16:f:1
cell:Y16:f:1
cell:Z16:vtf:t:a:i3:f:1
cell:AA16:f:1
cell:AB16:f:1
cell:AC16:f:1
cell:AD16:f:1
cell:AE16:f:1
cell:AF16:vtf:t:f:i4:f:1
cell:AG16:f:1
cell:AH16:f:1
cell:AI16:f:1
cell:AJ16:f:1
cell:AK16:f:1
cell:AL16:vtf:t:o:i5:f:1
cell:AM16:f:1
cell:AN16:f:1
cell:AO16:f:1
cell:AP16:f:1
cell:AQ16:f:1
cell:AR16:f:1
cell:AS16:f:1
cell:AT16:f:1
cell:AU16:f:1
cell:AV16:f:1
cell:AW16:f:1
cell:AX16:f:1
cell:AY16:f:1
cell:AZ16:f:1
cell:BA16:f:1
cell:BB16:f:1
cell:BC16:f:1
cell:BD16:f:1
cell:BE16:f:1
cell:BF16:f:1
cell:BG16:f:1
cell:BH16:f:1
cell:BI16:f:1
cell:BJ16:f:1
cell:BK16:f:1
cell:BL16:f:1
cell:BM16:f:1
cell:BN16:f:1
cell:BO16:f:1
cell:BP16:f:1
cell:BQ16:f:1
cell:BR16:f:1
cell:BS16:f:1
cell:BT16:f:1
cell:BU16:f:1
cell:BV16:f:1
cell:E17:f:1
cell:F17:f:1
cell:G17:f:1
cell:H17:f:1
cell:I17:f:1
cell:J17:vtf:t:i:j1:f:1
cell:K17:f:1
cell:L17:f:1
cell:M17:f:1
cell:N17:f:1
cell:O17:f:1
cell:P17:f:1
cell:Q17:f:1
cell:R17:f:1
cell:S17:f:1
cell:T17:f:1
cell:U17:vtf:t:r:j2:f:1
cell:V17:f:1
cell:W17:f:1
cell:X17:f:1
cell:Y17:f:1
cell:Z17:f:1
cell:AA17:vtf:t:r:j3:f:1
cell:AB17:f:1
cell:AC17:f:1
cell:AD17:f:1
cell:AE17:f:1
cell:AF17:vtf:t: :j4:f:1
cell:AG17:f:1
cell:AH17:f:1
cell:AI17:f:1
cell:AJ17:f:1
cell:AK17:f:1
cell:AL17:f:1
cell:AM17:vtf:t: :j5:f:1
cell:AN17:f:1
cell:AO17:f:1
cell:AP17:f:1
cell:AQ17:f:1
cell:AR17:f:1
cell:AS17:f:1
cell:AT17:f:1
cell:AU17:f:1
cell:AV17:f:1
cell:AW17:f:1
cell:AX17:f:1
cell:AY17:f:1
cell:AZ17:f:1
cell:BA17:f:1
cell:BB17:f:1
cell:BC17:f:1
cell:BD17:f:1
cell:BE17:f:1
cell:BF17:f:1
cell:BG17:f:1
cell:BH17:f:1
cell:BI17:f:1
cell:BJ17:f:1
cell:BK17:f:1
cell:BL17:f:1
cell:BM17:f:1
cell:BN17:f:1
cell:BO17:f:1
cell:BP17:f:1
cell:BQ17:f:1
cell:BR17:f:1
cell:BS17:f:1
cell:BT17:f:1
cell:BU17:f:1
cell:BV17:f:1
cell:E18:f:1
cell:F18:f:1
cell:G18:f:1
cell:H18:f:1
cell:I18:f:1
cell:J18:vtf:t:n:k1:f:1
cell:K18:f:1
cell:L18:f:1
cell:M18:f:1
cell:N18:f:1
cell:O18:f:1
cell:P18:f:1
cell:Q18:f:1
cell:R18:f:1
cell:S18:f:1
cell:T18:f:1
cell:U18:f:1
cell:V18:vtf:t:a:k2:f:1
cell:W18:f:1
cell:X18:f:1
cell:Y18:f:1
cell:Z18:f:1
cell:AA18:f:1
cell:AB18:vtf:t:i:k3:f:1
cell:AC18:f:1
cell:AD18:f:1
cell:AE18:f:1
cell:AF18:f:1
cell:AG18:vtf:t:i:k4:f:1
cell:AH18:f:1
cell:AI18:f:1
cell:AJ18:f:1
cell:AK18:f:1
cell:AL18:f:1
cell:AM18:f:1
cell:AN18:vtf:t:t:k5:f:1
cell:AO18:f:1
cell:AP18:f:1
cell:AQ18:f:1
cell:AR18:f:1
cell:AS18:f:1
cell:AT18:f:1
cell:AU18:f:1
cell:AV18:f:1
cell:AW18:f:1
cell:AX18:f:1
cell:AY18:f:1
cell:AZ18:f:1
cell:BA18:f:1
cell:BB18:f:1
cell:BC18:f:1
cell:BD18:f:1
cell:BE18:f:1
cell:BF18:f:1
cell:BG18:f:1
cell:BH18:f:1
cell:BI18:f:1
cell:BJ18:f:1
cell:BK18:f:1
cell:BL18:f:1
cell:BM18:f:1
cell:BN18:f:1
cell:BO18:f:1
cell:BP18:f:1
cell:BQ18:f:1
cell:BR18:f:1
cell:BS18:f:1
cell:BT18:f:1
cell:BU18:f:1
cell:BV18:f:1
cell:E19:f:1
cell:F19:f:1
cell:G19:f:1
cell:H19:f:1
cell:I19:f:1
cell:J19:f:1
cell:K19:vtf:t:g:l1:f:1
cell:L19:f:1
cell:M19:f:1
cell:N19:f:1
cell:O19:f:1
cell:P19:f:1
cell:Q19:f:1
cell:R19:f:1
cell:S19:f:1
cell:T19:f:1
cell:U19:f:1
cell:V19:vtf:t:i:l2:f:1
cell:W19:f:1
cell:X19:f:1
cell:Y19:f:1
cell:Z19:f:1
cell:AA19:f:1
cell:AB19:f:1
cell:AC19:vtf:t:n:l3:f:1
cell:AD19:f:1
cell:AE19:f:1
cell:AF19:f:1
cell:AG19:vtf:t:t:l4:f:1
cell:AH19:f:1
cell:AI19:f:1
cell:AJ19:f:1
cell:AK19:f:1
cell:AL19:f:1
cell:AM19:f:1
cell:AN19:vtf:t:h:l5:f:1
cell:AO19:f:1
cell:AP19:f:1
cell:AQ19:f:1
cell:AR19:f:1
cell:AS19:f:1
cell:AT19:f:1
cell:AU19:f:1
cell:AV19:f:1
cell:AW19:f:1
cell:AX19:f:1
cell:AY19:f:1
cell:AZ19:f:1
cell:BA19:f:1
cell:BB19:f:1
cell:BC19:f:1
cell:BD19:f:1
cell:BE19:f:1
cell:BF19:f:1
cell:BG19:f:1
cell:BH19:f:1
cell:BI19:f:1
cell:BJ19:f:1
cell:BK19:f:1
cell:BL19:f:1
cell:BM19:f:1
cell:BN19:f:1
cell:BO19:f:1
cell:BP19:f:1
cell:BQ19:f:1
cell:BR19:f:1
cell:BS19:f:1
cell:BT19:f:1
cell:BU19:f:1
cell:BV19:f:1
cell:E20:f:1
cell:F20:f:1
cell:G20:f:1
cell:H20:f:1
cell:I20:f:1
cell:J20:f:1
cell:K20:vtf:t: :m1:f:1
cell:L20:f:1
cell:M20:f:1
cell:N20:f:1
cell:O20:f:1
cell:P20:f:1
cell:Q20:f:1
cell:R20:f:1
cell:S20:f:1
cell:T20:f:1
cell:U20:f:1
cell:V20:vtf:t:n:m2:f:1
cell:W20:f:1
cell:X20:f:1
cell:Y20:f:1
cell:Z20:f:1
cell:AA20:f:1
cell:AB20:f:1
cell:AC20:vtf:t:g:m3:f:1
cell:AD20:f:1
cell:AE20:f:1
cell:AF20:f:1
cell:AG20:f:1
cell:AH20:vtf:t: :m4:f:1
cell:AI20:f:1
cell:AJ20:f:1
cell:AK20:f:1
cell:AL20:f:1
cell:AM20:f:1
cell:AN20:f:1
cell:AO20:vtf:t:e:m5:f:1
cell:AP20:f:1
cell:AQ20:f:1
cell:AR20:f:1
cell:AS20:f:1
cell:AT20:f:1
cell:AU20:f:1
cell:AV20:f:1
cell:AW20:f:1
cell:AX20:f:1
cell:AY20:f:1
cell:AZ20:f:1
cell:BA20:f:1
cell:BB20:f:1
cell:BC20:f:1
cell:BD20:f:1
cell:BE20:f:1
cell:BF20:f:1
cell:BG20:f:1
cell:BH20:f:1
cell:BI20:f:1
cell:BJ20:f:1
cell:BK20:f:1
cell:BL20:f:1
cell:BM20:f:1
cell:BN20:f:1
cell:BO20:f:1
cell:BP20:f:1
cell:BQ20:f:1
cell:BR20:f:1
cell:BS20:f:1
cell:BT20:f:1
cell:BU20:f:1
cell:BV20:f:1
cell:E21:f:1
cell:F21:f:1
cell:G21:f:1
cell:H21:f:1
cell:I21:f:1
cell:J21:f:1
cell:K21:f:1
cell:L21:vtf:t:w:n1:f:1
cell:M21:f:1
cell:N21:f:1
cell:O21:f:1
cell:P21:f:1
cell:Q21:f:1
cell:R21:f:1
cell:S21:f:1
cell:T21:f:1
cell:U21:f:1
cell:V21:f:1
cell:W21:vtf:t:i:n2:f:1
cell:X21:f:1
cell:Y21:f:1
cell:Z21:f:1
cell:AA21:f:1
cell:AB21:f:1
cell:AC21:f:1
cell:AD21:vtf:t: :n3:f:1
cell:AE21:f:1
cell:AF21:f:1
cell:AG21:f:1
cell:AH21:f:1
cell:AI21:vtf:t:r:n4:f:1
cell:AJ21:f:1
cell:AK21:f:1
cell:AL21:f:1
cell:AM21:f:1
cell:AN21:f:1
cell:AO21:f:1
cell:AP21:vtf:t: :n5:f:1
cell:AQ21:f:1
cell:AR21:f:1
cell:AS21:f:1
cell:AT21:f:1
cell:AU21:f:1
cell:AV21:f:1
cell:AW21:f:1
cell:AX21:f:1
cell:AY21:f:1
cell:AZ21:f:1
cell:BA21:f:1
cell:BB21:f:1
cell:BC21:f:1
cell:BD21:f:1
cell:BE21:f:1
cell:BF21:f:1
cell:BG21:f:1
cell:BH21:f:1
cell:BI21:f:1
cell:BJ21:f:1
cell:BK21:f:1
cell:BL21:f:1
cell:BM21:f:1
cell:BN21:f:1
cell:BO21:f:1
cell:BP21:f:1
cell:BQ21:f:1
cell:BR21:f:1
cell:BS21:f:1
cell:BT21:f:1
cell:BU21:f:1
cell:BV21:f:1
cell:E22:f:1
cell:F22:f:1
cell:G22:f:1
cell:H22:f:1
cell:I22:f:1
cell:J22:f:1
cell:K22:f:1
cell:L22:vtf:t:o:o1:f:1
cell:M22:f:1
cell:N22:f:1
cell:O22:f:1
cell:P22:f:1
cell:Q22:f:1
cell:R22:f:1
cell:S22:f:1
cell:T22:f:1
cell:U22:f:1
cell:V22:f:1
cell:W22:vtf:t:n:o2:f:1
cell:X22:f:1
cell:Y22:f:1
cell:Z22:f:1
cell:AA22:f:1
cell:AB22:f:1
cell:AC22:f:1
cell:AD22:f:1
cell:AE22:vtf:t:c:o3:f:1
cell:AF22:f:1
cell:AG22:f:1
cell:AH22:f:1
cell:AI22:f:1
cell:AJ22:vtf:t:a:o4:f:1
cell:AK22:f:1
cell:AL22:f:1
cell:AM22:f:1
cell:AN22:f:1
cell:AO22:f:1
cell:AP22:f:1
cell:AQ22:vtf:t:b:o5:f:1
cell:AR22:f:1
cell:AS22:f:1
cell:AT22:f:1
cell:AU22:f:1
cell:AV22:f:1
cell:AW22:f:1
cell:AX22:f:1
cell:AY22:f:1
cell:AZ22:f:1
cell:BA22:f:1
cell:BB22:f:1
cell:BC22:f:1
cell:BD22:f:1
cell:BE22:f:1
cell:BF22:f:1
cell:BG22:f:1
cell:BH22:f:1
cell:BI22:f:1
cell:BJ22:f:1
cell:BK22:f:1
cell:BL22:f:1
cell:BM22:f:1
cell:BN22:f:1
cell:BO22:f:1
cell:BP22:f:1
cell:BQ22:f:1
cell:BR22:f:1
cell:BS22:f:1
cell:BT22:f:1
cell:BU22:f:1
cell:BV22:f:1
cell:E23:f:1
cell:F23:f:1
cell:G23:f:1
cell:H23:f:1
cell:I23:f:1
cell:J23:f:1
cell:K23:f:1
cell:L23:f:1
cell:M23:vtf:t:m:p1:f:1
cell:N23:f:1
cell:O23:f:1
cell:P23:f:1
cell:Q23:f:1
cell:R23:f:1
cell:S23:f:1
cell:T23:f:1
cell:U23:f:1
cell:V23:f:1
cell:W23:f:1
cell:X23:vtf:t:g:p2:f:1
cell:Y23:f:1
cell:Z23:f:1
cell:AA23:f:1
cell:AB23:f:1
cell:AC23:f:1
cell:AD23:f:1
cell:AE23:vtf:t:l:p3:f:1
cell:AF23:f:1
cell:AG23:f:1
cell:AH23:f:1
cell:AI23:f:1
cell:AJ23:vtf:t:i:p4:f:1
cell:AK23:f:1
cell:AL23:f:1
cell:AM23:f:1
cell:AN23:f:1
cell:AO23:f:1
cell:AP23:f:1
cell:AQ23:vtf:t:o:p5:f:1
cell:AR23:f:1
cell:AS23:f:1
cell:AT23:f:1
cell:AU23:f:1
cell:AV23:f:1
cell:AW23:f:1
cell:AX23:f:1
cell:AY23:f:1
cell:AZ23:f:1
cell:BA23:f:1
cell:BB23:f:1
cell:BC23:f:1
cell:BD23:f:1
cell:BE23:f:1
cell:BF23:f:1
cell:BG23:f:1
cell:BH23:f:1
cell:BI23:f:1
cell:BJ23:f:1
cell:BK23:f:1
cell:BL23:f:1
cell:BM23:f:1
cell:BN23:f:1
cell:BO23:f:1
cell:BP23:f:1
cell:BQ23:f:1
cell:BR23:f:1
cell:BS23:f:1
cell:BT23:f:1
cell:BU23:f:1
cell:BV23:f:1
cell:E24:f:1
cell:F24:f:1
cell:G24:f:1
cell:H24:f:1
cell:I24:f:1
cell:J24:f:1
cell:K24:f:1
cell:L24:f:1
cell:M24:f:1
cell:N24:vtf:t:e:q1:f:1
cell:O24:f:1
cell:P24:f:1
cell:Q24:f:1
cell:R24:f:1
cell:S24:f:1
cell:T24:f:1
cell:U24:f:1
cell:V24:f:1
cell:W24:f:1
cell:X24:vtf:t: :q2:f:1
cell:Y24:f:1
cell:Z24:f:1
cell:AA24:f:1
cell:AB24:f:1
cell:AC24:f:1
cell:AD24:f:1
cell:AE24:f:1
cell:AF24:vtf:t:o:q3:f:1
cell:AG24:f:1
cell:AH24:f:1
cell:AI24:f:1
cell:AJ24:f:1
cell:AK24:vtf:t:n:q4:f:1
cell:AL24:f:1
cell:AM24:f:1
cell:AN24:f:1
cell:AO24:f:1
cell:AP24:f:1
cell:AQ24:f:1
cell:AR24:vtf:t:n:q5:f:1
cell:AS24:f:1
cell:AT24:f:1
cell:AU24:f:1
cell:AV24:f:1
cell:AW24:f:1
cell:AX24:f:1
cell:AY24:f:1
cell:AZ24:f:1
cell:BA24:f:1
cell:BB24:f:1
cell:BC24:f:1
cell:BD24:f:1
cell:BE24:f:1
cell:BF24:f:1
cell:BG24:f:1
cell:BH24:f:1
cell:BI24:f:1
cell:BJ24:f:1
cell:BK24:f:1
cell:BL24:f:1
cell:BM24:f:1
cell:BN24:f:1
cell:BO24:f:1
cell:BP24:f:1
cell:BQ24:f:1
cell:BR24:f:1
cell:BS24:f:1
cell:BT24:f:1
cell:BU24:f:1
cell:BV24:f:1
cell:E25:f:1
cell:F25:f:1
cell:G25:f:1
cell:H25:f:1
cell:I25:f:1
cell:J25:f:1
cell:K25:f:1
cell:L25:f:1
cell:M25:f:1
cell:N25:vtf:t:n:r1:f:1
cell:O25:f:1
cell:P25:f:1
cell:Q25:f:1
cell:R25:f:1
cell:S25:f:1
cell:T25:f:1
cell:U25:f:1
cell:V25:f:1
cell:W25:f:1
cell:X25:f:1
cell:Y25:vtf:t:y:r2:f:1
cell:Z25:f:1
cell:AA25:f:1
cell:AB25:f:1
cell:AC25:f:1
cell:AD25:f:1
cell:AE25:f:1
cell:AF25:f:1
cell:AG25:vtf:t:u:r3:f:1
cell:AH25:f:1
cell:AI25:f:1
cell:AJ25:f:1
cell:AK25:f:1
cell:AL25:vtf:t:s:r4:f:1
cell:AM25:f:1
cell:AN25:f:1
cell:AO25:f:1
cell:AP25:f:1
cell:AQ25:f:1
cell:AR25:f:1
cell:AS25:vtf:t:d:r5:f:1
cell:AT25:f:1
cell:AU25:f:1
cell:AV25:f:1
cell:AW25:f:1
cell:AX25:f:1
cell:AY25:f:1
cell:AZ25:f:1
cell:BA25:f:1
cell:BB25:f:1
cell:BC25:f:1
cell:BD25:f:1
cell:BE25:f:1
cell:BF25:f:1
cell:BG25:f:1
cell:BH25:f:1
cell:BI25:f:1
cell:BJ25:f:1
cell:BK25:f:1
cell:BL25:f:1
cell:BM25:f:1
cell:BN25:f:1
cell:BO25:f:1
cell:BP25:f:1
cell:BQ25:f:1
cell:BR25:f:1
cell:BS25:f:1
cell:BT25:f:1
cell:BU25:f:1
cell:BV25:f:1
cell:E26:f:1
cell:F26:f:1
cell:G26:f:1
cell:H26:f:1
cell:I26:f:1
cell:J26:f:1
cell:K26:f:1
cell:L26:f:1
cell:M26:f:1
cell:N26:f:1
cell:O26:vtf:t:':s1:f:1
cell:P26:f:1
cell:Q26:f:1
cell:R26:f:1
cell:S26:f:1
cell:T26:f:1
cell:U26:f:1
cell:V26:f:1
cell:W26:f:1
cell:X26:f:1
cell:Y26:vtf:t:o:s2:f:1
cell:Z26:f:1
cell:AA26:f:1
cell:AB26:f:1
cell:AC26:f:1
cell:AD26:f:1
cell:AE26:f:1
cell:AF26:f:1
cell:AG26:vtf:t:d:s3:f:1
cell:AH26:f:1
cell:AI26:f:1
cell:AJ26:f:1
cell:AK26:f:1
cell:AL26:vtf:t: :s4:f:1
cell:AM26:f:1
cell:AN26:f:1
cell:AO26:f:1
cell:AP26:f:1
cell:AQ26:f:1
cell:AR26:f:1
cell:AS26:f:1
cell:AT26:vtf:t:s:s5:f:1
cell:AU26:f:1
cell:AV26:f:1
cell:AW26:f:1
cell:AX26:f:1
cell:AY26:f:1
cell:AZ26:f:1
cell:BA26:f:1
cell:BB26:f:1
cell:BC26:f:1
cell:BD26:f:1
cell:BE26:f:1
cell:BF26:f:1
cell:BG26:f:1
cell:BH26:f:1
cell:BI26:f:1
cell:BJ26:f:1
cell:BK26:f:1
cell:BL26:f:1
cell:BM26:f:1
cell:BN26:f:1
cell:BO26:f:1
cell:BP26:f:1
cell:BQ26:f:1
cell:BR26:f:1
cell:BS26:f:1
cell:BT26:f:1
cell:BU26:f:1
cell:BV26:f:1
cell:E27:f:1
cell:F27:f:1
cell:G27:f:1
cell:H27:f:1
cell:I27:f:1
cell:J27:f:1
cell:K27:f:1
cell:L27:f:1
cell:M27:f:1
cell:N27:f:1
cell:O27:f:1
cell:P27:vtf:t:s:t1:f:1
cell:Q27:f:1
cell:R27:f:1
cell:S27:f:1
cell:T27:f:1
cell:U27:f:1
cell:V27:f:1
cell:W27:f:1
cell:X27:f:1
cell:Y27:f:1
cell:Z27:vtf:t:u:t2:f:1
cell:AA27:f:1
cell:AB27:f:1
cell:AC27:f:1
cell:AD27:f:1
cell:AE27:f:1
cell:AF27:f:1
cell:AG27:f:1
cell:AH27:vtf:t:s:t3:f:1
cell:AI27:f:1
cell:AJ27:f:1
cell:AK27:f:1
cell:AL27:f:1
cell:AM27:vtf:t:w:t4:f:1
cell:AN27:f:1
cell:AO27:f:1
cell:AP27:f:1
cell:AQ27:f:1
cell:AR27:f:1
cell:AS27:f:1
cell:AT27:vtf:t: :t5:f:1
cell:AU27:f:1
cell:AV27:f:1
cell:AW27:f:1
cell:AX27:f:1
cell:AY27:f:1
cell:AZ27:f:1
cell:BA27:f:1
cell:BB27:f:1
cell:BC27:f:1
cell:BD27:f:1
cell:BE27:f:1
cell:BF27:f:1
cell:BG27:f:1
cell:BH27:f:1
cell:BI27:f:1
cell:BJ27:f:1
cell:BK27:f:1
cell:BL27:f:1
cell:BM27:f:1
cell:BN27:f:1
cell:BO27:f:1
cell:BP27:f:1
cell:BQ27:f:1
cell:BR27:f:1
cell:BS27:f:1
cell:BT27:f:1
cell:BU27:f:1
cell:BV27:f:1
cell:E28:f:1
cell:F28:f:1
cell:G28:f:1
cell:H28:f:1
cell:I28:f:1
cell:J28:f:1
cell:K28:f:1
cell:L28:f:1
cell:M28:f:1
cell:N28:f:1
cell:O28:f:1
cell:P28:vtf:t: :u1:f:1
cell:Q28:vtf:t: :u1:f:1
cell:R28:f:1
cell:S28:f:1
cell:T28:f:1
cell:U28:f:1
cell:V28:f:1
cell:W28:f:1
cell:X28:f:1
cell:Y28:f:1
cell:Z28:vtf:t: :u2:f:1
cell:AA28:f:1
cell:AB28:f:1
cell:AC28:f:1
cell:AD28:f:1
cell:AE28:f:1
cell:AF28:f:1
cell:AG28:f:1
cell:AH28:vtf:t: :u3:f:1
cell:AI28:f:1
cell:AJ28:f:1
cell:AK28:f:1
cell:AL28:f:1
cell:AM28:f:1
cell:AN28:vtf:t:h:u4:f:1
cell:AO28:f:1
cell:AP28:f:1
cell:AQ28:f:1
cell:AR28:f:1
cell:AS28:f:1
cell:AT28:f:1
cell:AU28:vtf:t:f:u5:f:1
cell:AV28:f:1
cell:AW28:f:1
cell:AX28:f:1
cell:AY28:f:1
cell:AZ28:f:1
cell:BA28:f:1
cell:BB28:f:1
cell:BC28:f:1
cell:BD28:f:1
cell:BE28:f:1
cell:BF28:f:1
cell:BG28:f:1
cell:BH28:f:1
cell:BI28:f:1
cell:BJ28:f:1
cell:BK28:f:1
cell:BL28:f:1
cell:BM28:f:1
cell:BN28:f:1
cell:BO28:f:1
cell:BP28:f:1
cell:BQ28:f:1
cell:BR28:f:1
cell:BS28:f:1
cell:BT28:f:1
cell:BU28:f:1
cell:BV28:f:1
cell:E29:f:1
cell:F29:f:1
cell:G29:f:1
cell:H29:f:1
cell:I29:f:1
cell:J29:f:1
cell:K29:f:1
cell:L29:f:1
cell:M29:f:1
cell:N29:f:1
cell:O29:f:1
cell:P29:f:1
cell:Q29:vtf:t:v:v1:f:1
cell:R29:f:1
cell:S29:f:1
cell:T29:f:1
cell:U29:f:1
cell:V29:f:1
cell:W29:f:1
cell:X29:f:1
cell:Y29:f:1
cell:Z29:f:1
cell:AA29:vtf:t:a:v2:f:1
cell:AB29:f:1
cell:AC29:f:1
cell:AD29:f:1
cell:AE29:f:1
cell:AF29:f:1
cell:AG29:f:1
cell:AH29:vtf:t:b:v3:f:1
cell:AI29:f:1
cell:AJ29:f:1
cell:AK29:f:1
cell:AL29:f:1
cell:AM29:f:1
cell:AN29:f:1
cell:AO29:vtf:t:i:v4:f:1
cell:AP29:f:1
cell:AQ29:f:1
cell:AR29:f:1
cell:AS29:f:1
cell:AT29:f:1
cell:AU29:f:1
cell:AV29:vtf:t:a:v5:f:1
cell:AW29:f:1
cell:AX29:f:1
cell:AY29:f:1
cell:AZ29:f:1
cell:BA29:f:1
cell:BB29:f:1
cell:BC29:f:1
cell:BD29:f:1
cell:BE29:f:1
cell:BF29:f:1
cell:BG29:f:1
cell:BH29:f:1
cell:BI29:f:1
cell:BJ29:f:1
cell:BK29:f:1
cell:BL29:f:1
cell:BM29:f:1
cell:BN29:f:1
cell:BO29:f:1
cell:BP29:f:1
cell:BQ29:f:1
cell:BR29:f:1
cell:BS29:f:1
cell:BT29:f:1
cell:BU29:f:1
cell:BV29:f:1
cell:E30:f:1
cell:F30:f:1
cell:G30:f:1
cell:H30:f:1
cell:I30:f:1
cell:J30:f:1
cell:K30:f:1
cell:L30:f:1
cell:M30:f:1
cell:N30:f:1
cell:O30:f:1
cell:P30:f:1
cell:Q30:f:1
cell:R30:vtf:t:o:w1:f:1
cell:S30:f:1
cell:T30:f:1
cell:U30:f:1
cell:V30:f:1
cell:W30:f:1
cell:X30:f:1
cell:Y30:f:1
cell:Z30:f:1
cell:AA30:vtf:t:s:w2:f:1
cell:AB30:f:1
cell:AC30:f:1
cell:AD30:f:1
cell:AE30:f:1
cell:AF30:f:1
cell:AG30:f:1
cell:AH30:f:1
cell:AI30:vtf:t:e:w3:f:1
cell:AJ30:f:1
cell:AK30:f:1
cell:AL30:f:1
cell:AM30:f:1
cell:AN30:f:1
cell:AO30:f:1
cell:AP30:vtf:t:l:w4:f:1
cell:AQ30:f:1
cell:AR30:f:1
cell:AS30:f:1
cell:AT30:f:1
cell:AU30:f:1
cell:AV30:f:1
cell:AW30:vtf:t:l:w5:f:1
cell:AX30:f:1
cell:AY30:f:1
cell:AZ30:f:1
cell:BA30:f:1
cell:BB30:f:1
cell:BC30:f:1
cell:BD30:f:1
cell:BE30:f:1
cell:BF30:f:1
cell:BG30:f:1
cell:BH30:f:1
cell:BI30:f:1
cell:BJ30:f:1
cell:BK30:f:1
cell:BL30:f:1
cell:BM30:f:1
cell:BN30:f:1
cell:BO30:f:1
cell:BP30:f:1
cell:BQ30:f:1
cell:BR30:f:1
cell:BS30:f:1
cell:BT30:f:1
cell:BU30:f:1
cell:BV30:f:1
cell:E31:f:1
cell:F31:f:1
cell:G31:f:1
cell:H31:f:1
cell:I31:f:1
cell:J31:f:1
cell:K31:f:1
cell:L31:f:1
cell:M31:f:1
cell:N31:f:1
cell:O31:f:1
cell:P31:f:1
cell:Q31:f:1
cell:R31:vtf:t:i:x1:f:1
cell:S31:f:1
cell:T31:f:1
cell:U31:f:1
cell:V31:f:1
cell:W31:f:1
cell:X31:f:1
cell:Y31:f:1
cell:Z31:f:1
cell:AA31:f:1
cell:AB31:vtf:t: :x2:f:1
cell:AC31:f:1
cell:AD31:f:1
cell:AE31:f:1
cell:AF31:f:1
cell:AG31:f:1
cell:AH31:f:1
cell:AI31:vtf:t:g:x3:f:1
cell:AJ31:f:1
cell:AK31:f:1
cell:AL31:f:1
cell:AM31:f:1
cell:AN31:f:1
cell:AO31:f:1
cell:AP31:f:1
cell:AQ31:vtf:t:e:x4:f:1
cell:AR31:f:1
cell:AS31:f:1
cell:AT31:f:1
cell:AU31:f:1
cell:AV31:f:1
cell:AW31:f:1
cell:AX31:vtf:t:l:x5:f:1
cell:AY31:f:1
cell:AZ31:f:1
cell:BA31:f:1
cell:BB31:f:1
cell:BC31:f:1
cell:BD31:f:1
cell:BE31:f:1
cell:BF31:f:1
cell:BG31:f:1
cell:BH31:f:1
cell:BI31:f:1
cell:BJ31:f:1
cell:BK31:f:1
cell:BL31:f:1
cell:BM31:f:1
cell:BN31:f:1
cell:BO31:f:1
cell:BP31:f:1
cell:BQ31:f:1
cell:BR31:f:1
cell:BS31:f:1
cell:BT31:f:1
cell:BU31:f:1
cell:BV31:f:1
cell:E32:f:1
cell:F32:f:1
cell:G32:f:1
cell:H32:f:1
cell:I32:f:1
cell:J32:f:1
cell:K32:f:1
cell:L32:f:1
cell:M32:f:1
cell:N32:f:1
cell:O32:f:1
cell:P32:f:1
cell:Q32:f:1
cell:R32:f:1
cell:S32:vtf:t:c:y1:f:1
cell:T32:f:1
cell:U32:f:1
cell:V32:f:1
cell:W32:f:1
cell:X32:f:1
cell:Y32:f:1
cell:Z32:f:1
cell:AA32:f:1
cell:AB32:vtf:t:w:y2:f:1
cell:AC32:f:1
cell:AD32:f:1
cell:AE32:f:1
cell:AF32:f:1
cell:AG32:f:1
cell:AH32:f:1
cell:AI32:f:1
cell:AJ32:vtf:t:i:y3:f:1
cell:AK32:f:1
cell:AL32:f:1
cell:AM32:f:1
cell:AN32:f:1
cell:AO32:f:1
cell:AP32:f:1
cell:AQ32:f:1
cell:AR32:vtf:t: :y4:f:1
cell:AS32:f:1
cell:AT32:f:1
cell:AU32:f:1
cell:AV32:f:1
cell:AW32:f:1
cell:AX32:vtf:t: :y5:f:1
cell:AY32:f:1
cell:AZ32:f:1
cell:BA32:f:1
cell:BB32:f:1
cell:BC32:f:1
cell:BD32:f:1
cell:BE32:f:1
cell:BF32:f:1
cell:BG32:f:1
cell:BH32:f:1
cell:BI32:f:1
cell:BJ32:f:1
cell:BK32:f:1
cell:BL32:f:1
cell:BM32:f:1
cell:BN32:f:1
cell:BO32:f:1
cell:BP32:f:1
cell:BQ32:f:1
cell:BR32:f:1
cell:BS32:f:1
cell:BT32:f:1
cell:BU32:f:1
cell:BV32:f:1
cell:E33:f:1
cell:F33:f:1
cell:G33:f:1
cell:H33:f:1
cell:I33:f:1
cell:J33:f:1
cell:K33:f:1
cell:L33:f:1
cell:M33:f:1
cell:N33:f:1
cell:O33:f:1
cell:P33:f:1
cell:Q33:f:1
cell:R33:f:1
cell:S33:vtf:t:e:z1:f:1
cell:T33:f:1
cell:U33:f:1
cell:V33:f:1
cell:W33:f:1
cell:X33:f:1
cell:Y33:f:1
cell:Z33:f:1
cell:AA33:f:1
cell:AB33:f:1
cell:AC33:vtf:t:e:z2:f:1
cell:AD33:f:1
cell:AE33:f:1
cell:AF33:f:1
cell:AG33:f:1
cell:AH33:f:1
cell:AI33:f:1
cell:AJ33:f:1
cell:AK33:vtf:t:n:z3:f:1
cell:AL33:f:1
cell:AM33:f:1
cell:AN33:f:1
cell:AO33:f:1
cell:AP33:f:1
cell:AQ33:f:1
cell:AR33:vtf:t:r:z4:f:1
cell:AS33:f:1
cell:AT33:f:1
cell:AU33:f:1
cell:AV33:f:1
cell:AW33:f:1
cell:AX33:f:1
cell:AY33:vtf:t:o:z5:f:1
cell:AZ33:f:1
cell:BA33:f:1
cell:BB33:f:1
cell:BC33:f:1
cell:BD33:f:1
cell:BE33:f:1
cell:BF33:f:1
cell:BG33:f:1
cell:BH33:f:1
cell:BI33:f:1
cell:BJ33:f:1
cell:BK33:f:1
cell:BL33:f:1
cell:BM33:f:1
cell:BN33:f:1
cell:BO33:f:1
cell:BP33:f:1
cell:BQ33:f:1
cell:BR33:f:1
cell:BS33:f:1
cell:BT33:f:1
cell:BU33:f:1
cell:BV33:f:1
cell:E34:f:1
cell:F34:f:1
cell:G34:f:1
cell:H34:f:1
cell:I34:f:1
cell:J34:f:1
cell:K34:f:1
cell:L34:f:1
cell:M34:f:1
cell:N34:f:1
cell:O34:f:1
cell:P34:f:1
cell:Q34:f:1
cell:R34:f:1
cell:S34:f:1
cell:T34:vtf:t:s:aa1:f:1
cell:U34:f:1
cell:V34:f:1
cell:W34:f:1
cell:X34:f:1
cell:Y34:f:1
cell:Z34:f:1
cell:AA34:f:1
cell:AB34:f:1
cell:AC34:vtf:t:l:aa2:f:1
cell:AD34:f:1
cell:AE34:f:1
cell:AF34:f:1
cell:AG34:f:1
cell:AH34:f:1
cell:AI34:f:1
cell:AJ34:f:1
cell:AK34:vtf:t: :aa3:f:1
cell:AL34:f:1
cell:AM34:f:1
cell:AN34:f:1
cell:AO34:f:1
cell:AP34:f:1
cell:AQ34:f:1
cell:AR34:f:1
cell:AS34:vtf:t:e:aa4:f:1
cell:AT34:f:1
cell:AU34:f:1
cell:AV34:f:1
cell:AW34:f:1
cell:AX34:f:1
cell:AY34:f:1
cell:AZ34:vtf:t:f:aa5:f:1
cell:BA34:f:1
cell:BB34:f:1
cell:BC34:f:1
cell:BD34:f:1
cell:BE34:f:1
cell:BF34:f:1
cell:BG34:f:1
cell:BH34:f:1
cell:BI34:f:1
cell:BJ34:f:1
cell:BK34:f:1
cell:BL34:f:1
cell:BM34:f:1
cell:BN34:f:1
cell:BO34:f:1
cell:BP34:f:1
cell:BQ34:f:1
cell:BR34:f:1
cell:BS34:f:1
cell:BT34:f:1
cell:BU34:f:1
cell:BV34:f:1
cell:E35:f:1
cell:F35:f:1
cell:G35:f:1
cell:H35:f:1
cell:I35:f:1
cell:J35:f:1
cell:K35:f:1
cell:L35:f:1
cell:M35:f:1
cell:N35:f:1
cell:O35:f:1
cell:P35:f:1
cell:Q35:f:1
cell:R35:f:1
cell:S35:f:1
cell:T35:f:1
cell:U35:vtf:t: :ab1:f:1
cell:V35:f:1
cell:W35:f:1
cell:X35:f:1
cell:Y35:f:1
cell:Z35:f:1
cell:AA35:f:1
cell:AB35:f:1
cell:AC35:f:1
cell:AD35:vtf:t:l:ab2:f:1
cell:AE35:f:1
cell:AF35:f:1
cell:AG35:f:1
cell:AH35:f:1
cell:AI35:f:1
cell:AJ35:f:1
cell:AK35:f:1
cell:AL35:vtf:t:t:ab3:f:1
cell:AM35:f:1
cell:AN35:f:1
cell:AO35:f:1
cell:AP35:f:1
cell:AQ35:f:1
cell:AR35:f:1
cell:AS35:f:1
cell:AT35:vtf:t:g:ab4:f:1
cell:AU35:f:1
cell:AV35:f:1
cell:AW35:f:1
cell:AX35:f:1
cell:AY35:f:1
cell:AZ35:f:1
cell:BA35:vtf:t:f:ab5:f:1
cell:BB35:f:1
cell:BC35:f:1
cell:BD35:f:1
cell:BE35:f:1
cell:BF35:f:1
cell:BG35:f:1
cell:BH35:f:1
cell:BI35:f:1
cell:BJ35:f:1
cell:BK35:f:1
cell:BL35:f:1
cell:BM35:f:1
cell:BN35:f:1
cell:BO35:f:1
cell:BP35:f:1
cell:BQ35:f:1
cell:BR35:f:1
cell:BS35:f:1
cell:BT35:f:1
cell:BU35:f:1
cell:BV35:f:1
cell:E36:f:1
cell:F36:f:1
cell:G36:f:1
cell:H36:f:1
cell:I36:f:1
cell:J36:f:1
cell:K36:f:1
cell:L36:f:1
cell:M36:f:1
cell:N36:f:1
cell:O36:f:1
cell:P36:f:1
cell:Q36:f:1
cell:R36:f:1
cell:S36:f:1
cell:T36:f:1
cell:U36:vtf:t:a:ac1:f:1
cell:V36:f:1
cell:W36:f:1
cell:X36:f:1
cell:Y36:f:1
cell:Z36:f:1
cell:AA36:f:1
cell:AB36:f:1
cell:AC36:f:1
cell:AD36:f:1
cell:AE36:vtf:t: :ac2:f:1
cell:AF36:f:1
cell:AG36:f:1
cell:AH36:f:1
cell:AI36:f:1
cell:AJ36:f:1
cell:AK36:f:1
cell:AL36:vtf:t:o:ac3:f:1
cell:AM36:f:1
cell:AN36:f:1
cell:AO36:f:1
cell:AP36:f:1
cell:AQ36:f:1
cell:AR36:f:1
cell:AS36:f:1
cell:AT36:vtf:t:r:ac4:f:1
cell:AU36:f:1
cell:AV36:f:1
cell:AW36:f:1
cell:AX36:f:1
cell:AY36:f:1
cell:AZ36:f:1
cell:BA36:f:1
cell:BB36:vtf:t: :ac5:f:1
cell:BC36:f:1
cell:BD36:f:1
cell:BE36:f:1
cell:BF36:f:1
cell:BG36:f:1
cell:BH36:f:1
cell:BI36:f:1
cell:BJ36:f:1
cell:BK36:f:1
cell:BL36:f:1
cell:BM36:f:1
cell:BN36:f:1
cell:BO36:f:1
cell:BP36:f:1
cell:BQ36:f:1
cell:BR36:f:1
cell:BS36:f:1
cell:BT36:f:1
cell:BU36:f:1
cell:BV36:f:1
cell:E37:f:1
cell:F37:f:1
cell:G37:f:1
cell:H37:f:1
cell:I37:f:1
cell:J37:f:1
cell:K37:f:1
cell:L37:f:1
cell:M37:f:1
cell:N37:f:1
cell:O37:f:1
cell:P37:f:1
cell:Q37:f:1
cell:R37:f:1
cell:S37:f:1
cell:T37:f:1
cell:U37:f:1
cell:V37:vtf:t:s:ad1:f:1
cell:W37:f:1
cell:X37:f:1
cell:Y37:f:1
cell:Z37:f:1
cell:AA37:f:1
cell:AB37:f:1
cell:AC37:f:1
cell:AD37:f:1
cell:AE37:vtf:t:m:ad2:f:1
cell:AF37:f:1
cell:AG37:f:1
cell:AH37:f:1
cell:AI37:f:1
cell:AJ37:f:1
cell:AK37:f:1
cell:AL37:f:1
cell:AM37:vtf:t: :ad3:f:1
cell:AN37:f:1
cell:AO37:f:1
cell:AP37:f:1
cell:AQ37:f:1
cell:AR37:f:1
cell:AS37:f:1
cell:AT37:f:1
cell:AU37:vtf:t:e:ad4:f:1
cell:AV37:f:1
cell:AW37:f:1
cell:AX37:f:1
cell:AY37:f:1
cell:AZ37:f:1
cell:BA37:f:1
cell:BB37:vtf:t:w:ad5:f:1
cell:BC37:f:1
cell:BD37:f:1
cell:BE37:f:1
cell:BF37:f:1
cell:BG37:f:1
cell:BH37:f:1
cell:BI37:f:1
cell:BJ37:f:1
cell:BK37:f:1
cell:BL37:f:1
cell:BM37:f:1
cell:BN37:f:1
cell:BO37:f:1
cell:BP37:f:1
cell:BQ37:f:1
cell:BR37:f:1
cell:BS37:f:1
cell:BT37:f:1
cell:BU37:f:1
cell:BV37:f:1
cell:E38:f:1
cell:F38:f:1
cell:G38:f:1
cell:H38:f:1
cell:I38:f:1
cell:J38:f:1
cell:K38:f:1
cell:L38:f:1
cell:M38:f:1
cell:N38:f:1
cell:O38:f:1
cell:P38:f:1
cell:Q38:f:1
cell:R38:f:1
cell:S38:f:1
cell:T38:f:1
cell:U38:f:1
cell:V38:vtf:t: :ae1:f:1
cell:W38:f:1
cell:X38:f:1
cell:Y38:f:1
cell:Z38:f:1
cell:AA38:f:1
cell:AB38:f:1
cell:AC38:f:1
cell:AD38:f:1
cell:AE38:f:1
cell:AF38:vtf:t:a:ae2:f:1
cell:AG38:f:1
cell:AH38:f:1
cell:AI38:f:1
cell:AJ38:f:1
cell:AK38:f:1
cell:AL38:f:1
cell:AM38:f:1
cell:AN38:vtf:t:n:ae3:f:1
cell:AO38:f:1
cell:AP38:f:1
cell:AQ38:f:1
cell:AR38:f:1
cell:AS38:f:1
cell:AT38:f:1
cell:AU38:f:1
cell:AV38:vtf:t:t:ae4:f:1
cell:AW38:f:1
cell:AX38:f:1
cell:AY38:f:1
cell:AZ38:f:1
cell:BA38:f:1
cell:BB38:f:1
cell:BC38:vtf:t:h:ae5:f:1
cell:BD38:f:1
cell:BE38:f:1
cell:BF38:f:1
cell:BG38:f:1
cell:BH38:f:1
cell:BI38:f:1
cell:BJ38:f:1
cell:BK38:f:1
cell:BL38:f:1
cell:BM38:f:1
cell:BN38:f:1
cell:BO38:f:1
cell:BP38:f:1
cell:BQ38:f:1
cell:BR38:f:1
cell:BS38:f:1
cell:BT38:f:1
cell:BU38:f:1
cell:BV38:f:1
cell:E39:f:1
cell:F39:f:1
cell:G39:f:1
cell:H39:f:1
cell:I39:f:1
cell:J39:f:1
cell:K39:f:1
cell:L39:f:1
cell:M39:f:1
cell:N39:f:1
cell:O39:f:1
cell:P39:f:1
cell:Q39:f:1
cell:R39:f:1
cell:S39:f:1
cell:T39:f:1
cell:U39:f:1
cell:V39:f:1
cell:W39:vtf:t:i:af1:f:1
cell:X39:f:1
cell:Y39:f:1
cell:Z39:f:1
cell:AA39:f:1
cell:AB39:f:1
cell:AC39:f:1
cell:AD39:f:1
cell:AE39:f:1
cell:AF39:vtf:t:r:af2:f:1
cell:AG39:f:1
cell:AH39:f:1
cell:AI39:f:1
cell:AJ39:f:1
cell:AK39:f:1
cell:AL39:f:1
cell:AM39:f:1
cell:AN39:vtf:t:e:af3:f:1
cell:AO39:f:1
cell:AP39:f:1
cell:AQ39:f:1
cell:AR39:f:1
cell:AS39:f:1
cell:AT39:f:1
cell:AU39:f:1
cell:AV39:vtf:t: :af4:f:1
cell:AW39:f:1
cell:AX39:f:1
cell:AY39:f:1
cell:AZ39:f:1
cell:BA39:f:1
cell:BB39:f:1
cell:BC39:f:1
cell:BD39:vtf:t:i:af5:f:1
cell:BE39:f:1
cell:BF39:f:1
cell:BG39:f:1
cell:BH39:f:1
cell:BI39:f:1
cell:BJ39:f:1
cell:BK39:f:1
cell:BL39:f:1
cell:BM39:f:1
cell:BN39:f:1
cell:BO39:f:1
cell:BP39:f:1
cell:BQ39:f:1
cell:BR39:f:1
cell:BS39:f:1
cell:BT39:f:1
cell:BU39:f:1
cell:BV39:f:1
cell:E40:f:1
cell:F40:f:1
cell:G40:f:1
cell:H40:f:1
cell:I40:f:1
cell:J40:f:1
cell:K40:f:1
cell:L40:f:1
cell:M40:f:1
cell:N40:f:1
cell:O40:f:1
cell:P40:f:1
cell:Q40:f:1
cell:R40:f:1
cell:S40:f:1
cell:T40:f:1
cell:U40:f:1
cell:V40:f:1
cell:W40:vtf:t:f:ag1:f:1
cell:X40:f:1
cell:Y40:f:1
cell:Z40:f:1
cell:AA40:f:1
cell:AB40:f:1
cell:AC40:f:1
cell:AD40:f:1
cell:AE40:f:1
cell:AF40:f:1
cell:AG40:vtf:t:v:ag2:f:1
cell:AH40:f:1
cell:AI40:f:1
cell:AJ40:f:1
cell:AK40:f:1
cell:AL40:f:1
cell:AM40:f:1
cell:AN40:f:1
cell:AO40:vtf:t:i:ag3:f:1
cell:AP40:f:1
cell:AQ40:f:1
cell:AR40:f:1
cell:AS40:f:1
cell:AT40:f:1
cell:AU40:f:1
cell:AV40:f:1
cell:AW40:vtf:t:a:ag4:f:1
cell:AX40:f:1
cell:AY40:f:1
cell:AZ40:f:1
cell:BA40:f:1
cell:BB40:f:1
cell:BC40:f:1
cell:BD40:vtf:t:c:ag5:f:1
cell:BE40:f:1
cell:BF40:f:1
cell:BG40:f:1
cell:BH40:f:1
cell:BI40:f:1
cell:BJ40:f:1
cell:BK40:f:1
cell:BL40:f:1
cell:BM40:f:1
cell:BN40:f:1
cell:BO40:f:1
cell:BP40:f:1
cell:BQ40:f:1
cell:BR40:f:1
cell:BS40:f:1
cell:BT40:f:1
cell:BU40:f:1
cell:BV40:f:1
cell:E41:f:1
cell:F41:f:1
cell:G41:f:1
cell:H41:f:1
cell:I41:f:1
cell:J41:f:1
cell:K41:f:1
cell:L41:f:1
cell:M41:f:1
cell:N41:f:1
cell:O41:f:1
cell:P41:f:1
cell:Q41:f:1
cell:R41:f:1
cell:S41:f:1
cell:T41:f:1
cell:U41:f:1
cell:V41:f:1
cell:W41:f:1
cell:X41:vtf:t: :ah1:f:1
cell:Y41:f:1
cell:Z41:f:1
cell:AA41:f:1
cell:AB41:f:1
cell:AC41:f:1
cell:AD41:f:1
cell:AE41:f:1
cell:AF41:f:1
cell:AG41:f:1
cell:AH41:vtf:t:e:ah2:f:1
cell:AI41:f:1
cell:AJ41:f:1
cell:AK41:f:1
cell:AL41:f:1
cell:AM41:f:1
cell:AN41:f:1
cell:AO41:vtf:t:g:ah3:f:1
cell:AP41:f:1
cell:AQ41:f:1
cell:AR41:f:1
cell:AS41:f:1
cell:AT41:f:1
cell:AU41:f:1
cell:AV41:f:1
cell:AW41:vtf:t:n:ah4:f:1
cell:AX41:f:1
cell:AY41:f:1
cell:AZ41:f:1
cell:BA41:f:1
cell:BB41:f:1
cell:BC41:f:1
cell:BD41:f:1
cell:BE41:vtf:t:h:ah5:f:1
cell:BF41:f:1
cell:BG41:f:1
cell:BH41:f:1
cell:BI41:f:1
cell:BJ41:f:1
cell:BK41:f:1
cell:BL41:f:1
cell:BM41:f:1
cell:BN41:f:1
cell:BO41:f:1
cell:BP41:f:1
cell:BQ41:f:1
cell:BR41:f:1
cell:BS41:f:1
cell:BT41:f:1
cell:BU41:f:1
cell:BV41:f:1
cell:E42:f:1
cell:F42:f:1
cell:G42:f:1
cell:H42:f:1
cell:I42:f:1
cell:J42:f:1
cell:K42:f:1
cell:L42:f:1
cell:M42:f:1
cell:N42:f:1
cell:O42:f:1
cell:P42:f:1
cell:Q42:f:1
cell:R42:f:1
cell:S42:f:1
cell:T42:f:1
cell:U42:f:1
cell:V42:f:1
cell:W42:f:1
cell:X42:f:1
cell:Y42:vtf:t:t:ai1:f:1
cell:Z42:f:1
cell:AA42:f:1
cell:AB42:f:1
cell:AC42:f:1
cell:AD42:f:1
cell:AE42:f:1
cell:AF42:f:1
cell:AG42:f:1
cell:AH42:vtf:t:l:ai2:f:1
cell:AI42:f:1
cell:AJ42:f:1
cell:AK42:f:1
cell:AL42:f:1
cell:AM42:f:1
cell:AN42:f:1
cell:AO42:f:1
cell:AP42:vtf:t:h:ai3:f:1
cell:AQ42:f:1
cell:AR42:f:1
cell:AS42:f:1
cell:AT42:f:1
cell:AU42:f:1
cell:AV42:f:1
cell:AW42:f:1
cell:AX42:vtf:t:d:ai4:f:1
cell:AY42:f:1
cell:AZ42:f:1
cell:BA42:f:1
cell:BB42:f:1
cell:BC42:f:1
cell:BD42:f:1
cell:BE42:f:1
cell:BF42:vtf:t: :ai5:f:1
cell:BG42:f:1
cell:BH42:f:1
cell:BI42:f:1
cell:BJ42:f:1
cell:BK42:f:1
cell:BL42:f:1
cell:BM42:f:1
cell:BN42:f:1
cell:BO42:f:1
cell:BP42:f:1
cell:BQ42:f:1
cell:BR42:f:1
cell:BS42:f:1
cell:BT42:f:1
cell:BU42:f:1
cell:BV42:f:1
cell:E43:f:1
cell:F43:f:1
cell:G43:f:1
cell:H43:f:1
cell:I43:f:1
cell:J43:f:1
cell:K43:f:1
cell:L43:f:1
cell:M43:f:1
cell:N43:f:1
cell:O43:f:1
cell:P43:f:1
cell:Q43:f:1
cell:R43:f:1
cell:S43:f:1
cell:T43:f:1
cell:U43:f:1
cell:V43:f:1
cell:W43:f:1
cell:X43:f:1
cell:Y43:f:1
cell:Z43:vtf:t:h:aj1:f:1
cell:AA43:f:1
cell:AB43:f:1
cell:AC43:f:1
cell:AD43:f:1
cell:AE43:f:1
cell:AF43:f:1
cell:AG43:f:1
cell:AH43:f:1
cell:AI43:vtf:t:l:aj2:f:1
cell:AJ43:f:1
cell:AK43:f:1
cell:AL43:f:1
cell:AM43:f:1
cell:AN43:f:1
cell:AO43:f:1
cell:AP43:f:1
cell:AQ43:vtf:t: :aj3:f:1
cell:AR43:f:1
cell:AS43:f:1
cell:AT43:f:1
cell:AU43:f:1
cell:AV43:f:1
cell:AW43:f:1
cell:AX43:vtf:t: :aj4:f:1
cell:AY43:f:1
cell:AZ43:f:1
cell:BA43:f:1
cell:BB43:f:1
cell:BC43:f:1
cell:BD43:f:1
cell:BE43:f:1
cell:BF43:vtf:t:h:aj5:f:1
cell:BG43:f:1
cell:BH43:f:1
cell:BI43:f:1
cell:BJ43:f:1
cell:BK43:f:1
cell:BL43:f:1
cell:BM43:f:1
cell:BN43:f:1
cell:BO43:f:1
cell:BP43:f:1
cell:BQ43:f:1
cell:BR43:f:1
cell:BS43:f:1
cell:BT43:f:1
cell:BU43:f:1
cell:BV43:f:1
cell:E44:f:1
cell:F44:f:1
cell:G44:f:1
cell:H44:f:1
cell:I44:f:1
cell:J44:f:1
cell:K44:f:1
cell:L44:f:1
cell:M44:f:1
cell:N44:f:1
cell:O44:f:1
cell:P44:f:1
cell:Q44:f:1
cell:R44:f:1
cell:S44:f:1
cell:T44:f:1
cell:U44:f:1
cell:V44:f:1
cell:W44:f:1
cell:X44:f:1
cell:Y44:f:1
cell:Z44:vtf:t:e:ak1:f:1
cell:AA44:f:1
cell:AB44:f:1
cell:AC44:f:1
cell:AD44:f:1
cell:AE44:f:1
cell:AF44:f:1
cell:AG44:f:1
cell:AH44:f:1
cell:AI44:f:1
cell:AJ44:vtf:t:o:ak2:f:1
cell:AK44:f:1
cell:AL44:f:1
cell:AM44:f:1
cell:AN44:f:1
cell:AO44:f:1
cell:AP44:f:1
cell:AQ44:f:1
cell:AR44:vtf:t:a:ak3:f:1
cell:AS44:f:1
cell:AT44:f:1
cell:AU44:f:1
cell:AV44:f:1
cell:AW44:f:1
cell:AX44:f:1
cell:AY44:vtf:t:d:ak4:f:1
cell:AZ44:f:1
cell:BA44:f:1
cell:BB44:f:1
cell:BC44:f:1
cell:BD44:f:1
cell:BE44:f:1
cell:BF44:f:1
cell:BG44:vtf:t:o:ak5:f:1
cell:BH44:f:1
cell:BI44:f:1
cell:BJ44:f:1
cell:BK44:f:1
cell:BL44:f:1
cell:BM44:f:1
cell:BN44:f:1
cell:BO44:f:1
cell:BP44:f:1
cell:BQ44:f:1
cell:BR44:f:1
cell:BS44:f:1
cell:BT44:f:1
cell:BU44:f:1
cell:BV44:f:1
cell:E45:f:1
cell:F45:f:1
cell:G45:f:1
cell:H45:f:1
cell:I45:f:1
cell:J45:f:1
cell:K45:f:1
cell:L45:f:1
cell:M45:f:1
cell:N45:f:1
cell:O45:f:1
cell:P45:f:1
cell:Q45:f:1
cell:R45:f:1
cell:S45:f:1
cell:T45:f:1
cell:U45:f:1
cell:V45:f:1
cell:W45:f:1
cell:X45:f:1
cell:Y45:f:1
cell:Z45:vtf:t:y:al1:f:1
cell:AA45:f:1
cell:AB45:f:1
cell:AC45:f:1
cell:AD45:f:1
cell:AE45:f:1
cell:AF45:f:1
cell:AG45:f:1
cell:AH45:f:1
cell:AI45:f:1
cell:AJ45:f:1
cell:AK45:vtf:t:u:al2:f:1
cell:AL45:f:1
cell:AM45:f:1
cell:AN45:f:1
cell:AO45:f:1
cell:AP45:f:1
cell:AQ45:f:1
cell:AR45:f:1
cell:AS45:vtf:t: :al3:f:1
cell:AT45:f:1
cell:AU45:f:1
cell:AV45:f:1
cell:AW45:f:1
cell:AX45:f:1
cell:AY45:vtf:t:i:al4:f:1
cell:AZ45:f:1
cell:BA45:f:1
cell:BB45:f:1
cell:BC45:f:1
cell:BD45:f:1
cell:BE45:f:1
cell:BF45:f:1
cell:BG45:vtf:t:l:al5:f:1
cell:BH45:f:1
cell:BI45:f:1
cell:BJ45:f:1
cell:BK45:f:1
cell:BL45:f:1
cell:BM45:f:1
cell:BN45:f:1
cell:BO45:f:1
cell:BP45:f:1
cell:BQ45:f:1
cell:BR45:f:1
cell:BS45:f:1
cell:BT45:f:1
cell:BU45:f:1
cell:BV45:f:1
cell:E46:f:1
cell:F46:f:1
cell:G46:f:1
cell:H46:f:1
cell:I46:f:1
cell:J46:f:1
cell:K46:f:1
cell:L46:f:1
cell:M46:f:1
cell:N46:f:1
cell:O46:f:1
cell:P46:f:1
cell:Q46:f:1
cell:R46:f:1
cell:S46:f:1
cell:T46:f:1
cell:U46:f:1
cell:V46:f:1
cell:W46:f:1
cell:X46:f:1
cell:Y46:f:1
cell:Z46:f:1
cell:AA46:vtf:t: :am1:f:1
cell:AB46:f:1
cell:AC46:f:1
cell:AD46:f:1
cell:AE46:f:1
cell:AF46:f:1
cell:AG46:f:1
cell:AH46:f:1
cell:AI46:f:1
cell:AJ46:f:1
cell:AK46:vtf:t:s:am2:f:1
cell:AL46:f:1
cell:AM46:f:1
cell:AN46:f:1
cell:AO46:f:1
cell:AP46:f:1
cell:AQ46:f:1
cell:AR46:f:1
cell:AS46:vtf:t:w:am3:f:1
cell:AT46:f:1
cell:AU46:f:1
cell:AV46:f:1
cell:AW46:f:1
cell:AX46:f:1
cell:AY46:f:1
cell:AZ46:vtf:t:s:am4:f:1
cell:BA46:f:1
cell:BB46:f:1
cell:BC46:f:1
cell:BD46:f:1
cell:BE46:f:1
cell:BF46:f:1
cell:BG46:f:1
cell:BH46:vtf:t:d:am5:f:1
cell:BI46:f:1
cell:BJ46:f:1
cell:BK46:f:1
cell:BL46:f:1
cell:BM46:f:1
cell:BN46:f:1
cell:BO46:f:1
cell:BP46:f:1
cell:BQ46:f:1
cell:BR46:f:1
cell:BS46:f:1
cell:BT46:f:1
cell:BU46:f:1
cell:BV46:f:1
cell:E47:f:1
cell:F47:f:1
cell:G47:f:1
cell:H47:f:1
cell:I47:f:1
cell:J47:f:1
cell:K47:f:1
cell:L47:f:1
cell:M47:f:1
cell:N47:f:1
cell:O47:f:1
cell:P47:f:1
cell:Q47:f:1
cell:R47:f:1
cell:S47:f:1
cell:T47:f:1
cell:U47:f:1
cell:V47:f:1
cell:W47:f:1
cell:X47:f:1
cell:Y47:f:1
cell:Z47:f:1
cell:AA47:vtf:t:h:an1:f:1
cell:AB47:f:1
cell:AC47:f:1
cell:AD47:f:1
cell:AE47:f:1
cell:AF47:f:1
cell:AG47:f:1
cell:AH47:f:1
cell:AI47:f:1
cell:AJ47:f:1
cell:AK47:f:1
cell:AL47:vtf:t: :an2:f:1
cell:AM47:f:1
cell:AN47:f:1
cell:AO47:f:1
cell:AP47:f:1
cell:AQ47:f:1
cell:AR47:f:1
cell:AS47:f:1
cell:AT47:vtf:t:h:an3:f:1
cell:AU47:f:1
cell:AV47:f:1
cell:AW47:f:1
cell:AX47:f:1
cell:AY47:f:1
cell:AZ47:vtf:t:d:an4:f:1
cell:BA47:f:1
cell:BB47:f:1
cell:BC47:f:1
cell:BD47:f:1
cell:BE47:f:1
cell:BF47:f:1
cell:BG47:f:1
cell:BH47:vtf:t: :an5:f:1
cell:BI47:f:1
cell:BJ47:f:1
cell:BK47:f:1
cell:BL47:f:1
cell:BM47:f:1
cell:BN47:f:1
cell:BO47:f:1
cell:BP47:f:1
cell:BQ47:f:1
cell:BR47:f:1
cell:BS47:f:1
cell:BT47:f:1
cell:BU47:f:1
cell:BV47:f:1
cell:E48:f:1
cell:F48:f:1
cell:G48:f:1
cell:H48:f:1
cell:I48:f:1
cell:J48:f:1
cell:K48:f:1
cell:L48:f:1
cell:M48:f:1
cell:N48:f:1
cell:O48:f:1
cell:P48:f:1
cell:Q48:f:1
cell:R48:f:1
cell:S48:f:1
cell:T48:f:1
cell:U48:f:1
cell:V48:f:1
cell:W48:f:1
cell:X48:f:1
cell:Y48:f:1
cell:Z48:f:1
cell:AA48:f:1
cell:AB48:vtf:t:a:ao1:f:1
cell:AC48:f:1
cell:AD48:f:1
cell:AE48:f:1
cell:AF48:f:1
cell:AG48:f:1
cell:AH48:f:1
cell:AI48:f:1
cell:AJ48:f:1
cell:AK48:f:1
cell:AL48:vtf:t:e:ao2:f:1
cell:AM48:f:1
cell:AN48:f:1
cell:AO48:f:1
cell:AP48:f:1
cell:AQ48:f:1
cell:AR48:f:1
cell:AS48:f:1
cell:AT48:f:1
cell:AU48:vtf:t:o:ao3:f:1
cell:AV48:f:1
cell:AW48:f:1
cell:AX48:f:1
cell:AY48:f:1
cell:AZ48:f:1
cell:BA48:vtf:t:a:ao4:f:1
cell:BB48:f:1
cell:BC48:f:1
cell:BD48:f:1
cell:BE48:f:1
cell:BF48:f:1
cell:BG48:f:1
cell:BH48:f:1
cell:BI48:vtf:t:y:ao5:f:1
cell:BJ48:f:1
cell:BK48:f:1
cell:BL48:f:1
cell:BM48:f:1
cell:BN48:f:1
cell:BO48:f:1
cell:BP48:f:1
cell:BQ48:f:1
cell:BR48:f:1
cell:BS48:f:1
cell:BT48:f:1
cell:BU48:f:1
cell:BV48:f:1
cell:E49:f:1
cell:F49:f:1
cell:G49:f:1
cell:H49:f:1
cell:I49:f:1
cell:J49:f:1
cell:K49:f:1
cell:L49:f:1
cell:M49:f:1
cell:N49:f:1
cell:O49:f:1
cell:P49:f:1
cell:Q49:f:1
cell:R49:f:1
cell:S49:f:1
cell:T49:f:1
cell:U49:f:1
cell:V49:f:1
cell:W49:f:1
cell:X49:f:1
cell:Y49:f:1
cell:Z49:f:1
cell:AA49:f:1
cell:AB49:vtf:t:d:ap1:f:1
cell:AC49:f:1
cell:AD49:f:1
cell:AE49:f:1
cell:AF49:f:1
cell:AG49:f:1
cell:AH49:f:1
cell:AI49:f:1
cell:AJ49:f:1
cell:AK49:f:1
cell:AL49:f:1
cell:AM49:vtf:t:n:ap2:f:1
cell:AN49:f:1
cell:AO49:f:1
cell:AP49:f:1
cell:AQ49:f:1
cell:AR49:f:1
cell:AS49:f:1
cell:AT49:f:1
cell:AU49:f:1
cell:AV49:vtf:t:l:ap3:f:1
cell:AW49:f:1
cell:AX49:f:1
cell:AY49:f:1
cell:AZ49:f:1
cell:BA49:f:1
cell:BB49:vtf:t:i:ap4:f:1
cell:BC49:f:1
cell:BD49:f:1
cell:BE49:f:1
cell:BF49:f:1
cell:BG49:f:1
cell:BH49:f:1
cell:BI49:vtf:t:o:ap5:f:1
cell:BJ49:f:1
cell:BK49:f:1
cell:BL49:f:1
cell:BM49:f:1
cell:BN49:f:1
cell:BO49:f:1
cell:BP49:f:1
cell:BQ49:f:1
cell:BR49:f:1
cell:BS49:f:1
cell:BT49:f:1
cell:BU49:f:1
cell:BV49:f:1
cell:E50:f:1
cell:F50:f:1
cell:G50:f:1
cell:H50:f:1
cell:I50:f:1
cell:J50:f:1
cell:K50:f:1
cell:L50:f:1
cell:M50:f:1
cell:N50:f:1
cell:O50:f:1
cell:P50:f:1
cell:Q50:f:1
cell:R50:f:1
cell:S50:f:1
cell:T50:f:1
cell:U50:f:1
cell:V50:f:1
cell:W50:f:1
cell:X50:f:1
cell:Y50:f:1
cell:Z50:f:1
cell:AA50:f:1
cell:AB50:f:1
cell:AC50:vtf:t: :aq1:f:1
cell:AD50:f:1
cell:AE50:f:1
cell:AF50:f:1
cell:AG50:f:1
cell:AH50:f:1
cell:AI50:f:1
cell:AJ50:f:1
cell:AK50:f:1
cell:AL50:f:1
cell:AM50:vtf:t:c:aq2:f:1
cell:AN50:f:1
cell:AO50:f:1
cell:AP50:f:1
cell:AQ50:f:1
cell:AR50:f:1
cell:AS50:f:1
cell:AT50:f:1
cell:AU50:f:1
cell:AV50:vtf:t:e:aq3:f:1
cell:AW50:f:1
cell:AX50:f:1
cell:AY50:f:1
cell:AZ50:f:1
cell:BA50:f:1
cell:BB50:f:1
cell:BC50:vtf:t:n:aq4:f:1
cell:BD50:f:1
cell:BE50:f:1
cell:BF50:f:1
cell:BG50:f:1
cell:BH50:f:1
cell:BI50:vtf:t:u:aq5:f:1
cell:BJ50:f:1
cell:BK50:f:1
cell:BL50:f:1
cell:BM50:f:1
cell:BN50:f:1
cell:BO50:f:1
cell:BP50:f:1
cell:BQ50:f:1
cell:BR50:f:1
cell:BS50:f:1
cell:BT50:f:1
cell:BU50:f:1
cell:BV50:f:1
cell:E51:f:1
cell:F51:f:1
cell:G51:f:1
cell:H51:f:1
cell:I51:f:1
cell:J51:f:1
cell:K51:f:1
cell:L51:f:1
cell:M51:f:1
cell:N51:f:1
cell:O51:f:1
cell:P51:f:1
cell:Q51:f:1
cell:R51:f:1
cell:S51:f:1
cell:T51:f:1
cell:U51:f:1
cell:V51:f:1
cell:W51:f:1
cell:X51:f:1
cell:Y51:f:1
cell:Z51:f:1
cell:AA51:f:1
cell:AB51:f:1
cell:AC51:f:1
cell:AD51:vtf:t:d:ar1:f:1
cell:AE51:f:1
cell:AF51:f:1
cell:AG51:f:1
cell:AH51:f:1
cell:AI51:f:1
cell:AJ51:f:1
cell:AK51:f:1
cell:AL51:f:1
cell:AM51:f:1
cell:AN51:vtf:t:o:ar2:f:1
cell:AO51:f:1
cell:AP51:f:1
cell:AQ51:f:1
cell:AR51:f:1
cell:AS51:f:1
cell:AT51:f:1
cell:AU51:f:1
cell:AV51:f:1
cell:AW51:vtf:t: :ar3:f:1
cell:AX51:f:1
cell:AY51:f:1
cell:AZ51:f:1
cell:BA51:f:1
cell:BB51:f:1
cell:BC51:f:1
cell:BD51:vtf:t: :ar4:f:1
cell:BE51:f:1
cell:BF51:f:1
cell:BG51:f:1
cell:BH51:f:1
cell:BI51:f:1
cell:BJ51:vtf:t: :ar5:f:1
cell:BK51:f:1
cell:BL51:f:1
cell:BM51:f:1
cell:BN51:f:1
cell:BO51:f:1
cell:BP51:f:1
cell:BQ51:f:1
cell:BR51:f:1
cell:BS51:f:1
cell:BT51:f:1
cell:BU51:f:1
cell:BV51:f:1
cell:E52:f:1
cell:F52:f:1
cell:G52:f:1
cell:H52:f:1
cell:I52:f:1
cell:J52:f:1
cell:K52:f:1
cell:L52:f:1
cell:M52:f:1
cell:N52:f:1
cell:O52:f:1
cell:P52:f:1
cell:Q52:f:1
cell:R52:f:1
cell:S52:f:1
cell:T52:f:1
cell:U52:f:1
cell:V52:f:1
cell:W52:f:1
cell:X52:f:1
cell:Y52:f:1
cell:Z52:f:1
cell:AA52:f:1
cell:AB52:f:1
cell:AC52:f:1
cell:AD52:f:1
cell:AE52:vtf:t:i:as1:f:1
cell:AF52:f:1
cell:AG52:f:1
cell:AH52:f:1
cell:AI52:f:1
cell:AJ52:f:1
cell:AK52:f:1
cell:AL52:f:1
cell:AM52:f:1
cell:AN52:vtf:t:u:as2:f:1
cell:AO52:f:1
cell:AP52:f:1
cell:AQ52:f:1
cell:AR52:f:1
cell:AS52:f:1
cell:AT52:f:1
cell:AU52:f:1
cell:AV52:f:1
cell:AW52:vtf:t:u:as3:f:1
cell:AX52:f:1
cell:AY52:f:1
cell:AZ52:f:1
cell:BA52:f:1
cell:BB52:f:1
cell:BC52:f:1
cell:BD52:f:1
cell:BE52:vtf:t:w:as4:f:1
cell:BF52:f:1
cell:BG52:f:1
cell:BH52:f:1
cell:BI52:f:1
cell:BJ52:vtf:t:a:as5:f:1
cell:BK52:f:1
cell:BL52:f:1
cell:BM52:f:1
cell:BN52:f:1
cell:BO52:f:1
cell:BP52:f:1
cell:BQ52:f:1
cell:BR52:f:1
cell:BS52:f:1
cell:BT52:f:1
cell:BU52:f:1
cell:BV52:f:1
cell:E53:f:1
cell:F53:f:1
cell:G53:f:1
cell:H53:f:1
cell:I53:f:1
cell:J53:f:1
cell:K53:f:1
cell:L53:f:1
cell:M53:f:1
cell:N53:f:1
cell:O53:f:1
cell:P53:f:1
cell:Q53:f:1
cell:R53:f:1
cell:S53:f:1
cell:T53:f:1
cell:U53:f:1
cell:V53:f:1
cell:W53:f:1
cell:X53:f:1
cell:Y53:f:1
cell:Z53:f:1
cell:AA53:f:1
cell:AB53:f:1
cell:AC53:f:1
cell:AD53:f:1
cell:AE53:f:1
cell:AF53:vtf:t:e:at1:f:1
cell:AG53:f:1
cell:AH53:f:1
cell:AI53:f:1
cell:AJ53:f:1
cell:AK53:f:1
cell:AL53:f:1
cell:AM53:f:1
cell:AN53:f:1
cell:AO53:vtf:t:n:at2:f:1
cell:AP53:f:1
cell:AQ53:f:1
cell:AR53:f:1
cell:AS53:f:1
cell:AT53:f:1
cell:AU53:f:1
cell:AV53:f:1
cell:AW53:f:1
cell:AX53:vtf:t:n:at3:f:1
cell:AY53:f:1
cell:AZ53:f:1
cell:BA53:f:1
cell:BB53:f:1
cell:BC53:f:1
cell:BD53:f:1
cell:BE53:f:1
cell:BF53:vtf:t:e:at4:f:1
cell:BG53:f:1
cell:BH53:f:1
cell:BI53:f:1
cell:BJ53:f:1
cell:BK53:vtf:t:b:at5:f:1
cell:BL53:f:1
cell:BM53:f:1
cell:BN53:f:1
cell:BO53:f:1
cell:BP53:f:1
cell:BQ53:f:1
cell:BR53:f:1
cell:BS53:f:1
cell:BT53:f:1
cell:BU53:f:1
cell:BV53:f:1
cell:E54:f:1
cell:F54:f:1
cell:G54:f:1
cell:H54:f:1
cell:I54:f:1
cell:J54:f:1
cell:K54:f:1
cell:L54:f:1
cell:M54:f:1
cell:N54:f:1
cell:O54:f:1
cell:P54:f:1
cell:Q54:f:1
cell:R54:f:1
cell:S54:f:1
cell:T54:f:1
cell:U54:f:1
cell:V54:f:1
cell:W54:f:1
cell:X54:f:1
cell:Y54:f:1
cell:Z54:f:1
cell:AA54:f:1
cell:AB54:f:1
cell:AC54:f:1
cell:AD54:f:1
cell:AE54:f:1
cell:AF54:vtf:t:d:au1:f:1
cell:AG54:f:1
cell:AH54:f:1
cell:AI54:f:1
cell:AJ54:f:1
cell:AK54:f:1
cell:AL54:f:1
cell:AM54:f:1
cell:AN54:f:1
cell:AO54:f:1
cell:AP54:vtf:t:t:au2:f:1
cell:AQ54:f:1
cell:AR54:f:1
cell:AS54:f:1
cell:AT54:f:1
cell:AU54:f:1
cell:AV54:f:1
cell:AW54:f:1
cell:AX54:vtf:t:i:au3:f:1
cell:AY54:f:1
cell:AZ54:f:1
cell:BA54:f:1
cell:BB54:f:1
cell:BC54:f:1
cell:BD54:f:1
cell:BE54:f:1
cell:BF54:vtf:t:e:au4:f:1
cell:BG54:f:1
cell:BH54:f:1
cell:BI54:f:1
cell:BJ54:f:1
cell:BK54:vtf:t:o:au5:f:1
cell:BL54:f:1
cell:BM54:f:1
cell:BN54:f:1
cell:BO54:f:1
cell:BP54:f:1
cell:BQ54:f:1
cell:BR54:f:1
cell:BS54:f:1
cell:BT54:f:1
cell:BU54:f:1
cell:BV54:f:1
cell:E55:f:1
cell:F55:f:1
cell:G55:f:1
cell:H55:f:1
cell:I55:f:1
cell:J55:f:1
cell:K55:f:1
cell:L55:f:1
cell:M55:f:1
cell:N55:f:1
cell:O55:f:1
cell:P55:f:1
cell:Q55:f:1
cell:R55:f:1
cell:S55:f:1
cell:T55:f:1
cell:U55:f:1
cell:V55:f:1
cell:W55:f:1
cell:X55:f:1
cell:Y55:f:1
cell:Z55:f:1
cell:AA55:f:1
cell:AB55:f:1
cell:AC55:f:1
cell:AD55:f:1
cell:AE55:f:1
cell:AF55:f:1
cell:AG55:vtf:t: :av1:f:1
cell:AH55:f:1
cell:AI55:f:1
cell:AJ55:f:1
cell:AK55:f:1
cell:AL55:f:1
cell:AM55:f:1
cell:AN55:f:1
cell:AO55:f:1
cell:AP55:vtf:t:e:av2:f:1
cell:AQ55:f:1
cell:AR55:f:1
cell:AS55:f:1
cell:AT55:f:1
cell:AU55:f:1
cell:AV55:f:1
cell:AW55:f:1
cell:AX55:f:1
cell:AY55:vtf:t:v:av3:f:1
cell:AZ55:f:1
cell:BA55:f:1
cell:BB55:f:1
cell:BC55:f:1
cell:BD55:f:1
cell:BE55:f:1
cell:BF55:f:1
cell:BG55:vtf:t:p:av4:f:1
cell:BH55:f:1
cell:BI55:f:1
cell:BJ55:f:1
cell:BK55:f:1
cell:BL55:vtf:t:v:av5:f:1
cell:BM55:f:1
cell:BN55:f:1
cell:BO55:f:1
cell:BP55:f:1
cell:BQ55:f:1
cell:BR55:f:1
cell:BS55:f:1
cell:BT55:f:1
cell:BU55:f:1
cell:BV55:f:1
cell:E56:f:1
cell:F56:f:1
cell:G56:f:1
cell:H56:f:1
cell:I56:f:1
cell:J56:f:1
cell:K56:f:1
cell:L56:f:1
cell:M56:f:1
cell:N56:f:1
cell:O56:f:1
cell:P56:f:1
cell:Q56:f:1
cell:R56:f:1
cell:S56:f:1
cell:T56:f:1
cell:U56:f:1
cell:V56:f:1
cell:W56:f:1
cell:X56:f:1
cell:Y56:f:1
cell:Z56:f:1
cell:AA56:f:1
cell:AB56:f:1
cell:AC56:f:1
cell:AD56:f:1
cell:AE56:f:1
cell:AF56:f:1
cell:AG56:vtf:t:e:aw1:f:1
cell:AH56:f:1
cell:AI56:f:1
cell:AJ56:f:1
cell:AK56:f:1
cell:AL56:f:1
cell:AM56:f:1
cell:AN56:f:1
cell:AO56:f:1
cell:AP56:f:1
cell:AQ56:vtf:t:r:aw2:f:1
cell:AR56:f:1
cell:AS56:f:1
cell:AT56:f:1
cell:AU56:f:1
cell:AV56:f:1
cell:AW56:f:1
cell:AX56:f:1
cell:AY56:vtf:t:e:aw3:f:1
cell:AZ56:f:1
cell:BA56:f:1
cell:BB56:f:1
cell:BC56:f:1
cell:BD56:f:1
cell:BE56:f:1
cell:BF56:f:1
cell:BG56:vtf:t: :aw4:f:1
cell:BH56:f:1
cell:BI56:f:1
cell:BJ56:f:1
cell:BK56:f:1
cell:BL56:vtf:t:e:aw5:f:1
cell:BM56:f:1
cell:BN56:f:1
cell:BO56:f:1
cell:BP56:f:1
cell:BQ56:f:1
cell:BR56:f:1
cell:BS56:f:1
cell:BT56:f:1
cell:BU56:f:1
cell:BV56:f:1
cell:E57:f:1
cell:F57:f:1
cell:G57:f:1
cell:H57:f:1
cell:I57:f:1
cell:J57:f:1
cell:K57:f:1
cell:L57:f:1
cell:M57:f:1
cell:N57:f:1
cell:O57:f:1
cell:P57:f:1
cell:Q57:f:1
cell:R57:f:1
cell:S57:f:1
cell:T57:f:1
cell:U57:f:1
cell:V57:f:1
cell:W57:f:1
cell:X57:f:1
cell:Y57:f:1
cell:Z57:f:1
cell:AA57:f:1
cell:AB57:f:1
cell:AC57:f:1
cell:AD57:f:1
cell:AE57:f:1
cell:AF57:f:1
cell:AG57:f:1
cell:AH57:vtf:t:v:ax1:f:1
cell:AI57:f:1
cell:AJ57:f:1
cell:AK57:f:1
cell:AL57:f:1
cell:AM57:f:1
cell:AN57:f:1
cell:AO57:f:1
cell:AP57:f:1
cell:AQ57:f:1
cell:AR57:vtf:t:s:ax2:f:1
cell:AS57:f:1
cell:AT57:f:1
cell:AU57:f:1
cell:AV57:f:1
cell:AW57:f:1
cell:AX57:f:1
cell:AY57:f:1
cell:AZ57:vtf:t:r:ax3:f:1
cell:BA57:f:1
cell:BB57:f:1
cell:BC57:f:1
cell:BD57:f:1
cell:BE57:f:1
cell:BF57:f:1
cell:BG57:f:1
cell:BH57:vtf:t:t:ax4:f:1
cell:BI57:f:1
cell:BJ57:f:1
cell:BK57:f:1
cell:BL57:vtf:t: :ax5:f:1
cell:BM57:f:1
cell:BN57:f:1
cell:BO57:f:1
cell:BP57:f:1
cell:BQ57:f:1
cell:BR57:f:1
cell:BS57:f:1
cell:BT57:f:1
cell:BU57:f:1
cell:BV57:f:1
cell:E58:f:1
cell:F58:f:1
cell:G58:f:1
cell:H58:f:1
cell:I58:f:1
cell:J58:f:1
cell:K58:f:1
cell:L58:f:1
cell:M58:f:1
cell:N58:f:1
cell:O58:f:1
cell:P58:f:1
cell:Q58:f:1
cell:R58:f:1
cell:S58:f:1
cell:T58:f:1
cell:U58:f:1
cell:V58:f:1
cell:W58:f:1
cell:X58:f:1
cell:Y58:f:1
cell:Z58:f:1
cell:AA58:f:1
cell:AB58:f:1
cell:AC58:f:1
cell:AD58:f:1
cell:AE58:f:1
cell:AF58:f:1
cell:AG58:f:1
cell:AH58:vtf:t:e:ay1:f:1
cell:AI58:f:1
cell:AJ58:f:1
cell:AK58:f:1
cell:AL58:f:1
cell:AM58:f:1
cell:AN58:f:1
cell:AO58:f:1
cell:AP58:f:1
cell:AQ58:f:1
cell:AR58:f:1
cell:AS58:vtf:t: :ay2:f:1
cell:AT58:f:1
cell:AU58:f:1
cell:AV58:f:1
cell:AW58:f:1
cell:AX58:f:1
cell:AY58:f:1
cell:AZ58:vtf:t:s:ay3:f:1
cell:BA58:f:1
cell:BB58:f:1
cell:BC58:f:1
cell:BD58:f:1
cell:BE58:f:1
cell:BF58:f:1
cell:BG58:f:1
cell:BH58:vtf:t:o:ay4:f:1
cell:BI58:f:1
cell:BJ58:f:1
cell:BK58:f:1
cell:BL58:f:1
cell:BM58:vtf:t:a:ay5:f:1
cell:BN58:f:1
cell:BO58:f:1
cell:BP58:f:1
cell:BQ58:f:1
cell:BR58:f:1
cell:BS58:f:1
cell:BT58:f:1
cell:BU58:f:1
cell:BV58:f:1
cell:E59:f:1
cell:F59:f:1
cell:G59:f:1
cell:H59:f:1
cell:I59:f:1
cell:J59:f:1
cell:K59:f:1
cell:L59:f:1
cell:M59:f:1
cell:N59:f:1
cell:O59:f:1
cell:P59:f:1
cell:Q59:f:1
cell:R59:f:1
cell:S59:f:1
cell:T59:f:1
cell:U59:f:1
cell:V59:f:1
cell:W59:f:1
cell:X59:f:1
cell:Y59:f:1
cell:Z59:f:1
cell:AA59:f:1
cell:AB59:f:1
cell:AC59:f:1
cell:AD59:f:1
cell:AE59:f:1
cell:AF59:f:1
cell:AG59:f:1
cell:AH59:f:1
cell:AI59:vtf:t:n:az1:f:1
cell:AJ59:f:1
cell:AK59:f:1
cell:AL59:f:1
cell:AM59:f:1
cell:AN59:f:1
cell:AO59:f:1
cell:AP59:f:1
cell:AQ59:f:1
cell:AR59:f:1
cell:AS59:f:1
cell:AT59:vtf:t:o:az2:f:1
cell:AU59:f:1
cell:AV59:f:1
cell:AW59:f:1
cell:AX59:f:1
cell:AY59:f:1
cell:AZ59:f:1
cell:BA59:vtf:t:e:az3:f:1
cell:BB59:f:1
cell:BC59:f:1
cell:BD59:f:1
cell:BE59:f:1
cell:BF59:f:1
cell:BG59:f:1
cell:BH59:f:1
cell:BI59:vtf:t: :az4:f:1
cell:BJ59:f:1
cell:BK59:f:1
cell:BL59:f:1
cell:BM59:f:1
cell:BN59:vtf:t:n:az5:f:1
cell:BO59:f:1
cell:BP59:f:1
cell:BQ59:f:1
cell:BR59:f:1
cell:BS59:f:1
cell:BT59:f:1
cell:BU59:f:1
cell:BV59:f:1
cell:E60:f:1
cell:F60:f:1
cell:G60:f:1
cell:H60:f:1
cell:I60:f:1
cell:J60:f:1
cell:K60:f:1
cell:L60:f:1
cell:M60:f:1
cell:N60:f:1
cell:O60:f:1
cell:P60:f:1
cell:Q60:f:1
cell:R60:f:1
cell:S60:f:1
cell:T60:f:1
cell:U60:f:1
cell:V60:f:1
cell:W60:f:1
cell:X60:f:1
cell:Y60:f:1
cell:Z60:f:1
cell:AA60:f:1
cell:AB60:f:1
cell:AC60:f:1
cell:AD60:f:1
cell:AE60:f:1
cell:AF60:f:1
cell:AG60:f:1
cell:AH60:f:1
cell:AI60:f:1
cell:AJ60:vtf:t: :ba1:f:1
cell:AK60:f:1
cell:AL60:f:1
cell:AM60:f:1
cell:AN60:f:1
cell:AO60:f:1
cell:AP60:f:1
cell:AQ60:f:1
cell:AR60:f:1
cell:AS60:f:1
cell:AT60:f:1
cell:AU60:vtf:t:f:ba2:f:1
cell:AV60:f:1
cell:AW60:f:1
cell:AX60:f:1
cell:AY60:f:1
cell:AZ60:f:1
cell:BA60:vtf:t: :ba3:f:1
cell:BB60:f:1
cell:BC60:f:1
cell:BD60:f:1
cell:BE60:f:1
cell:BF60:f:1
cell:BG60:f:1
cell:BH60:f:1
cell:BI60:f:1
cell:BJ60:vtf:t:a:ba4:f:1
cell:BK60:f:1
cell:BL60:f:1
cell:BM60:f:1
cell:BN60:f:1
cell:BO60:vtf:t:d:ba5:f:1
cell:BP60:f:1
cell:BQ60:f:1
cell:BR60:f:1
cell:BS60:f:1
cell:BT60:f:1
cell:BU60:f:1
cell:BV60:f:1
cell:E61:f:1
cell:F61:f:1
cell:G61:f:1
cell:H61:f:1
cell:I61:f:1
cell:J61:f:1
cell:K61:f:1
cell:L61:f:1
cell:M61:f:1
cell:N61:f:1
cell:O61:f:1
cell:P61:f:1
cell:Q61:f:1
cell:R61:f:1
cell:S61:f:1
cell:T61:f:1
cell:U61:f:1
cell:V61:f:1
cell:W61:f:1
cell:X61:f:1
cell:Y61:f:1
cell:Z61:f:1
cell:AA61:f:1
cell:AB61:f:1
cell:AC61:f:1
cell:AD61:f:1
cell:AE61:f:1
cell:AF61:f:1
cell:AG61:f:1
cell:AH61:f:1
cell:AI61:f:1
cell:AJ61:f:1
cell:AK61:vtf:t:i:bb1:f:1
cell:AL61:f:1
cell:AM61:f:1
cell:AN61:f:1
cell:AO61:f:1
cell:AP61:f:1
cell:AQ61:f:1
cell:AR61:f:1
cell:AS61:f:1
cell:AT61:f:1
cell:AU61:vtf:t: :bb2:f:1
cell:AV61:f:1
cell:AW61:f:1
cell:AX61:f:1
cell:AY61:f:1
cell:AZ61:f:1
cell:BA61:f:1
cell:BB61:vtf:t:o:bb3:f:1
cell:BC61:f:1
cell:BD61:f:1
cell:BE61:f:1
cell:BF61:f:1
cell:BG61:f:1
cell:BH61:f:1
cell:BI61:f:1
cell:BJ61:vtf:t:n:bb4:f:1
cell:BK61:f:1
cell:BL61:f:1
cell:BM61:f:1
cell:BN61:f:1
cell:BO61:vtf:t: :bb5:f:1
cell:BP61:f:1
cell:BQ61:f:1
cell:BR61:f:1
cell:BS61:f:1
cell:BT61:f:1
cell:BU61:f:1
cell:BV61:f:1
cell:E62:f:1
cell:F62:f:1
cell:G62:f:1
cell:H62:f:1
cell:I62:f:1
cell:J62:f:1
cell:K62:f:1
cell:L62:f:1
cell:M62:f:1
cell:N62:f:1
cell:O62:f:1
cell:P62:f:1
cell:Q62:f:1
cell:R62:f:1
cell:S62:f:1
cell:T62:f:1
cell:U62:f:1
cell:V62:f:1
cell:W62:f:1
cell:X62:f:1
cell:Y62:f:1
cell:Z62:f:1
cell:AA62:f:1
cell:AB62:f:1
cell:AC62:f:1
cell:AD62:f:1
cell:AE62:f:1
cell:AF62:f:1
cell:AG62:f:1
cell:AH62:f:1
cell:AI62:f:1
cell:AJ62:f:1
cell:AK62:vtf:t:n:bc1:f:1
cell:AL62:f:1
cell:AM62:f:1
cell:AN62:f:1
cell:AO62:f:1
cell:AP62:f:1
cell:AQ62:f:1
cell:AR62:f:1
cell:AS62:f:1
cell:AT62:f:1
cell:AU62:f:1
cell:AV62:vtf:t:m:bc2:f:1
cell:AW62:f:1
cell:AX62:f:1
cell:AY62:f:1
cell:AZ62:f:1
cell:BA62:f:1
cell:BB62:f:1
cell:BC62:vtf:t:f:bc3:f:1
cell:BD62:f:1
cell:BE62:f:1
cell:BF62:f:1
cell:BG62:f:1
cell:BH62:f:1
cell:BI62:f:1
cell:BJ62:f:1
cell:BK62:vtf:t: :bc4:f:1
cell:BL62:f:1
cell:BM62:f:1
cell:BN62:f:1
cell:BO62:f:1
cell:BP62:vtf:t:b:bc5:f:1
cell:BQ62:f:1
cell:BR62:f:1
cell:BS62:f:1
cell:BT62:f:1
cell:BU62:f:1
cell:BV62:f:1
cell:E63:f:1
cell:F63:f:1
cell:G63:f:1
cell:H63:f:1
cell:I63:f:1
cell:J63:f:1
cell:K63:f:1
cell:L63:f:1
cell:M63:f:1
cell:N63:f:1
cell:O63:f:1
cell:P63:f:1
cell:Q63:f:1
cell:R63:f:1
cell:S63:f:1
cell:T63:f:1
cell:U63:f:1
cell:V63:f:1
cell:W63:f:1
cell:X63:f:1
cell:Y63:f:1
cell:Z63:f:1
cell:AA63:f:1
cell:AB63:f:1
cell:AC63:f:1
cell:AD63:f:1
cell:AE63:f:1
cell:AF63:f:1
cell:AG63:f:1
cell:AH63:f:1
cell:AI63:f:1
cell:AJ63:f:1
cell:AK63:f:1
cell:AL63:vtf:t: :bd1:f:1
cell:AM63:f:1
cell:AN63:f:1
cell:AO63:f:1
cell:AP63:f:1
cell:AQ63:f:1
cell:AR63:f:1
cell:AS63:f:1
cell:AT63:f:1
cell:AU63:f:1
cell:AV63:f:1
cell:AW63:vtf:t:y:bd2:f:1
cell:AX63:f:1
cell:AY63:f:1
cell:AZ63:f:1
cell:BA63:f:1
cell:BB63:f:1
cell:BC63:f:1
cell:BD63:vtf:t: :bd3:f:1
cell:BE63:f:1
cell:BF63:f:1
cell:BG63:f:1
cell:BH63:f:1
cell:BI63:f:1
cell:BJ63:f:1
cell:BK63:f:1
cell:BL63:vtf:t:a:bd4:f:1
cell:BM63:f:1
cell:BN63:f:1
cell:BO63:f:1
cell:BP63:f:1
cell:BQ63:vtf:t:e:bd5:f:1
cell:BR63:f:1
cell:BS63:f:1
cell:BT63:f:1
cell:BU63:f:1
cell:BV63:f:1
cell:E64:f:1
cell:F64:f:1
cell:G64:f:1
cell:H64:f:1
cell:I64:f:1
cell:J64:f:1
cell:K64:f:1
cell:L64:f:1
cell:M64:f:1
cell:N64:f:1
cell:O64:f:1
cell:P64:f:1
cell:Q64:f:1
cell:R64:f:1
cell:S64:f:1
cell:T64:f:1
cell:U64:f:1
cell:V64:f:1
cell:W64:f:1
cell:X64:f:1
cell:Y64:f:1
cell:Z64:f:1
cell:AA64:f:1
cell:AB64:f:1
cell:AC64:f:1
cell:AD64:f:1
cell:AE64:f:1
cell:AF64:f:1
cell:AG64:f:1
cell:AH64:f:1
cell:AI64:f:1
cell:AJ64:f:1
cell:AK64:f:1
cell:AL64:f:1
cell:AM64:vtf:t:m:be1:f:1
cell:AN64:f:1
cell:AO64:f:1
cell:AP64:f:1
cell:AQ64:f:1
cell:AR64:f:1
cell:AS64:f:1
cell:AT64:f:1
cell:AU64:f:1
cell:AV64:f:1
cell:AW64:f:1
cell:AX64:vtf:t: :be2:f:1
cell:AY64:f:1
cell:AZ64:f:1
cell:BA64:f:1
cell:BB64:f:1
cell:BC64:f:1
cell:BD64:f:1
cell:BE64:vtf:t:a:be3:f:1
cell:BF64:f:1
cell:BG64:f:1
cell:BH64:f:1
cell:BI64:f:1
cell:BJ64:f:1
cell:BK64:f:1
cell:BL64:f:1
cell:BM64:vtf:t:n:be4:f:1
cell:BN64:f:1
cell:BO64:f:1
cell:BP64:f:1
cell:BQ64:vtf:t:l:be5:f:1
cell:BR64:f:1
cell:BS64:f:1
cell:BT64:f:1
cell:BU64:f:1
cell:BV64:f:1
cell:E65:f:1
cell:F65:f:1
cell:G65:f:1
cell:H65:f:1
cell:I65:f:1
cell:J65:f:1
cell:K65:f:1
cell:L65:f:1
cell:M65:f:1
cell:N65:f:1
cell:O65:f:1
cell:P65:f:1
cell:Q65:f:1
cell:R65:f:1
cell:S65:f:1
cell:T65:f:1
cell:U65:f:1
cell:V65:f:1
cell:W65:f:1
cell:X65:f:1
cell:Y65:f:1
cell:Z65:f:1
cell:AA65:f:1
cell:AB65:f:1
cell:AC65:f:1
cell:AD65:f:1
cell:AE65:f:1
cell:AF65:f:1
cell:AG65:f:1
cell:AH65:f:1
cell:AI65:f:1
cell:AJ65:f:1
cell:AK65:f:1
cell:AL65:f:1
cell:AM65:vtf:t:e:bf1:f:1
cell:AN65:f:1
cell:AO65:f:1
cell:AP65:f:1
cell:AQ65:f:1
cell:AR65:f:1
cell:AS65:f:1
cell:AT65:f:1
cell:AU65:f:1
cell:AV65:f:1
cell:AW65:f:1
cell:AX65:vtf:t:l:bf2:f:1
cell:AY65:f:1
cell:AZ65:f:1
cell:BA65:f:1
cell:BB65:f:1
cell:BC65:f:1
cell:BD65:f:1
cell:BE65:vtf:t:u:bf3:f:1
cell:BF65:f:1
cell:BG65:f:1
cell:BH65:f:1
cell:BI65:f:1
cell:BJ65:f:1
cell:BK65:f:1
cell:BL65:f:1
cell:BM65:vtf:t:c:bf4:f:1
cell:BN65:f:1
cell:BO65:f:1
cell:BP65:f:1
cell:BQ65:f:1
cell:BR65:vtf:t:o:bf5:f:1
cell:BS65:f:1
cell:BT65:f:1
cell:BU65:f:1
cell:BV65:f:1
cell:E66:f:1
cell:F66:f:1
cell:G66:f:1
cell:H66:f:1
cell:I66:f:1
cell:J66:f:1
cell:K66:f:1
cell:L66:f:1
cell:M66:f:1
cell:N66:f:1
cell:O66:f:1
cell:P66:f:1
cell:Q66:f:1
cell:R66:f:1
cell:S66:f:1
cell:T66:f:1
cell:U66:f:1
cell:V66:f:1
cell:W66:f:1
cell:X66:f:1
cell:Y66:f:1
cell:Z66:f:1
cell:AA66:f:1
cell:AB66:f:1
cell:AC66:f:1
cell:AD66:f:1
cell:AE66:f:1
cell:AF66:f:1
cell:AG66:f:1
cell:AH66:f:1
cell:AI66:f:1
cell:AJ66:f:1
cell:AK66:f:1
cell:AL66:f:1
cell:AM66:f:1
cell:AN66:vtf:t:m:bg1:f:1
cell:AO66:f:1
cell:AP66:f:1
cell:AQ66:f:1
cell:AR66:f:1
cell:AS66:f:1
cell:AT66:f:1
cell:AU66:f:1
cell:AV66:f:1
cell:AW66:f:1
cell:AX66:f:1
cell:AY66:vtf:t:i:bg2:f:1
cell:AZ66:f:1
cell:BA66:f:1
cell:BB66:f:1
cell:BC66:f:1
cell:BD66:f:1
cell:BE66:f:1
cell:BF66:vtf:t:r:bg3:f:1
cell:BG66:f:1
cell:BH66:f:1
cell:BI66:f:1
cell:BJ66:f:1
cell:BK66:f:1
cell:BL66:f:1
cell:BM66:f:1
cell:BN66:vtf:t:i:bg4:f:1
cell:BO66:f:1
cell:BP66:f:1
cell:BQ66:f:1
cell:BR66:f:1
cell:BS66:vtf:t:w:bg5:f:1
cell:BT66:f:1
cell:BU66:f:1
cell:BV66:f:1
cell:E67:f:1
cell:F67:f:1
cell:G67:f:1
cell:H67:f:1
cell:I67:f:1
cell:J67:f:1
cell:K67:f:1
cell:L67:f:1
cell:M67:f:1
cell:N67:f:1
cell:O67:f:1
cell:P67:f:1
cell:Q67:f:1
cell:R67:f:1
cell:S67:f:1
cell:T67:f:1
cell:U67:f:1
cell:V67:f:1
cell:W67:f:1
cell:X67:f:1
cell:Y67:f:1
cell:Z67:f:1
cell:AA67:f:1
cell:AB67:f:1
cell:AC67:f:1
cell:AD67:f:1
cell:AE67:f:1
cell:AF67:f:1
cell:AG67:f:1
cell:AH67:f:1
cell:AI67:f:1
cell:AJ67:f:1
cell:AK67:f:1
cell:AL67:f:1
cell:AM67:f:1
cell:AN67:vtf:t:o:bh1:f:1
cell:AO67:f:1
cell:AP67:f:1
cell:AQ67:f:1
cell:AR67:f:1
cell:AS67:f:1
cell:AT67:f:1
cell:AU67:f:1
cell:AV67:f:1
cell:AW67:f:1
cell:AX67:f:1
cell:AY67:f:1
cell:AZ67:vtf:t:f:bh2:f:1
cell:BA67:f:1
cell:BB67:f:1
cell:BC67:f:1
cell:BD67:f:1
cell:BE67:f:1
cell:BF67:f:1
cell:BG67:vtf:t:i:bh3:f:1
cell:BH67:f:1
cell:BI67:f:1
cell:BJ67:f:1
cell:BK67:f:1
cell:BL67:f:1
cell:BM67:f:1
cell:BN67:f:1
cell:BO67:vtf:t:e:bh4:f:1
cell:BP67:f:1
cell:BQ67:f:1
cell:BR67:f:1
cell:BS67:f:1
cell:BT67:f:1
cell:BU67:f:1
cell:BV67:f:1
cell:E68:f:1
cell:F68:f:1
cell:G68:f:1
cell:H68:f:1
cell:I68:f:1
cell:J68:f:1
cell:K68:f:1
cell:L68:f:1
cell:M68:f:1
cell:N68:f:1
cell:O68:f:1
cell:P68:f:1
cell:Q68:f:1
cell:R68:f:1
cell:S68:f:1
cell:T68:f:1
cell:U68:f:1
cell:V68:f:1
cell:W68:f:1
cell:X68:f:1
cell:Y68:f:1
cell:Z68:f:1
cell:AA68:f:1
cell:AB68:f:1
cell:AC68:f:1
cell:AD68:f:1
cell:AE68:f:1
cell:AF68:f:1
cell:AG68:f:1
cell:AH68:f:1
cell:AI68:f:1
cell:AJ68:f:1
cell:AK68:f:1
cell:AL68:f:1
cell:AM68:f:1
cell:AN68:f:1
cell:AO68:vtf:t:r:bi1:f:1
cell:AP68:f:1
cell:AQ68:f:1
cell:AR68:f:1
cell:AS68:f:1
cell:AT68:f:1
cell:AU68:f:1
cell:AV68:f:1
cell:AW68:f:1
cell:AX68:f:1
cell:AY68:f:1
cell:AZ68:f:1
cell:BA68:vtf:t:e:bi2:f:1
cell:BB68:f:1
cell:BC68:f:1
cell:BD68:f:1
cell:BE68:f:1
cell:BF68:f:1
cell:BG68:f:1
cell:BH68:vtf:t:c:bi3:f:1
cell:BI68:f:1
cell:BJ68:f:1
cell:BK68:f:1
cell:BL68:f:1
cell:BM68:f:1
cell:BN68:f:1
cell:BO68:vtf:t:n:bi4:f:1
cell:BP68:f:1
cell:BQ68:f:1
cell:BR68:f:1
cell:BS68:f:1
cell:BT68:f:1
cell:BU68:f:1
cell:BV68:f:1
cell:E69:f:1
cell:F69:f:1
cell:G69:f:1
cell:H69:f:1
cell:I69:f:1
cell:J69:f:1
cell:K69:f:1
cell:L69:f:1
cell:M69:f:1
cell:N69:f:1
cell:O69:f:1
cell:P69:f:1
cell:Q69:f:1
cell:R69:f:1
cell:S69:f:1
cell:T69:f:1
cell:U69:f:1
cell:V69:f:1
cell:W69:f:1
cell:X69:f:1
cell:Y69:f:1
cell:Z69:f:1
cell:AA69:f:1
cell:AB69:f:1
cell:AC69:f:1
cell:AD69:f:1
cell:AE69:f:1
cell:AF69:f:1
cell:AG69:f:1
cell:AH69:f:1
cell:AI69:f:1
cell:AJ69:f:1
cell:AK69:f:1
cell:AL69:f:1
cell:AM69:f:1
cell:AN69:f:1
cell:AO69:vtf:t:y:bj1:f:1
cell:AP69:f:1
cell:AQ69:f:1
cell:AR69:f:1
cell:AS69:f:1
cell:AT69:f:1
cell:AU69:f:1
cell:AV69:f:1
cell:AW69:f:1
cell:AX69:f:1
cell:AY69:f:1
cell:AZ69:f:1
cell:BA69:f:1
cell:BB69:vtf:t: :bj2:f:1
cell:BC69:f:1
cell:BD69:f:1
cell:BE69:f:1
cell:BF69:f:1
cell:BG69:f:1
cell:BH69:vtf:t:u:bj3:f:1
cell:BI69:f:1
cell:BJ69:f:1
cell:BK69:f:1
cell:BL69:f:1
cell:BM69:f:1
cell:BN69:f:1
cell:BO69:f:1
cell:BP69:vtf:t:t:bj4:f:1
cell:BQ69:f:1
cell:BR69:f:1
cell:BS69:f:1
cell:BT69:f:1
cell:BU69:f:1
cell:BV69:f:1
cell:E70:f:1
cell:F70:f:1
cell:G70:f:1
cell:H70:f:1
cell:I70:f:1
cell:J70:f:1
cell:K70:f:1
cell:L70:f:1
cell:M70:f:1
cell:N70:f:1
cell:O70:f:1
cell:P70:f:1
cell:Q70:f:1
cell:R70:f:1
cell:S70:f:1
cell:T70:f:1
cell:U70:f:1
cell:V70:f:1
cell:W70:f:1
cell:X70:f:1
cell:Y70:f:1
cell:Z70:f:1
cell:AA70:f:1
cell:AB70:f:1
cell:AC70:f:1
cell:AD70:f:1
cell:AE70:f:1
cell:AF70:f:1
cell:AG70:f:1
cell:AH70:f:1
cell:AI70:f:1
cell:AJ70:f:1
cell:AK70:f:1
cell:AL70:f:1
cell:AM70:f:1
cell:AN70:f:1
cell:AO70:f:1
cell:AP70:vtf:t: :bk1:f:1
cell:AQ70:f:1
cell:AR70:f:1
cell:AS70:f:1
cell:AT70:f:1
cell:AU70:f:1
cell:AV70:f:1
cell:AW70:f:1
cell:AX70:f:1
cell:AY70:f:1
cell:AZ70:f:1
cell:BA70:f:1
cell:BB70:vtf:t:O:bk2:f:1
cell:BC70:f:1
cell:BD70:f:1
cell:BE70:f:1
cell:BF70:f:1
cell:BG70:f:1
cell:BH70:f:1
cell:BI70:vtf:t:l:bk3:f:1
cell:BJ70:f:1
cell:BK70:f:1
cell:BL70:f:1
cell:BM70:f:1
cell:BN70:f:1
cell:BO70:f:1
cell:BP70:f:1
cell:BQ70:vtf:t: :bk4:f:1
cell:BR70:f:1
cell:BS70:f:1
cell:BT70:f:1
cell:BU70:f:1
cell:BV70:f:1
cell:E71:f:1
cell:F71:f:1
cell:G71:f:1
cell:H71:f:1
cell:I71:f:1
cell:J71:f:1
cell:K71:f:1
cell:L71:f:1
cell:M71:f:1
cell:N71:f:1
cell:O71:f:1
cell:P71:f:1
cell:Q71:f:1
cell:R71:f:1
cell:S71:f:1
cell:T71:f:1
cell:U71:f:1
cell:V71:f:1
cell:W71:f:1
cell:X71:f:1
cell:Y71:f:1
cell:Z71:f:1
cell:AA71:f:1
cell:AB71:f:1
cell:AC71:f:1
cell:AD71:f:1
cell:AE71:f:1
cell:AF71:f:1
cell:AG71:f:1
cell:AH71:f:1
cell:AI71:f:1
cell:AJ71:f:1
cell:AK71:f:1
cell:AL71:f:1
cell:AM71:f:1
cell:AN71:f:1
cell:AO71:f:1
cell:AP71:vtf:t: :bl1:f:1
cell:AQ71:f:1
cell:AR71:f:1
cell:AS71:f:1
cell:AT71:f:1
cell:AU71:f:1
cell:AV71:f:1
cell:AW71:f:1
cell:AX71:f:1
cell:AY71:f:1
cell:AZ71:f:1
cell:BA71:f:1
cell:BB71:f:1
cell:BC71:vtf:t: :bl2:f:1
cell:BD71:f:1
cell:BE71:f:1
cell:BF71:f:1
cell:BG71:f:1
cell:BH71:f:1
cell:BI71:f:1
cell:BJ71:vtf:t:a:bl3:f:1
cell:BK71:f:1
cell:BL71:f:1
cell:BM71:f:1
cell:BN71:f:1
cell:BO71:f:1
cell:BP71:f:1
cell:BQ71:vtf:t:m:bl4:f:1
cell:BR71:f:1
cell:BS71:f:1
cell:BT71:f:1
cell:BU71:f:1
cell:BV71:f:1
cell:E72:f:1
cell:F72:f:1
cell:G72:f:1
cell:H72:f:1
cell:I72:f:1
cell:J72:f:1
cell:K72:f:1
cell:L72:f:1
cell:M72:f:1
cell:N72:f:1
cell:O72:f:1
cell:P72:f:1
cell:Q72:f:1
cell:R72:f:1
cell:S72:f:1
cell:T72:f:1
cell:U72:f:1
cell:V72:f:1
cell:W72:f:1
cell:X72:f:1
cell:Y72:f:1
cell:Z72:f:1
cell:AA72:f:1
cell:AB72:f:1
cell:AC72:f:1
cell:AD72:f:1
cell:AE72:f:1
cell:AF72:f:1
cell:AG72:f:1
cell:AH72:f:1
cell:AI72:f:1
cell:AJ72:f:1
cell:AK72:f:1
cell:AL72:f:1
cell:AM72:f:1
cell:AN72:f:1
cell:AO72:f:1
cell:AP72:f:1
cell:AQ72:vtf:t: :bm1:f:1
cell:AR72:f:1
cell:AS72:f:1
cell:AT72:f:1
cell:AU72:f:1
cell:AV72:f:1
cell:AW72:f:1
cell:AX72:f:1
cell:AY72:f:1
cell:AZ72:f:1
cell:BA72:f:1
cell:BB72:f:1
cell:BC72:vtf:t:l:bm2:f:1
cell:BD72:f:1
cell:BE72:f:1
cell:BF72:f:1
cell:BG72:f:1
cell:BH72:f:1
cell:BI72:f:1
cell:BJ72:f:1
cell:BK72:vtf:t:r:bm3:f:1
cell:BL72:f:1
cell:BM72:f:1
cell:BN72:f:1
cell:BO72:f:1
cell:BP72:f:1
cell:BQ72:f:1
cell:BR72:vtf:t:u:bm4:f:1
cell:BS72:f:1
cell:BT72:f:1
cell:BU72:f:1
cell:BV72:f:1
cell:E73:f:1
cell:F73:f:1
cell:G73:f:1
cell:H73:f:1
cell:I73:f:1
cell:J73:f:1
cell:K73:f:1
cell:L73:f:1
cell:M73:f:1
cell:N73:f:1
cell:O73:f:1
cell:P73:f:1
cell:Q73:f:1
cell:R73:f:1
cell:S73:f:1
cell:T73:f:1
cell:U73:f:1
cell:V73:f:1
cell:W73:f:1
cell:X73:f:1
cell:Y73:f:1
cell:Z73:f:1
cell:AA73:f:1
cell:AB73:f:1
cell:AC73:f:1
cell:AD73:f:1
cell:AE73:f:1
cell:AF73:f:1
cell:AG73:f:1
cell:AH73:f:1
cell:AI73:f:1
cell:AJ73:f:1
cell:AK73:f:1
cell:AL73:f:1
cell:AM73:f:1
cell:AN73:f:1
cell:AO73:f:1
cell:AP73:f:1
cell:AQ73:vtf:t: :bn1:f:1
cell:AR73:f:1
cell:AS73:f:1
cell:AT73:f:1
cell:AU73:f:1
cell:AV73:f:1
cell:AW73:f:1
cell:AX73:f:1
cell:AY73:f:1
cell:AZ73:f:1
cell:BA73:f:1
cell:BB73:f:1
cell:BC73:vtf:t:i:bn2:f:1
cell:BD73:f:1
cell:BE73:f:1
cell:BF73:f:1
cell:BG73:f:1
cell:BH73:f:1
cell:BI73:f:1
cell:BJ73:f:1
cell:BK73:vtf:t: :bn3:f:1
cell:BL73:f:1
cell:BM73:f:1
cell:BN73:f:1
cell:BO73:f:1
cell:BP73:f:1
cell:BQ73:f:1
cell:BR73:f:1
cell:BS73:vtf:t:s:bn4:f:1
cell:BT73:f:1
cell:BU73:f:1
cell:BV73:f:1
cell:E74:f:1
cell:F74:f:1
cell:G74:f:1
cell:H74:f:1
cell:I74:f:1
cell:J74:f:1
cell:K74:f:1
cell:L74:f:1
cell:M74:f:1
cell:N74:f:1
cell:O74:f:1
cell:P74:f:1
cell:Q74:f:1
cell:R74:f:1
cell:S74:f:1
cell:T74:f:1
cell:U74:f:1
cell:V74:f:1
cell:W74:f:1
cell:X74:f:1
cell:Y74:f:1
cell:Z74:f:1
cell:AA74:f:1
cell:AB74:f:1
cell:AC74:f:1
cell:AD74:f:1
cell:AE74:f:1
cell:AF74:f:1
cell:AG74:f:1
cell:AH74:f:1
cell:AI74:f:1
cell:AJ74:f:1
cell:AK74:f:1
cell:AL74:f:1
cell:AM74:f:1
cell:AN74:f:1
cell:AO74:f:1
cell:AP74:f:1
cell:AQ74:f:1
cell:AR74:vtf:t: :bo1:f:1
cell:AS74:f:1
cell:AT74:f:1
cell:AU74:f:1
cell:AV74:f:1
cell:AW74:f:1
cell:AX74:f:1
cell:AY74:f:1
cell:AZ74:f:1
cell:BA74:f:1
cell:BB74:f:1
cell:BC74:vtf:t:t:bo2:f:1
cell:BD74:f:1
cell:BE74:f:1
cell:BF74:f:1
cell:BG74:f:1
cell:BH74:f:1
cell:BI74:f:1
cell:BJ74:f:1
cell:BK74:f:1
cell:BL74:vtf:t:c:bo3:f:1
cell:BM74:f:1
cell:BN74:f:1
cell:BO74:f:1
cell:BP74:f:1
cell:BQ74:f:1
cell:BR74:f:1
cell:BS74:f:1
cell:BT74:vtf:t:i:bo4:f:1
cell:BU74:f:1
cell:BV74:f:1
cell:E75:f:1
cell:F75:f:1
cell:G75:f:1
cell:H75:f:1
cell:I75:f:1
cell:J75:f:1
cell:K75:f:1
cell:L75:f:1
cell:M75:f:1
cell:N75:f:1
cell:O75:f:1
cell:P75:f:1
cell:Q75:f:1
cell:R75:f:1
cell:S75:f:1
cell:T75:f:1
cell:U75:f:1
cell:V75:f:1
cell:W75:f:1
cell:X75:f:1
cell:Y75:f:1
cell:Z75:f:1
cell:AA75:f:1
cell:AB75:f:1
cell:AC75:f:1
cell:AD75:f:1
cell:AE75:f:1
cell:AF75:f:1
cell:AG75:f:1
cell:AH75:f:1
cell:AI75:f:1
cell:AJ75:f:1
cell:AK75:f:1
cell:AL75:f:1
cell:AM75:f:1
cell:AN75:f:1
cell:AO75:f:1
cell:AP75:f:1
cell:AQ75:f:1
cell:AR75:vtf:t: :bp1:f:1
cell:AS75:f:1
cell:AT75:f:1
cell:AU75:f:1
cell:AV75:f:1
cell:AW75:f:1
cell:AX75:f:1
cell:AY75:f:1
cell:AZ75:f:1
cell:BA75:f:1
cell:BB75:f:1
cell:BC75:f:1
cell:BD75:vtf:t:t:bp2:f:1
cell:BE75:f:1
cell:BF75:f:1
cell:BG75:f:1
cell:BH75:f:1
cell:BI75:f:1
cell:BJ75:f:1
cell:BK75:f:1
cell:BL75:f:1
cell:BM75:vtf:t:i:bp3:f:1
cell:BN75:f:1
cell:BO75:f:1
cell:BP75:f:1
cell:BQ75:f:1
cell:BR75:f:1
cell:BS75:f:1
cell:BT75:vtf:t:c:bp4:f:1
cell:BU75:f:1
cell:BV75:f:1
cell:E76:f:1
cell:F76:f:1
cell:G76:f:1
cell:H76:f:1
cell:I76:f:1
cell:J76:f:1
cell:K76:f:1
cell:L76:f:1
cell:M76:f:1
cell:N76:f:1
cell:O76:f:1
cell:P76:f:1
cell:Q76:f:1
cell:R76:f:1
cell:S76:f:1
cell:T76:f:1
cell:U76:f:1
cell:V76:f:1
cell:W76:f:1
cell:X76:f:1
cell:Y76:f:1
cell:Z76:f:1
cell:AA76:f:1
cell:AB76:f:1
cell:AC76:f:1
cell:AD76:f:1
cell:AE76:f:1
cell:AF76:f:1
cell:AG76:f:1
cell:AH76:f:1
cell:AI76:f:1
cell:AJ76:f:1
cell:AK76:f:1
cell:AL76:f:1
cell:AM76:f:1
cell:AN76:f:1
cell:AO76:f:1
cell:AP76:f:1
cell:AQ76:f:1
cell:AR76:f:1
cell:AS76:vtf:t: :bq1:f:1
cell:AT76:f:1
cell:AU76:f:1
cell:AV76:f:1
cell:AW76:f:1
cell:AX76:f:1
cell:AY76:f:1
cell:AZ76:f:1
cell:BA76:f:1
cell:BB76:f:1
cell:BC76:f:1
cell:BD76:f:1
cell:BE76:vtf:t:l:bq2:f:1
cell:BF76:f:1
cell:BG76:f:1
cell:BH76:f:1
cell:BI76:f:1
cell:BJ76:f:1
cell:BK76:f:1
cell:BL76:f:1
cell:BM76:f:1
cell:BN76:vtf:t:t:bq3:f:1
cell:BO76:f:1
cell:BP76:f:1
cell:BQ76:f:1
cell:BR76:f:1
cell:BS76:f:1
cell:BT76:f:1
cell:BU76:vtf:t: :bq4:f:1
cell:BV76:f:1
cell:E77:f:1
cell:F77:f:1
cell:G77:f:1
cell:H77:f:1
cell:I77:f:1
cell:J77:f:1
cell:K77:f:1
cell:L77:f:1
cell:M77:f:1
cell:N77:f:1
cell:O77:f:1
cell:P77:f:1
cell:Q77:f:1
cell:R77:f:1
cell:S77:f:1
cell:T77:f:1
cell:U77:f:1
cell:V77:f:1
cell:W77:f:1
cell:X77:f:1
cell:Y77:f:1
cell:Z77:f:1
cell:AA77:f:1
cell:AB77:f:1
cell:AC77:f:1
cell:AD77:f:1
cell:AE77:f:1
cell:AF77:f:1
cell:AG77:f:1
cell:AH77:f:1
cell:AI77:f:1
cell:AJ77:f:1
cell:AK77:f:1
cell:AL77:f:1
cell:AM77:f:1
cell:AN77:f:1
cell:AO77:f:1
cell:AP77:f:1
cell:AQ77:f:1
cell:AR77:f:1
cell:AS77:vtf:t: :br1:f:1
cell:AT77:f:1
cell:AU77:f:1
cell:AV77:f:1
cell:AW77:f:1
cell:AX77:f:1
cell:AY77:f:1
cell:AZ77:f:1
cell:BA77:f:1
cell:BB77:f:1
cell:BC77:f:1
cell:BD77:f:1
cell:BE77:f:1
cell:BF77:vtf:t:e:br2:f:1
cell:BG77:f:1
cell:BH77:f:1
cell:BI77:f:1
cell:BJ77:f:1
cell:BK77:f:1
cell:BL77:f:1
cell:BM77:f:1
cell:BN77:vtf:t:i:br3:f:1
cell:BO77:f:1
cell:BP77:f:1
cell:BQ77:f:1
cell:BR77:f:1
cell:BS77:f:1
cell:BT77:f:1
cell:BU77:f:1
cell:BV77:vtf:t: :br4:f:1
cell:E78:f:1
cell:F78:f:1
cell:G78:f:1
cell:H78:f:1
cell:I78:f:1
cell:J78:f:1
cell:K78:f:1
cell:L78:f:1
cell:M78:f:1
cell:N78:f:1
cell:O78:f:1
cell:P78:f:1
cell:Q78:f:1
cell:R78:f:1
cell:S78:f:1
cell:T78:f:1
cell:U78:f:1
cell:V78:f:1
cell:W78:f:1
cell:X78:f:1
cell:Y78:f:1
cell:Z78:f:1
cell:AA78:f:1
cell:AB78:f:1
cell:AC78:f:1
cell:AD78:f:1
cell:AE78:f:1
cell:AF78:f:1
cell:AG78:f:1
cell:AH78:f:1
cell:AI78:f:1
cell:AJ78:f:1
cell:AK78:f:1
cell:AL78:f:1
cell:AM78:f:1
cell:AN78:f:1
cell:AO78:f:1
cell:AP78:f:1
cell:AQ78:f:1
cell:AR78:f:1
cell:AS78:f:1
cell:AT78:vtf:t: :bs1:f:1
cell:AU78:f:1
cell:AV78:f:1
cell:AW78:f:1
cell:AX78:f:1
cell:AY78:f:1
cell:AZ78:f:1
cell:BA78:f:1
cell:BB78:f:1
cell:BC78:f:1
cell:BD78:f:1
cell:BE78:f:1
cell:BF78:f:1
cell:BG78:vtf:t: :bs2:f:1
cell:BH78:f:1
cell:BI78:f:1
cell:BJ78:f:1
cell:BK78:f:1
cell:BL78:f:1
cell:BM78:f:1
cell:BN78:f:1
cell:BO78:vtf:t:e:bs3:f:1
cell:BP78:f:1
cell:BQ78:f:1
cell:BR78:f:1
cell:BS78:f:1
cell:BT78:f:1
cell:BU78:f:1
cell:BV78:vtf:t: :bs4:f:1
cell:E79:f:1
cell:F79:f:1
cell:G79:f:1
cell:H79:f:1
cell:I79:f:1
cell:J79:f:1
cell:K79:f:1
cell:L79:f:1
cell:M79:f:1
cell:N79:f:1
cell:O79:f:1
cell:P79:f:1
cell:Q79:f:1
cell:R79:f:1
cell:S79:f:1
cell:T79:f:1
cell:U79:f:1
cell:V79:f:1
cell:W79:f:1
cell:X79:f:1
cell:Y79:f:1
cell:Z79:f:1
cell:AA79:f:1
cell:AB79:f:1
cell:AC79:f:1
cell:AD79:f:1
cell:AE79:f:1
cell:AF79:f:1
cell:AG79:f:1
cell:AH79:f:1
cell:AI79:f:1
cell:AJ79:f:1
cell:AK79:f:1
cell:AL79:f:1
cell:AM79:f:1
cell:AN79:f:1
cell:AO79:f:1
cell:AP79:f:1
cell:AQ79:f:1
cell:AR79:f:1
cell:AS79:f:1
cell:AT79:vtf:t: :bt1:f:1
cell:AU79:f:1
cell:AV79:f:1
cell:AW79:f:1
cell:AX79:f:1
cell:AY79:f:1
cell:AZ79:f:1
cell:BA79:f:1
cell:BB79:f:1
cell:BC79:f:1
cell:BD79:f:1
cell:BE79:f:1
cell:BF79:f:1
cell:BG79:vtf:t:d:bt2:f:1
cell:BH79:f:1
cell:BI79:f:1
cell:BJ79:f:1
cell:BK79:f:1
cell:BL79:f:1
cell:BM79:f:1
cell:BN79:f:1
cell:BO79:vtf:t:s:bt3:f:1
cell:BP79:f:1
cell:BQ79:f:1
cell:BR79:f:1
cell:BS79:f:1
cell:BT79:f:1
cell:BU79:f:1
cell:BV79:vtf:t: :bt4:f:1
cell:E80:f:1
cell:F80:f:1
cell:G80:f:1
cell:H80:f:1
cell:I80:f:1
cell:J80:f:1
cell:K80:f:1
cell:L80:f:1
cell:M80:f:1
cell:N80:f:1
cell:O80:f:1
cell:P80:f:1
cell:Q80:f:1
cell:R80:f:1
cell:S80:f:1
cell:T80:f:1
cell:U80:f:1
cell:V80:f:1
cell:W80:f:1
cell:X80:f:1
cell:Y80:f:1
cell:Z80:f:1
cell:AA80:f:1
cell:AB80:f:1
cell:AC80:f:1
cell:AD80:f:1
cell:AE80:f:1
cell:AF80:f:1
cell:AG80:f:1
cell:AH80:f:1
cell:AI80:f:1
cell:AJ80:f:1
cell:AK80:f:1
cell:AL80:f:1
cell:AM80:f:1
cell:AN80:f:1
cell:AO80:f:1
cell:AP80:f:1
cell:AQ80:f:1
cell:AR80:f:1
cell:AS80:f:1
cell:AT80:f:1
cell:AU80:vtf:t: :bu1:f:1
cell:AV80:f:1
cell:AW80:f:1
cell:AX80:f:1
cell:AY80:f:1
cell:AZ80:f:1
cell:BA80:f:1
cell:BB80:f:1
cell:BC80:f:1
cell:BD80:f:1
cell:BE80:f:1
cell:BF80:f:1
cell:BG80:f:1
cell:BH80:vtf:t:r:bu2:f:1
cell:BI80:f:1
cell:BJ80:f:1
cell:BK80:f:1
cell:BL80:f:1
cell:BM80:f:1
cell:BN80:f:1
cell:BO80:f:1
cell:BP80:vtf:t: :bu3:f:1
cell:BQ80:f:1
cell:BR80:f:1
cell:BS80:f:1
cell:BT80:f:1
cell:BU80:f:1
cell:BV80:f:1
cell:BW80:vtf:t: :bu4
cell:E81:f:1
cell:F81:f:1
cell:G81:f:1
cell:H81:f:1
cell:I81:f:1
cell:J81:f:1
cell:K81:f:1
cell:L81:f:1
cell:M81:f:1
cell:N81:f:1
cell:O81:f:1
cell:P81:f:1
cell:Q81:f:1
cell:R81:f:1
cell:S81:f:1
cell:T81:f:1
cell:U81:f:1
cell:V81:f:1
cell:W81:f:1
cell:X81:f:1
cell:Y81:f:1
cell:Z81:f:1
cell:AA81:f:1
cell:AB81:f:1
cell:AC81:f:1
cell:AD81:f:1
cell:AE81:f:1
cell:AF81:f:1
cell:AG81:f:1
cell:AH81:f:1
cell:AI81:f:1
cell:AJ81:f:1
cell:AK81:f:1
cell:AL81:f:1
cell:AM81:f:1
cell:AN81:f:1
cell:AO81:f:1
cell:AP81:f:1
cell:AQ81:f:1
cell:AR81:f:1
cell:AS81:f:1
cell:AT81:f:1
cell:AU81:vtf:t: :bv1:f:1
cell:AV81:f:1
cell:AW81:f:1
cell:AX81:f:1
cell:AY81:f:1
cell:AZ81:f:1
cell:BA81:f:1
cell:BB81:f:1
cell:BC81:f:1
cell:BD81:f:1
cell:BE81:f:1
cell:BF81:f:1
cell:BG81:f:1
cell:BH81:vtf:t:o:bv2:f:1
cell:BI81:f:1
cell:BJ81:f:1
cell:BK81:f:1
cell:BL81:f:1
cell:BM81:f:1
cell:BN81:f:1
cell:BO81:f:1
cell:BP81:f:1
cell:BQ81:vtf:t: :bv3:f:1
cell:BR81:f:1
cell:BS81:f:1
cell:BT81:f:1
cell:BU81:f:1
cell:BV81:f:1
cell:BX81:vtf:t: :bv4
cell:E82:f:1
cell:F82:f:1
cell:G82:f:1
cell:H82:f:1
cell:I82:f:1
cell:J82:f:1
cell:K82:f:1
cell:L82:f:1
cell:M82:f:1
cell:N82:f:1
cell:O82:f:1
cell:P82:f:1
cell:Q82:f:1
cell:R82:f:1
cell:S82:f:1
cell:T82:f:1
cell:U82:f:1
cell:V82:f:1
cell:W82:f:1
cell:X82:f:1
cell:Y82:f:1
cell:Z82:f:1
cell:AA82:f:1
cell:AB82:f:1
cell:AC82:f:1
cell:AD82:f:1
cell:AE82:f:1
cell:AF82:f:1
cell:AG82:f:1
cell:AH82:f:1
cell:AI82:f:1
cell:AJ82:f:1
cell:AK82:f:1
cell:AL82:f:1
cell:AM82:f:1
cell:AN82:f:1
cell:AO82:f:1
cell:AP82:f:1
cell:AQ82:f:1
cell:AR82:f:1
cell:AS82:f:1
cell:AT82:f:1
cell:AU82:f:1
cell:AV82:vtf:t: :bw1:f:1
cell:AW82:f:1
cell:AX82:f:1
cell:AY82:f:1
cell:AZ82:f:1
cell:BA82:f:1
cell:BB82:f:1
cell:BC82:f:1
cell:BD82:f:1
cell:BE82:f:1
cell:BF82:f:1
cell:BG82:f:1
cell:BH82:f:1
cell:BI82:vtf:t:p:bw2:f:1
cell:BJ82:f:1
cell:BK82:f:1
cell:BL82:f:1
cell:BM82:f:1
cell:BN82:f:1
cell:BO82:f:1
cell:BP82:f:1
cell:BQ82:f:1
cell:BR82:vtf:t: :bw3:f:1
cell:BS82:f:1
cell:BT82:f:1
cell:BU82:f:1
cell:BV82:f:1
cell:BX82:vtf:t: :bw4
cell:E83:f:1
cell:F83:f:1
cell:G83:f:1
cell:H83:f:1
cell:I83:f:1
cell:J83:f:1
cell:K83:f:1
cell:L83:f:1
cell:M83:f:1
cell:N83:f:1
cell:O83:f:1
cell:P83:f:1
cell:Q83:f:1
cell:R83:f:1
cell:S83:f:1
cell:T83:f:1
cell:U83:f:1
cell:V83:f:1
cell:W83:f:1
cell:X83:f:1
cell:Y83:f:1
cell:Z83:f:1
cell:AA83:f:1
cell:AB83:f:1
cell:AC83:f:1
cell:AD83:f:1
cell:AE83:f:1
cell:AF83:f:1
cell:AG83:f:1
cell:AH83:f:1
cell:AI83:f:1
cell:AJ83:f:1
cell:AK83:f:1
cell:AL83:f:1
cell:AM83:f:1
cell:AN83:f:1
cell:AO83:f:1
cell:AP83:f:1
cell:AQ83:f:1
cell:AR83:f:1
cell:AS83:f:1
cell:AT83:f:1
cell:AU83:f:1
cell:AV83:vtf:t: :bx1:f:1
cell:AW83:f:1
cell:AX83:f:1
cell:AY83:f:1
cell:AZ83:f:1
cell:BA83:f:1
cell:BB83:f:1
cell:BC83:f:1
cell:BD83:f:1
cell:BE83:f:1
cell:BF83:f:1
cell:BG83:f:1
cell:BH83:f:1
cell:BI83:vtf:t:s:bx2:f:1
cell:BJ83:f:1
cell:BK83:f:1
cell:BL83:f:1
cell:BM83:f:1
cell:BN83:f:1
cell:BO83:f:1
cell:BP83:f:1
cell:BQ83:f:1
cell:BR83:vtf:t: :bx3:f:1
cell:BS83:f:1
cell:BT83:f:1
cell:BU83:f:1
cell:BV83:f:1
cell:BY83:vtf:t: :bx4
cell:E84:f:1
cell:F84:f:1
cell:G84:f:1
cell:H84:f:1
cell:I84:f:1
cell:J84:f:1
cell:K84:f:1
cell:L84:f:1
cell:M84:f:1
cell:N84:f:1
cell:O84:f:1
cell:P84:f:1
cell:Q84:f:1
cell:R84:f:1
cell:S84:f:1
cell:T84:f:1
cell:U84:f:1
cell:V84:f:1
cell:W84:f:1
cell:X84:f:1
cell:Y84:f:1
cell:Z84:f:1
cell:AA84:f:1
cell:AB84:f:1
cell:AC84:f:1
cell:AD84:f:1
cell:AE84:f:1
cell:AF84:f:1
cell:AG84:f:1
cell:AH84:f:1
cell:AI84:f:1
cell:AJ84:f:1
cell:AK84:f:1
cell:AL84:f:1
cell:AM84:f:1
cell:AN84:f:1
cell:AO84:f:1
cell:AP84:f:1
cell:AQ84:f:1
cell:AR84:f:1
cell:AS84:f:1
cell:AT84:f:1
cell:AU84:f:1
cell:AV84:f:1
cell:AW84:vtf:t: :by1:f:1
cell:AX84:f:1
cell:AY84:f:1
cell:AZ84:f:1
cell:BA84:f:1
cell:BB84:f:1
cell:BC84:f:1
cell:BD84:f:1
cell:BE84:f:1
cell:BF84:f:1
cell:BG84:f:1
cell:BH84:f:1
cell:BI84:f:1
cell:BJ84:vtf:t: :by2:f:1
cell:BK84:f:1
cell:BL84:f:1
cell:BM84:f:1
cell:BN84:f:1
cell:BO84:f:1
cell:BP84:f:1
cell:BQ84:f:1
cell:BR84:f:1
cell:BS84:vtf:t: :by3:f:1
cell:BT84:f:1
cell:BU84:f:1
cell:BV84:f:1
cell:BY84:vtf:t: :by4
cell:AW85:vtf:t: :bz1
cell:BK85:vtf:t: :bz2
cell:BS85:vtf:t: :bz3
cell:BZ85:vtf:t: :bz4
cell:AX86:vtf:t: :ca1
cell:BK86:vtf:t: :ca2
cell:BT86:vtf:t: :ca3
cell:CA86:vtf:t: :ca4
cell:BT87:vtf:t: :cb3
cell:CA87:vtf:t: :cb4
cell:CB88:vtf:t: :cc4
col:A:w:14
col:B:w:14
col:C:w:14
col:D:w:14
col:E:w:14
col:F:w:14
col:G:w:14
col:H:w:14
col:I:w:14
col:J:w:14
col:K:w:14
col:L:w:14
col:M:w:14
col:N:w:14
col:O:w:14
col:P:w:14
col:Q:w:14
col:R:w:14
col:S:w:14
col:T:w:14
col:U:w:14
col:V:w:14
col:W:w:14
col:X:w:14
col:Y:w:14
col:Z:w:14
col:AA:w:14
col:AB:w:14
col:AC:w:14
col:AD:w:14
col:AE:w:14
col:AF:w:14
col:AG:w:14
col:AH:w:14
col:AI:w:14
col:AJ:w:14
col:AK:w:14
col:AL:w:14
col:AM:w:14
col:AN:w:14
col:AO:w:14
col:AP:w:14
col:AQ:w:14
col:AR:w:14
col:AS:w:14
col:AT:w:14
col:AU:w:14
col:AV:w:14
col:AW:w:14
col:AX:w:14
col:AY:w:14
col:AZ:w:14
col:BA:w:14
col:BB:w:14
col:BC:w:14
col:BD:w:14
col:BE:w:14
col:BF:w:14
col:BG:w:14
col:BH:w:14
col:BI:w:14
col:BJ:w:14
col:BK:w:14
col:BL:w:14
col:BM:w:14
col:BN:w:14
col:BO:w:14
col:BP:w:14
col:BQ:w:14
col:BR:w:14
col:BS:w:14
col:BT:w:14
col:BU:w:14
col:BV:w:14
col:BW:w:14
col:BX:w:14
col:BY:w:14
col:BZ:w:14
col:CA:w:14
col:CB:w:14
col:CC:w:14
row:1:hide:yes
row:2:hide:yes
row:3:hide:yes
row:4:hide:yes
row:5:hide:yes
sheet:c:81:r:88
font:1:normal bold * *
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:24
colpane:0:1:40
ecell:A6
range:A1:1:5:1:1
sort::-1:down::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set 5 hide
set 4 hide
set 3 hide
set 2 hide
set 1 hide
set AY1 text t e
set A6 formula e8
set A6 empty
set 1:5 hide yes
--SocialCalcSpreadsheetControlSave--
"""
''It's raining'' by Guillaume Apollinaire. Calligrammes (1918).
Translation : Roger Shattuck.
"""
<$edit-socialcalc tiddler="SocialCalc/Demos/calligramme-in-english" mode="view" grid="no" height=500/>
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:f:1
cell:C1:f:1
cell:E1:f:1
col:A:w:10
col:B:w:10
col:C:w:10
col:D:w:10
col:E:w:10
col:F:w:10
col:G:w:10
col:H:w:10
col:I:w:10
col:J:w:10
col:K:w:10
col:L:w:10
col:M:w:10
col:N:w:10
col:O:w:10
col:P:w:10
col:Q:w:10
col:R:w:10
col:S:w:10
col:T:w:10
col:U:w:10
col:V:w:10
col:W:w:10
col:X:w:10
col:Y:w:10
col:Z:w:10
col:AA:w:10
col:AB:w:10
col:AC:w:10
col:AD:w:10
col:AE:w:10
col:AF:w:10
col:AG:w:10
col:AH:w:10
col:AI:w:10
col:AJ:w:10
col:AK:w:10
col:AL:w:10
col:AM:w:10
col:AN:w:10
col:AO:w:10
col:AP:w:10
col:AQ:w:10
col:AR:w:10
col:AS:w:10
col:AT:w:10
col:AU:w:10
col:AV:w:10
col:AW:w:10
col:AX:w:10
col:AY:w:10
col:AZ:w:10
col:BA:w:10
col:BB:w:10
col:BC:w:10
col:BD:w:10
col:BE:w:10
col:BF:w:10
sheet:c:58:r:1
font:1:normal bold * *
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:17
colpane:0:1:56
ecell:I2
sort::-1:up::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set B2 formula a2+b1+c2+b3
copy B2 formulas
loadclipboard
paste C2 formulas
loadclipboard
paste D2 formulas
loadclipboard
paste E2 formulas
loadclipboard
paste F2 formulas
copy B2:F2 formulas
loadclipboard
paste G2 formulas
loadclipboard
paste L2 formulas
copy B2:P2 formulas
loadclipboard
paste B3 formulas
set O width 147
set O width 10
set B2:P3 empty
set B2 formula a2+b1
set C3 formula a3+c1+d3+c4
copy C3 formulas
loadclipboard
paste D3 formulas
loadclipboard
paste E3 formulas
loadclipboard
paste F3 formulas
loadclipboard
paste G3 formulas
loadclipboard
paste H3 formulas
loadclipboard
paste I3 formulas
copy C3:I3 formulas
loadclipboard
paste C4 formulas
set C3:I4 empty
set C3 empty
set B2 formula a2+b1+d2+b4
copy B2 formulas
loadclipboard
paste C2 formulas
loadclipboard
paste D2 formulas
loadclipboard
paste E2 formulas
loadclipboard
paste F2 formulas
loadclipboard
paste G2 formulas
loadclipboard
paste H2 formulas
loadclipboard
paste I2 formulas
copy B2:I2 formulas
loadclipboard
paste B3 formulas
loadclipboard
paste B4 formulas
set B2:I4 empty
--SocialCalcSpreadsheetControlSave--
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:v:0:bg:1
cell:B1:v:1:bg:1
cell:C1:v:1:bg:1
cell:D1:v:1:bg:1
cell:E1:v:1:bg:1
cell:F1:v:1:bg:1
cell:G1:v:1:bg:1
cell:A2:v:1:bg:1
cell:B2:vtf:n:2:a2+b1
cell:C2:vtf:n:3:B2+C1
cell:D2:vtf:n:4:C2+D1
cell:E2:vtf:n:5:D2+E1
cell:F2:vtf:n:6:E2+F1
cell:G2:vtf:n:7:F2+G1
cell:A3:v:1:bg:1
cell:B3:vtf:n:3:A3+B2
cell:C3:vtf:n:6:B3+C2
cell:D3:vtf:n:10:C3+D2
cell:E3:vtf:n:15:D3+E2
cell:F3:vtf:n:21:E3+F2
cell:G3:vtf:n:28:F3+G2
cell:A4:v:1:bg:1
cell:B4:vtf:n:4:A4+B3
cell:C4:vtf:n:10:B4+C3
cell:D4:vtf:n:20:C4+D3
cell:E4:vtf:n:35:D4+E3
cell:F4:vtf:n:56:E4+F3
cell:G4:vtf:n:84:F4+G3
cell:A5:v:1:bg:1
cell:B5:vtf:n:5:A5+B4
cell:C5:vtf:n:15:B5+C4
cell:D5:vtf:n:35:C5+D4
cell:E5:vtf:n:70:D5+E4
cell:F5:vtf:n:126:E5+F4
cell:G5:vtf:n:210:F5+G4
cell:A6:v:1:bg:1
cell:B6:vtf:n:6:A6+B5
cell:C6:vtf:n:21:B6+C5
cell:D6:vtf:n:56:C6+D5
cell:E6:vtf:n:126:D6+E5
cell:F6:vtf:n:252:E6+F5
cell:G6:vtf:n:462:F6+G5
cell:A7:v:1:bg:1
cell:B7:vtf:n:7:A7+B6
cell:C7:vtf:n:28:B7+C6
cell:D7:vtf:n:84:C7+D6
cell:E7:vtf:n:210:D7+E6
cell:F7:vtf:n:462:E7+F6
cell:G7:vtf:n:924:F7+G6
cell:A8:v:1:bg:1
cell:B8:vtf:n:8:A8+B7
cell:C8:vtf:n:36:B8+C7
cell:D8:vtf:n:120:C8+D7
cell:E8:vtf:n:330:D8+E7
cell:F8:vtf:n:792:E8+F7
cell:G8:vtf:n:1716:F8+G7
cell:A9:v:1:bg:1
cell:B9:vtf:n:9:A9+B8
cell:C9:vtf:n:45:B9+C8
cell:D9:vtf:n:165:C9+D8
cell:E9:vtf:n:495:D9+E8
cell:F9:vtf:n:1287:E9+F8
cell:G9:vtf:n:3003:F9+G8
cell:A10:v:1:bg:1
cell:B10:vtf:n:10:A10+B9
cell:C10:vtf:n:55:B10+C9
cell:D10:vtf:n:220:C10+D9
cell:E10:vtf:n:715:D10+E9
cell:F10:vtf:n:2002:E10+F9
cell:G10:vtf:n:5005:F10+G9
cell:A11:v:1:bg:1
cell:B11:vtf:n:11:A11+B10
cell:C11:vtf:n:66:B11+C10
cell:D11:vtf:n:286:C11+D10
cell:E11:vtf:n:1001:D11+E10
cell:F11:vtf:n:3003:E11+F10
cell:G11:vtf:n:8008:F11+G10
cell:A12:v:1:bg:1
cell:B12:vtf:n:12:A12+B11
cell:C12:vtf:n:78:B12+C11
cell:D12:vtf:n:364:C12+D11
cell:E12:vtf:n:1365:D12+E11
cell:F12:vtf:n:4368:E12+F11
cell:G12:vtf:n:12376:F12+G11
cell:A13:v:1:bg:1
cell:B13:vtf:n:13:A13+B12
cell:C13:vtf:n:91:B13+C12
cell:D13:vtf:n:455:C13+D12
cell:E13:vtf:n:1820:D13+E12
cell:F13:vtf:n:6188:E13+F12
cell:G13:vtf:n:18564:F13+G12
cell:A14:v:1:bg:1
cell:B14:vtf:n:14:A14+B13
cell:C14:vtf:n:105:B14+C13
cell:D14:vtf:n:560:C14+D13
cell:E14:vtf:n:2380:D14+E13
cell:F14:vtf:n:8568:E14+F13
cell:G14:vtf:n:27132:F14+G13
sheet:c:7:r:14
color:1:rgb(255, 153, 0)
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:17
colpane:0:1:7
ecell:A1
sort::-1:up::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set D1 value n 10
set D1 value n 3
set C1 value n 1
set D1 value n 0
set E1 value n 0
set F1 value n 1
set G1 value n 1
set E1 value n 1
set D1 value n 1
set A3 value n 1
set A4 value n 1
set A5 value n 1
set A6 value n 1
set A7 value n 1
set A8 value n 1
set A9 value n 1
set A10 value n 1
set A11 value n 1
set A12 value n 1
set A13 value n 1
set A14 value n 1
--SocialCalcSpreadsheetControlSave--
''A field of numbers''
<$edit-socialcalc tiddler="SocialCalc/Demos/field" height=400/>
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:t:Link:f:1:bg:1:cf:1
cell:B1:t:Comment:f:1:bg:1:cf:1
cell:A2:vtf:n:2:"one-plus-one"!e1:f:1
cell:B2:t:Solution of a big calculation
cell:A3:vtf:t:I:"calligramme"!e8:f:1
cell:B3:t:First letter of a beautiful poem
cell:A4:t:[field]:tvf:1
cell:B4:t:A calc sheet with a field of numbers
cell:A5:t:Plugin<tw\c$\c/plugins/rboue/SocialCalc>:tvf:1
cell:B5:t:The SocialCalc plugin
cell:A6:t:TiddlyWiki<http\c//tiddlywiki.com/>:tvf:1
cell:B6:t:A non-linear personal web notebook
col:B:w:260
sheet:c:2:r:6
cellformat:1:center
color:1:rgb(255, 153, 0)
font:1:normal bold * *
valueformat:1:text-link
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:11
colpane:0:1:5
ecell:A6
sort::-1:down::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set A4 text t [field]
set A4 text t Page[field]
set A4 text t [field]
set A4 textvalueformat text-link
set B4 text t A calc sheet with a field of numbers
set A5 text t Plugin<tw\c$\c/plugins/rboue/SocialCalc>
set A5 text t Plugin<tw\c$/plugins/rboue/SocialCalc>
set A5 text t Plugin<tw\c$\c/plugins/rboue/SocialCalc>
set A5 textvalueformat text-link
set B5 text t The SocialCalc plugin
set A6 text t TiddlyWiki<>
set A6 text t TiddlyWiki<http\c//tiddlywiki.com/>
set A6 textvalueformat text-link
set B6 text t A
set B6 text t A non-linear personal web notebook
--SocialCalcSpreadsheetControlSave--
''Examples of links''
<$edit-socialcalc tiddler="SocialCalc/Demos/links"/>
socialcalc:version:1.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
# SocialCalc Spreadsheet Control Save
version:1.0
part:sheet
part:edit
part:audit
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.5
cell:A1:v:1:f:1:bg:2
cell:B1:t:+
cell:C1:v:1:f:1:bg:3
cell:D1:t:=
cell:E1:vtf:n:2:$a$1+$c$1:f:1:bg:1
cell:K2:vtf:t::IF($e$1=2,""," "):comment:Don't say it !
cell:G3:vtf:n:1:$a$1:bg:2
cell:H3:vtf:n:1:$A$1:bg:2
cell:X3:vtf:n:1:$c$1:bg:3
cell:Y3:vtf:n:1:$C$1:bg:3
cell:AN3:vtf:n:2:$e$1:bg:1
cell:AO3:vtf:n:2:$E$1:bg:1
cell:F4:vtf:n:1:$A$1:bg:2
cell:G4:vtf:n:1:$A$1:bg:2
cell:H4:vtf:n:1:$A$1:bg:2
cell:W4:vtf:n:1:$C$1:bg:3
cell:X4:vtf:n:1:$C$1:bg:3
cell:Y4:vtf:n:1:$C$1:bg:3
cell:AM4:vtf:n:2:$E$1:bg:1
cell:AN4:vtf:n:2:$E$1:bg:1
cell:AO4:vtf:n:2:$E$1:bg:1
cell:AP4:vtf:n:2:$E$1:bg:1
cell:E5:vtf:n:1:$A$1:bg:2
cell:F5:vtf:n:1:$A$1:bg:2
cell:G5:vtf:n:1:$A$1:bg:2
cell:H5:vtf:n:1:$A$1:bg:2
cell:V5:vtf:n:1:$C$1:bg:3
cell:W5:vtf:n:1:$C$1:bg:3
cell:X5:vtf:n:1:$C$1:bg:3
cell:Y5:vtf:n:1:$C$1:bg:3
cell:AL5:vtf:n:2:$E$1:bg:1
cell:AM5:vtf:n:2:$E$1:bg:1
cell:AP5:vtf:n:2:$E$1:bg:1
cell:AQ5:vtf:n:2:$E$1:bg:1
cell:D6:vtf:n:1:$A$1:bg:2
cell:E6:vtf:n:1:$A$1:bg:2
cell:G6:vtf:n:1:$A$1:bg:2
cell:H6:vtf:n:1:$A$1:bg:2
cell:N6:vtf:t:+:$b$1
cell:O6:vtf:t:+:$B$1
cell:U6:vtf:n:1:$C$1:bg:3
cell:V6:vtf:n:1:$C$1:bg:3
cell:X6:vtf:n:1:$C$1:bg:3
cell:Y6:vtf:n:1:$C$1:bg:3
cell:AL6:vtf:n:2:$E$1:bg:1
cell:AM6:vtf:n:2:$E$1:bg:1
cell:AP6:vtf:n:2:$E$1:bg:1
cell:AQ6:vtf:n:2:$E$1:bg:1
cell:G7:vtf:n:1:$A$1:bg:2
cell:H7:vtf:n:1:$A$1:bg:2
cell:L7:vtf:t:+:$B$1
cell:M7:vtf:t:+:$B$1
cell:N7:vtf:t:+:$B$1
cell:O7:vtf:t:+:$B$1
cell:P7:vtf:t:+:$B$1
cell:Q7:vtf:t:+:$B$1
cell:X7:vtf:n:1:$C$1:bg:3
cell:Y7:vtf:n:1:$C$1:bg:3
cell:AC7:vtf:t:=:$d$1
cell:AD7:vtf:t:=:$D$1
cell:AE7:vtf:t:=:$D$1
cell:AF7:vtf:t:=:$D$1
cell:AG7:vtf:t:=:$D$1
cell:AH7:vtf:t:=:$D$1
cell:AO7:vtf:n:2:$E$1:bg:1
cell:AP7:vtf:n:2:$E$1:bg:1
cell:G8:vtf:n:1:$A$1:bg:2
cell:H8:vtf:n:1:$A$1:bg:2
cell:L8:vtf:t:+:$B$1
cell:M8:vtf:t:+:$B$1
cell:N8:vtf:t:+:$B$1
cell:O8:vtf:t:+:$B$1
cell:P8:vtf:t:+:$B$1
cell:Q8:vtf:t:+:$B$1
cell:X8:vtf:n:1:$C$1:bg:3
cell:Y8:vtf:n:1:$C$1:bg:3
cell:AC8:vtf:t:=:$D$1
cell:AD8:vtf:t:=:$D$1
cell:AE8:vtf:t:=:$D$1
cell:AF8:vtf:t:=:$D$1
cell:AG8:vtf:t:=:$D$1
cell:AH8:vtf:t:=:$D$1
cell:AN8:vtf:n:2:$E$1:bg:1
cell:AO8:vtf:n:2:$E$1:bg:1
cell:G9:vtf:n:1:$A$1:bg:2
cell:H9:vtf:n:1:$A$1:bg:2
cell:N9:vtf:t:+:$B$1
cell:O9:vtf:t:+:$B$1
cell:X9:vtf:n:1:$C$1:bg:3
cell:Y9:vtf:n:1:$C$1:bg:3
cell:AM9:vtf:n:2:$E$1:bg:1
cell:AN9:vtf:n:2:$E$1:bg:1
cell:G10:vtf:n:1:$A$1:bg:2
cell:H10:vtf:n:1:$A$1:bg:2
cell:X10:vtf:n:1:$C$1:bg:3
cell:Y10:vtf:n:1:$C$1:bg:3
cell:AL10:vtf:n:2:$E$1:bg:1
cell:AM10:vtf:n:2:$E$1:bg:1
cell:AN10:vtf:n:2:$E$1:bg:1
cell:AO10:vtf:n:2:$E$1:bg:1
cell:AP10:vtf:n:2:$E$1:bg:1
cell:AQ10:vtf:n:2:$E$1:bg:1
cell:G11:vtf:n:1:$A$1:bg:2
cell:H11:vtf:n:1:$A$1:bg:2
cell:X11:vtf:n:1:$C$1:bg:3
cell:Y11:vtf:n:1:$C$1:bg:3
cell:AL11:vtf:n:2:$E$1:bg:1
cell:AM11:vtf:n:2:$E$1:bg:1
cell:AN11:vtf:n:2:$E$1:bg:1
cell:AO11:vtf:n:2:$E$1:bg:1
cell:AP11:vtf:n:2:$E$1:bg:1
cell:AQ11:vtf:n:2:$E$1:bg:1
col:A:w:10
col:B:w:10
col:C:w:10
col:D:w:10
col:E:w:10
col:F:w:10
col:G:w:10
col:H:w:10
col:I:w:10
col:J:w:10
col:K:w:10
col:L:w:10
col:M:w:10
col:N:w:10
col:O:w:10
col:P:w:10
col:Q:w:10
col:R:w:10
col:S:w:10
col:T:w:10
col:U:w:10
col:V:w:10
col:W:w:10
col:X:w:10
col:Y:w:10
col:Z:w:10
col:AA:w:10
col:AB:w:10
col:AC:w:10
col:AD:w:10
col:AE:w:10
col:AF:w:10
col:AG:w:10
col:AH:w:10
col:AI:w:10
col:AJ:w:10
col:AK:w:10
col:AL:w:10
col:AM:w:10
col:AN:w:10
col:AO:w:10
col:AP:w:10
col:AQ:w:10
col:AR:w:10
col:AS:w:10
col:AT:w:10
col:AU:w:10
col:AV:w:10
col:AW:w:10
col:AX:w:10
col:AY:w:10
col:AZ:w:10
col:BA:w:10
col:BB:w:10
col:BC:w:10
col:BD:w:10
col:BE:w:10
col:BF:w:10
sheet:c:58:r:11
color:1:rgb(0, 255, 255)
color:2:rgb(255, 153, 0)
color:3:rgb(255, 255, 0)
font:1:normal bold * *
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
version:1.0
rowpane:0:1:17
colpane:0:1:56
ecell:A2
sort::-1:up::::
graph:range:undefined:type::minmax:undefined,undefined,undefined,undefined
--SocialCalcSpreadsheetControlSave
Content-type: text/plain; charset=UTF-8
set K2 comment Don't say it !
--SocialCalcSpreadsheetControlSave--
''A calc sheet. Feel free to modify it !''
<$edit-socialcalc tiddler="SocialCalc/Demos/one-plus-one" height=400/>
The plugin : [[SocialCalc|$:/plugins/rboue/SocialCalc]]
!Demos
Some calc sheets to play and see what you can do with ~SocialCalc :
[[one-plus-one|SocialCalc/Demos/one-plus-one--demo]]
[[field|SocialCalc/Demos/field--demo]]
[[calligramme|SocialCalc/Demos/calligramme--demo]]
[[links|SocialCalc/Demos/links--demo]]
!What is ~SocialCalc ?
A calc sheet to do effective calculations and much more.
Links :
[[Documentation|http://sternlife.stern.nyu.edu/help-en/SocialCalc]]
[[Engine|http://www.softwaregarden.com/products/wikicalc/socialcalc/EngineDoc-8.html]]
!~SocialCalc in ~TiddlyWiki environment
"""
__''Calc sheet storage''__
~SocialCalc stores calc sheets in tiddlers of type `application/x-socialcalc`.
__''Calc sheet edition''__
There is two ways to edit a calc sheet : with the standard tiddler editor or with the `<$edit-socialcal>` widget.
For the widget way, see below.
When you click on the edit icon of an `application/x-socialcalc` tiddler, the tiddler's editor displays an `<$edit-socialcalc>` widget to edit the calc page. You can also modify tiddler's fields the usual way.
__''Data exchange''__
The "Clipboard" menu allows you to import/export data. However, supported formats are very limited. Don't expect to exchange data with EXCEL. There is simple text formats like CSV and Tab-delimited, and the "~SocialCalc-save" format. You can export a selection of a calc sheet (the clipboard) to a tiddler and you can import a data tiddler to the clipboard, nothing more.
__''Links in calc sheet''__
~SocialCalc offers a reasonable choice of link's types. See ~SocialCal documentation for details.
There is two kinds of links that the plugin manages in a different way : calc sheet references (better known as "page references") and URL links.
__Page reference__
A page reference is a reference to another calc sheet's piece of data in a formula. This type of link is essential to simplify the task of building calc sheets by splitting data between different sheets. In conventional case, calc sheets are web pages on specific servers. In ~TiddlyWiki's case, calc sheets are always stored in local tiddlers.
Then, with ~TiddlyWiki, the reference to a page is simply the title of its tiddler.
Example of a formula with page references :
`="My first tiddler with a calc sheet"!a11 * "My second tiddler with a calc sheet"!b22`
To ease the task of page referencing, the plugin offers an ambryo of filesystem and relative path handling. Let's say a main sheet is stored in the tiddler named "My directory/my main page" and a sheet with useful data in "My directory/my useful page". With relative path you can simply reference "my useful page" in a formula of the main sheet. This behaviour is configuration dependent (see below). You must define a filesystem.PATH attribute with the list of directories to search for page references.
Example of configuration and formula with relative page references :
Configuration tiddler (`$:config/rboue/SocialCalc`) :
"""
```
{
"filesystem": {
"PATH": "My directory;other directory"
},
...
}
```
"""
`="my useful page"!a11 * "my useful page"!b22`
__URL links__
Conventional ~SocialCalc offers the possibility to define clickable links, with common URLs like "http:...", "mailto:...", etc.
The plugin adds the possibility to open tiddlers the same way, with a special type of URL :
''tw:''`title of a tiddler`
Example of cell's value with a clickable link to a tiddler :
`'<tw:My tiddler>`
Filesystem and relative path applies also to URL links of type "tw:". This is the same behaviour than with page references.
When creating a link, don't forget to set the cell's format value to `Link`.
__''<$edit-socialcalc> widget''__
The widget offers quite the same UI than conventional ~SocialCalc editor.
However there is some slight differences :
"""
* A new "Save changes" icon enables you to save sheet's data in tiddler. Its colour changes as soon as a change in data occured, to inform you that a save is required.
* The "Clipboard" menu has more functionnalities. You can import clipboard data from tiddlers, with a choice of different formats. You can also export the clipboard to a data tiddler.
* The "Graph" menu has been enhanced and offers more effective data display.
"""
The full set of conventional ~SocialCalc's editor keys is available whith the "Edit" menu, especially Ctrl-c/Ctrl-x/Ctrl-v to copy/delete/paste cells or ranges of cells.
Please note that Ctrl-s has the same behaviour than a click on the "Save changes" icon.
The content of the `<$edit-socialcalc>` widget is not interpreted.
"""
|Attribute |Description |h
|width |Width of the widget in pixel |
|height |Height of the widget in pixel (300 by default) |
|mode |Type of display : "edit" to edit the data (default value), "view" to display without modification |
|grid |"yes" to display the grid (default value), "no" otherwise |
|class |An optional CSS class name to be assigned to the HTML element |
"""
__''Configuration''__
The plugin is configured via the `$:config/rboue/SocialCalc` tiddler (of type `application/json`).
Example of configuration :
"""
```
{
"filesystem": {
"PATH": "SocialCalc/Tests;SocialCalc/Tests/TestPath1;SocialCalc/Tests/TestPath2"
},
"grid": "yes",
"LANG": "fr-FR",
"heightInTiddlerEditor": 500
}
```
|Attribute |Description |h
|filesystem |Activates the pseudo filesystem behaviour. `PATH` is a list of absolute directories to search under when calc sheets are referenced in formula |
|grid |If "yes", displays the grid (default). If "no", suppress the grid |
|LANG |Language for menus, helps and tooltips translations. "en-GB" by default |
|heightInTiddlerEditor |Height in pixel of the `<$edit-socialcalc>` widget in the tiddler's editor. Default is 300 |
Default configuration is defined in the `$:/plugins/rboue/SocialCalc/config.json` tiddler.
[[three.js|http://threejs.org/]] - deferred area lights ~WebGL demo by [[redPlant|http://de.redplant.de]] - based on [[ArKano22's|http://www.gamedev.net/topic/552315-glsl-area-light-implementation/]] glsl implementation
@@float:right;
[[View source|Three.js/Demos/arealights.js]]
@@
<$view3js tiddler="Three.js/Demos/arealights.js"/>
require("./Lib/Loaders/BinaryLoader.js");
require("./Lib/Renderers/WebGLDeferredRenderer.js");
require("./Lib/ShaderDeferred.js");
require("./Lib/Shaders/CopyShader.js");
require("./Lib/Shaders/FXAAShader.js");
require("./Lib/Shaders/ConvolutionShader.js");
require("./Lib/Postprocessing/EffectComposer.js");
require("./Lib/Postprocessing/RenderPass.js");
require("./Lib/Postprocessing/ShaderPass.js");
require("./Lib/Postprocessing/MaskPass.js");
require("./Lib/Postprocessing/BloomPass.js");
var Stats = require("./Lib/stats-min.js").Stats;
var Tools = require("./Lib/tools.js").Tools;
var SCALE = 1;
var MARGIN = 0;
var WIDTH = 0;
var HEIGHT = 0;
var NEAR = 1.0, FAR = 350.0;
//var VIEW_ANGLE = 40;
var VIEW_ANGLE = 50;
// controls
var mouseX = 0;
var mouseY = 0;
var targetX = 0, targetY = 0;
var angle = 0;
var target = new THREE.Vector3( 0, 0, 0 );
var windowHalfX = 0;
var windowHalfY = 0;
// core
var renderer, camera, scene, stats, clock;
// lights
var areaLight1, areaLight2, areaLight3;
var node = null;
var flagStats = false;
// -----------------------------
function main(input) {
var func = "main";
node = input.node;
WIDTH = node.offsetWidth;
HEIGHT = node.offsetHeight - 2 * MARGIN;
windowHalfX = node.offsetWidth / 2;
windowHalfY = node.offsetHeight / 2;
// renderer
renderer = new THREE.WebGLDeferredRenderer( { width: WIDTH, height: HEIGHT, scale: SCALE, antialias: true, tonemapping: THREE.FilmicOperator, brightness: 2.5 } );
node.appendChild( renderer.domElement );
// effects
var bloomEffect = new THREE.BloomPass( 0.65 );
renderer.addEffect( bloomEffect );
// camera
camera = new THREE.PerspectiveCamera( VIEW_ANGLE, WIDTH / HEIGHT, NEAR, FAR );
camera.position.y = 40;
// scene
scene = new THREE.Scene();
scene.add( camera );
// stats
if (flagStats) stats = Tools.addStats(node);
// clock
clock = new THREE.Clock();
// add lights
initLights();
// add objects
initObjects();
// events
node.addEventListener( 'mousemove', onDocumentMouseMove, false );
var onTiddlerRefresh = onWindowResize;
onTiddlerRefresh();
// Animation
var animation = new Tools.Animation(node, function() {
animate();
}, true);
animation.start();
return {onTiddlerRefresh: onTiddlerRefresh};
}
// -----------------------------
function createAreaEmitter( light ) {
var geometry = new THREE.BoxGeometry( 1, 1, 1 );
var material = new THREE.MeshBasicMaterial( { color: light.color.getHex(), vertexColors: THREE.FaceColors } );
var backColor = 0x222222;
geometry.faces[ 5 ].color.setHex( backColor );
geometry.faces[ 4 ].color.setHex( backColor );
geometry.faces[ 2 ].color.setHex( backColor );
geometry.faces[ 1 ].color.setHex( backColor );
geometry.faces[ 0 ].color.setHex( backColor );
var emitter = new THREE.Mesh( geometry, material );
emitter.scale.set( light.width * 2, 0.2, light.height * 2 );
return emitter;
}
function setupAreaLight( light ) {
var matrix = light.matrixWorld;
light.right.set( 1, 0, 0 );
light.normal.set( 0, -1, 0 );
light.right.applyMatrix4( matrix );
light.normal.applyMatrix4( matrix );
}
function initLights() {
areaLight1 = new THREE.AreaLight( 0xffffff, 1 );
areaLight1.position.set( 0.0001, 10.0001, -18.5001 );
areaLight1.rotation.set( -0.74719, 0.0001, 0.0001 );
areaLight1.width = 10;
areaLight1.height = 1;
scene.add( areaLight1 );
var meshEmitter = createAreaEmitter( areaLight1 );
areaLight1.add( meshEmitter );
//
areaLight2 = new THREE.AreaLight( 0x33ff66, 1.5 );
areaLight2.position.set( -19.0001, 3.0001, 0.0001 );
areaLight2.rotation.set( -1.5707, 0.0001, 1.5707 );
areaLight2.width = 8;
areaLight2.height = 1;
scene.add( areaLight2 );
var meshEmitter = createAreaEmitter( areaLight2 );
areaLight2.add( meshEmitter );
//
areaLight3 = new THREE.AreaLight( 0x3366ff, 1.5 );
areaLight3.position.set( 19.0001, 3.0001, 0.0001 );
areaLight3.rotation.set( 1.5707, 0.0001, -1.5707 );
areaLight3.width = 8;
areaLight3.height = 1;
scene.add( areaLight3 );
var meshEmitter = createAreaEmitter( areaLight3 );
areaLight3.add( meshEmitter );
}
// -----------------------------
function initObjects() {
var loader = new THREE.BinaryLoader();
loader.load( "tw:obj/box/box.js", function ( geometry, materials ) {
var material = new THREE.MeshPhongMaterial( { color: 0xffaa55, specular: 0x888888, shininess: 200 } );
var object = new THREE.Mesh( geometry, material );
object.scale.multiplyScalar( 2 );
scene.add( object );
} );
/*
var loader = new THREE.BinaryLoader();
loader.load( "obj/veyron/VeyronNoUv_bin.js", function ( geometry ) {
var r = "textures/cube/Bridge2/";
var urls = [
r + "posx.jpg", r + "negx.jpg",
r + "posy.jpg", r + "negy.jpg",
r + "posz.jpg", r + "negz.jpg"
];
var textureCube = THREE.ImageUtils.loadTextureCube( urls );
textureCube.format = THREE.RGBFormat;
var materials = [
// tires + inside
new THREE.MeshLambertMaterial( {
color: 0x050505
} ),
// wheels + extras chrome
new THREE.MeshLambertMaterial( {
color: 0xffffff,
envMap: textureCube
} ),
// back / top / front torso
new THREE.MeshLambertMaterial( {
color: 0x000000,
ambient: 0x000000,
envMap: textureCube,
combine: THREE.MixOperation,
reflectivity: 0.15
} ),
// glass
new THREE.MeshLambertMaterial( {
color: 0x101046,
envMap: textureCube,
opacity: 0.25,
transparent: true
} ),
// sides torso
new THREE.MeshLambertMaterial( {
color: 0xffffff,
envMap: textureCube
} ),
// engine
new THREE.MeshLambertMaterial( {
color: 0xffffff,
envMap: textureCube
} ),
// backlights
new THREE.MeshLambertMaterial( {
color: 0xff0000,
opacity: 0.5,
transparent: true
} ),
// backsignals
new THREE.MeshLambertMaterial( {
color: 0xffbb00,
opacity: 0.5,
transparent: true
} )
];
var object = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
object.position.y = 5;
object.rotation.y = Math.PI / 4;
object.scale.multiplyScalar( 0.1 );
scene.add( object );
} );
*/
}
// -----------------------------
function onWindowResize( event ) {
windowHalfX = node.offsetWidth / 2;
windowHalfY = node.offsetHeight / 2;
WIDTH = node.offsetWidth;
HEIGHT = node.offsetHeight - 2 * MARGIN;
renderer.setSize( WIDTH, HEIGHT );
camera.aspect = WIDTH / HEIGHT;
camera.updateProjectionMatrix();
}
function onDocumentMouseMove( event ) {
mouseX = ( event.clientX + window.pageXOffset - node.offsetLeft - windowHalfX ) * 1;
mouseY = ( event.clientY + window.pageYOffset - node.offsetTop - windowHalfY ) * 1;
}
// -----------------------------
function animate() {
//requestAnimationFrame( animate );
render();
if (flagStats) stats.update();
}
function render() {
// update camera
var delta = clock.getDelta();
targetX = mouseX * .001;
targetY = mouseY * .001;
angle += 0.05 * ( targetX - angle );
camera.position.x = -Math.sin( angle ) * 40;
camera.position.z = Math.cos( angle ) * 40;
camera.lookAt( target );
var time = Date.now();
areaLight1.position.x = Math.sin( Date.now() * 0.001 ) * 9;
areaLight1.position.y = Math.sin( Date.now() * 0.0013 ) * 5 + 5;
areaLight2.position.y = Math.sin( Date.now() * 0.0011 ) * 3 + 5;
areaLight2.position.z = Math.sin( Date.now() * 0.00113 ) * 10;
areaLight3.position.y = Math.sin( Date.now() * 0.00111 ) * 3 + 5;
areaLight3.position.z = Math.sin( Date.now() * 0.001113 ) * 10;
// render
renderer.render( scene, camera );
}
Skybox by [[Paul Debevec|http://ict.debevec.org/~debevec/]].
@@float:right;
[[View source|Three.js/Demos/bubbles.js]]
@@
<$view3js tiddler="Three.js/Demos/bubbles.js"/>
// A faire :
// - Ajouter un outil de gestion d'animation
//
require("./Lib/Effects/AnaglyphEffect.js");
var Tools = require("./Lib/tools.js").Tools;
var flagNoLog = true;
var camera, scene, renderer, effect, mesh, lightMesh, geometry;
var spheres = [];
var directionalLight, pointLight;
var mouseX = 0, mouseY = 0;
var nodeHalfX = 0, nodeHalfY = 0;
var node = null;
function main(input) {
var fonc = "main";
node = input.node;
hack.log("node: "+hack.logPoint(node.offsetWidth, node.offsetHeight)+"@"+hack.logPoint(node.offsetLeft, node.offsetTop), flagNoLog, fonc);
nodeHalfX = node.offsetWidth / 2;
nodeHalfY = node.offsetHeight / 2;
camera = new THREE.PerspectiveCamera(60, node.offsetWidth / node.offsetHeight, 1, 100000);
camera.position.z = 3200;
scene = new THREE.Scene();
var geometry = new THREE.SphereGeometry(100, 32, 16);
var path = "tw:textures/cube/pisa/";
var format = '.png';
var urls = [
path + 'px' + format, path + 'nx' + format,
path + 'py' + format, path + 'ny' + format,
path + 'pz' + format, path + 'nz' + format
];
var textureCube = THREE.ImageUtils.loadTextureCube( urls );
var material = new THREE.MeshBasicMaterial({color: 0xffffff, envMap: textureCube});
for (var i = 0; i < 500; i++) {
var mesh = new THREE.Mesh(geometry, material);
mesh.position.x = Math.random() * 10000 - 5000;
mesh.position.y = Math.random() * 10000 - 5000;
mesh.position.z = Math.random() * 10000 - 5000;
mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 3 + 1;
scene.add(mesh);
spheres.push(mesh);
}
// Skybox
var shader = THREE.ShaderLib["cube"];
shader.uniforms[ "tCube" ].value = textureCube;
var material = new THREE.ShaderMaterial({
fragmentShader: shader.fragmentShader,
vertexShader: shader.vertexShader,
uniforms: shader.uniforms,
side: THREE.BackSide
}),
mesh = new THREE.Mesh(new THREE.BoxGeometry(100000, 100000, 100000), material);
scene.add(mesh);
// Rendering
renderer = new THREE.WebGLRenderer();
node.appendChild( renderer.domElement );
var width = node.offsetWidth || 2;
var height = node.offsetHeight || 2;
effect = new THREE.AnaglyphEffect(renderer);
effect.setSize(width, height);
node.addEventListener("mousemove", onMouseMove, false);
var onTiddlerRefresh = function() {
var fonc = "onTiddlerRefresh";
nodeHalfX = node.offsetWidth / 2,
nodeHalfY = node.offsetHeight / 2,
camera.aspect = node.offsetWidth / node.offsetHeight;
camera.updateProjectionMatrix();
effect.setSize(node.offsetWidth, node.offsetHeight);
effect.render(scene, camera);
};
onTiddlerRefresh();
// Animation
var animation = new Tools.Animation(node, render, true);
animation.start();
return {onTiddlerRefresh: onTiddlerRefresh};
}
function onMouseMove(event) {
fonc = "onDocumentMouseMove";
var factor = 10;
// Origin (0,0) = center of the node
mouseX = event.clientX + window.pageXOffset - node.offsetLeft - nodeHalfX;
mouseY = event.clientY + window.pageYOffset - node.offsetTop - nodeHalfY;
hack.log("mouse = "+hack.logPoint(mouseX, mouseY), flagNoLog, fonc);
}
function render() {
var fonc = "render";
var timer = 0.0001 * Date.now();
var cameraDelta = 0.7;
var mouseFactor = 15;
camera.position.x += (mouseX * mouseFactor - camera.position.x) * cameraDelta;
camera.position.y += (-mouseY * mouseFactor - camera.position.y) * cameraDelta;
hack.log("camera.position = "+hack.logPoint(camera.position.x, camera.position.y), flagNoLog, fonc);
camera.lookAt(scene.position);
for (var i = 0, il = spheres.length; i < il; i++) {
var sphere = spheres[i];
sphere.position.x = 5000 * Math.cos(timer + i);
sphere.position.y = 5000 * Math.sin(timer + i * 1.1);
}
effect.render(scene, camera);
}
Model by [[mirada|http://mirada.com]] from [[rome|http://www.ro.me]].
@@float:right;
[[View source|Three.js/Demos/horse.js]]
@@
<$view3js tiddler="Three.js/Demos/horse.js" class="threejs-screen"/>
require("./Lib/Controls/OrbitControls.js");
var flagNoLog = true;
var renderer, scene, camera, animation, rootNode;
var prevTime = Date.now();
function threePointLight() {
var directionalLight = new THREE.DirectionalLight( 0xb8b8b8 );
directionalLight.position.set(1, 1, 1).normalize();
directionalLight.intensity = 1.0;
scene.add( directionalLight );
directionalLight = new THREE.DirectionalLight( 0xb8b8b8 );
directionalLight.position.set(-1, 0.6, 0.5).normalize();
directionalLight.intensity = 0.5;
scene.add(directionalLight);
directionalLight = new THREE.DirectionalLight();
directionalLight.position.set(-0.3, 0.6, -0.8).normalize( 0xb8b8b8 );
directionalLight.intensity = 0.45;
scene.add(directionalLight);
}
function objet(geometry, color, x, y, z) {
var obj = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({color: color}));
obj.position.set(x, y, z);
scene.add(obj);
}
function render() {
if (animation) {
var time = Date.now();
animation.update(time - prevTime);
prevTime = time;
}
renderer.render(scene, camera);
}
function main(input) {
var fonc = "main";
hack.log("input.node geometry = "+hack.logPoint(input.node.offsetWidth, input.node.offsetHeight), hack.bug, fonc);
scene = new THREE.Scene();
scene.add(new THREE.GridHelper(20, 2.5));
camera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000);
camera.aspect = input.node.offsetWidth / input.node.offsetHeight;
renderer = new THREE.WebGLRenderer({antialias: true, alpha: true});
renderer.setSize(input.node.innerWidth, input.node.innerHeight);
input.node.appendChild(renderer.domElement);
var geo = new THREE.BoxGeometry(5,5,5);
objet(geo, 0xff0000, -20, 0, 20);
objet(geo, 0x0000ff, 20, 0, 20);
objet(geo, 0x0c0c0c, -20, 0, -20);
objet(geo, 0x00ff00, 20, 0, -20);
var orbit = new THREE.OrbitControls(camera, input.node);
orbit.addEventListener("change", render);
camera.position.z = 40;
camera.position.x = 40;
camera.position.y = 40;
var target = new THREE.Vector3(0, 1, 0);
camera.lookAt( target );
orbit.target = target;
camera.updateProjectionMatrix();
threePointLight();
var loader = new THREE.JSONLoader(true);
loader.load( "tw:models/animated/horse.json", function (geometry) {
var mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial({color: 0x606060, morphTargets: true, overdraw: 0.5}));
mesh.scale.set(0.1, 0.1, 0.1);
mesh.position.set(0, 0, 0);
scene.add(mesh);
animation = new THREE.MorphAnimation(mesh);
animation.play();
});
var onTiddlerRefresh = function() {
var fonc = "onTiddlerRefresh";
hack.log("input.node geometry = "+hack.logPoint(input.node.offsetWidth, input.node.offsetHeight), flagNoLog, fonc);
camera.aspect = input.node.offsetWidth / input.node.offsetHeight;
camera.updateProjectionMatrix();
renderer.setSize(input.node.offsetWidth, input.node.offsetHeight );
renderer.render(scene, camera);
}
onTiddlerRefresh();
render();
return {onTiddlerRefresh: onTiddlerRefresh};
}
[[three.js|http://threejs.org/]] - featuring lava shader by [[TheGameMaker|http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=21057]]
@@float:right;
[[View source|Three.js/Demos/lava.js]]
@@
<$view3js tiddler="Three.js/Demos/lava.js" height=400/>
require("./Lib/Shaders/ConvolutionShader.js");
require("./Lib/Shaders/CopyShader.js");
require("./Lib/Shaders/FilmShader.js");
require("./Lib/Postprocessing/EffectComposer.js");
require("./Lib/Postprocessing/ShaderPass.js");
require("./Lib/Postprocessing/MaskPass.js");
require("./Lib/Postprocessing/RenderPass.js");
require("./Lib/Postprocessing/BloomPass.js");
require("./Lib/Postprocessing/FilmPass.js");
var Stats = require("./Lib/stats-min.js").Stats;
var Tools = require("./Lib/tools.js").Tools;
var fragmentShader = ""+
"uniform float time;"+
"uniform vec2 resolution;"+
"uniform float fogDensity;"+
"uniform vec3 fogColor;"+
"uniform sampler2D texture1;"+
"uniform sampler2D texture2;"+
"varying vec2 vUv;"+
"void main( void ) {;"+
"vec2 position = -1.0 + 2.0 * vUv;"+
"vec4 noise = texture2D( texture1, vUv );"+
"vec2 T1 = vUv + vec2( 1.5, -1.5 ) * time *0.02;"+
"vec2 T2 = vUv + vec2( -0.5, 2.0 ) * time * 0.01;"+
"T1.x += noise.x * 2.0;"+
"T1.y += noise.y * 2.0;"+
"T2.x -= noise.y * 0.2;"+
"T2.y += noise.z * 0.2;"+
"float p = texture2D( texture1, T1 * 2.0 ).a;"+
"vec4 color = texture2D( texture2, T2 * 2.0 );"+
"vec4 temp = color * ( vec4( p, p, p, p ) * 2.0 ) + ( color * color - 0.1 );"+
"if( temp.r > 1.0 ){ temp.bg += clamp( temp.r - 2.0, 0.0, 100.0 ); }"+
"if( temp.g > 1.0 ){ temp.rb += temp.g - 1.0; }"+
"if( temp.b > 1.0 ){ temp.rg += temp.b - 1.0; }"+
"gl_FragColor = temp;"+
"float depth = gl_FragCoord.z / gl_FragCoord.w;"+
"const float LOG2 = 1.442695;"+
"float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );"+
"fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );"+
"gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );"+
"}";
var vertexShader = ""+
"uniform vec2 uvScale;"+
"varying vec2 vUv;"+
"void main() {"+
"vUv = uvScale * uv;"+
"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"+
"gl_Position = projectionMatrix * mvPosition;"+
"}";
var container, stats;
var clock = new THREE.Clock();
var camera, scene, renderer, composer;
var uniforms, material, mesh;
var mouseX = 0, mouseY = 0,
lat = 0, lon = 0, phy = 0, theta = 0;
var width = 0;
var height = 0;
var windowHalfX = 0;
var windowHalfY = 0;
var node = null;
var flagStats = false;
function main(input) {
var func = "main";
node = input.node;
width = node.offsetWidth || 2;
height = node.offsetHeight || 2;
windowHalfX = width / 2;
windowHalfY = height / 2;
container = document.getElementById( 'container' );
camera = new THREE.PerspectiveCamera( 35, windowHalfX / windowHalfY, 1, 3000 );
camera.position.z = 4;
scene = new THREE.Scene();
uniforms = {
fogDensity: { type: "f", value: 0.45 },
fogColor: { type: "v3", value: new THREE.Vector3( 0, 0, 0 ) },
time: { type: "f", value: 1.0 },
resolution: { type: "v2", value: new THREE.Vector2() },
uvScale: { type: "v2", value: new THREE.Vector2( 3.0, 1.0 ) },
texture1: { type: "t", value: THREE.ImageUtils.loadTexture( "tw:textures/lava/cloud.png" ) },
texture2: { type: "t", value: THREE.ImageUtils.loadTexture( "tw:textures/lava/lavatile.jpg" ) }
};
uniforms.texture1.value.wrapS = uniforms.texture1.value.wrapT = THREE.RepeatWrapping;
uniforms.texture2.value.wrapS = uniforms.texture2.value.wrapT = THREE.RepeatWrapping;
var size = 0.65;
material = new THREE.ShaderMaterial( {
uniforms: uniforms,
vertexShader: vertexShader,
fragmentShader: fragmentShader
} );
mesh = new THREE.Mesh( new THREE.TorusGeometry( size, 0.3, 30, 30 ), material );
mesh.rotation.x = 0.3;
scene.add( mesh );
//
renderer = new THREE.WebGLRenderer( { antialias: true } );
node.appendChild( renderer.domElement );
renderer.autoClear = false;
//
var renderModel = new THREE.RenderPass( scene, camera );
var effectBloom = new THREE.BloomPass( 1.25 );
var effectFilm = new THREE.FilmPass( 0.35, 0.95, 2048, false );
effectFilm.renderToScreen = true;
composer = new THREE.EffectComposer( renderer );
composer.addPass( renderModel );
composer.addPass( effectBloom );
composer.addPass( effectFilm );
//
if (flagStats) stats = Tools.addStats(node);
var onTiddlerRefresh = onWindowResize;
onTiddlerRefresh();
// Animation
var animation = new Tools.Animation(node, function() {
animate();
}, true);
animation.start();
return {onTiddlerRefresh: onTiddlerRefresh};
}
function onWindowResize( event ) {
uniforms.resolution.value.x = node.offsetWidth;
uniforms.resolution.value.y = node.offsetHeight;
renderer.setSize( node.offsetWidth, node.offsetHeight );
camera.aspect = node.offsetWidth / node.offsetHeight;
camera.updateProjectionMatrix();
composer.reset();
}
//
function animate() {
//requestAnimationFrame( animate );
render();
if (flagStats) stats.update();
}
function render() {
var delta = 5 * clock.getDelta();
uniforms.time.value += 0.2 * delta;
mesh.rotation.y += 0.0125 * delta;
mesh.rotation.x += 0.05 * delta;
renderer.clear();
composer.render( 0.01 );
}
[[three.js|http://threejs.org/]] - based on greggman's [[blob|http://webglsamples.googlecode.com/hg/blob/blob.html]], original code by Henrik Rydgård
@@float:right;
[[View source|Three.js/Demos/marchingcubes.js]]
@@
<$view3js tiddler="Three.js/Demos/marchingcubes.js" height=400/>
require("./Lib/Controls/TrackballControls.js");
require("./Lib/Shaders/CopyShader.js");
require("./Lib/Shaders/FXAAShader.js");
require("./Lib/Shaders/HorizontalTiltShiftShader.js");
require("./Lib/Shaders/VerticalTiltShiftShader.js");
require("./Lib/Postprocessing/EffectComposer.js");
require("./Lib/Postprocessing/RenderPass.js");
require("./Lib/Postprocessing/BloomPass.js");
require("./Lib/Postprocessing/ShaderPass.js");
require("./Lib/Postprocessing/MaskPass.js");
require("./Lib/Postprocessing/SavePass.js");
require("./Lib/MarchingCubes.js");
require("./Lib/ShaderToon.js");
var Tools = require("./Lib/tools.js").Tools;
var controls, renderTarget;
var MARGIN = 0;
var container, stats;
var camera, scene, renderer;
var mesh, texture, geometry, materials, material, current_material;
var light, pointLight, ambientLight;
var effect, resolution, numBlobs;
var composer, effectFXAA, hblur, vblur;
var effectController;
var time = 0;
var clock = new THREE.Clock();
var node = null;
var flagStats = false;
var animation = null;
var menu = null;
function main(input) {
var func = "main";
node = input.node;
// CAMERA
camera = new THREE.PerspectiveCamera( 45, node.offsetWidth / node.offsetHeight, 1, 10000 );
camera.position.set( -500, 500, 1500 );
// SCENE
scene = new THREE.Scene();
// LIGHTS
light = new THREE.DirectionalLight( 0xffffff );
light.position.set( 0.5, 0.5, 1 );
scene.add( light );
pointLight = new THREE.PointLight( 0xff3300 );
pointLight.position.set( 0, 0, 100 );
scene.add( pointLight );
ambientLight = new THREE.AmbientLight( 0x080808 );
scene.add( ambientLight );
// MATERIALS
materials = generateMaterials();
current_material = "shiny";
// MARCHING CUBES
resolution = 28;
numBlobs = 10;
effect = new THREE.MarchingCubes( resolution, materials[ current_material ].m, true, true );
effect.position.set( 0, 0, 0 );
effect.scale.set( 700, 700, 700 );
effect.enableUvs = false;
effect.enableColors = false;
scene.add( effect );
// RENDERER
renderer = new THREE.WebGLRenderer();
renderer.setClearColor( 0x050505, 1 );
renderer.setSize( node.offsetWidth, node.offsetHeight );
renderer.gammaInput = true;
renderer.gammaOutput = true;
node.appendChild( renderer.domElement );
// CONTROLS
controls = new THREE.TrackballControls( camera, renderer.domElement );
// COMPOSER
renderer.autoClear = false;
var renderTargetParameters = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat, stencilBuffer: false };
renderTarget = new THREE.WebGLRenderTarget( node.offsetWidth, node.offsetHeight, renderTargetParameters );
effectFXAA = new THREE.ShaderPass( THREE.FXAAShader );
hblur = new THREE.ShaderPass( THREE.HorizontalTiltShiftShader );
vblur = new THREE.ShaderPass( THREE.VerticalTiltShiftShader );
var bluriness = 8;
hblur.uniforms[ 'h' ].value = bluriness / node.offsetWidth;
vblur.uniforms[ 'v' ].value = bluriness / node.offsetHeight;
hblur.uniforms[ 'r' ].value = vblur.uniforms[ 'r' ].value = 0.5;
effectFXAA.uniforms[ 'resolution' ].value.set( 1 / node.offsetWidth, 1 / node.offsetHeight );
composer = new THREE.EffectComposer( renderer, renderTarget );
var renderModel = new THREE.RenderPass( scene, camera );
vblur.renderToScreen = true;
//effectFXAA.renderToScreen = true;
composer = new THREE.EffectComposer( renderer, renderTarget );
composer.addPass( renderModel );
composer.addPass( effectFXAA );
composer.addPass( hblur );
composer.addPass( vblur );
// GUI
menu = new Tools.Gui(node);
setupGui(menu.get());
//
if (flagStats) stats = Tools.addStats(node);
var onTiddlerRefresh = onWindowResize;
onTiddlerRefresh();
// Animation
animation = new Tools.Animation(node, function() {
animate();
}, false);
animation.start();
return {onTiddlerRefresh: onTiddlerRefresh};
}
//
function onWindowResize( event ) {
camera.aspect = node.offsetWidth / node.offsetHeight;
camera.updateProjectionMatrix();
renderer.setSize( node.offsetWidth, node.offsetHeight );
composer.setSize( node.offsetWidth, node.offsetHeight );
hblur.uniforms[ 'h' ].value = 4 / node.offsetWidth;
vblur.uniforms[ 'v' ].value = 4 / node.offsetHeight;
effectFXAA.uniforms[ 'resolution' ].value.set( 1 / node.offsetWidth, 1 / node.offsetHeight );
menu.onTiddlerRefresh();
}
function generateMaterials() {
// environment map
var path = "tw:textures/cube/SwedishRoyalCastle/";
var format = '.jpg';
var urls = [
path + 'px' + format, path + 'nx' + format,
path + 'py' + format, path + 'ny' + format,
path + 'pz' + format, path + 'nz' + format
];
var reflectionCube = THREE.ImageUtils.loadTextureCube( urls );
reflectionCube.format = THREE.RGBFormat;
var refractionCube = new THREE.Texture( reflectionCube.image, new THREE.CubeRefractionMapping() );
reflectionCube.format = THREE.RGBFormat;
// toons
var toonMaterial1 = createShaderMaterial( "toon1", light, ambientLight ),
toonMaterial2 = createShaderMaterial( "toon2", light, ambientLight ),
hatchingMaterial = createShaderMaterial( "hatching", light, ambientLight ),
hatchingMaterial2 = createShaderMaterial( "hatching", light, ambientLight ),
dottedMaterial = createShaderMaterial( "dotted", light, ambientLight ),
dottedMaterial2 = createShaderMaterial( "dotted", light, ambientLight );
hatchingMaterial2.uniforms.uBaseColor.value.setRGB( 0, 0, 0 );
hatchingMaterial2.uniforms.uLineColor1.value.setHSL( 0, 0.8, 0.5 );
hatchingMaterial2.uniforms.uLineColor2.value.setHSL( 0, 0.8, 0.5 );
hatchingMaterial2.uniforms.uLineColor3.value.setHSL( 0, 0.8, 0.5 );
hatchingMaterial2.uniforms.uLineColor4.value.setHSL( 0.1, 0.8, 0.5 );
dottedMaterial2.uniforms.uBaseColor.value.setRGB( 0, 0, 0 );
dottedMaterial2.uniforms.uLineColor1.value.setHSL( 0.05, 1.0, 0.5 );
var texture = THREE.ImageUtils.loadTexture( "tw:textures/UV_Grid_Sm.jpg" );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
var materials = {
"chrome" :
{
m: new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: reflectionCube } ),
h: 0, s: 0, l: 1
},
"liquid" :
{
m: new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: refractionCube, refractionRatio: 0.85 } ),
h: 0, s: 0, l: 1
},
"shiny" :
{
m: new THREE.MeshPhongMaterial( { color: 0x550000, specular: 0x440000, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.3, metal: true } ),
h: 0, s: 0.8, l: 0.2
},
"matte" :
{
m: new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x111111, shininess: 1 } ),
h: 0, s: 0, l: 1
},
"flat" :
{
m: new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x111111, shininess: 1, shading: THREE.FlatShading } ),
h: 0, s: 0, l: 1
},
"textured" :
{
m: new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x111111, shininess: 1, map: texture } ),
h: 0, s: 0, l: 1
},
"colors" :
{
m: new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0xffffff, shininess: 2, vertexColors: THREE.VertexColors } ),
h: 0, s: 0, l: 1
},
"plastic" :
{
m: new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x888888, ambient: 0x000000, shininess: 250 } ),
h: 0.6, s: 0.8, l: 0.1
},
"toon1" :
{
m: toonMaterial1,
h: 0.2, s: 1, l: 0.75
},
"toon2" :
{
m: toonMaterial2,
h: 0.4, s: 1, l: 0.75
},
"hatching" :
{
m: hatchingMaterial,
h: 0.2, s: 1, l: 0.9
},
"hatching2" :
{
m: hatchingMaterial2,
h: 0.0, s: 0.8, l: 0.5
},
"dotted" :
{
m: dottedMaterial,
h: 0.2, s: 1, l: 0.9
},
"dotted2" :
{
m: dottedMaterial2,
h: 0.1, s: 1, l: 0.5
}
};
return materials;
}
function createShaderMaterial( id, light, ambientLight ) {
var shader = THREE.ShaderToon[ id ];
var u = THREE.UniformsUtils.clone( shader.uniforms );
var vs = shader.vertexShader;
var fs = shader.fragmentShader;
var material = new THREE.ShaderMaterial( { uniforms: u, vertexShader: vs, fragmentShader: fs } );
material.uniforms.uDirLightPos.value = light.position;
material.uniforms.uDirLightColor.value = light.color;
material.uniforms.uAmbientLightColor.value = ambientLight.color;
return material;
}
//
function setupGui(gui) {
var createHandler = function( id ) {
return function() {
var mat_old = materials[ current_material ];
mat_old.h = m_h.getValue();
mat_old.s = m_s.getValue();
mat_old.l = m_l.getValue();
current_material = id;
var mat = materials[ id ];
effect.material = mat.m;
m_h.setValue( mat.h );
m_s.setValue( mat.s );
m_l.setValue( mat.l );
if ( current_material === "textured" ) {
effect.enableUvs = true;
} else {
effect.enableUvs = false;
}
if ( current_material === "colors" ) {
effect.enableColors = true;
} else {
effect.enableColors = false;
}
};
};
effectController = {
material: "shiny",
speed: 1.0,
numBlobs: 10,
resolution: 28,
isolation: 80,
floor: true,
wallx: false,
wallz: false,
hue: 0.0,
saturation: 0.8,
lightness: 0.1,
lhue: 0.04,
lsaturation: 1.0,
llightness: 0.5,
lx: 0.5,
ly: 0.5,
lz: 1.0,
postprocessing: false,
"Start/Stop": function() {animation.startStop();},
dummy: function() {
}
};
var h, m_h, m_s, m_l;
// Start/Stop animation
gui.add(effectController, "Start/Stop");
// material (type)
h = gui.addFolder( "Materials" );
for ( var m in materials ) {
effectController[ m ] = createHandler( m );
h.add( effectController, m ).name( m );
}
// material (color)
h = gui.addFolder( "Material color" );
m_h = h.add( effectController, "hue", 0.0, 1.0, 0.025 );
m_s = h.add( effectController, "saturation", 0.0, 1.0, 0.025 );
m_l = h.add( effectController, "lightness", 0.0, 1.0, 0.025 );
// light (point)
h = gui.addFolder( "Point light color" );
h.add( effectController, "lhue", 0.0, 1.0, 0.025 ).name("hue");
h.add( effectController, "lsaturation", 0.0, 1.0, 0.025 ).name("saturation");
h.add( effectController, "llightness", 0.0, 1.0, 0.025 ).name("lightness");
// light (directional)
h = gui.addFolder( "Directional light orientation" );
h.add( effectController, "lx", -1.0, 1.0, 0.025 ).name("x");
h.add( effectController, "ly", -1.0, 1.0, 0.025 ).name("y");
h.add( effectController, "lz", -1.0, 1.0, 0.025 ).name("z");
// simulation
h = gui.addFolder( "Simulation" );
h.add( effectController, "speed", 0.1, 8.0, 0.05 );
h.add( effectController, "numBlobs", 1, 50, 1 );
h.add( effectController, "resolution", 14, 40, 1 );
h.add( effectController, "isolation", 10, 300, 1 );
h.add( effectController, "floor" );
h.add( effectController, "wallx" );
h.add( effectController, "wallz" );
// rendering
h = gui.addFolder( "Rendering" );
h.add( effectController, "postprocessing" );
}
// this controls content of marching cubes voxel field
function updateCubes( object, time, numblobs, floor, wallx, wallz ) {
object.reset();
// fill the field with some metaballs
var i, ballx, bally, ballz, subtract, strength;
subtract = 12;
strength = 1.2 / ( ( Math.sqrt( numblobs ) - 1 ) / 4 + 1 );
for ( i = 0; i < numblobs; i ++ ) {
ballx = Math.sin( i + 1.26 * time * ( 1.03 + 0.5 * Math.cos( 0.21 * i ) ) ) * 0.27 + 0.5;
bally = Math.abs( Math.cos( i + 1.12 * time * Math.cos( 1.22 + 0.1424 * i ) ) ) * 0.77; // dip into the floor
ballz = Math.cos( i + 1.32 * time * 0.1 * Math.sin( ( 0.92 + 0.53 * i ) ) ) * 0.27 + 0.5;
object.addBall(ballx, bally, ballz, strength, subtract);
}
if ( floor ) object.addPlaneY( 2, 12 );
if ( wallz ) object.addPlaneZ( 2, 12 );
if ( wallx ) object.addPlaneX( 2, 12 );
}
//
function animate() {
//requestAnimationFrame( animate );
render();
if (flagStats) stats.update();
}
function render() {
var delta = clock.getDelta();
time += delta * effectController.speed * 0.5;
controls.update( delta );
// marching cubes
if ( effectController.resolution !== resolution ) {
resolution = effectController.resolution;
effect.init( resolution );
}
if ( effectController.isolation !== effect.isolation ) {
effect.isolation = effectController.isolation;
}
updateCubes( effect, time, effectController.numBlobs, effectController.floor, effectController.wallx, effectController.wallz );
// materials
if ( effect.material instanceof THREE.ShaderMaterial ) {
if ( current_material === "dotted2" ) {
effect.material.uniforms.uLineColor1.value.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
} else if ( current_material === "hatching2" ) {
var u = effect.material.uniforms;
u.uLineColor1.value.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
u.uLineColor2.value.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
u.uLineColor3.value.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
u.uLineColor4.value.setHSL( ( effectController.hue + 0.2 % 1.0 ), effectController.saturation, effectController.lightness );
} else {
effect.material.uniforms.uBaseColor.value.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
}
} else {
effect.material.color.setHSL( effectController.hue, effectController.saturation, effectController.lightness );
}
// lights
light.position.set( effectController.lx, effectController.ly, effectController.lz );
light.position.normalize();
pointLight.color.setHSL( effectController.lhue, effectController.lsaturation, effectController.llightness );
// render
if ( effectController.postprocessing ) {
composer.render( delta );
} else {
renderer.clear();
renderer.render( scene, camera );
}
}
[[three.js|http://threejs.org/]]
@@float:right;
[[View source|Three.js/Demos/molecules.js]]
@@
<$view3js tiddler="Three.js/Demos/molecules.js" height=500/>
require("./Lib/Controls/TrackballControls.js");
require("./Lib/Loaders/PDBLoader.js");
require("./Lib/Renderers/CSS2DRenderer.js");
var Stats = require("./Lib/stats-min.js").Stats;
var Tools = require("./Lib/tools.js").Tools;
var node = null;
var camera, scene, renderer, labelRenderer;
var controls;
var root;
var container = null, menu = null;
var MOLECULES = {
"Ethanol": "ethanol.pdb",
"Aspirin": "aspirin.pdb",
"Caffeine": "caffeine.pdb",
"Nicotine": "nicotine.pdb",
"LSD": "lsd.pdb",
"Cocaine": "cocaine.pdb",
"Cholesterol": "cholesterol.pdb",
"Lycopene": "lycopene.pdb",
"Glucose": "glucose.pdb",
"Aluminium oxide": "Al2O3.pdb",
"Cubane": "cubane.pdb",
"Copper": "cu.pdb",
"Fluorite": "caf2.pdb",
"Salt": "nacl.pdb",
"YBCO superconductor": "ybco.pdb",
"Buckyball": "buckyball.pdb",
//"Diamond": "diamond.pdb",
"Graphite": "graphite.pdb"
};
var loader = new THREE.PDBLoader();
function main(input) {
var func = "main";
node = input.node;
camera = new THREE.PerspectiveCamera( 70, node.offsetWidth / node.offsetHeight, 1, 5000 );
camera.position.z = 1500;
scene = new THREE.Scene();
var light = new THREE.HemisphereLight( 0xffffff, 0x000000 );
light.position.set( 1, 1, 1 );
scene.add( light );
root = new THREE.Object3D();
scene.add( root );
//
container = document.createElement("div");
node.appendChild(container);
menu = document.createElement("div");
menu.style = "position: relative; z-index:100; font-size: small; margin-left: 4px;";
menu.style.top = "" + (-node.offsetHeight -50) + "px";
node.appendChild(menu);
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setClearColor( 0x050505 );
renderer.setSize( node.offsetWidth, node.offsetHeight );
container.appendChild( renderer.domElement );
labelRenderer = new THREE.CSS2DRenderer();
labelRenderer.setSize( node.offsetWidth, node.offsetHeight );
/*
labelRenderer.domElement.style.position = 'absolute';
labelRenderer.domElement.style.top = '0';
labelRenderer.domElement.style.pointerEvents = 'none';
container.appendChild( labelRenderer.domElement );
*/
labelRenderer.domElement.style.position = 'relative';
labelRenderer.domElement.style.zIndex = 50;
labelRenderer.domElement.style.top = "" + (-node.offsetHeight - 8) + "px";
labelRenderer.domElement.style.left = "20px";
labelRenderer.domElement.style.pointerEvents = 'none';
labelRenderer.domElement.style.fontSize = 'x-small';
container.appendChild( labelRenderer.domElement );
//
controls = new THREE.TrackballControls( camera, renderer.domElement );
controls.rotateSpeed = 0.5;
controls.addEventListener( 'change', render );
//
loadMolecule( "tw:models/molecules/caffeine.pdb" );
createMenu();
var onTiddlerRefresh = onWindowResize;
onTiddlerRefresh();
// Animation
//var animation = new Tools.Animation(node, animate, true);
//animation.start();
animate();
return {onTiddlerRefresh: onTiddlerRefresh};
}
//
function generateButtonCallback( url ) {
return function ( event ) {
loadMolecule( url );
}
}
function createMenu() {
for ( var m in MOLECULES ) {
var button = document.createElement( 'button' );
button.innerHTML = m;
menu.appendChild( button );
var url = "tw:models/molecules/" + MOLECULES[ m ];
button.addEventListener( 'click', generateButtonCallback( url ), false );
}
}
//
function loadMolecule( url ) {
while( root.children.length > 0 ) {
var object = root.children[ 0 ];
object.parent.remove( object );
}
loader.load( url, function ( geometry, geometryBonds, json ) {
var boxGeometry = new THREE.BoxGeometry( 1, 1, 1 );
var sphereGeometry = new THREE.IcosahedronGeometry( 1, 2 );
var offset = geometry.center();
geometryBonds.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
for ( var i = 0; i < geometry.vertices.length; i ++ ) {
var position = geometry.vertices[ i ];
var color = geometry.colors[ i ];
var element = geometry.elements[ i ];
var material = new THREE.MeshLambertMaterial( { color: color } );
var object = new THREE.Mesh( sphereGeometry, material );
object.position.copy( position );
object.position.multiplyScalar( 75 );
object.scale.multiplyScalar( 25 );
root.add( object );
var atom = json.atoms[ i ];
var text = document.createElement( 'div' );
text.className = 'label';
text.style.color = 'rgb(' + atom[ 3 ][ 0 ] + ',' + atom[ 3 ][ 1 ] + ',' + atom[ 3 ][ 2 ] + ')';
text.textContent = atom[ 4 ];
var label = new THREE.CSS2DObject( text );
label.position.copy( object.position );
root.add( label );
}
for ( var i = 0; i < geometryBonds.vertices.length; i += 2 ) {
var start = geometryBonds.vertices[ i ];
var end = geometryBonds.vertices[ i + 1 ];
start.multiplyScalar( 75 );
end.multiplyScalar( 75 );
var object = new THREE.Mesh( boxGeometry, new THREE.MeshLambertMaterial( 0xffffff ) );
object.position.copy( start );
object.position.lerp( end, 0.5 );
object.scale.set( 5, 5, start.distanceTo( end ) );
object.lookAt( end );
root.add( object );
}
render();
} );
}
//
function onWindowResize() {
camera.aspect = node.offsetWidth / node.offsetHeight;
camera.updateProjectionMatrix();
renderer.setSize( node.offsetWidth, node.offsetHeight );
labelRenderer.setSize( node.offsetWidth, node.offsetHeight );
render();
}
function animate() {
requestAnimationFrame( animate );
controls.update();
var time = Date.now() * 0.0004;
root.rotation.x = time;
root.rotation.y = time * 0.7;
render();
}
function render() {
renderer.render( scene, camera );
labelRenderer.render( scene, camera );
}
.threejs-screen {
background: #1b1c1e;
background-image: linear-gradient(#7d8fa3, #1b1c1e);
}
The base plugin : [[Three.js|$:/plugins/rboue/Three.js]]
<br>
The extra plugin : [[Three.js-plus|$:/plugins/rboue/Three.js-plus]]
The extra plugin extends base plugin with numerous modules. With both you have an almost complete Three.js system.
!Demos
A few demos to play and see what you can do with Three.js :
[[Horse|Three.js/Demos/horse]]
[[Bubbles|Three.js/Demos/bubbles]]
[[Molecules|Three.js/Demos/molecules]]
[[Lava|Three.js/Demos/lava]]
[[Marchingcubes|Three.js/Demos/marchingcubes]]
[[Arealights|Three.js/Demos/arealights]]
!What is Three.js ?
A library that makes ~WebGL - 3D in the browser.
Links :
[[threejs.org|http://threejs.org/]]
[[Computer-graphics|http://math.hws.edu/eck/cs424/notes2013/]]
[[WebGL|http://get.webgl.org/]]
[[webglsamples.org|http://webglsamples.org/]]
!Three.js in ~TiddlyWiki environment
"""
The plugin provides a `<$view3js>` widget to execute Three.js programs and display graphical results and animations. ~TiddlyWiki can be used as a development tool for 3D - ~WebGL graphics.
__''What is a Three.js program ?''__
A Three.js program is a set of javascript instructions contained in a tiddler of type "application/javascript". It is run by a `<$view3js>` widget. It accesses the Three.js library via the `THREE` javascript object.
Requirements :
"""
* A main() function must be defined at top level. It is the program's entry point.
* The main() function must define one argument, an object with a `node` property, a reference to the root node of the widget. This node is a container for the Three.js renderer created by the program (or else your 3D objects will not stay inside the widget).
* The main() function should return an object with a callback property named `onTiddlerRefresh`. This callback is called every time the widget is refreshed by the ~TiddlyWiki's core, for example to resize Three.js scene and rendering.
* Program's exceptions are intercepted and error messages displayed. The program stops after the first exception.
* The program has access to widget context, especially the include mechanism (cf. require() function).
"""
The include mechanism is a simple way to extend the `THREE` object with modules or add new functionalities to the program. See plugin content for existing modules and watch demos and examples at threejs.org. Three.js library is documented at threejs.org.
The //tools.js// module defines useful tools to manipulate Three.js in ~TiddlyWiki environment. You can add it to your program with the following instruction :
`var Tools = require("./Lib/tools.js").Tools;`
__''3D data and model loading''__
In conventional Three.js programs, 3D data and models are searched around in server files or web pages (URLs beginning with "http://"). In ~TiddlyWiki's case, data are searched in local tiddlers.
The plugin allows the loading of tiddlers with the use of a special type of URL :
''tw:''`title of a tiddler`
The plugin offers also an ambryo of filesystem and relative path handling. Let's say a Three.js program is stored in the tiddler named "My directory/my program", a 3D model in "My directory/my 3D body" and another 3D model in "My other directory/my 3D head". With relative path you can simply reference "my 3D body" and "my 3D head" in your program. This behaviour is configuration dependent (see below). You must define a `filesystem.PATH` attribute with the list of directories to search for page references.
Example of configuration and data loading with relative tiddler references :
Configuration tiddler (`$:config/rboue/Three.js`) :
"""
```
{
"filesystem": {
"PATH": "My directory;My other directory"
},
...
}
```
or
Widget definition :
```
<$view3js tiddler="My directory/my program" path="My directory;My other directory" />
```
Program :
```
...
var loader = new THREE.JSONLoader(true);
loader.load("tw:my 3D body", function(geometry) {// etc...});
loader.load("tw:my 3D head", function(geometry) {// etc...});
...
```
"""
__''<$view3js> widget''__
The widget offers an UI to Three.js rendering.
It executes a Three.js program and displays graphical results and animations.
The content of the `<$view3js>` widget is not interpreted.
"""
|Attribute |Description |h
|tiddler |The tiddler of the Three.js program |
|width |Width of the widget in pixel |
|height |Height of the widget in pixel (300 by default) |
|path |A list of directories to search under for the data tiddlers expected by Three.js loaders. It superseded the global configuration's attribute `filesystem.PATH` |
|class |An optional CSS class name to be assigned to the HTML element |
"""
__''Configuration''__
The plugin is configured via the `$:config/rboue/Three.js` tiddler (of type `application/json`).
Example of configuration :
"""
```
{
"filesystem": {
"PATH": "Three.js/Tests;Three.js/Tests1"
}
}
```
|Attribute |Description |h
|filesystem |Activates the pseudo filesystem behaviour. `PATH` is a list of absolute directories to search under when data tiddlers are loaded by the Three.js loaders |
{
"metadata" : {
"formatVersion" : 3,
"description" : "3D assets and textures for ROME - 3 Dreams of Black - at http://ro.me are licensed under a Creative CommonsAttribution-NonCommercial-ShareAlike 3.0 Unported License ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )."
},
"scale" : 10.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "comp_horse_rig:blinn9SG",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.41999999999999998, 0.56999999999999995, 0.45000000000000001],
"colorSpecular" : [1.0, 0.42999999999999999, 0.35999999999999999],
"illumination" : 4,
"opticalDensity" : 1.0
}],
"vertices": [0,1389,54,0,1408,116,0,1372,-298,0,1439,-555,0,1131,-976,0,1259,-956,0,1394,-842,0,808,-505,0,779,-253,0,734,9,-5,1670,554,-11,1443,895,0,971,701,0,1038,-964,0,941,-871,-1,896,647,0,816,421,-5,1756,1032,4,1712,1112,-5,1409,918,29,1343,1240,14,1574,1167,5,1353,1004,20,1246,1119,34,1287,1277,20,1210,1113,28,1172,1181,23,1254,1154,24,1180,1142,27,1180,1173,0,854,-702,23,1431,1210,33,1194,1240,0,1382,-872,0,1334,-913,0,1425,-1083,0,1319,-1080,0,1483,-1203,0,1338,-1247,-4,1364,-1607,-4,1256,-1696,34,1224,1253,0,1497,282,0,1082,707,-18,1764,797,0,902,-786,18,1502,1189,0,1197,694,0,837,553,271,1031,184,225,1236,7,272,1169,-179,261,1009,-455,277,860,-34,145,1291,207,250,1105,467,144,1336,-362,201,1402,-547,291,856,-749,173,1289,525,137,1349,-861,210,834,-270,256,950,451,209,1091,336,257,867,623,232,1036,597,221,927,678,106,1544,711,66,1646,583,78,1511,892,104,966,675,148,1018,-954,243,878,-847,248,800,583,116,1593,948,49,1736,1066,105,1622,986,35,1710,1109,112,1496,896,108,1594,1085,94,1418,907,74,1294,1128,98,1503,1113,50,1342,1237,51,1575,1161,70,1367,998,57,1254,1121,275,1140,-715,102,1133,-993,86,1255,1140,73,1299,1249,63,1209,1137,75,1196,1164,73,1201,1161,204,830,-522,93,884,632,86,880,-875,83,784,471,111,1708,1124,72,1796,1207,69,1786,1209,153,294,1278,130,291,1333,140,298,1217,82,38,-1190,64,30,-1114,63,46,-1217,58,290,1332,72,298,1213,-28,48,-1119,-6,58,-1217,77,835,-761,-34,56,-1166,59,1706,1107,85,1690,1088,90,1688,1071,64,1720,1095,52,1429,1204,82,1694,1030,42,1290,-937,96,1239,1204,82,1219,1201,200,905,352,23,1368,-879,33,1343,-893,34,1392,-1080,65,1330,-1079,46,1444,-1217,82,1358,-1250,42,1361,-1544,75,1310,-1586,96,1277,1210,75,1263,1209,109,1590,1139,71,1709,1100,100,1740,1151,112,1751,1146,83,1702,1044,67,820,603,43,294,1271,67,1485,299,80,1095,683,65,1232,1238,62,1197,1229,63,1176,1174,54,1252,1141,56,1184,1168,45,1184,1140,60,1760,1154,88,1737,1126,117,1710,1112,98,1750,1061,64,1770,1147,326,783,-599,291,1098,-503,210,1126,-904,243,674,-884,259,730,-915,216,781,-946,135,811,-958,98,716,-929,143,660,-868,78,124,-1146,0,144,-1161,-1,142,-1202,21,149,-1226,74,136,-1218,84,121,-1194,87,1657,881,44,1734,800,170,573,-1141,164,560,-1099,185,708,903,188,746,928,177,782,948,159,592,-1172,161,674,1001,152,690,1020,155,655,980,97,206,-1227,97,213,-1198,100,200,-1255,89,554,-1123,82,776,940,118,620,-1190,85,690,1015,84,691,890,88,642,962,24,229,-1212,45,209,-1265,68,742,922,79,675,997,85,574,-1153,30,230,-1239,127,459,1229,76,458,1226,62,443,1204,78,428,1183,129,430,1188,145,443,1207,80,1321,1187,168,824,-515,71,888,-741,35,1506,1186,56,1553,1165,114,1564,1068,96,1403,1063,49,872,-711,102,824,-510,94,1395,115,102,1376,59,142,808,-256,166,766,15,73,1228,667,197,1196,590,-270,1067,192,-225,1236,7,-266,1151,-201,-235,987,-609,-277,860,-34,-145,1307,225,-248,1136,510,-142,1307,-364,-202,1388,-542,-269,962,-976,-172,1288,549,-139,1355,-865,-200,821,-319,-256,1034,444,-207,1172,384,-261,877,503,-232,1022,606,-226,873,593,-124,1542,705,-78,1645,579,-105,1509,891,-106,920,652,-155,1110,-1023,-232,1037,-1056,-251,870,430,-130,1585,973,-50,1733,1076,-113,1615,1007,-26,1707,1116,-130,1488,921,-95,1587,1105,-105,1411,927,-33,1291,1139,-74,1497,1130,7,1341,1241,-22,1573,1168,-60,1362,1011,-16,1252,1128,-275,1157,-744,-110,1191,-979,-41,1251,1152,-9,1297,1257,-15,1207,1144,-22,1193,1174,-20,1198,1170,-184,859,-632,-96,848,571,-79,1073,-1085,-85,843,393,-102,1719,1140,-59,1831,1182,-55,1822,1187,-95,10,485,-77,17,541,-78,8,425,-166,462,-1813,-161,395,-1854,-142,482,-1800,-5,30,544,-10,20,425,-66,388,-1859,-71,473,-1805,-55,978,-1001,-52,427,-1835,-50,1704,1118,-78,1686,1105,-86,1682,1090,-58,1718,1106,-6,1427,1210,-86,1689,1047,-45,1304,-923,-37,1235,1217,-22,1215,1211,-199,990,336,-23,1368,-879,-33,1343,-893,-32,1391,-1080,-63,1330,-1078,-46,1443,-1215,-81,1356,-1248,-50,1360,-1543,-82,1308,-1583,-38,1273,1223,-17,1260,1219,-85,1584,1159,-63,1706,1113,-89,1758,1153,-103,1767,1146,-85,1695,1061,-70,809,521,13,29,484,-67,1485,299,-80,1078,693,0,1230,1245,3,1196,1235,-6,1174,1181,-9,1250,1148,-1,1182,1174,3,1183,1144,-51,1779,1143,-81,1748,1129,-109,1716,1129,-100,1737,1066,-56,1786,1134,-285,840,-846,-275,1059,-602,-218,1190,-907,-204,776,-1116,-227,831,-1145,-192,887,-1176,-115,927,-1191,-67,836,-1165,-102,774,-1104,-151,385,-1755,-70,386,-1750,-62,425,-1736,-80,444,-1715,-134,445,-1717,-151,430,-1737,-118,1655,882,-81,1732,803,-154,720,-1416,-153,686,-1379,-200,550,432,-203,545,478,-193,543,521,-134,747,-1435,-165,445,456,-156,440,481,-159,452,429,-142,416,-1650,-145,407,-1627,-142,431,-1669,-81,676,-1404,-98,553,513,-86,769,-1437,-90,452,479,-100,560,412,-93,468,410,-69,409,-1628,-86,433,-1670,-83,554,475,-84,459,457,-69,706,-1422,-70,426,-1648,-90,145,415,-40,155,414,-26,160,390,-42,168,362,-92,158,365,-107,147,387,-29,1317,1198,-159,840,-563,-65,928,-816,1,1505,1189,-26,1550,1174,-102,1557,1090,-75,1398,1080,-44,896,-759,-100,827,-525,-94,1395,115,-102,1376,59,-139,800,-275,-166,766,15,-73,1224,673,-197,1184,625,140,1138,642,161,991,644,151,925,695,133,796,956,124,701,1032,100,472,1241,98,289,1349,104,293,1295,105,297,1233,104,417,1172,125,642,964,128,683,884,165,761,525,208,851,451,-208,962,399,-168,854,383,-143,559,401,-130,462,410,-68,168,346,-44,16,442,-48,20,504,-46,24,559,-64,145,432,-128,440,498,-149,545,538,-155,859,618,-162,959,627,-140,1115,669,167,882,-901,174,810,-957,149,614,-1185,73,190,-1271,53,147,-1228,28,49,-1200,12,46,-1157,10,35,-1084,37,130,-1130,59,217,-1185,124,559,-1094,199,648,-867,264,761,-557,-162,1076,-1105,-154,921,-1189,-118,769,-1437,-116,437,-1680,-111,449,-1709,-110,463,-1811,-100,425,-1836,-111,363,-1874,-112,366,-1766,-109,394,-1616,-114,675,-1372,-157,755,-1101,-218,815,-813,152,366,1246,133,403,1214,104,412,1203,74,403,1208,48,366,1242,70,378,1275,99,384,1287,129,376,1279,-27,103,475,-1,94,445,-30,121,405,-61,122,387,-89,111,407,-104,76,443,-86,94,476,-58,105,493,-38,1362,1180,0,1386,1224,26,1386,1225,50,1387,1219,82,1366,1168,-32,1400,-944,-42,1356,-975,0,1342,-976,43,1357,-975,33,1400,-944,0,1413,-944,-82,1321,-1424,-1,1306,-1415,79,1323,-1426,44,1413,-1423,-2,1456,-1408,-50,1412,-1421,197,654,-1107,173,693,-1143,170,714,-1163,95,712,-1154,97,674,-1135,91,625,-1072,149,608,-1057,193,620,-1069,-65,838,-1383,-141,840,-1391,-143,815,-1375,-167,771,-1345,-163,730,-1313,-120,716,-1303,-61,736,-1315,-66,797,-1369,93,1553,1130,107,1577,1113,108,1563,1086,98,1537,1100,-68,1548,1146,-87,1571,1133,-92,1557,1106,-79,1531,1118,111,1556,1111,-90,1549,1131],
"morphTargets": [
{ "name": "horse_A_001", "vertices": [0,1389,54,0,1408,116,0,1372,-298,0,1439,-555,0,1131,-976,0,1259,-956,0,1394,-842,0,808,-505,0,779,-253,0,734,9,-5,1670,554,-11,1443,895,0,971,701,0,1038,-964,0,941,-871,-1,896,647,0,816,421,-5,1756,1032,4,1712,1112,-5,1409,918,29,1343,1240,14,1574,1167,5,1353,1004,20,1246,1119,34,1287,1277,20,1210,1113,28,1172,1181,23,1254,1154,24,1180,1142,27,1180,1173,0,854,-702,23,1431,1210,33,1194,1240,0,1382,-872,0,1334,-913,0,1425,-1083,0,1319,-1080,0,1483,-1203,0,1338,-1247,-4,1364,-1607,-4,1256,-1696,34,1224,1253,0,1497,282,0,1082,707,-18,1764,797,0,902,-786,18,1502,1189,0,1197,694,0,837,553,271,1031,184,225,1236,7,272,1169,-179,261,1009,-455,277,860,-34,145,1291,207,250,1105,467,144,1336,-362,201,1402,-547,291,856,-749,173,1289,525,137,1349,-861,210,834,-270,256,950,451,209,1091,336,257,867,623,232,1036,597,221,927,678,106,1544,711,66,1646,583,78,1511,892,104,966,675,148,1018,-954,243,878,-847,248,800,583,116,1593,948,49,1736,1066,105,1622,986,35,1710,1109,112,1496,896,108,1594,1085,94,1418,907,74,1294,1128,98,1503,1113,50,1342,1237,51,1575,1161,70,1367,998,57,1254,1121,275,1140,-715,102,1133,-993,86,1255,1140,73,1299,1249,63,1209,1137,75,1196,1164,73,1201,1161,204,830,-522,93,884,632,86,880,-875,83,784,471,111,1708,1124,72,1796,1207,69,1786,1209,153,294,1278,130,291,1333,140,298,1217,82,38,-1190,64,30,-1114,63,46,-1217,58,290,1332,72,298,1213,-28,48,-1119,-6,58,-1217,77,835,-761,-34,56,-1166,59,1706,1107,85,1690,1088,90,1688,1071,64,1720,1095,52,1429,1204,82,1694,1030,42,1290,-937,96,1239,1204,82,1219,1201,200,905,352,23,1368,-879,33,1343,-893,34,1392,-1080,65,1330,-1079,46,1444,-1217,82,1358,-1250,42,1361,-1544,75,1310,-1586,96,1277,1210,75,1263,1209,109,1590,1139,71,1709,1100,100,1740,1151,112,1751,1146,83,1702,1044,67,820,603,43,294,1271,67,1485,299,80,1095,683,65,1232,1238,62,1197,1229,63,1176,1174,54,1252,1141,56,1184,1168,45,1184,1140,60,1760,1154,88,1737,1126,117,1710,1112,98,1750,1061,64,1770,1147,326,783,-599,291,1098,-503,210,1126,-904,243,674,-884,259,730,-915,216,781,-946,135,811,-958,98,716,-929,143,660,-868,78,124,-1146,0,144,-1161,-1,142,-1202,21,149,-1226,74,136,-1218,84,121,-1194,87,1657,881,44,1734,800,170,573,-1141,164,560,-1099,185,708,903,188,746,928,177,782,948,159,592,-1172,161,674,1001,152,690,1020,155,655,980,97,206,-1227,97,213,-1198,100,200,-1255,89,554,-1123,82,776,940,118,620,-1190,85,690,1015,84,691,890,88,642,962,24,229,-1212,45,209,-1265,68,742,922,79,675,997,85,574,-1153,30,230,-1239,127,459,1229,76,458,1226,62,443,1204,78,428,1183,129,430,1188,145,443,1207,80,1321,1187,168,824,-515,71,888,-741,35,1506,1186,56,1553,1165,114,1564,1068,96,1403,1063,49,872,-711,102,824,-510,94,1395,115,102,1376,59,142,808,-256,166,766,15,73,1228,667,197,1196,590,-270,1067,192,-225,1236,7,-266,1151,-201,-235,987,-609,-277,860,-34,-145,1307,225,-248,1136,510,-142,1307,-364,-202,1388,-542,-269,962,-976,-172,1288,549,-139,1355,-865,-200,821,-319,-256,1034,444,-207,1172,384,-261,877,503,-232,1022,606,-226,873,593,-124,1542,705,-78,1645,579,-105,1509,891,-106,920,652,-155,1110,-1023,-232,1037,-1056,-251,870,430,-130,1585,973,-50,1733,1076,-113,1615,1007,-26,1707,1116,-130,1488,921,-95,1587,1105,-105,1411,927,-33,1291,1139,-74,1497,1130,7,1341,1241,-22,1573,1168,-60,1362,1011,-16,1252,1128,-275,1157,-744,-110,1191,-979,-41,1251,1152,-9,1297,1257,-15,1207,1144,-22,1193,1174,-20,1198,1170,-184,859,-632,-96,848,571,-79,1073,-1085,-85,843,393,-102,1719,1140,-59,1831,1182,-55,1822,1187,-95,10,485,-77,17,541,-78,8,425,-166,462,-1813,-161,395,-1854,-142,482,-1800,-5,30,544,-10,20,425,-66,388,-1859,-71,473,-1805,-55,978,-1001,-52,427,-1835,-50,1704,1118,-78,1686,1105,-86,1682,1090,-58,1718,1106,-6,1427,1210,-86,1689,1047,-45,1304,-923,-37,1235,1217,-22,1215,1211,-199,990,336,-23,1368,-879,-33,1343,-893,-32,1391,-1080,-63,1330,-1078,-46,1443,-1215,-81,1356,-1248,-50,1360,-1543,-82,1308,-1583,-38,1273,1223,-17,1260,1219,-85,1584,1159,-63,1706,1113,-89,1758,1153,-103,1767,1146,-85,1695,1061,-70,809,521,13,29,484,-67,1485,299,-80,1078,693,0,1230,1245,3,1196,1235,-6,1174,1181,-9,1250,1148,-1,1182,1174,3,1183,1144,-51,1779,1143,-81,1748,1129,-109,1716,1129,-100,1737,1066,-56,1786,1134,-285,840,-846,-275,1059,-602,-218,1190,-907,-204,776,-1116,-227,831,-1145,-192,887,-1176,-115,927,-1191,-67,836,-1165,-102,774,-1104,-151,385,-1755,-70,386,-1750,-62,425,-1736,-80,444,-1715,-134,445,-1717,-151,430,-1737,-118,1655,882,-81,1732,803,-154,720,-1416,-153,686,-1379,-200,550,432,-203,545,478,-193,543,521,-134,747,-1435,-165,445,456,-156,440,481,-159,452,429,-142,416,-1650,-145,407,-1627,-142,431,-1669,-81,676,-1404,-98,553,513,-86,769,-1437,-90,452,479,-100,560,412,-93,468,410,-69,409,-1628,-86,433,-1670,-83,554,475,-84,459,457,-69,706,-1422,-70,426,-1648,-90,145,415,-40,155,414,-26,160,390,-42,168,362,-92,158,365,-107,147,387,-29,1317,1198,-159,840,-563,-65,928,-816,1,1505,1189,-26,1550,1174,-102,1557,1090,-75,1398,1080,-44,896,-759,-100,827,-525,-94,1395,115,-102,1376,59,-139,800,-275,-166,766,15,-73,1224,673,-197,1184,625,140,1138,642,161,991,644,151,925,695,133,796,956,124,701,1032,100,472,1241,98,289,1349,104,293,1295,105,297,1233,104,417,1172,125,642,964,128,683,884,165,761,525,208,851,451,-208,962,399,-168,854,383,-143,559,401,-130,462,410,-68,168,346,-44,16,442,-48,20,504,-46,24,559,-64,145,432,-128,440,498,-149,545,538,-155,859,618,-162,959,627,-140,1115,669,167,882,-901,174,810,-957,149,614,-1185,73,190,-1271,53,147,-1228,28,49,-1200,12,46,-1157,10,35,-1084,37,130,-1130,59,217,-1185,124,559,-1094,199,648,-867,264,761,-557,-162,1076,-1105,-154,921,-1189,-118,769,-1437,-116,437,-1680,-111,449,-1709,-110,463,-1811,-100,425,-1836,-111,363,-1874,-112,366,-1766,-109,394,-1616,-114,675,-1372,-157,755,-1101,-218,815,-813,152,366,1246,133,403,1214,104,412,1203,74,403,1208,48,366,1242,70,378,1275,99,384,1287,129,376,1279,-27,103,475,-1,94,445,-30,121,405,-61,122,387,-89,111,407,-104,76,443,-86,94,476,-58,105,493,-38,1362,1180,0,1386,1224,26,1386,1225,50,1387,1219,82,1366,1168,-32,1400,-944,-42,1356,-975,0,1342,-976,43,1357,-975,33,1400,-944,0,1413,-944,-82,1321,-1424,-1,1306,-1415,79,1323,-1426,44,1413,-1423,-2,1456,-1408,-50,1412,-1421,197,654,-1107,173,693,-1143,170,714,-1163,95,712,-1154,97,674,-1135,91,625,-1072,149,608,-1057,193,620,-1069,-65,838,-1383,-141,840,-1391,-143,815,-1375,-167,771,-1345,-163,730,-1313,-120,716,-1303,-61,736,-1315,-66,797,-1369,93,1553,1130,107,1577,1113,108,1563,1086,98,1537,1100,-68,1548,1146,-87,1571,1133,-92,1557,1106,-79,1531,1118,111,1556,1111,-90,1549,1131] },
{ "name": "horse_A_002", "vertices": [0,1408,54,0,1425,111,0,1413,-326,0,1474,-585,0,1159,-1000,0,1286,-982,0,1422,-871,0,845,-521,0,808,-261,0,760,-5,-5,1682,553,-11,1451,892,0,967,685,0,1066,-986,0,969,-889,0,896,627,0,823,393,-5,1764,1030,3,1720,1110,-4,1417,916,28,1351,1239,13,1582,1165,5,1361,1003,20,1254,1117,34,1295,1275,20,1219,1111,28,1180,1179,23,1262,1152,24,1188,1140,27,1188,1171,0,887,-719,22,1439,1208,33,1202,1238,0,1410,-901,0,1361,-941,0,1443,-1112,1,1338,-1106,0,1493,-1227,1,1348,-1269,-5,1406,-1629,-5,1341,-1747,34,1233,1251,0,1513,278,0,1088,699,-18,1773,796,0,932,-804,18,1510,1187,0,1209,687,0,838,528,271,1058,176,224,1257,8,271,1185,-187,260,1013,-520,276,886,-44,146,1313,206,251,1119,469,142,1366,-389,199,1433,-573,308,914,-846,173,1302,527,136,1378,-888,211,857,-294,255,971,421,210,1127,336,252,849,555,231,1025,585,218,893,628,106,1554,709,66,1658,582,78,1519,889,103,947,652,156,1073,-1003,261,953,-941,242,795,504,116,1602,947,49,1744,1064,105,1631,984,35,1718,1108,112,1505,895,108,1602,1083,95,1426,905,74,1303,1126,98,1511,1111,50,1350,1235,50,1583,1159,70,1375,996,57,1263,1119,275,1181,-750,105,1176,-1021,86,1263,1138,73,1308,1247,63,1218,1135,75,1204,1163,73,1209,1159,210,857,-583,90,872,591,105,953,-975,80,798,423,111,1716,1122,71,1803,1206,68,1792,1208,141,290,1251,119,322,1297,127,255,1201,115,203,-1516,104,168,-1446,93,218,-1536,47,324,1296,58,255,1198,10,183,-1437,23,228,-1526,95,886,-870,0,207,-1477,59,1714,1105,85,1699,1086,90,1696,1069,63,1729,1093,51,1437,1202,82,1703,1028,42,1322,-963,96,1247,1202,82,1227,1199,198,933,322,23,1396,-908,33,1371,-921,34,1411,-1108,65,1349,-1105,46,1454,-1240,83,1368,-1272,42,1392,-1569,75,1350,-1618,96,1286,1208,75,1271,1208,109,1598,1137,70,1717,1098,99,1747,1150,111,1759,1145,82,1711,1042,64,814,559,31,289,1245,67,1500,294,80,1098,679,65,1240,1236,62,1206,1228,63,1184,1172,54,1260,1140,56,1192,1166,45,1192,1138,59,1767,1152,88,1745,1125,116,1717,1110,98,1758,1060,63,1777,1146,341,817,-708,288,1111,-550,213,1175,-935,274,753,-1009,288,814,-1030,244,867,-1054,161,895,-1065,129,794,-1053,174,732,-1000,114,268,-1443,36,289,-1444,30,301,-1483,51,317,-1505,104,304,-1506,116,282,-1490,87,1666,880,44,1743,799,209,695,-1300,207,669,-1262,175,617,782,179,652,811,168,687,836,194,723,-1322,152,581,883,143,598,901,145,561,863,126,373,-1491,129,370,-1462,127,377,-1520,129,669,-1282,73,683,828,152,754,-1327,76,597,897,74,602,766,78,547,846,55,387,-1463,71,387,-1521,59,651,806,70,581,880,123,698,-1303,59,397,-1490,118,378,1120,67,378,1117,54,360,1098,69,343,1076,120,345,1081,136,359,1100,79,1329,1186,171,856,-552,76,922,-786,34,1514,1184,56,1562,1164,114,1572,1067,96,1411,1061,52,905,-746,103,859,-532,94,1412,110,102,1395,60,142,835,-269,166,791,2,73,1239,663,198,1200,596,-271,1075,178,-224,1257,8,-266,1171,-200,-236,980,-601,-276,886,-44,-146,1319,214,-250,1127,479,-142,1346,-388,-201,1421,-567,-271,965,-965,-173,1299,537,-138,1381,-888,-201,846,-323,-256,1016,414,-210,1161,351,-256,849,474,-232,1011,576,-221,851,565,-124,1553,702,-78,1657,578,-105,1517,888,-104,916,629,-152,1126,-1030,-233,1041,-1044,-247,845,402,-130,1593,971,-51,1741,1074,-113,1623,1005,-27,1716,1114,-130,1496,918,-95,1595,1103,-105,1419,924,-33,1299,1137,-74,1505,1128,7,1349,1239,-23,1581,1166,-60,1370,1009,-16,1260,1126,-274,1177,-753,-108,1210,-1006,-41,1259,1150,-9,1305,1255,-15,1215,1143,-22,1201,1172,-20,1206,1168,-186,867,-644,-92,836,548,-79,1074,-1074,-82,837,373,-102,1724,1139,-58,1833,1188,-54,1824,1192,-113,0,216,-92,-34,261,-98,39,170,-180,569,-1867,-175,501,-1905,-156,590,-1855,-19,-29,266,-30,45,173,-80,493,-1910,-85,581,-1860,-57,975,-991,-66,533,-1887,-51,1712,1116,-79,1694,1103,-87,1690,1088,-58,1726,1104,-6,1435,1208,-87,1697,1045,-45,1329,-952,-37,1243,1215,-22,1224,1209,-199,983,313,-23,1396,-908,-33,1371,-921,-32,1410,-1107,-63,1349,-1104,-46,1453,-1239,-81,1366,-1270,-50,1390,-1567,-83,1347,-1616,-38,1281,1221,-17,1268,1217,-86,1592,1157,-64,1714,1111,-89,1762,1155,-102,1772,1148,-85,1703,1059,-66,802,500,-3,10,220,-67,1500,294,-80,1087,679,0,1238,1243,3,1204,1234,-6,1182,1179,-9,1258,1146,-1,1191,1172,3,1191,1142,-51,1784,1145,-81,1754,1130,-109,1722,1128,-100,1747,1066,-56,1791,1137,-289,831,-848,-275,1068,-597,-216,1208,-926,-214,816,-1140,-236,876,-1157,-200,937,-1176,-123,977,-1184,-76,881,-1179,-112,809,-1131,-165,495,-1805,-84,497,-1800,-76,536,-1788,-94,557,-1768,-148,557,-1771,-165,542,-1790,-118,1663,881,-81,1741,802,-168,813,-1441,-168,776,-1409,-183,531,406,-187,518,449,-177,510,490,-149,842,-1457,-154,427,402,-146,415,423,-147,442,378,-156,533,-1702,-159,521,-1680,-156,550,-1721,-95,769,-1434,-81,518,485,-101,864,-1457,-79,422,425,-82,541,389,-80,459,364,-83,523,-1681,-100,551,-1722,-66,525,448,-73,435,406,-83,800,-1449,-85,542,-1699,-100,150,267,-49,155,269,-35,169,247,-51,186,224,-101,179,225,-117,163,242,-29,1325,1197,-159,863,-579,-65,947,-824,1,1513,1187,-26,1559,1172,-102,1565,1088,-75,1406,1078,-44,919,-770,-100,861,-540,-94,1412,110,-102,1395,60,-139,830,-279,-166,791,2,-73,1236,665,-198,1190,606,141,1137,644,160,974,624,148,891,650,124,701,846,114,609,913,92,391,1132,87,332,1310,92,301,1265,92,265,1214,96,331,1065,115,547,848,118,594,760,160,768,451,205,873,400,-207,947,375,-164,838,358,-125,542,378,-117,455,363,-76,192,209,-63,31,185,-64,-8,233,-60,-42,276,-75,143,284,-118,407,439,-133,507,507,-150,844,591,-161,952,600,-140,1121,651,187,964,-996,200,895,-1063,183,747,-1327,98,372,-1536,82,316,-1510,60,215,-1517,47,196,-1476,52,160,-1412,75,266,-1423,93,368,-1445,168,666,-1254,231,723,-997,279,785,-673,-162,1080,-1094,-161,971,-1182,-132,864,-1457,-130,556,-1733,-125,562,-1762,-124,571,-1866,-114,531,-1888,-125,468,-1924,-127,476,-1815,-123,507,-1670,-128,765,-1403,-167,791,-1130,-222,800,-818,142,326,1181,123,335,1134,94,332,1116,64,334,1128,37,326,1178,60,355,1197,90,366,1201,120,355,1201,-38,72,270,-14,85,237,-42,133,230,-73,143,222,-102,125,229,-118,76,232,-97,65,266,-69,66,289,-39,1370,1178,0,1394,1222,25,1394,1223,50,1396,1217,82,1375,1166,-32,1425,-974,-42,1380,-1004,0,1366,-1004,43,1381,-1004,34,1425,-974,0,1437,-974,-81,1329,-1451,0,1314,-1444,79,1332,-1454,44,1420,-1443,-2,1460,-1425,-50,1419,-1441,238,765,-1237,211,809,-1265,208,835,-1280,133,827,-1272,136,786,-1260,134,724,-1208,193,706,-1197,235,722,-1207,-78,928,-1392,-154,933,-1400,-157,906,-1388,-181,857,-1366,-177,812,-1341,-134,795,-1334,-75,816,-1343,-80,885,-1386,93,1561,1128,106,1585,1112,107,1572,1084,98,1545,1098,-69,1556,1144,-87,1579,1131,-93,1565,1104,-79,1539,1115,111,1564,1109,-91,1557,1129] },
{ "name": "horse_A_003", "vertices": [0,1442,55,0,1456,105,0,1470,-324,0,1530,-584,0,1213,-996,0,1340,-979,0,1476,-869,0,901,-515,0,856,-270,0,803,-17,-4,1712,537,-9,1482,879,0,968,659,0,1119,-982,0,1023,-884,1,897,600,0,849,357,-3,1805,1011,5,1764,1092,-2,1455,908,32,1400,1233,16,1628,1152,8,1402,997,23,1299,1115,37,1345,1271,24,1263,1111,32,1227,1180,26,1308,1150,28,1234,1140,31,1235,1171,0,941,-713,25,1487,1200,37,1252,1238,0,1464,-899,0,1414,-938,0,1486,-1105,1,1380,-1098,0,1522,-1210,1,1377,-1251,-6,1482,-1598,-9,1485,-1736,37,1282,1250,0,1541,273,0,1101,685,-16,1803,780,0,987,-799,21,1557,1177,0,1231,676,0,854,493,271,1104,171,224,1293,10,270,1226,-188,257,1068,-531,274,930,-50,147,1348,206,252,1150,473,142,1422,-388,199,1488,-572,301,977,-861,174,1322,529,136,1432,-886,209,907,-302,255,1028,395,213,1184,346,249,875,474,231,1035,566,214,891,560,107,1582,692,67,1688,566,80,1547,873,101,948,618,155,1132,-1006,256,1019,-954,239,844,408,118,1641,933,50,1787,1045,107,1671,969,37,1762,1090,114,1542,884,110,1646,1069,97,1464,897,77,1348,1122,100,1556,1100,53,1399,1230,53,1630,1146,73,1416,990,61,1308,1116,274,1239,-755,105,1233,-1020,89,1309,1136,76,1357,1243,66,1263,1134,79,1251,1162,77,1255,1159,206,914,-589,88,884,539,100,1023,-988,79,849,366,113,1760,1105,73,1848,1187,70,1837,1189,110,94,882,87,114,934,96,74,824,166,410,-1732,156,339,-1698,144,433,-1740,15,119,932,28,78,819,61,339,-1690,73,431,-1733,88,953,-886,50,382,-1709,61,1758,1088,87,1742,1069,92,1739,1052,65,1773,1075,54,1485,1194,83,1744,1011,43,1376,-961,99,1295,1200,86,1275,1198,198,995,296,23,1450,-906,33,1425,-918,34,1453,-1101,65,1392,-1097,46,1483,-1224,83,1397,-1255,41,1454,-1546,73,1427,-1603,99,1334,1205,79,1319,1205,111,1644,1124,72,1761,1081,101,1791,1132,113,1803,1127,84,1753,1024,62,836,500,0,99,874,67,1528,290,80,1109,669,68,1289,1235,66,1255,1227,66,1231,1172,57,1306,1137,60,1239,1166,49,1238,1138,61,1811,1134,90,1789,1107,118,1761,1093,100,1801,1042,65,1821,1128,333,875,-726,286,1165,-557,213,1233,-936,264,822,-1029,279,884,-1048,236,939,-1071,154,968,-1081,120,868,-1072,164,803,-1020,156,417,-1635,76,429,-1630,70,462,-1654,90,489,-1660,144,483,-1664,158,457,-1664,90,1695,864,46,1773,783,206,794,-1337,207,757,-1306,163,567,569,167,586,612,156,607,649,189,825,-1352,136,491,647,127,500,670,130,482,620,158,528,-1609,162,516,-1582,159,542,-1634,130,756,-1328,61,609,638,144,852,-1349,60,502,664,63,563,547,63,478,597,86,525,-1581,102,547,-1634,47,590,604,54,495,642,121,789,-1342,88,543,-1602,93,211,779,42,213,774,29,204,750,45,198,722,96,196,729,111,200,753,83,1377,1181,169,913,-552,74,981,-788,37,1562,1173,58,1608,1151,116,1616,1054,98,1455,1053,50,962,-745,103,916,-528,94,1443,103,102,1429,60,141,885,-277,164,834,-8,73,1258,656,199,1213,599,-271,1097,165,-224,1293,10,-267,1214,-195,-243,1026,-573,-274,930,-50,-146,1344,204,-252,1119,449,-142,1405,-384,-201,1478,-564,-280,1001,-931,-174,1316,525,-138,1433,-884,-203,896,-321,-256,998,397,-213,1156,323,-250,808,427,-231,988,546,-214,801,516,-123,1581,686,-77,1687,562,-103,1545,872,-101,898,597,-151,1165,-1016,-238,1072,-1013,-242,838,365,-128,1633,958,-49,1784,1055,-111,1664,991,-25,1760,1096,-127,1534,909,-93,1639,1090,-102,1457,917,-30,1344,1133,-71,1550,1118,10,1398,1234,-20,1627,1153,-57,1411,1004,-13,1305,1124,-274,1228,-742,-106,1255,-1005,-37,1305,1148,-6,1354,1251,-12,1261,1142,-18,1248,1172,-17,1253,1168,-192,912,-627,-87,801,503,-83,1097,-1043,-81,850,349,-99,1766,1123,-54,1873,1175,-50,1863,1179,-139,153,-188,-118,99,-175,-122,213,-201,-194,474,-1735,-189,396,-1741,-170,498,-1733,-45,97,-172,-54,214,-199,-94,387,-1742,-99,488,-1733,-65,1001,-957,-80,433,-1738,-49,1756,1099,-77,1738,1086,-85,1733,1071,-56,1769,1086,-3,1483,1200,-85,1739,1028,-44,1381,-951,-33,1291,1214,-19,1272,1209,-199,989,304,-23,1450,-906,-33,1425,-918,-32,1453,-1101,-63,1391,-1097,-46,1482,-1222,-81,1394,-1252,-51,1452,-1545,-84,1424,-1600,-35,1329,1219,-14,1316,1214,-83,1637,1143,-62,1758,1094,-86,1803,1140,-99,1813,1134,-83,1746,1042,-63,793,455,-28,157,-185,-67,1528,290,-80,1099,662,4,1287,1241,7,1253,1233,-2,1229,1179,-5,1304,1144,1,1237,1172,7,1237,1143,-48,1825,1130,-78,1795,1114,-106,1764,1112,-99,1791,1051,-53,1833,1123,-303,870,-814,-279,1121,-575,-214,1254,-921,-229,860,-1112,-249,922,-1126,-211,982,-1143,-132,1019,-1149,-89,921,-1149,-128,848,-1104,-179,432,-1648,-98,436,-1644,-90,476,-1649,-108,504,-1640,-162,503,-1642,-179,481,-1653,-116,1692,865,-79,1771,786,-182,850,-1393,-182,824,-1356,-168,577,196,-172,548,232,-162,523,267,-163,873,-1417,-146,478,158,-138,459,175,-138,498,139,-170,510,-1570,-173,505,-1545,-171,521,-1594,-109,809,-1375,-66,532,262,-115,895,-1423,-71,462,176,-68,593,182,-70,514,127,-97,507,-1546,-114,522,-1596,-52,554,230,-64,479,161,-97,835,-1397,-99,520,-1570,-114,243,-48,-63,245,-47,-49,265,-64,-64,287,-80,-115,283,-79,-131,265,-66,-26,1373,1192,-162,914,-569,-68,992,-809,4,1560,1176,-23,1605,1160,-100,1608,1076,-72,1449,1071,-46,968,-759,-101,916,-533,-94,1443,103,-102,1429,60,-139,880,-284,-164,834,-8,-73,1255,654,-199,1198,588,141,1145,641,158,979,592,144,885,586,112,616,663,98,506,685,66,218,794,55,122,948,60,103,897,61,82,838,71,191,709,101,477,600,106,557,539,158,829,362,205,943,349,-206,946,373,-162,855,331,-111,599,173,-108,513,127,-89,298,-92,-88,196,-196,-90,136,-182,-86,82,-170,-89,230,-34,-110,446,187,-118,513,280,-144,801,544,-159,935,568,-141,1125,631,182,1033,-1009,193,968,-1078,175,849,-1350,131,543,-1652,122,494,-1662,110,417,-1730,98,376,-1710,105,309,-1680,117,401,-1623,126,505,-1568,168,748,-1298,220,792,-1019,270,843,-693,-166,1105,-1063,-170,1015,-1147,-146,895,-1423,-144,523,-1609,-139,510,-1636,-138,476,-1734,-129,431,-1738,-140,358,-1744,-141,410,-1649,-138,494,-1531,-143,814,-1349,-184,833,-1104,-237,836,-785,113,147,824,96,169,780,68,171,760,37,171,773,9,152,818,32,173,845,62,181,853,91,171,850,-57,176,-104,-34,205,-126,-59,249,-100,-89,259,-96,-119,245,-101,-138,205,-128,-117,175,-108,-88,163,-89,-35,1417,1172,3,1442,1216,29,1442,1216,53,1444,1211,85,1421,1160,-32,1474,-972,-42,1429,-1001,0,1415,-1001,43,1429,-1001,34,1474,-972,0,1487,-972,-82,1363,-1441,-1,1349,-1437,78,1366,-1444,44,1448,-1424,-3,1484,-1402,-50,1447,-1422,228,844,-1258,201,891,-1281,197,918,-1293,122,909,-1285,126,866,-1278,124,798,-1234,184,780,-1225,227,798,-1233,-91,976,-1365,-167,983,-1373,-170,957,-1360,-195,910,-1335,-193,868,-1308,-150,851,-1299,-90,869,-1310,-94,934,-1356,95,1606,1116,109,1630,1098,110,1615,1071,101,1589,1086,-66,1601,1132,-85,1623,1118,-90,1609,1091,-76,1583,1104,113,1609,1097,-88,1602,1117] },
{ "name": "horse_A_004", "vertices": [0,1480,55,0,1490,99,0,1530,-319,0,1590,-578,0,1272,-991,0,1399,-974,0,1536,-863,0,961,-509,0,906,-278,0,849,-26,-3,1742,513,-7,1519,857,0,995,640,0,1179,-976,0,1082,-879,0,909,586,0,881,339,-2,1858,986,7,1820,1069,0,1505,894,34,1460,1221,18,1686,1133,10,1455,985,26,1356,1106,40,1407,1261,27,1320,1102,35,1285,1173,29,1365,1140,31,1291,1132,34,1293,1164,0,1001,-707,28,1546,1185,40,1312,1230,0,1524,-893,0,1474,-933,1,1532,-1094,1,1427,-1086,0,1554,-1186,1,1409,-1227,-8,1526,-1573,-12,1540,-1714,40,1343,1241,0,1572,269,0,1125,671,-15,1836,757,0,1046,-793,23,1615,1159,0,1254,663,0,879,477,270,1129,159,223,1333,13,269,1275,-185,251,1137,-522,273,976,-53,147,1377,193,252,1166,446,142,1485,-383,200,1550,-567,289,1035,-847,174,1348,514,137,1492,-881,205,963,-303,255,1044,395,213,1192,316,248,876,481,231,1055,556,213,891,570,108,1611,665,68,1718,541,82,1577,848,101,966,614,152,1185,-999,245,1075,-942,239,869,407,120,1692,913,52,1841,1021,108,1723,948,38,1817,1066,116,1592,867,112,1701,1049,99,1514,883,80,1405,1111,102,1612,1083,56,1459,1217,54,1687,1126,75,1468,977,63,1364,1107,274,1301,-751,105,1292,-1016,92,1366,1126,79,1417,1232,69,1320,1126,82,1309,1154,80,1313,1150,199,978,-578,87,876,542,89,1085,-975,79,876,357,114,1815,1082,74,1904,1162,71,1894,1165,86,-8,439,62,-18,494,73,5,380,208,570,-1783,203,491,-1785,184,594,-1782,-9,-10,493,5,13,377,108,483,-1785,113,584,-1783,75,1020,-871,94,529,-1784,62,1814,1064,88,1797,1046,93,1794,1029,66,1828,1051,57,1544,1179,85,1798,988,43,1436,-956,102,1355,1191,88,1334,1189,198,1021,296,23,1510,-900,33,1484,-913,34,1500,-1089,66,1439,-1086,46,1516,-1200,83,1430,-1231,39,1496,-1523,71,1472,-1580,102,1393,1194,82,1379,1195,113,1701,1104,74,1816,1057,102,1847,1108,114,1859,1103,86,1807,1001,61,842,488,-23,4,434,67,1558,285,80,1135,654,71,1349,1226,69,1314,1219,69,1289,1165,60,1363,1128,63,1297,1159,52,1295,1131,62,1867,1110,91,1844,1083,120,1816,1069,101,1855,1018,66,1877,1103,317,936,-710,283,1232,-551,213,1292,-932,245,877,-1011,262,937,-1032,222,994,-1056,141,1027,-1066,102,928,-1055,144,863,-1002,193,533,-1694,112,537,-1691,104,577,-1698,122,605,-1690,176,604,-1692,193,581,-1702,91,1727,840,47,1807,759,196,858,-1323,196,816,-1294,163,555,421,166,551,467,155,551,509,176,888,-1335,132,451,448,123,447,472,126,457,420,184,618,-1622,187,603,-1598,184,636,-1643,123,813,-1322,60,560,499,128,911,-1332,56,455,468,63,565,398,60,469,398,111,606,-1599,128,638,-1645,47,561,460,51,461,445,111,846,-1332,113,627,-1618,76,146,414,25,152,412,12,157,386,29,165,359,79,159,364,94,149,387,85,1435,1169,165,974,-543,70,1043,-779,39,1620,1155,60,1665,1132,118,1670,1035,101,1509,1039,48,1024,-737,102,976,-522,94,1477,97,102,1467,61,140,938,-282,164,879,-15,73,1281,644,199,1239,579,-271,1141,161,-223,1333,13,-268,1264,-187,-250,1091,-526,-273,976,-53,-146,1380,200,-252,1162,444,-142,1471,-376,-200,1541,-559,-289,1034,-871,-174,1342,520,-137,1491,-877,-205,952,-312,-256,1054,380,-213,1210,323,-251,872,380,-231,1026,526,-215,850,468,-121,1610,661,-77,1717,538,-101,1576,848,-101,931,567,-152,1198,-994,-245,1093,-958,-244,908,325,-126,1684,939,-47,1838,1031,-110,1716,971,-24,1815,1073,-125,1584,892,-91,1694,1070,-100,1507,903,-28,1401,1123,-69,1606,1101,13,1458,1221,-18,1684,1134,-55,1464,991,-10,1362,1114,-274,1285,-725,-105,1302,-1001,-34,1362,1139,-3,1415,1240,-9,1318,1134,-15,1306,1164,-14,1311,1160,-199,965,-594,-88,847,461,-90,1108,-990,-81,904,322,-96,1818,1101,-51,1923,1156,-47,1913,1160,-154,348,-346,-134,292,-349,-137,409,-342,-208,369,-1477,-203,296,-1446,-184,390,-1486,-62,289,-349,-69,409,-341,-108,288,-1442,-113,381,-1482,-75,1023,-896,-94,331,-1461,-47,1811,1076,-75,1792,1063,-83,1788,1048,-55,1824,1063,-1,1542,1185,-84,1792,1006,-43,1438,-948,-30,1350,1204,-16,1331,1200,-199,1042,292,-23,1510,-900,-33,1484,-913,-32,1499,-1089,-63,1438,-1085,-46,1514,-1197,-80,1426,-1227,-53,1494,-1521,-86,1468,-1576,-32,1389,1208,-11,1376,1204,-81,1694,1124,-60,1813,1071,-83,1855,1119,-97,1865,1114,-82,1800,1019,-63,841,418,-44,349,-345,-67,1558,285,-80,1122,649,7,1347,1232,10,1312,1225,0,1287,1172,-3,1361,1134,4,1295,1165,10,1294,1135,-45,1877,1110,-76,1848,1093,-104,1817,1090,-98,1846,1030,-50,1885,1103,-317,915,-746,-283,1190,-541,-213,1300,-914,-245,889,-1048,-262,951,-1063,-222,1009,-1082,-141,1043,-1089,-102,944,-1086,-144,874,-1039,-193,373,-1381,-112,378,-1379,-104,411,-1403,-122,439,-1407,-176,438,-1409,-193,413,-1408,-114,1725,842,-77,1805,762,-196,859,-1304,-196,848,-1263,-171,679,117,-175,644,147,-165,613,177,-177,872,-1334,-150,588,62,-143,567,76,-143,611,47,-184,478,-1350,-187,483,-1323,-184,479,-1377,-123,828,-1272,-69,622,173,-129,890,-1347,-75,567,76,-71,695,104,-74,628,37,-111,484,-1326,-128,479,-1379,-55,649,145,-68,587,64,-111,843,-1302,-113,488,-1353,-126,395,-184,-75,396,-185,-60,418,-197,-75,443,-208,-126,441,-207,-143,420,-198,-23,1431,1180,-165,969,-551,-70,1041,-786,6,1618,1159,-22,1662,1141,-98,1663,1057,-70,1503,1057,-48,1022,-742,-102,974,-524,-94,1477,97,-102,1467,61,-140,933,-285,-164,879,-15,-73,1278,645,-199,1223,581,141,1171,624,158,1000,584,143,889,593,111,553,526,94,446,488,49,145,431,30,-18,510,36,-7,456,38,6,395,55,166,344,98,465,400,107,563,388,159,868,355,205,978,363,-207,1003,351,-163,921,299,-114,704,97,-112,628,37,-100,457,-217,-103,391,-342,-106,329,-346,-103,274,-350,-101,380,-174,-115,551,84,-121,601,189,-145,845,497,-159,971,541,-141,1149,620,172,1090,-997,180,1025,-1064,160,910,-1332,158,641,-1660,153,612,-1687,152,572,-1783,142,527,-1784,153,454,-1786,154,511,-1694,151,587,-1588,157,804,-1289,200,850,-1000,253,908,-675,-172,1117,-1011,-180,1041,-1087,-160,890,-1347,-158,475,-1391,-153,447,-1407,-152,371,-1478,-143,329,-1460,-153,262,-1431,-155,353,-1371,-152,478,-1306,-157,841,-1254,-200,861,-1039,-253,882,-714,93,66,418,78,109,393,50,123,377,19,117,388,-10,78,415,12,80,449,42,80,461,71,73,453,-71,346,-261,-48,379,-274,-71,414,-236,-101,422,-228,-131,411,-237,-152,381,-274,-131,346,-264,-102,329,-250,-33,1475,1159,6,1502,1202,31,1502,1202,56,1503,1197,87,1479,1147,-32,1528,-966,-42,1483,-994,0,1469,-994,43,1483,-994,34,1528,-966,0,1541,-966,-82,1399,-1418,-1,1385,-1415,78,1403,-1422,43,1484,-1401,-4,1519,-1378,-51,1482,-1398,209,896,-1240,182,943,-1263,179,970,-1275,103,961,-1267,107,919,-1261,105,849,-1218,166,831,-1209,208,850,-1216,-103,990,-1308,-179,998,-1317,-183,974,-1301,-210,934,-1272,-208,897,-1241,-166,881,-1230,-106,895,-1242,-107,951,-1295,97,1663,1097,111,1686,1079,111,1671,1052,102,1645,1068,-64,1657,1114,-83,1679,1099,-88,1664,1073,-75,1639,1086,115,1665,1078,-86,1658,1099] },
{ "name": "horse_A_005", "vertices": [0,1515,56,0,1520,92,0,1582,-313,0,1641,-573,0,1323,-985,0,1451,-968,0,1587,-858,0,1012,-504,0,948,-283,0,886,-28,-3,1765,478,-7,1561,829,0,1026,626,0,1230,-971,0,1134,-873,0,928,576,0,905,327,-4,1925,954,5,1889,1038,-1,1569,874,33,1535,1202,16,1758,1106,9,1522,966,25,1427,1091,39,1483,1244,26,1391,1088,34,1359,1160,28,1438,1125,30,1363,1120,33,1366,1151,0,1053,-702,26,1620,1163,39,1387,1216,0,1575,-887,0,1526,-927,1,1573,-1082,1,1468,-1074,0,1580,-1159,2,1435,-1202,-10,1559,-1550,-14,1574,-1691,39,1419,1226,0,1599,262,0,1150,657,-15,1873,722,0,1098,-787,21,1688,1135,0,1276,650,0,903,465,270,1154,149,224,1369,15,269,1320,-181,254,1210,-499,274,1013,-53,146,1403,181,251,1186,420,142,1540,-377,200,1604,-562,297,1092,-815,174,1373,500,137,1544,-876,207,1010,-299,255,1062,387,212,1206,288,250,888,472,231,1076,538,215,901,558,109,1635,630,68,1741,506,82,1609,815,101,986,600,154,1226,-982,253,1125,-912,241,899,399,118,1757,887,50,1910,989,107,1789,921,36,1887,1035,115,1655,844,110,1771,1022,98,1578,862,79,1476,1095,101,1682,1059,54,1535,1198,53,1759,1100,74,1535,958,62,1436,1091,274,1360,-739,105,1341,-1008,91,1438,1110,78,1493,1214,68,1393,1112,81,1382,1141,79,1386,1137,203,1037,-557,87,880,528,97,1128,-947,80,903,348,112,1885,1051,72,1977,1129,69,1966,1131,89,32,217,63,5,264,78,66,166,221,452,-1607,217,375,-1590,198,475,-1612,-8,13,264,10,75,163,121,367,-1588,127,465,-1610,84,1070,-838,108,412,-1598,60,1883,1034,86,1866,1016,92,1862,999,64,1897,1020,55,1618,1157,83,1865,958,43,1487,-951,101,1429,1176,88,1409,1175,198,1044,294,23,1561,-894,33,1536,-907,35,1540,-1078,66,1480,-1074,46,1542,-1174,83,1457,-1206,38,1530,-1500,70,1505,-1557,101,1468,1178,81,1453,1179,112,1772,1077,72,1886,1026,100,1918,1076,112,1929,1071,84,1874,970,62,858,470,-20,47,212,67,1586,279,80,1159,638,70,1425,1211,68,1390,1205,69,1363,1152,59,1436,1112,62,1370,1146,51,1368,1118,60,1938,1077,89,1914,1052,118,1886,1038,99,1924,986,64,1947,1071,327,1004,-671,285,1302,-534,213,1343,-923,258,922,-968,274,981,-993,232,1035,-1021,151,1065,-1034,114,966,-1015,157,906,-958,207,438,-1512,126,443,-1510,118,480,-1526,136,509,-1526,190,507,-1527,207,483,-1531,91,1762,806,47,1845,725,209,864,-1261,210,834,-1223,170,600,304,172,586,348,160,577,390,190,888,-1283,138,491,315,128,485,339,132,500,288,198,538,-1463,201,531,-1436,198,548,-1489,136,822,-1246,65,588,380,142,911,-1288,61,494,335,70,615,282,66,515,267,125,533,-1438,141,549,-1491,52,597,342,56,502,312,125,849,-1266,126,547,-1462,79,191,248,29,197,245,16,207,220,33,217,195,84,210,200,98,198,222,84,1509,1151,167,1029,-531,73,1095,-766,38,1693,1131,59,1738,1106,116,1739,1009,100,1578,1019,49,1076,-727,102,1028,-514,94,1507,90,102,1502,61,140,981,-283,164,915,-17,73,1304,633,199,1264,559,-271,1172,153,-224,1369,15,-269,1316,-177,-255,1181,-461,-274,1013,-53,-146,1410,189,-251,1201,428,-142,1535,-370,-199,1600,-555,-299,1061,-774,-173,1370,509,-137,1542,-872,-208,1004,-293,-256,1094,367,-212,1246,305,-253,917,376,-231,1070,514,-217,898,464,-121,1634,626,-76,1740,503,-101,1607,815,-102,971,557,-154,1213,-961,-254,1097,-871,-245,949,318,-127,1749,912,-49,1906,999,-111,1782,943,-25,1885,1042,-126,1647,869,-93,1764,1043,-101,1571,883,-29,1473,1106,-71,1677,1077,12,1533,1203,-20,1756,1107,-56,1531,972,-11,1433,1099,-274,1338,-704,-105,1336,-995,-35,1434,1123,-4,1491,1223,-10,1390,1120,-16,1379,1151,-15,1384,1146,-204,1023,-538,-90,886,455,-98,1099,-906,-82,936,310,-98,1886,1071,-51,1989,1128,-47,1979,1131,-159,460,-375,-139,406,-392,-142,517,-356,-224,292,-1120,-219,239,-1061,-200,307,-1137,-67,403,-392,-74,517,-356,-124,234,-1054,-129,301,-1130,-85,1038,-797,-110,264,-1089,-49,1881,1045,-77,1862,1033,-85,1857,1018,-57,1893,1032,-2,1616,1163,-85,1859,975,-43,1485,-946,-31,1425,1189,-17,1405,1186,-199,1077,282,-23,1561,-894,-33,1536,-907,-32,1540,-1077,-62,1478,-1073,-46,1540,-1171,-80,1452,-1202,-54,1527,-1498,-87,1501,-1553,-33,1464,1192,-12,1450,1188,-83,1766,1097,-62,1882,1040,-84,1922,1089,-98,1932,1085,-84,1868,988,-64,876,409,-49,460,-374,-67,1586,279,-80,1150,637,5,1423,1217,9,1388,1211,0,1361,1159,-4,1433,1119,4,1369,1151,9,1366,1122,-46,1944,1081,-77,1916,1064,-105,1884,1060,-99,1916,1000,-51,1952,1073,-329,972,-630,-285,1276,-498,-213,1332,-902,-260,889,-925,-276,948,-950,-234,1001,-979,-152,1030,-992,-117,932,-972,-160,872,-914,-209,336,-1035,-128,341,-1035,-120,361,-1070,-138,385,-1087,-192,383,-1087,-209,361,-1076,-114,1759,808,-78,1843,728,-212,814,-1154,-213,820,-1115,-175,709,127,-179,673,155,-169,643,184,-193,815,-1187,-154,626,65,-147,603,76,-146,651,53,-200,445,-1051,-203,459,-1028,-200,435,-1077,-139,797,-1114,-73,650,180,-144,827,-1206,-79,604,76,-74,726,115,-78,668,45,-127,460,-1031,-144,434,-1078,-58,678,153,-72,625,66,-127,801,-1146,-129,452,-1058,-131,466,-204,-80,467,-205,-65,491,-213,-79,517,-222,-131,514,-221,-147,493,-214,-25,1505,1163,-168,1023,-523,-73,1085,-752,4,1692,1135,-23,1735,1115,-99,1732,1031,-71,1573,1037,-50,1069,-718,-102,1026,-512,-94,1507,90,-102,1502,61,-141,979,-282,-164,915,-17,-73,1302,635,-198,1256,568,141,1195,606,159,1023,567,145,901,581,116,575,405,99,482,354,52,189,264,30,0,278,38,28,232,42,61,179,60,219,181,104,510,268,113,615,273,161,906,348,206,1006,370,-207,1041,338,-163,958,289,-117,734,109,-116,668,45,-105,532,-229,-108,501,-362,-111,441,-380,-108,389,-397,-105,449,-196,-119,586,82,-125,630,194,-147,891,493,-160,1013,531,-140,1182,607,179,1135,-969,189,1064,-1031,174,910,-1287,171,548,-1505,167,516,-1524,165,454,-1608,156,410,-1598,167,338,-1582,168,417,-1506,165,520,-1422,171,824,-1215,214,895,-955,264,976,-635,-180,1106,-928,-191,1030,-990,-176,827,-1206,-174,425,-1088,-169,392,-1090,-168,293,-1121,-158,263,-1087,-169,214,-1033,-171,322,-1018,-167,461,-1011,-174,817,-1105,-216,861,-911,-266,944,-593,96,110,223,82,159,213,55,177,202,23,169,208,-7,123,220,14,114,254,43,110,267,73,105,257,-76,437,-293,-52,472,-298,-76,497,-253,-106,502,-243,-136,495,-254,-157,474,-297,-136,438,-296,-107,419,-287,-34,1548,1140,4,1576,1181,30,1576,1182,54,1578,1176,86,1552,1127,-32,1574,-959,-42,1529,-987,0,1515,-987,43,1530,-988,34,1575,-959,0,1587,-960,-83,1430,-1394,-2,1416,-1391,77,1434,-1398,42,1515,-1376,-4,1550,-1353,-51,1512,-1374,223,926,-1197,195,968,-1227,191,993,-1242,116,984,-1234,121,943,-1221,120,881,-1167,180,866,-1155,222,884,-1165,-118,937,-1201,-193,944,-1210,-198,925,-1190,-226,894,-1154,-225,867,-1116,-183,855,-1103,-122,863,-1118,-123,903,-1180,96,1734,1071,109,1756,1052,110,1740,1026,101,1715,1043,-66,1729,1088,-85,1750,1072,-90,1734,1047,-76,1709,1061,114,1735,1052,-88,1729,1073] },
{ "name": "horse_A_006", "vertices": [0,1542,55,0,1542,87,0,1618,-307,0,1674,-567,0,1351,-974,0,1478,-960,0,1617,-851,0,1046,-490,0,969,-279,0,903,-16,-3,1786,443,-8,1602,802,0,1055,615,0,1258,-959,0,1163,-861,0,960,567,0,931,316,-6,1984,921,3,1951,1006,-2,1626,851,31,1601,1179,14,1821,1078,7,1581,944,23,1490,1071,37,1550,1222,24,1454,1070,32,1424,1142,26,1502,1105,28,1427,1102,31,1431,1133,0,1084,-689,24,1685,1138,37,1454,1197,0,1604,-881,0,1554,-920,1,1592,-1068,1,1488,-1062,0,1586,-1131,2,1442,-1176,-11,1581,-1518,-16,1613,-1660,37,1485,1206,0,1621,257,0,1175,650,-16,1908,687,0,1128,-775,19,1752,1109,0,1298,643,0,930,453,272,1182,144,225,1395,17,270,1350,-177,254,1258,-469,278,1033,-43,146,1428,174,251,1219,395,142,1578,-368,199,1639,-555,299,1124,-777,173,1396,492,137,1574,-868,209,1035,-289,255,1099,351,211,1243,265,252,925,411,231,1105,503,217,932,500,108,1659,599,68,1762,472,81,1641,785,102,1011,565,154,1246,-958,254,1152,-876,243,940,343,117,1814,858,48,1969,957,105,1847,891,34,1948,1003,114,1711,819,108,1831,993,97,1634,839,76,1539,1074,99,1744,1033,52,1600,1176,51,1822,1071,72,1595,936,60,1499,1072,274,1395,-718,105,1367,-994,89,1502,1091,75,1559,1193,66,1456,1093,79,1447,1122,77,1450,1119,204,1076,-530,89,909,483,99,1152,-911,81,936,316,110,1947,1019,70,2041,1094,66,2030,1097,106,92,73,79,53,110,96,139,32,225,329,-1302,220,268,-1253,201,348,-1317,7,60,109,28,147,29,125,261,-1248,131,340,-1311,86,1099,-799,112,297,-1276,58,1944,1002,84,1927,984,90,1923,968,62,1958,988,53,1682,1132,81,1924,927,43,1515,-942,99,1494,1156,85,1474,1156,199,1078,273,23,1590,-888,33,1564,-900,35,1560,-1064,66,1499,-1061,46,1548,-1146,83,1463,-1180,37,1550,-1472,69,1529,-1529,99,1533,1157,78,1519,1159,109,1834,1048,70,1947,994,98,1980,1043,110,1992,1037,82,1934,939,64,888,432,-3,106,68,67,1607,274,80,1181,627,68,1491,1191,66,1456,1187,66,1427,1134,57,1499,1092,60,1435,1128,49,1431,1100,58,2000,1044,87,1976,1019,116,1947,1007,97,1984,953,62,2010,1037,329,1044,-627,285,1347,-510,213,1371,-907,261,943,-917,277,1000,-946,235,1051,-977,153,1079,-993,118,982,-967,161,926,-905,211,359,-1211,129,364,-1211,122,390,-1242,140,416,-1254,194,414,-1255,210,391,-1248,90,1797,773,46,1881,691,213,852,-1175,214,842,-1132,175,649,223,177,633,266,165,621,307,194,864,-1206,145,540,229,135,532,252,139,549,202,202,470,-1210,205,476,-1183,202,468,-1238,140,821,-1143,71,632,298,146,882,-1220,68,540,248,75,664,201,73,564,181,129,477,-1186,145,468,-1240,57,643,260,63,549,226,129,836,-1173,130,479,-1214,91,240,149,41,246,146,29,258,121,46,269,97,96,262,103,110,250,124,82,1573,1130,168,1065,-511,73,1127,-745,35,1756,1104,56,1801,1079,114,1800,981,98,1639,995,50,1107,-708,102,1063,-499,94,1529,85,102,1529,60,142,1003,-277,167,933,-5,73,1326,627,198,1288,547,-272,1193,150,-225,1395,17,-270,1356,-169,-254,1269,-406,-278,1033,-43,-146,1432,180,-251,1235,417,-141,1581,-365,-199,1640,-553,-303,1086,-678,-173,1397,500,-136,1571,-867,-210,1039,-272,-256,1125,364,-211,1271,290,-253,953,398,-231,1113,514,-218,945,487,-121,1658,594,-76,1761,469,-102,1640,785,-102,1012,565,-156,1213,-923,-259,1097,-781,-245,977,335,-129,1807,883,-51,1966,967,-113,1841,914,-27,1947,1010,-128,1704,843,-95,1825,1014,-103,1628,859,-31,1536,1085,-73,1739,1050,9,1599,1180,-22,1820,1079,-57,1591,949,-13,1496,1079,-274,1373,-681,-106,1348,-980,-38,1498,1103,-7,1557,1202,-12,1454,1101,-18,1444,1132,-17,1448,1127,-205,1077,-480,-90,922,472,-103,1089,-817,-82,959,314,-99,1945,1039,-52,2047,1098,-47,2037,1101,-160,538,-335,-141,490,-365,-143,589,-303,-235,293,-737,-230,270,-661,-211,300,-759,-68,487,-366,-75,589,-303,-134,267,-653,-140,297,-750,-90,1055,-697,-121,281,-697,-51,1942,1013,-79,1922,1001,-87,1917,986,-59,1954,1000,-4,1681,1138,-87,1919,944,-43,1509,-939,-34,1490,1170,-19,1471,1166,-200,1100,283,-23,1590,-888,-33,1564,-900,-31,1559,-1063,-62,1498,-1060,-46,1545,-1144,-80,1458,-1175,-55,1547,-1469,-89,1524,-1525,-35,1529,1171,-14,1516,1168,-85,1829,1068,-64,1943,1008,-85,1981,1058,-99,1991,1054,-86,1928,956,-65,905,422,-50,538,-334,-67,1607,274,-80,1179,632,3,1489,1198,6,1454,1193,-2,1425,1141,-6,1497,1099,1,1433,1133,7,1430,1104,-47,2003,1050,-78,1975,1032,-107,1944,1028,-101,1976,969,-53,2012,1043,-332,1034,-516,-284,1351,-465,-214,1346,-884,-268,882,-783,-283,934,-822,-241,977,-863,-159,1002,-883,-125,911,-841,-168,867,-770,-220,368,-678,-139,373,-681,-131,376,-721,-149,391,-746,-203,389,-745,-220,374,-726,-115,1794,775,-79,1879,694,-222,760,-978,-224,781,-946,-175,714,182,-179,680,210,-169,651,238,-203,748,-1008,-155,637,118,-147,613,127,-147,663,108,-211,461,-739,-214,483,-723,-211,441,-758,-150,760,-934,-74,658,235,-155,752,-1031,-80,614,127,-74,730,170,-79,681,102,-138,482,-726,-155,440,-760,-59,684,208,-73,636,120,-138,751,-965,-139,465,-748,-132,503,-165,-81,503,-165,-66,528,-171,-80,554,-177,-131,551,-177,-148,529,-171,-27,1570,1141,-168,1065,-488,-74,1114,-714,2,1755,1108,-25,1798,1087,-101,1793,1003,-73,1634,1013,-50,1101,-688,-103,1063,-493,-94,1529,85,-102,1529,60,-142,1004,-273,-167,933,-5,-73,1326,629,-198,1288,559,141,1218,591,159,1050,531,146,929,527,121,618,322,105,528,267,64,237,165,46,44,120,55,84,84,60,130,42,72,272,83,111,560,183,119,665,192,162,945,303,206,1042,332,-207,1069,340,-163,980,299,-117,738,164,-117,681,102,-106,569,-183,-109,574,-312,-112,521,-345,-109,475,-374,-106,485,-158,-119,596,132,-126,638,249,-147,937,515,-160,1055,536,-140,1217,601,181,1157,-933,192,1079,-990,178,882,-1219,175,460,-1253,170,424,-1256,169,331,-1304,160,296,-1275,171,239,-1230,172,342,-1196,169,472,-1166,175,835,-1122,217,916,-902,266,1019,-588,-186,1092,-839,-198,1002,-880,-187,752,-1030,-184,427,-765,-180,396,-752,-178,293,-739,-169,280,-695,-180,259,-625,-181,363,-657,-178,492,-708,-185,782,-936,-224,858,-764,-269,1015,-474,111,166,100,96,216,102,68,234,98,37,225,98,7,177,96,28,160,128,56,152,142,87,152,130,-77,495,-261,-53,531,-257,-77,544,-208,-107,545,-197,-137,542,-210,-158,532,-256,-137,497,-264,-107,477,-259,-36,1612,1117,2,1641,1158,27,1641,1158,52,1643,1153,84,1616,1104,-32,1599,-951,-42,1555,-979,0,1540,-979,44,1555,-980,34,1600,-951,1,1612,-951,-83,1441,-1370,-2,1428,-1367,77,1446,-1374,42,1525,-1349,-5,1558,-1325,-52,1522,-1347,227,931,-1145,199,967,-1182,195,988,-1201,119,980,-1192,125,943,-1172,124,895,-1108,184,884,-1093,226,899,-1107,-128,858,-1064,-204,863,-1074,-208,851,-1051,-236,832,-1009,-236,818,-966,-194,810,-950,-133,813,-967,-134,833,-1036,93,1796,1044,107,1818,1024,108,1801,998,99,1776,1016,-68,1791,1060,-87,1812,1044,-92,1795,1019,-78,1771,1034,111,1797,1025,-90,1791,1045] },
{ "name": "horse_A_007", "vertices": [0,1555,54,0,1550,87,0,1633,-295,0,1676,-558,0,1333,-949,0,1461,-941,0,1605,-839,0,1052,-452,0,962,-259,0,899,19,-4,1801,429,-9,1620,789,0,1088,626,0,1241,-929,0,1152,-828,0,994,585,0,949,334,-6,1993,903,3,1959,988,-3,1635,832,29,1609,1160,13,1829,1059,6,1590,925,21,1498,1052,35,1558,1203,22,1462,1050,30,1432,1123,24,1510,1086,26,1435,1082,29,1439,1113,0,1081,-652,23,1693,1120,35,1462,1178,0,1591,-868,0,1539,-905,1,1567,-1048,2,1462,-1040,0,1545,-1097,2,1400,-1140,-12,1547,-1478,-18,1594,-1620,35,1493,1187,0,1634,254,0,1203,658,-17,1926,669,0,1121,-740,18,1761,1090,0,1321,649,0,955,469,274,1197,155,227,1407,22,272,1360,-165,254,1278,-401,285,1031,-16,146,1440,176,251,1247,389,141,1593,-354,199,1643,-543,302,1120,-680,173,1417,494,136,1561,-851,212,1035,-258,256,1130,340,211,1271,260,253,961,387,231,1135,492,217,965,478,107,1679,589,67,1778,459,80,1664,775,102,1039,558,155,1218,-893,258,1135,-780,244,976,323,116,1823,840,48,1978,939,105,1856,874,34,1957,986,113,1720,801,108,1840,975,96,1643,820,75,1548,1055,98,1752,1015,50,1608,1157,50,1830,1053,71,1603,917,59,1507,1053,274,1390,-674,106,1340,-963,87,1510,1072,74,1567,1174,64,1464,1074,77,1455,1103,75,1459,1099,205,1083,-467,90,939,472,103,1129,-814,81,962,314,110,1957,1001,70,2053,1073,66,2043,1076,148,229,-129,126,175,-115,134,288,-143,232,299,-1021,227,253,-957,208,312,-1041,53,175,-115,65,291,-144,132,248,-950,137,306,-1033,89,1090,-700,118,275,-987,58,1953,984,84,1936,967,89,1931,950,62,1966,970,52,1691,1114,81,1933,909,43,1497,-924,97,1502,1137,83,1482,1137,201,1103,277,23,1577,-874,33,1551,-885,35,1535,-1043,66,1474,-1039,46,1508,-1112,84,1422,-1144,36,1514,-1434,67,1496,-1492,97,1541,1139,76,1527,1140,109,1843,1030,70,1955,977,98,1991,1024,110,2002,1018,82,1942,921,64,917,426,38,235,-130,67,1620,272,80,1206,633,66,1499,1172,64,1464,1168,64,1436,1115,55,1507,1073,58,1443,1108,47,1439,1080,58,2011,1024,87,1986,1000,116,1957,988,97,1992,934,62,2020,1017,333,1054,-528,284,1363,-457,214,1349,-869,267,935,-815,282,992,-846,239,1041,-880,158,1068,-896,123,972,-867,166,918,-803,217,352,-942,136,357,-943,128,373,-980,146,395,-999,200,393,-1000,217,372,-986,89,1818,758,45,1899,674,220,834,-1049,221,838,-1008,175,693,199,178,670,239,167,651,278,201,837,-1082,152,588,179,143,573,198,145,605,156,208,459,-972,211,473,-948,209,449,-998,147,815,-1010,72,659,270,153,850,-1101,76,577,196,74,706,181,78,620,140,135,473,-951,152,448,-1000,58,676,235,70,591,178,135,820,-1043,137,467,-978,121,324,10,70,327,8,57,344,-10,72,363,-29,123,359,-26,139,343,-9,80,1581,1111,169,1071,-462,74,1121,-690,34,1765,1086,56,1809,1060,114,1808,963,97,1648,977,50,1103,-660,103,1069,-458,94,1537,86,102,1542,60,144,998,-253,171,931,28,73,1350,632,198,1312,548,-274,1199,163,-227,1407,22,-271,1373,-160,-251,1322,-350,-285,1031,-16,-146,1441,180,-250,1260,421,-141,1600,-356,-199,1645,-546,-301,1091,-567,-173,1420,500,-136,1558,-853,-212,1047,-240,-256,1145,383,-210,1281,290,-254,984,452,-231,1153,534,-219,990,540,-123,1678,583,-77,1777,455,-104,1663,774,-103,1054,595,-156,1178,-857,-257,1078,-669,-245,995,382,-129,1816,865,-51,1975,949,-113,1850,895,-28,1955,992,-128,1713,824,-96,1834,995,-104,1638,840,-32,1545,1066,-74,1748,1032,7,1607,1161,-23,1828,1060,-58,1600,930,-15,1505,1060,-274,1371,-645,-106,1317,-947,-39,1507,1084,-9,1565,1182,-14,1462,1082,-20,1452,1113,-19,1457,1108,-203,1104,-410,-91,955,517,-102,1064,-703,-82,971,346,-99,1953,1021,-51,2053,1083,-47,2043,1085,-164,562,-228,-144,517,-264,-147,609,-190,-233,415,-364,-228,432,-287,-209,410,-387,-72,515,-265,-78,609,-190,-133,434,-279,-138,413,-378,-87,1058,-580,-119,424,-324,-51,1950,995,-79,1931,983,-87,1926,968,-59,1963,982,-6,1689,1120,-87,1928,925,-43,1489,-922,-36,1499,1150,-21,1479,1147,-201,1112,305,-23,1577,-874,-33,1551,-885,-31,1534,-1043,-62,1473,-1038,-46,1504,-1109,-80,1417,-1139,-56,1510,-1431,-90,1491,-1487,-37,1537,1152,-16,1524,1149,-86,1837,1049,-64,1952,990,-85,1988,1041,-99,1999,1037,-86,1938,938,-65,929,464,-53,562,-228,-67,1620,272,-80,1210,642,1,1497,1179,4,1462,1173,-4,1434,1122,-7,1505,1080,0,1442,1114,5,1438,1085,-47,2010,1033,-78,1983,1015,-107,1952,1010,-101,1986,952,-52,2019,1027,-329,1074,-399,-282,1389,-426,-214,1319,-847,-265,872,-633,-281,916,-681,-239,951,-729,-158,972,-755,-122,890,-697,-165,860,-618,-218,510,-349,-137,513,-354,-129,496,-391,-147,497,-420,-201,496,-419,-218,491,-394,-116,1816,760,-79,1897,677,-221,733,-790,-222,764,-772,-177,709,286,-181,678,315,-171,652,344,-202,709,-813,-157,634,225,-150,610,233,-149,660,215,-209,561,-448,-212,588,-444,-209,535,-457,-148,751,-751,-76,658,340,-154,703,-835,-82,611,233,-76,723,273,-81,679,210,-136,586,-445,-153,533,-457,-61,682,313,-75,633,226,-136,729,-775,-138,561,-458,-135,506,-61,-84,507,-62,-69,531,-66,-84,557,-72,-135,554,-72,-151,532,-66,-28,1578,1122,-168,1080,-435,-74,1114,-656,1,1764,1089,-26,1807,1069,-102,1802,984,-74,1643,994,-50,1101,-638,-102,1071,-451,-94,1537,86,-102,1542,60,-144,1001,-249,-171,931,28,-73,1351,634,-198,1319,562,141,1243,592,160,1079,522,147,961,509,123,644,292,114,562,211,95,314,24,93,159,-111,99,212,-124,99,273,-140,99,372,-41,115,619,140,118,711,172,163,977,290,207,1073,323,-207,1087,364,-163,991,338,-119,730,266,-119,679,209,-109,573,-78,-113,595,-201,-115,547,-240,-113,504,-275,-109,488,-55,-122,593,238,-128,641,355,-148,983,565,-160,1096,562,-140,1252,608,185,1133,-836,196,1068,-893,185,851,-1100,182,438,-1010,177,402,-1003,176,300,-1023,167,274,-986,178,232,-926,179,340,-923,176,474,-930,182,834,-998,223,908,-799,269,1031,-489,-185,1061,-724,-197,973,-752,-185,703,-835,-183,519,-456,-178,499,-427,-177,415,-366,-168,425,-322,-178,440,-250,-180,516,-328,-177,603,-433,-183,768,-765,-221,852,-610,-265,1064,-355,147,282,-70,127,323,-45,98,337,-40,68,328,-46,42,285,-71,65,256,-49,94,244,-39,124,253,-51,-80,510,-160,-57,546,-152,-80,553,-102,-110,551,-90,-140,551,-103,-161,547,-151,-140,513,-163,-110,492,-162,-38,1621,1098,0,1650,1139,26,1650,1140,51,1651,1134,83,1624,1086,-32,1581,-936,-42,1536,-964,1,1522,-964,44,1536,-964,34,1581,-936,1,1594,-937,-84,1400,-1335,-2,1387,-1333,77,1405,-1340,42,1482,-1314,-5,1514,-1290,-52,1479,-1311,234,917,-1044,206,946,-1083,201,965,-1104,126,957,-1094,131,924,-1071,131,886,-1005,191,877,-989,233,890,-1003,-127,794,-904,-203,795,-914,-207,790,-890,-235,782,-847,-234,780,-806,-192,777,-790,-131,775,-806,-132,777,-873,93,1804,1026,106,1826,1006,107,1810,980,98,1785,997,-69,1800,1041,-87,1821,1025,-93,1804,1000,-79,1780,1015,111,1805,1006,-91,1800,1026] },
{ "name": "horse_A_008", "vertices": [0,1558,52,0,1550,92,0,1628,-285,0,1653,-549,0,1282,-915,0,1412,-916,0,1563,-825,0,1037,-402,0,938,-225,0,885,71,-5,1816,422,-11,1640,786,0,1133,660,0,1193,-889,0,1112,-783,0,1040,628,0,974,380,-5,1995,891,3,1961,976,-3,1637,819,28,1611,1148,13,1831,1047,5,1593,912,20,1500,1039,33,1560,1191,20,1464,1037,28,1434,1110,23,1512,1073,24,1437,1069,27,1441,1100,0,1052,-603,22,1695,1107,33,1463,1165,0,1548,-853,0,1493,-886,1,1511,-1028,2,1407,-1015,0,1481,-1070,2,1334,-1105,-13,1468,-1447,-19,1519,-1590,33,1495,1174,0,1641,255,0,1237,681,-17,1945,657,0,1086,-694,17,1762,1078,0,1349,665,0,990,512,276,1213,183,228,1407,29,273,1354,-151,254,1279,-322,291,1018,21,146,1450,189,251,1298,418,140,1586,-340,198,1621,-531,306,1099,-561,173,1443,509,136,1518,-830,215,1019,-216,256,1191,371,211,1320,289,254,1037,415,231,1194,523,218,1037,506,106,1702,589,66,1794,453,78,1692,774,103,1092,588,158,1164,-809,262,1099,-657,245,1049,352,117,1825,829,49,1980,927,105,1858,862,35,1959,974,113,1722,789,108,1842,964,96,1645,808,73,1549,1042,98,1754,1003,49,1610,1144,50,1832,1041,71,1605,905,57,1509,1040,274,1357,-619,107,1280,-920,86,1511,1059,72,1569,1162,62,1466,1061,75,1456,1090,73,1460,1087,207,1072,-389,90,997,502,108,1086,-691,82,1008,347,111,1962,988,71,2062,1056,68,2052,1059,166,487,-241,146,433,-259,149,544,-222,241,305,-725,236,278,-651,217,313,-747,74,431,-260,80,544,-222,141,275,-642,146,309,-738,94,1064,-577,127,291,-686,59,1955,972,85,1938,955,90,1933,939,63,1968,958,51,1692,1101,82,1935,897,43,1445,-901,95,1504,1125,81,1483,1124,202,1147,312,23,1533,-858,33,1506,-868,35,1479,-1022,66,1419,-1015,46,1443,-1083,84,1356,-1111,36,1436,-1403,67,1418,-1460,95,1542,1126,75,1528,1127,109,1844,1018,70,1958,965,99,1998,1010,111,2008,1003,83,1944,910,65,968,457,55,488,-241,67,1629,274,80,1240,656,64,1500,1159,61,1465,1155,62,1437,1102,54,1509,1061,56,1445,1096,45,1441,1067,59,2017,1009,88,1991,986,117,1961,976,98,1993,920,63,2026,1001,336,1049,-409,283,1358,-395,215,1295,-818,274,912,-692,289,968,-725,245,1015,-760,163,1040,-777,130,944,-746,174,893,-680,226,377,-662,145,382,-664,137,387,-704,155,404,-728,209,402,-728,226,385,-710,88,1842,750,45,1917,663,229,809,-903,230,824,-867,176,774,228,180,745,261,170,720,295,210,802,-935,157,684,180,149,663,193,149,708,164,217,472,-719,220,492,-700,217,456,-741,156,801,-860,75,727,289,162,809,-956,82,664,192,75,788,213,81,724,154,144,492,-702,161,454,-742,60,748,259,75,683,180,144,797,-892,146,478,-727,136,492,-68,85,493,-69,70,515,-80,84,539,-91,136,537,-90,152,517,-80,79,1583,1098,169,1057,-400,75,1092,-621,34,1767,1074,55,1811,1048,114,1810,951,96,1649,965,51,1076,-599,103,1054,-406,94,1537,91,102,1545,58,146,976,-217,175,919,76,73,1378,647,198,1348,570,-276,1197,190,-228,1407,29,-273,1372,-150,-250,1346,-304,-291,1018,21,-146,1443,188,-250,1279,443,-141,1595,-348,-199,1624,-540,-295,1082,-464,-173,1443,508,-137,1515,-836,-214,1036,-203,-256,1162,427,-210,1282,310,-255,1019,540,-232,1194,575,-220,1043,623,-124,1701,582,-78,1793,449,-105,1691,772,-104,1102,647,-153,1122,-782,-252,1049,-560,-246,1014,465,-129,1819,852,-50,1978,937,-113,1853,883,-27,1958,980,-128,1716,812,-96,1837,983,-104,1641,827,-34,1547,1053,-74,1750,1019,6,1609,1149,-23,1830,1048,-59,1602,917,-16,1507,1047,-274,1339,-608,-106,1258,-905,-41,1509,1071,-10,1567,1170,-16,1464,1069,-22,1454,1100,-21,1459,1095,-201,1110,-342,-92,995,591,-97,1031,-591,-82,983,404,-99,1958,1008,-52,2060,1067,-48,2050,1070,-168,530,-56,-148,484,-89,-151,579,-21,-222,522,-117,-217,564,-51,-198,510,-137,-76,482,-91,-82,579,-20,-122,568,-43,-128,515,-129,-82,1051,-472,-108,544,-82,-51,1953,983,-79,1934,971,-87,1929,956,-58,1966,969,-7,1691,1107,-87,1931,913,-43,1438,-899,-37,1501,1137,-23,1481,1134,-202,1118,350,-23,1533,-858,-33,1506,-868,-31,1478,-1021,-62,1417,-1013,-46,1440,-1080,-80,1350,-1105,-56,1433,-1399,-90,1413,-1454,-39,1539,1139,-18,1526,1136,-86,1840,1037,-64,1955,978,-85,1994,1027,-99,2004,1023,-85,1940,926,-66,956,534,-57,531,-55,-67,1629,274,-80,1245,664,0,1499,1166,2,1464,1160,-6,1436,1109,-9,1507,1067,-2,1443,1101,3,1440,1072,-47,2015,1019,-78,1988,1002,-107,1957,997,-101,1988,938,-52,2024,1012,-323,1096,-298,-282,1396,-394,-214,1266,-802,-256,856,-494,-273,890,-548,-231,918,-602,-151,935,-631,-113,865,-560,-155,849,-477,-208,616,-136,-126,617,-141,-118,589,-170,-136,580,-198,-191,579,-196,-207,583,-172,-118,1840,751,-80,1915,665,-210,702,-623,-211,736,-615,-180,713,440,-184,688,473,-174,667,505,-191,673,-638,-160,635,389,-152,612,399,-152,660,377,-198,630,-246,-202,657,-250,-199,602,-247,-137,730,-590,-78,673,500,-143,661,-657,-85,613,398,-79,724,426,-84,678,370,-125,655,-251,-142,600,-247,-63,691,470,-78,634,390,-125,703,-607,-127,627,-256,-139,483,114,-87,484,113,-73,508,106,-87,533,98,-139,530,99,-155,509,106,-30,1580,1109,-166,1075,-377,-72,1091,-593,0,1766,1077,-27,1809,1056,-102,1805,972,-75,1646,981,-49,1078,-581,-102,1059,-400,-94,1537,91,-102,1545,58,-145,981,-214,-175,919,76,-73,1379,647,-198,1350,575,140,1283,616,160,1135,553,148,1027,537,127,709,307,121,647,202,110,476,-58,115,416,-265,117,469,-247,115,528,-228,110,554,-100,118,724,154,119,795,205,163,1040,321,207,1130,354,-207,1101,416,-164,1001,409,-122,731,419,-122,678,370,-113,548,91,-117,565,-31,-119,514,-67,-117,470,-99,-113,466,121,-124,595,405,-130,658,517,-149,1037,643,-160,1140,610,-140,1289,628,190,1089,-711,202,1041,-775,193,809,-956,191,442,-749,186,409,-734,185,305,-727,176,290,-684,186,265,-615,188,371,-641,185,499,-683,191,823,-857,231,885,-675,273,1029,-370,-179,1022,-611,-189,936,-628,-175,661,-657,-172,586,-241,-167,579,-205,-166,521,-119,-157,545,-81,-168,584,-19,-169,629,-118,-166,674,-244,-172,742,-609,-212,841,-468,-259,1096,-254,163,500,-163,141,520,-120,111,527,-109,82,523,-120,58,499,-165,82,463,-160,112,447,-156,142,464,-163,-84,482,14,-61,518,20,-84,528,70,-114,527,82,-144,525,68,-165,519,21,-144,485,11,-114,466,11,-39,1623,1085,0,1652,1126,25,1651,1127,49,1653,1122,81,1626,1073,-32,1533,-919,-42,1486,-945,1,1472,-944,44,1486,-945,34,1533,-919,1,1545,-921,-84,1324,-1301,-2,1311,-1298,76,1330,-1306,41,1406,-1284,-5,1439,-1261,-52,1403,-1280,243,886,-921,214,910,-961,209,925,-982,134,918,-973,140,889,-948,140,860,-881,201,856,-865,243,867,-880,-117,733,-747,-192,732,-756,-197,731,-732,-224,731,-690,-223,737,-651,-180,738,-636,-120,734,-650,-121,723,-713,93,1806,1014,106,1828,994,107,1811,968,98,1787,985,-69,1802,1029,-87,1824,1013,-93,1807,988,-79,1783,1002,111,1807,995,-91,1803,1014] },
{ "name": "horse_A_009", "vertices": [0,1555,50,0,1552,104,0,1614,-274,0,1623,-540,0,1230,-880,0,1360,-891,0,1517,-809,0,1018,-355,0,914,-192,0,873,115,-5,1834,429,-12,1665,795,0,1173,698,0,1143,-849,0,1069,-741,0,1079,671,0,1006,424,-3,2005,900,5,1969,984,-3,1649,820,27,1615,1148,13,1838,1052,5,1602,912,18,1507,1037,32,1563,1190,19,1471,1034,26,1439,1106,21,1518,1071,22,1443,1066,25,1446,1097,0,1021,-557,21,1700,1109,31,1467,1162,0,1500,-836,0,1444,-866,1,1457,-1011,2,1353,-990,-1,1427,-1058,2,1278,-1078,-12,1375,-1429,-19,1411,-1577,31,1498,1172,0,1652,263,0,1272,711,-18,1970,661,0,1049,-649,18,1768,1081,0,1379,688,0,1026,555,278,1216,211,230,1402,34,274,1343,-138,252,1279,-254,296,1005,55,146,1457,204,250,1330,445,138,1571,-326,196,1592,-518,316,1084,-455,173,1471,524,135,1471,-809,218,1002,-179,256,1221,416,210,1335,313,254,1085,498,231,1245,566,219,1100,585,105,1729,602,66,1815,462,77,1724,785,103,1147,642,164,1113,-731,274,1071,-548,245,1083,429,118,1835,834,50,1989,935,106,1868,868,36,1967,982,114,1733,791,109,1849,969,96,1656,809,73,1555,1041,98,1761,1006,48,1614,1145,50,1838,1046,70,1615,905,56,1515,1038,273,1322,-565,110,1219,-875,85,1517,1057,71,1572,1161,61,1472,1058,74,1461,1087,71,1465,1084,211,1060,-318,91,1045,574,120,1046,-580,82,1030,406,113,1972,996,73,2075,1059,70,2064,1063,150,580,-111,129,535,-145,134,628,-74,268,414,-397,263,411,-318,245,415,-420,57,533,-145,66,628,-72,167,409,-311,174,413,-412,106,1037,-469,154,410,-357,60,1964,980,86,1946,963,91,1941,946,64,1977,966,51,1697,1103,83,1944,905,43,1391,-875,94,1508,1122,80,1488,1121,203,1163,355,23,1485,-840,33,1458,-848,35,1425,-1003,66,1365,-991,46,1388,-1067,84,1299,-1086,36,1348,-1382,67,1325,-1438,94,1547,1125,73,1532,1125,109,1851,1024,72,1966,973,101,2008,1016,112,2019,1008,84,1953,917,65,1005,526,40,581,-108,67,1641,282,80,1279,684,62,1504,1157,60,1469,1152,61,1442,1099,53,1515,1059,54,1450,1092,44,1447,1064,61,2028,1015,89,2001,992,118,1971,983,99,2000,926,64,2036,1006,346,1051,-304,279,1350,-340,217,1242,-766,295,890,-577,306,945,-613,261,988,-651,178,1008,-671,150,912,-634,196,868,-565,252,502,-359,170,504,-363,163,497,-404,181,506,-431,236,505,-430,252,495,-407,87,1871,757,44,1941,668,254,793,-756,255,822,-736,178,791,367,182,765,401,172,743,435,235,772,-782,156,706,319,148,684,332,148,730,305,242,576,-441,245,602,-432,243,552,-454,180,805,-716,77,749,431,187,768,-805,81,685,333,76,803,354,79,747,298,169,599,-435,187,549,-455,62,768,400,74,705,322,169,786,-743,171,576,-451,126,528,60,75,529,61,60,552,53,74,576,42,126,574,42,143,553,50,78,1588,1098,172,1040,-343,78,1060,-557,34,1772,1077,56,1817,1053,114,1818,956,96,1657,966,53,1045,-542,103,1035,-357,94,1539,104,102,1542,56,147,954,-183,178,909,117,73,1410,667,198,1385,590,-278,1220,223,-230,1402,34,-275,1364,-145,-252,1357,-283,-296,1005,55,-145,1459,212,-250,1329,491,-143,1580,-340,-201,1594,-533,-288,1063,-386,-173,1469,535,-137,1466,-820,-216,1023,-170,-256,1216,444,-209,1341,359,-257,1088,547,-232,1241,607,-222,1109,633,-125,1727,594,-79,1813,457,-107,1722,783,-104,1144,673,-148,1063,-717,-243,1013,-474,-248,1057,476,-128,1831,857,-49,1987,945,-112,1863,888,-26,1966,987,-128,1729,814,-95,1845,988,-104,1653,828,-35,1553,1051,-74,1758,1022,5,1613,1149,-23,1837,1053,-60,1612,917,-17,1514,1045,-274,1298,-577,-104,1200,-864,-42,1515,1069,-12,1571,1169,-17,1470,1066,-24,1460,1096,-22,1464,1092,-199,1114,-290,-93,1064,609,-87,993,-501,-83,1014,428,-99,1971,1014,-53,2078,1065,-49,2068,1069,-173,505,182,-153,461,147,-156,552,220,-203,388,17,-198,420,88,-179,378,-4,-80,459,145,-87,552,220,-103,424,96,-108,382,4,-74,1037,-387,-89,405,54,-50,1962,990,-77,1943,978,-86,1938,963,-57,1974,977,-7,1696,1109,-85,1941,920,-43,1384,-875,-39,1505,1135,-25,1486,1131,-203,1155,370,-23,1485,-840,-33,1458,-848,-31,1425,-1002,-62,1364,-989,-46,1385,-1063,-79,1294,-1080,-56,1345,-1379,-90,1319,-1432,-40,1544,1137,-19,1531,1134,-85,1847,1042,-62,1963,985,-86,2009,1030,-99,2018,1025,-84,1949,933,-67,1008,564,-62,506,183,-67,1641,282,-80,1275,697,-1,1503,1163,1,1468,1157,-8,1441,1105,-10,1514,1065,-3,1449,1097,1,1446,1068,-47,2029,1021,-78,2000,1005,-107,1969,1003,-99,1995,942,-52,2037,1013,-317,1112,-225,-285,1388,-379,-212,1210,-761,-242,837,-363,-259,858,-423,-219,874,-482,-138,887,-514,-99,836,-429,-141,837,-345,-188,484,11,-107,486,6,-99,462,-26,-117,457,-54,-171,455,-52,-188,456,-28,-119,1868,757,-80,1939,670,-191,633,-459,-191,667,-443,-184,770,595,-188,760,633,-178,753,669,-172,606,-478,-165,682,573,-157,664,589,-157,703,553,-179,513,-95,-182,540,-95,-179,485,-100,-118,657,-423,-83,755,662,-124,596,-499,-90,664,588,-83,775,578,-89,717,540,-106,538,-97,-123,483,-100,-68,761,630,-83,682,573,-106,631,-444,-108,511,-105,-143,452,358,-92,453,357,-78,473,345,-92,493,329,-143,491,331,-160,474,344,-31,1586,1108,-165,1067,-327,-70,1064,-539,0,1772,1081,-26,1815,1061,-101,1814,976,-75,1654,982,-48,1052,-530,-102,1042,-353,-94,1539,104,-102,1542,56,-147,958,-183,-178,909,117,-73,1409,670,-197,1381,612,140,1326,642,160,1188,602,148,1091,613,129,734,448,121,668,340,101,512,70,98,521,-155,101,565,-122,100,614,-84,100,591,33,117,747,297,120,809,345,163,1063,389,207,1158,406,-208,1135,415,-165,1027,426,-126,778,569,-127,717,540,-118,506,318,-121,539,209,-124,490,170,-121,447,136,-118,438,371,-129,650,600,-135,749,683,-151,1097,658,-161,1181,640,-140,1321,664,203,1051,-599,217,1011,-668,219,769,-805,217,536,-456,212,510,-438,212,413,-400,203,411,-354,213,408,-281,213,501,-337,209,614,-421,216,824,-728,253,862,-559,283,1032,-265,-170,978,-518,-177,887,-511,-155,597,-498,-153,469,-96,-148,456,-62,-147,387,15,-138,406,56,-148,436,123,-150,494,31,-147,556,-87,-152,673,-436,-197,830,-334,-253,1124,-182,150,567,-34,130,572,13,101,571,28,71,574,17,45,566,-32,69,530,-39,99,513,-39,128,533,-44,-89,454,251,-65,489,258,-89,497,309,-119,492,322,-149,495,307,-170,490,260,-149,457,247,-119,438,249,-40,1629,1085,0,1656,1127,24,1656,1128,49,1657,1123,81,1631,1074,-32,1483,-901,-42,1435,-924,1,1421,-922,44,1435,-924,34,1483,-902,1,1496,-904,-83,1247,-1271,-2,1235,-1268,77,1252,-1277,42,1331,-1262,-5,1365,-1243,-52,1328,-1259,267,851,-807,238,866,-845,232,876,-867,158,867,-858,164,845,-832,165,830,-770,226,832,-754,267,840,-768,-98,669,-586,-174,664,-596,-178,667,-570,-205,674,-524,-203,686,-480,-161,689,-463,-101,684,-479,-102,663,-548,93,1813,1018,107,1835,999,108,1819,973,98,1794,990,-69,1810,1033,-87,1831,1017,-92,1815,992,-79,1790,1006,111,1814,999,-90,1810,1018] },
{ "name": "horse_A_010", "vertices": [0,1521,48,0,1527,118,0,1574,-265,0,1574,-531,1,1169,-856,0,1300,-873,0,1461,-797,0,975,-327,0,869,-175,0,836,139,-6,1819,448,-12,1650,813,0,1178,731,1,1084,-823,0,1015,-714,0,1086,717,0,987,470,-2,1975,924,5,1936,1007,-4,1623,829,25,1575,1156,13,1801,1070,4,1572,919,17,1471,1040,30,1521,1195,17,1435,1036,24,1400,1106,20,1481,1074,20,1406,1066,23,1408,1097,0,972,-530,21,1661,1120,29,1426,1163,0,1442,-823,0,1385,-851,1,1401,-1002,2,1298,-974,-1,1376,-1061,3,1225,-1066,-12,1272,-1428,-18,1275,-1574,29,1457,1175,0,1630,274,0,1268,732,-18,1956,679,0,998,-623,17,1730,1096,0,1369,706,0,1020,601,279,1192,233,230,1367,37,273,1311,-131,245,1273,-209,298,967,73,146,1434,220,250,1324,470,136,1531,-319,195,1544,-509,317,1058,-364,173,1459,539,135,1413,-793,218,968,-155,256,1216,452,210,1320,338,255,1094,553,232,1251,599,220,1116,638,104,1718,623,65,1800,481,75,1714,805,103,1154,679,168,1049,-669,278,1028,-451,246,1084,482,118,1808,851,51,1957,960,107,1839,886,37,1933,1005,113,1708,805,109,1816,987,95,1630,819,71,1519,1047,97,1726,1020,47,1574,1152,50,1802,1064,69,1584,913,54,1479,1041,272,1271,-528,112,1148,-839,83,1480,1061,69,1531,1167,59,1435,1060,72,1424,1088,69,1428,1085,210,1037,-264,91,1051,622,126,994,-481,82,1020,447,114,1941,1018,74,2044,1080,71,2034,1085,142,615,-19,120,577,-60,127,655,26,287,506,-166,280,523,-89,263,501,-189,48,576,-59,59,655,30,185,520,-82,193,499,-181,109,1004,-374,172,510,-127,61,1930,1003,87,1913,985,92,1909,969,65,1944,989,50,1658,1115,84,1913,927,44,1327,-856,92,1468,1126,78,1448,1124,204,1149,386,23,1427,-827,33,1400,-834,35,1370,-992,66,1310,-976,46,1336,-1066,84,1245,-1076,36,1253,-1376,68,1220,-1427,93,1507,1130,72,1493,1130,109,1815,1042,73,1933,996,102,1977,1038,114,1988,1030,85,1921,940,66,1004,572,32,615,-12,67,1619,293,80,1274,706,61,1463,1160,58,1428,1153,59,1404,1099,51,1478,1062,52,1412,1093,42,1410,1064,62,1997,1036,90,1969,1014,119,1939,1005,99,1968,948,65,2005,1028,345,1049,-213,272,1330,-307,219,1175,-726,304,850,-461,315,900,-504,269,936,-548,186,950,-571,159,860,-523,205,826,-448,267,600,-151,186,599,-157,180,583,-194,198,585,-223,252,585,-221,269,582,-196,86,1859,776,44,1928,687,269,746,-620,269,779,-613,179,788,452,184,764,487,174,744,520,251,717,-637,156,705,406,149,683,418,148,729,392,257,652,-249,259,678,-250,259,625,-253,194,769,-587,79,750,517,204,703,-658,82,684,420,78,799,440,79,746,386,183,673,-252,202,621,-254,64,767,487,74,704,410,184,741,-606,186,646,-259,121,532,144,70,533,146,55,556,139,69,579,128,120,577,127,138,556,135,77,1549,1105,172,1006,-303,79,1016,-511,34,1735,1092,56,1780,1069,114,1785,973,95,1624,976,53,1000,-503,103,994,-327,94,1513,118,102,1508,56,147,913,-165,179,872,140,73,1400,684,198,1380,608,-279,1185,244,-230,1367,37,-277,1325,-140,-257,1318,-260,-298,967,73,-145,1431,224,-249,1309,509,-145,1537,-331,-202,1544,-524,-280,1019,-339,-172,1456,545,-138,1408,-805,-217,981,-153,-256,1188,489,-209,1301,376,-258,1082,635,-232,1241,644,-223,1121,712,-126,1715,615,-79,1799,476,-108,1712,803,-104,1153,720,-142,1003,-672,-233,965,-422,-249,1038,565,-128,1803,874,-48,1955,969,-112,1835,906,-25,1932,1010,-128,1703,827,-95,1812,1006,-105,1627,837,-36,1518,1056,-74,1723,1036,4,1573,1156,-23,1801,1070,-61,1582,925,-19,1478,1048,-274,1239,-552,-102,1137,-835,-44,1478,1072,-13,1530,1174,-19,1434,1067,-26,1422,1097,-24,1427,1093,-198,1076,-257,-94,1063,676,-76,950,-446,-84,989,488,-100,1942,1035,-55,2052,1080,-51,2043,1085,-176,368,504,-156,316,483,-159,424,527,-177,188,-27,-173,200,50,-153,184,-50,-84,313,482,-91,424,527,-77,202,59,-83,186,-40,-65,1003,-338,-63,194,13,-49,1929,1013,-77,1910,1000,-85,1906,985,-56,1942,1000,-8,1657,1120,-85,1910,942,-43,1324,-857,-41,1466,1138,-26,1446,1133,-204,1120,410,-23,1427,-827,-33,1400,-834,-31,1369,-991,-62,1309,-974,-46,1333,-1062,-79,1240,-1069,-55,1250,-1372,-89,1215,-1421,-42,1504,1142,-21,1491,1138,-85,1811,1060,-62,1931,1008,-87,1981,1049,-100,1990,1043,-83,1918,956,-68,999,630,-66,369,505,-67,1619,293,-79,1272,717,-3,1462,1166,0,1427,1159,-10,1403,1105,-12,1477,1068,-5,1411,1098,0,1410,1068,-48,2001,1039,-78,1971,1025,-107,1939,1024,-98,1962,961,-53,2008,1031,-313,1076,-184,-290,1342,-360,-210,1148,-731,-225,797,-308,-243,815,-369,-202,830,-428,-122,845,-461,-82,799,-373,-124,802,-290,-163,282,-7,-81,285,-11,-73,270,-49,-92,273,-78,-146,271,-77,-162,265,-53,-120,1856,775,-81,1926,688,-165,567,-410,-166,597,-381,-188,775,732,-192,779,775,-182,786,814,-146,548,-436,-168,680,757,-160,672,781,-160,687,730,-154,337,-103,-157,364,-94,-154,312,-116,-92,579,-367,-86,786,807,-98,546,-459,-93,672,780,-87,773,713,-92,693,712,-81,362,-97,-97,310,-117,-71,779,771,-86,679,758,-81,561,-396,-82,339,-113,-147,372,692,-96,372,690,-81,383,671,-96,392,646,-147,391,649,-163,383,670,-32,1547,1115,-165,1026,-297,-68,1018,-506,0,1734,1095,-26,1779,1077,-102,1781,992,-76,1621,991,-47,1006,-499,-102,1000,-325,-94,1513,118,-102,1508,56,-148,915,-165,-179,872,140,-73,1399,686,-197,1375,624,140,1323,664,160,1195,639,149,1105,663,131,735,534,121,667,426,96,515,155,88,566,-72,93,602,-31,93,643,15,94,594,119,117,746,385,121,805,431,164,1057,437,207,1152,445,-208,1105,474,-167,1000,506,-130,772,703,-130,693,712,-121,396,630,-125,408,520,-128,350,497,-125,299,476,-121,366,710,-132,666,798,-138,787,831,-152,1111,732,-161,1187,684,-140,1319,681,209,998,-499,224,955,-568,236,705,-657,233,610,-252,229,587,-230,231,503,-169,221,512,-124,230,528,-53,228,604,-130,223,693,-243,230,782,-608,262,823,-441,282,1034,-173,-157,931,-463,-161,843,-458,-130,546,-459,-127,296,-117,-123,275,-85,-121,187,-29,-112,195,15,-123,206,87,-124,286,14,-121,377,-82,-126,602,-370,-180,793,-278,-249,1093,-141,143,587,54,125,583,102,95,578,118,65,585,108,39,586,58,62,552,44,91,535,42,121,556,37,-93,340,586,-69,375,582,-93,396,628,-122,394,644,-152,394,627,-173,376,583,-152,340,581,-123,326,587,-41,1591,1093,-1,1617,1137,23,1616,1138,48,1618,1132,80,1594,1082,-32,1427,-888,-42,1377,-908,1,1364,-906,44,1378,-909,34,1427,-888,1,1440,-891,-83,1172,-1252,-1,1160,-1247,77,1176,-1258,42,1258,-1254,-5,1295,-1239,-52,1255,-1250,282,780,-686,252,787,-723,247,792,-745,173,783,-737,180,767,-709,180,764,-651,240,771,-637,282,777,-650,-73,631,-526,-149,625,-537,-152,626,-509,-179,629,-459,-178,638,-411,-136,641,-392,-76,640,-410,-77,622,-486,93,1777,1035,107,1800,1017,108,1785,990,98,1760,1005,-69,1775,1049,-87,1797,1034,-92,1782,1008,-79,1756,1021,111,1779,1016,-90,1776,1034] },
{ "name": "horse_A_011", "vertices": [0,1452,49,0,1462,124,0,1502,-263,0,1505,-528,0,1104,-856,0,1235,-872,0,1396,-795,0,904,-332,0,799,-178,0,763,139,-6,1755,480,-14,1575,837,0,1113,740,0,1019,-824,0,949,-718,-2,1021,728,-2,920,481,-4,1886,968,3,1840,1047,-8,1542,846,22,1469,1168,11,1701,1100,0,1484,932,13,1375,1045,26,1412,1203,13,1339,1038,20,1299,1105,16,1382,1080,16,1308,1065,19,1307,1097,0,903,-534,17,1558,1139,25,1320,1164,0,1378,-821,0,1321,-850,1,1347,-1009,2,1243,-978,-1,1330,-1084,3,1179,-1079,-10,1170,-1448,-14,1118,-1576,25,1350,1178,0,1565,281,0,1200,738,-19,1887,717,0,930,-627,14,1629,1120,0,1300,714,-2,954,612,279,1120,238,231,1298,35,273,1255,-136,242,1260,-215,299,895,71,146,1366,225,250,1254,480,138,1466,-324,197,1477,-514,305,1002,-309,173,1391,543,136,1347,-797,217,912,-153,256,1145,471,210,1244,348,256,1031,593,232,1189,616,220,1060,674,103,1650,653,65,1735,513,74,1642,835,104,1095,698,163,964,-650,265,951,-391,246,1014,520,115,1724,882,49,1865,1002,104,1752,920,35,1838,1045,110,1628,828,106,1722,1018,91,1550,836,67,1422,1055,94,1630,1044,43,1468,1164,47,1702,1093,65,1497,927,50,1383,1046,272,1196,-525,110,1073,-827,79,1382,1066,65,1424,1176,55,1337,1061,67,1323,1089,65,1328,1086,203,1005,-244,92,990,650,112,918,-416,82,949,467,112,1847,1058,73,1949,1123,70,1938,1127,137,642,50,113,619,0,123,667,106,262,353,3,255,378,77,239,345,-19,41,617,2,55,667,110,159,375,84,168,344,-11,93,957,-311,147,360,40,59,1835,1043,84,1819,1024,90,1816,1007,63,1850,1030,46,1555,1133,82,1824,966,44,1258,-854,88,1365,1130,74,1345,1126,204,1075,400,23,1363,-825,33,1335,-833,35,1316,-997,66,1255,-980,46,1290,-1086,84,1199,-1090,38,1163,-1390,70,1118,-1434,89,1403,1137,68,1389,1135,107,1717,1073,70,1838,1036,100,1883,1078,112,1894,1071,82,1830,979,66,938,598,26,642,58,67,1554,300,80,1208,712,56,1357,1164,53,1323,1154,54,1303,1098,47,1380,1067,48,1311,1093,37,1312,1064,60,1902,1078,88,1876,1055,117,1846,1045,97,1875,988,63,1911,1070,329,1035,-156,273,1292,-321,217,1095,-715,281,774,-336,295,808,-391,253,831,-446,171,842,-476,138,772,-402,180,761,-319,242,448,7,161,446,0,155,425,-34,174,424,-63,228,425,-60,244,425,-35,84,1787,810,43,1858,724,245,601,-462,244,635,-449,181,715,526,186,692,557,176,672,588,228,573,-481,157,644,471,149,620,480,148,670,462,233,487,-96,235,515,-96,235,460,-101,170,622,-428,81,677,586,181,561,-502,82,621,484,80,726,516,80,688,460,159,508,-99,179,455,-102,66,694,558,75,643,477,160,596,-448,162,482,-107,116,515,186,65,517,189,51,540,187,65,565,179,116,562,176,133,540,181,73,1447,1115,168,953,-294,75,957,-498,31,1633,1117,53,1680,1098,111,1692,1001,91,1532,992,50,940,-496,102,928,-328,94,1449,124,102,1440,56,148,846,-168,180,799,139,73,1332,689,198,1313,613,-279,1122,248,-231,1298,35,-276,1237,-133,-252,1160,-220,-299,895,71,-145,1367,231,-248,1252,521,-144,1457,-316,-202,1471,-508,-280,916,-378,-171,1390,553,-138,1346,-795,-217,889,-158,-258,1125,491,-208,1246,388,-266,1032,638,-232,1182,650,-228,1072,712,-127,1648,645,-80,1734,507,-109,1639,832,-107,1090,723,-145,954,-679,-235,892,-468,-257,974,578,-131,1719,904,-50,1863,1011,-114,1748,939,-27,1837,1050,-132,1623,850,-98,1718,1037,-108,1546,854,-40,1420,1064,-77,1626,1060,0,1467,1168,-26,1701,1100,-64,1494,938,-23,1381,1053,-274,1161,-536,-103,1078,-844,-48,1380,1077,-17,1423,1183,-23,1335,1069,-30,1321,1098,-29,1326,1094,-195,948,-270,-98,1013,674,-79,886,-496,-88,919,496,-103,1850,1074,-59,1961,1118,-55,1951,1123,-178,242,901,-156,197,933,-162,292,866,-146,58,-399,-139,68,-321,-122,57,-423,-84,196,934,-94,295,865,-44,75,-315,-52,62,-415,-65,900,-385,-31,70,-361,-51,1834,1053,-79,1816,1039,-87,1813,1024,-58,1848,1040,-11,1554,1139,-87,1820,981,-43,1262,-857,-45,1362,1142,-31,1343,1136,-207,1051,412,-23,1363,-825,-33,1335,-833,-31,1315,-996,-62,1254,-979,-46,1287,-1082,-79,1194,-1084,-54,1161,-1387,-87,1113,-1428,-46,1400,1149,-25,1387,1144,-88,1713,1090,-64,1836,1048,-90,1889,1088,-103,1898,1081,-85,1826,995,-73,942,636,-67,246,899,-67,1554,300,-79,1204,724,-7,1356,1169,-5,1322,1159,-15,1301,1104,-16,1378,1073,-10,1310,1098,-4,1311,1068,-52,1909,1078,-82,1878,1064,-110,1847,1063,-100,1868,1000,-56,1916,1070,-309,908,-222,-286,1216,-317,-211,1090,-734,-227,707,-458,-246,750,-504,-207,791,-551,-128,819,-575,-86,739,-519,-126,702,-442,-136,152,-376,-55,160,-382,-47,147,-421,-66,150,-449,-120,145,-447,-136,137,-422,-121,1784,809,-82,1856,725,-168,548,-653,-169,563,-614,-205,762,820,-209,785,859,-198,809,893,-150,543,-686,-183,687,893,-175,694,917,-175,680,866,-133,211,-473,-136,233,-454,-132,191,-494,-94,545,-611,-103,805,886,-103,553,-708,-108,696,915,-104,752,803,-107,677,846,-60,237,-459,-76,192,-496,-88,783,855,-101,690,893,-83,541,-645,-62,221,-483,-152,393,1001,-101,394,1000,-86,392,976,-101,387,950,-152,386,953,-169,390,975,-36,1445,1125,-164,928,-307,-68,937,-518,-2,1632,1120,-29,1678,1105,-104,1688,1021,-80,1528,1007,-46,927,-509,-101,922,-331,-94,1449,124,-102,1440,56,-148,839,-168,-180,799,139,-73,1331,692,-196,1309,634,140,1258,670,160,1134,657,150,1050,696,133,663,601,122,603,486,91,497,194,81,611,-13,87,634,35,88,660,92,90,581,172,118,688,458,123,732,507,164,984,468,207,1081,466,-213,1028,474,-174,926,522,-148,747,793,-145,676,847,-127,382,934,-128,279,876,-129,228,911,-124,183,943,-126,399,1019,-147,698,934,-154,817,908,-157,1059,732,-163,1125,691,-139,1253,689,195,913,-432,209,845,-473,212,563,-501,209,443,-99,205,426,-70,206,350,0,196,363,43,204,387,112,203,454,26,198,529,-89,205,638,-442,237,757,-309,265,1036,-115,-160,874,-515,-166,817,-572,-134,551,-707,-105,175,-499,-97,150,-456,-90,61,-402,-80,67,-357,-89,75,-285,-97,158,-355,-101,243,-438,-130,564,-604,-182,689,-435,-245,907,-180,138,594,112,120,577,158,91,567,172,60,578,164,34,594,118,56,565,95,85,549,91,115,569,88,-95,297,968,-72,314,936,-97,364,944,-127,374,951,-157,360,946,-177,313,937,-155,292,966,-125,292,978,-44,1490,1107,-5,1512,1152,20,1512,1153,44,1513,1148,76,1493,1096,-32,1368,-888,-42,1318,-908,1,1304,-905,44,1318,-908,34,1368,-888,1,1380,-891,-82,1110,-1256,0,1099,-1248,78,1115,-1262,42,1200,-1270,-5,1240,-1260,-51,1197,-1266,258,641,-527,231,639,-571,227,640,-596,151,636,-586,157,626,-552,154,637,-485,214,645,-469,256,647,-485,-83,659,-732,-158,657,-743,-161,646,-718,-187,626,-671,-185,613,-625,-142,608,-608,-83,616,-626,-85,634,-701,90,1680,1063,104,1704,1046,105,1691,1019,95,1665,1032,-72,1677,1077,-90,1700,1064,-95,1687,1037,-82,1661,1048,108,1683,1044,-93,1679,1062] },
{ "name": "horse_A_012", "vertices": [0,1386,51,0,1398,128,0,1430,-262,0,1447,-527,0,1061,-874,0,1194,-884,0,1350,-799,0,836,-361,0,738,-196,0,693,116,-6,1682,514,-16,1487,862,-1,1027,738,0,975,-846,0,900,-744,-4,950,716,-4,844,471,-6,1788,1009,1,1738,1086,-11,1452,866,19,1359,1182,9,1596,1129,-2,1389,948,10,1273,1053,24,1300,1214,10,1238,1044,17,1193,1109,13,1278,1089,13,1205,1070,16,1202,1101,0,846,-563,15,1450,1160,22,1211,1169,0,1334,-826,0,1278,-858,1,1319,-1022,2,1214,-994,-1,1314,-1112,3,1163,-1108,-8,1116,-1475,-9,1019,-1568,22,1240,1185,0,1496,288,0,1117,736,-20,1804,757,0,877,-654,12,1522,1145,0,1220,714,-4,876,602,279,1051,231,231,1232,30,276,1196,-145,250,1201,-240,299,826,52,145,1299,227,250,1177,486,142,1399,-329,200,1417,-519,292,915,-317,173,1314,547,137,1299,-807,217,851,-169,256,1059,457,210,1172,353,256,955,592,232,1109,614,221,992,670,103,1571,683,65,1661,546,74,1554,863,104,1017,692,153,901,-682,248,860,-399,247,912,523,113,1632,913,47,1765,1042,102,1658,953,33,1735,1083,108,1539,853,104,1621,1049,89,1461,857,64,1319,1067,92,1528,1069,41,1358,1179,45,1597,1123,63,1402,943,47,1281,1056,274,1126,-541,105,1027,-844,76,1279,1075,63,1314,1187,52,1234,1068,64,1219,1095,62,1223,1092,199,947,-263,93,930,644,92,837,-424,83,858,460,110,1744,1096,71,1843,1166,68,1832,1169,130,610,210,107,584,161,118,638,264,216,140,21,207,166,95,193,131,-1,34,583,164,50,638,270,111,164,99,122,131,4,78,886,-316,100,148,56,57,1733,1081,82,1718,1061,88,1716,1044,61,1748,1069,44,1448,1153,79,1726,1003,43,1215,-864,85,1258,1138,71,1238,1133,204,988,383,23,1319,-831,33,1292,-840,35,1287,-1011,66,1226,-996,46,1274,-1114,84,1183,-1119,40,1122,-1414,73,1067,-1448,86,1295,1147,65,1281,1145,105,1612,1103,68,1736,1074,99,1779,1118,110,1790,1111,80,1731,1017,67,865,599,20,611,219,67,1484,306,80,1126,710,54,1248,1171,51,1214,1160,51,1198,1102,44,1276,1076,45,1206,1097,34,1209,1069,58,1798,1119,87,1773,1095,115,1744,1083,95,1776,1028,62,1807,1111,320,967,-162,283,1226,-344,213,1037,-732,249,689,-301,266,711,-361,225,728,-420,145,740,-452,107,687,-368,148,687,-284,196,235,23,115,233,15,109,212,-19,128,210,-47,183,211,-44,198,211,-18,84,1700,844,42,1775,763,201,473,-408,199,504,-384,183,644,697,188,631,724,179,621,750,184,450,-434,158,590,645,151,565,651,149,617,639,188,272,-82,190,300,-76,191,246,-92,126,484,-370,83,624,750,137,443,-458,83,566,656,82,650,690,81,636,640,114,294,-80,134,240,-94,68,633,727,76,589,652,117,463,-397,118,269,-94,112,491,349,61,492,352,47,516,352,61,542,347,112,539,344,129,517,346,70,1341,1128,166,891,-318,71,897,-520,28,1526,1142,51,1575,1126,109,1592,1030,89,1433,1011,48,882,-520,102,862,-355,94,1385,127,102,1374,58,148,783,-185,180,729,118,73,1251,689,198,1233,616,-278,1055,240,-231,1232,30,-275,1143,-144,-249,948,-298,-299,826,52,-143,1301,233,-245,1180,524,-143,1366,-303,-201,1401,-495,-286,796,-581,-169,1313,557,-137,1299,-799,-216,787,-199,-261,1048,485,-205,1178,390,-276,961,628,-233,1103,647,-236,998,698,-127,1568,674,-80,1660,540,-110,1552,860,-110,1007,714,-151,932,-779,-242,822,-678,-270,896,577,-133,1626,935,-52,1763,1051,-117,1652,972,-29,1734,1089,-134,1533,875,-100,1616,1067,-111,1456,875,-43,1317,1076,-80,1523,1085,-1,1357,1183,-28,1595,1130,-67,1399,955,-26,1279,1062,-274,1088,-570,-105,1067,-883,-51,1276,1086,-19,1312,1195,-26,1232,1075,-33,1216,1103,-31,1221,1100,-197,810,-378,-104,938,657,-86,828,-711,-95,838,489,-106,1750,1111,-63,1862,1152,-59,1853,1157,-173,307,1248,-150,311,1303,-159,305,1187,-115,14,-897,-110,15,-818,-92,18,-921,-78,316,1303,-90,309,1183,-16,28,-810,-22,28,-911,-71,780,-601,-2,30,-856,-53,1731,1090,-81,1715,1076,-89,1711,1061,-61,1745,1079,-14,1446,1159,-89,1722,1018,-43,1231,-866,-47,1254,1150,-33,1235,1142,-210,972,403,-23,1319,-831,-33,1292,-840,-31,1286,-1010,-62,1225,-994,-46,1271,-1111,-79,1178,-1113,-52,1119,-1411,-85,1062,-1443,-48,1292,1159,-28,1279,1153,-90,1607,1121,-66,1733,1086,-93,1789,1123,-106,1798,1116,-87,1726,1033,-79,867,626,-63,313,1242,-67,1484,306,-79,1121,722,-10,1246,1177,-8,1213,1165,-17,1196,1109,-19,1275,1082,-13,1205,1102,-7,1208,1073,-55,1809,1114,-84,1778,1100,-113,1747,1100,-102,1766,1036,-59,1816,1105,-313,714,-437,-283,1046,-353,-212,1069,-780,-240,630,-735,-258,688,-760,-218,743,-788,-138,776,-800,-98,679,-782,-138,617,-724,-113,105,-863,-33,120,-867,-24,113,-906,-43,117,-935,-96,108,-934,-112,96,-911,-122,1697,843,-83,1773,764,-179,554,-980,-180,552,-939,-227,729,865,-229,764,895,-218,798,920,-161,564,-1012,-201,684,962,-193,700,982,-193,667,941,-114,177,-954,-119,190,-928,-113,164,-980,-103,539,-944,-123,791,912,-115,586,-1029,-126,703,978,-127,712,849,-126,658,922,-44,201,-931,-56,170,-982,-109,759,890,-119,690,959,-93,551,-976,-44,195,-959,-156,463,1181,-105,465,1178,-90,451,1157,-105,436,1134,-156,435,1139,-173,446,1159,-39,1338,1138,-164,830,-374,-69,856,-598,-4,1525,1145,-31,1572,1133,-107,1587,1050,-82,1429,1026,-47,851,-570,-102,846,-369,-94,1385,127,-102,1374,58,-148,763,-191,-180,729,118,-72,1250,692,-193,1231,636,140,1177,670,161,1053,656,150,980,693,135,617,762,123,548,656,87,472,355,74,576,148,81,602,196,82,630,252,86,558,341,119,636,637,125,653,682,165,873,469,207,977,442,-220,940,466,-186,841,523,-171,705,843,-163,656,924,-131,424,1123,-124,308,1203,-123,311,1265,-118,314,1320,-130,476,1194,-165,712,995,-174,810,931,-164,981,719,-166,1043,686,-137,1171,688,175,823,-440,184,741,-449,169,445,-456,165,227,-91,159,212,-54,160,137,16,148,151,59,155,176,128,156,241,42,153,312,-66,160,507,-375,205,680,-273,255,978,-120,-169,830,-733,-176,774,-798,-147,581,-1028,-84,151,-990,-74,116,-942,-60,22,-899,-50,24,-854,-61,22,-781,-75,112,-841,-84,196,-909,-141,552,-929,-195,604,-722,-249,691,-400,133,566,274,115,550,321,87,543,336,56,551,328,29,565,281,51,536,260,80,520,256,110,540,251,-95,395,1236,-72,380,1204,-99,412,1166,-130,417,1158,-158,408,1172,-176,375,1207,-154,389,1240,-124,402,1245,-47,1385,1123,-7,1404,1170,17,1403,1170,42,1405,1165,74,1388,1112,-32,1330,-894,-42,1280,-916,0,1266,-914,44,1281,-917,34,1330,-895,1,1342,-897,-81,1093,-1278,0,1082,-1268,79,1097,-1284,43,1184,-1300,-5,1227,-1294,-51,1182,-1297,215,529,-464,188,525,-513,185,524,-540,109,525,-530,113,516,-491,110,533,-418,169,538,-399,212,537,-417,-100,691,-1008,-175,693,-1018,-178,672,-999,-204,636,-964,-202,605,-926,-159,594,-913,-100,609,-928,-102,655,-989,88,1576,1091,102,1602,1076,103,1590,1047,93,1563,1059,-74,1572,1105,-92,1597,1094,-97,1585,1066,-84,1558,1075,106,1581,1072,-96,1576,1090] },
{ "name": "horse_A_013", "vertices": [0,1349,53,0,1361,129,0,1375,-264,0,1413,-526,0,1059,-906,0,1192,-904,0,1340,-805,0,791,-412,0,709,-224,0,655,78,-6,1630,545,-15,1412,881,-1,963,730,0,971,-885,0,887,-789,-5,896,690,-4,789,456,-6,1706,1043,1,1652,1117,-10,1376,886,21,1270,1198,9,1509,1154,-1,1310,965,11,1189,1066,25,1210,1227,11,1155,1055,19,1108,1118,14,1193,1101,15,1121,1080,18,1117,1111,0,817,-612,16,1362,1179,24,1123,1179,0,1326,-834,0,1273,-870,1,1334,-1036,1,1227,-1018,-1,1349,-1139,2,1198,-1150,-5,1147,-1509,-4,1022,-1570,24,1151,1196,0,1454,293,0,1058,728,-20,1735,794,0,856,-701,13,1434,1167,0,1163,709,-4,819,586,278,1004,217,230,1194,21,276,1148,-151,252,1085,-248,298,790,20,145,1256,225,250,1113,485,144,1344,-326,201,1381,-513,283,841,-401,172,1261,545,137,1291,-813,216,802,-199,256,973,449,209,1109,353,257,887,596,232,1040,607,222,935,663,103,1508,706,65,1607,575,74,1479,885,104,955,682,149,902,-746,238,814,-492,248,821,549,113,1554,940,47,1682,1074,102,1578,980,33,1650,1114,108,1464,876,104,1538,1075,89,1385,877,66,1235,1081,93,1444,1092,42,1270,1195,46,1510,1148,64,1323,961,49,1197,1068,274,1088,-566,103,1028,-885,78,1194,1088,65,1225,1201,54,1150,1079,66,1134,1105,64,1138,1102,196,857,-319,93,883,627,82,806,-520,83,781,465,110,1656,1128,71,1749,1205,68,1738,1208,149,437,458,127,390,428,133,486,493,137,29,-314,125,50,-238,115,24,-339,55,387,430,65,486,497,29,55,-240,44,29,-336,68,822,-407,20,44,-285,57,1648,1112,82,1634,1091,88,1633,1074,61,1663,1100,45,1360,1173,79,1644,1033,43,1214,-882,87,1171,1149,73,1151,1144,204,907,371,23,1311,-840,33,1285,-851,34,1301,-1029,66,1239,-1018,46,1309,-1145,84,1219,-1158,41,1160,-1448,75,1100,-1477,88,1208,1160,67,1194,1158,105,1527,1129,68,1651,1105,98,1690,1153,110,1701,1147,80,1649,1048,67,813,599,38,437,465,67,1442,310,80,1068,704,56,1160,1182,53,1127,1169,53,1112,1112,46,1192,1089,47,1121,1107,36,1125,1079,58,1709,1155,86,1686,1129,115,1657,1115,95,1694,1062,62,1718,1148,311,838,-243,286,1139,-345,211,1028,-772,232,628,-472,251,670,-520,211,708,-568,131,734,-593,90,656,-534,131,623,-456,124,125,-305,44,130,-318,39,112,-354,60,111,-381,114,108,-375,128,104,-349,84,1626,875,42,1705,798,173,468,-646,171,489,-613,184,701,866,189,705,893,180,710,918,156,456,-679,162,631,847,156,612,864,154,650,828,127,170,-409,129,195,-394,128,147,-425,96,471,-610,85,710,916,111,461,-706,88,613,867,83,699,856,85,665,818,54,196,-404,72,146,-432,69,705,894,81,630,852,87,461,-643,57,177,-425,129,396,638,78,397,640,63,417,628,77,437,611,128,435,610,145,418,623,72,1254,1143,164,825,-372,69,859,-576,29,1439,1164,51,1488,1150,109,1510,1055,89,1351,1030,47,845,-574,101,813,-406,94,1348,128,102,1336,59,148,750,-213,179,691,81,73,1196,686,197,1175,613,-277,1014,225,-230,1194,21,-274,1103,-164,-242,887,-398,-298,790,20,-143,1260,232,-245,1125,521,-143,1307,-310,-201,1362,-498,-276,786,-728,-169,1261,556,-138,1291,-814,-213,747,-246,-261,995,474,-204,1131,387,-277,897,610,-233,1041,639,-237,930,683,-126,1506,697,-80,1606,570,-109,1477,882,-110,942,702,-151,952,-865,-234,837,-821,-271,837,555,-133,1546,962,-52,1679,1083,-116,1571,1000,-29,1648,1120,-134,1456,898,-99,1531,1094,-111,1379,895,-41,1232,1091,-79,1438,1107,0,1268,1198,-27,1508,1155,-66,1319,973,-24,1195,1075,-273,1066,-622,-105,1085,-917,-49,1191,1099,-18,1223,1209,-24,1148,1086,-31,1130,1114,-30,1136,1110,-190,771,-472,-105,875,641,-79,856,-854,-95,786,468,-106,1666,1142,-65,1778,1182,-60,1769,1187,-167,286,1279,-146,314,1328,-151,259,1225,-100,21,-1178,-96,6,-1101,-77,29,-1201,-73,320,1326,-83,264,1220,-1,17,-1090,-7,37,-1189,-61,783,-752,11,28,-1135,-53,1646,1121,-81,1630,1107,-89,1627,1091,-60,1660,1110,-12,1358,1178,-89,1639,1049,-44,1233,-880,-46,1167,1161,-32,1148,1153,-209,924,384,-23,1311,-840,-33,1285,-851,-32,1301,-1028,-62,1238,-1017,-46,1306,-1142,-80,1214,-1153,-50,1157,-1446,-82,1096,-1472,-47,1204,1172,-26,1191,1166,-90,1521,1147,-66,1648,1117,-94,1705,1154,-107,1714,1146,-87,1642,1064,-80,806,607,-57,293,1272,-67,1442,310,-79,1062,714,-8,1158,1188,-6,1125,1175,-16,1110,1118,-17,1190,1095,-11,1120,1112,-5,1124,1083,-55,1725,1145,-85,1694,1131,-113,1662,1130,-102,1681,1067,-60,1732,1136,-299,680,-591,-279,986,-426,-213,1080,-823,-224,625,-888,-244,684,-910,-206,741,-935,-127,778,-946,-84,682,-932,-122,615,-878,-98,103,-1126,-18,119,-1127,-9,120,-1167,-28,130,-1194,-82,120,-1195,-97,104,-1175,-121,1623,875,-83,1703,799,-164,566,-1150,-165,555,-1108,-231,643,827,-233,677,858,-222,711,884,-146,583,-1180,-203,600,928,-196,617,946,-196,581,907,-99,192,-1201,-104,200,-1173,-98,185,-1229,-88,545,-1117,-127,704,875,-100,608,-1191,-128,621,941,-131,626,811,-128,573,889,-29,211,-1174,-41,191,-1229,-113,673,852,-122,606,923,-78,563,-1146,-30,211,-1202,-153,394,1159,-102,397,1155,-87,381,1136,-102,363,1113,-153,362,1119,-169,374,1139,-37,1251,1153,-161,789,-443,-66,838,-677,-3,1438,1167,-31,1485,1158,-106,1503,1075,-81,1346,1045,-45,827,-638,-101,802,-424,-94,1348,128,-102,1336,59,-147,729,-227,-179,691,81,-72,1194,689,-193,1174,634,140,1117,664,161,987,651,151,925,685,137,711,930,128,598,877,105,382,653,95,375,419,100,421,450,99,472,485,101,449,598,123,665,816,126,699,849,166,775,498,208,870,438,-220,890,449,-187,786,499,-174,619,804,-165,570,891,-128,351,1103,-117,270,1238,-118,298,1293,-114,324,1342,-127,408,1171,-168,630,958,-177,723,894,-165,912,704,-166,979,676,-137,1112,684,164,794,-539,170,733,-590,142,460,-702,101,130,-430,92,111,-386,81,31,-321,68,43,-278,72,61,-207,84,133,-288,93,207,-382,131,491,-606,187,611,-448,247,837,-201,-162,859,-876,-166,774,-944,-132,603,-1192,-69,174,-1241,-59,130,-1201,-45,30,-1179,-36,21,-1134,-47,5,-1063,-60,105,-1103,-69,202,-1153,-126,553,-1098,-178,600,-876,-233,653,-556,150,428,537,132,435,585,103,434,601,72,438,590,46,427,541,69,391,537,99,374,540,129,393,529,-91,363,1233,-67,338,1209,-95,350,1162,-126,348,1150,-154,347,1168,-171,331,1214,-150,358,1238,-121,373,1240,-46,1298,1140,-6,1315,1187,18,1315,1188,43,1317,1183,75,1302,1129,-32,1330,-904,-42,1283,-930,0,1269,-929,43,1283,-930,34,1330,-904,0,1343,-905,-81,1144,-1319,0,1133,-1308,79,1148,-1323,43,1236,-1341,-4,1280,-1335,-51,1234,-1338,193,539,-681,168,554,-728,166,564,-753,90,565,-745,92,543,-712,88,532,-638,147,527,-619,190,531,-635,-86,706,-1156,-162,708,-1166,-164,685,-1149,-189,643,-1117,-186,608,-1082,-143,596,-1069,-83,615,-1082,-88,667,-1140,88,1491,1115,102,1517,1102,103,1507,1073,93,1479,1083,-73,1486,1130,-91,1511,1119,-97,1501,1091,-84,1473,1099,107,1497,1097,-95,1490,1115] },
{ "name": "horse_A_014", "vertices": [0,1338,54,0,1352,127,0,1342,-270,0,1401,-529,0,1080,-939,0,1210,-924,0,1349,-814,0,772,-463,0,710,-246,0,653,41,-6,1607,567,-14,1369,893,-1,942,722,0,989,-925,0,896,-832,-4,865,691,-3,753,465,-6,1660,1063,2,1606,1136,-8,1333,902,23,1222,1212,11,1461,1172,0,1265,980,14,1143,1079,28,1162,1240,14,1109,1068,22,1061,1130,17,1146,1114,18,1075,1092,21,1070,1123,0,813,-661,18,1314,1194,27,1075,1191,0,1337,-844,0,1287,-884,0,1366,-1050,1,1259,-1041,0,1403,-1161,2,1254,-1189,-3,1219,-1543,-1,1079,-1587,28,1103,1208,0,1440,294,0,1034,716,-20,1696,820,0,859,-746,14,1387,1184,0,1139,703,-3,790,593,277,964,207,229,1184,13,274,1117,-164,247,957,-333,293,786,-11,145,1228,217,250,1046,475,143,1303,-327,201,1362,-512,280,787,-588,172,1231,530,137,1301,-825,212,770,-242,257,897,487,210,1017,350,258,848,685,232,1001,614,222,917,727,104,1476,721,65,1582,596,75,1437,899,104,939,697,149,940,-852,236,802,-685,249,774,649,114,1510,958,47,1636,1094,102,1534,999,33,1604,1133,109,1421,893,105,1492,1093,91,1342,892,68,1190,1094,94,1398,1108,45,1222,1208,47,1463,1166,65,1279,976,51,1151,1081,274,1074,-621,104,1068,-939,80,1149,1100,67,1178,1214,57,1104,1091,69,1087,1117,67,1092,1114,193,783,-432,93,855,674,80,807,-718,84,739,514,110,1606,1148,71,1692,1233,68,1681,1235,171,282,808,151,225,809,154,342,807,82,12,-770,71,22,-693,61,13,-796,79,222,810,86,342,808,-22,37,-693,-9,25,-793,65,774,-606,-32,34,-740,57,1601,1131,83,1588,1110,88,1587,1093,62,1617,1120,47,1313,1188,80,1599,1053,43,1238,-902,90,1124,1162,76,1105,1156,204,844,395,23,1323,-851,33,1297,-864,34,1333,-1045,65,1271,-1041,46,1363,-1171,83,1275,-1195,43,1232,-1482,77,1172,-1509,90,1161,1173,70,1147,1170,106,1480,1146,69,1604,1124,99,1637,1176,110,1649,1170,81,1605,1067,68,786,644,61,282,809,67,1428,311,79,1045,690,59,1112,1195,56,1080,1181,56,1066,1123,48,1146,1102,50,1075,1119,39,1079,1091,59,1656,1179,87,1635,1151,116,1608,1135,96,1649,1086,62,1666,1173,306,720,-441,282,1046,-398,212,1058,-833,229,613,-732,249,670,-761,210,724,-792,130,758,-806,88,663,-781,128,604,-720,79,106,-747,0,121,-759,-5,110,-798,15,111,-825,68,101,-818,81,92,-793,85,1583,896,42,1666,822,165,526,-954,165,534,-915,185,739,990,190,757,1018,180,775,1043,150,528,-988,166,664,1019,158,658,1043,158,669,992,89,167,-844,92,185,-821,89,149,-867,87,521,-920,85,772,1038,106,546,-1012,91,658,1043,84,730,978,90,674,974,18,196,-832,33,155,-874,69,755,1016,84,664,1021,79,525,-954,20,184,-858,144,352,976,93,352,976,78,361,954,92,369,929,143,368,931,160,362,952,74,1208,1157,163,782,-452,68,840,-664,31,1392,1181,53,1441,1167,111,1465,1073,91,1306,1045,46,828,-648,101,787,-463,94,1339,126,102,1325,60,146,740,-241,176,688,45,73,1172,676,197,1144,592,-276,995,206,-229,1184,13,-271,1098,-185,-237,908,-504,-293,786,-11,-144,1245,226,-246,1088,508,-142,1277,-328,-202,1350,-510,-268,835,-858,-170,1238,549,-139,1306,-833,-208,748,-289,-260,956,466,-205,1093,374,-274,846,608,-233,1002,630,-235,882,683,-126,1474,713,-80,1581,591,-108,1434,896,-109,907,694,-152,1006,-954,-230,899,-948,-267,792,547,-132,1501,981,-52,1632,1103,-116,1526,1019,-28,1601,1139,-133,1412,915,-98,1484,1112,-109,1335,911,-39,1186,1104,-77,1391,1124,2,1220,1212,-26,1460,1172,-64,1274,988,-22,1148,1088,-274,1083,-681,-108,1122,-946,-46,1144,1112,-15,1175,1222,-21,1101,1098,-28,1084,1126,-26,1089,1122,-185,787,-553,-103,832,638,-76,928,-981,-93,756,456,-105,1617,1162,-64,1728,1207,-60,1719,1212,-155,183,1208,-135,216,1254,-138,150,1157,-102,31,-1377,-97,4,-1303,-78,41,-1398,-63,225,1252,-70,156,1153,-2,11,-1291,-8,45,-1386,-54,844,-884,10,28,-1334,-53,1599,1141,-81,1583,1126,-89,1580,1110,-60,1613,1130,-10,1310,1193,-89,1593,1068,-45,1252,-895,-43,1119,1174,-28,1101,1166,-207,895,367,-23,1323,-851,-33,1297,-864,-32,1332,-1045,-63,1270,-1040,-46,1361,-1169,-80,1271,-1192,-49,1230,-1480,-81,1169,-1506,-44,1156,1185,-23,1144,1179,-88,1473,1164,-66,1601,1136,-93,1656,1176,-106,1665,1169,-87,1596,1083,-78,768,597,-45,192,1201,-67,1428,311,-79,1036,704,-5,1110,1201,-2,1077,1187,-12,1063,1130,-14,1144,1107,-8,1073,1124,-2,1077,1095,-55,1676,1167,-84,1646,1152,-112,1614,1151,-101,1636,1088,-59,1684,1158,-287,725,-718,-276,992,-513,-216,1114,-864,-207,650,-995,-229,705,-1025,-193,760,-1057,-116,798,-1072,-69,706,-1045,-105,646,-983,-97,104,-1313,-16,117,-1313,-7,124,-1353,-26,138,-1378,-80,130,-1379,-96,112,-1362,-121,1580,896,-83,1664,823,-148,568,-1270,-149,550,-1227,-226,568,793,-229,597,828,-218,627,859,-130,587,-1297,-198,510,886,-190,524,906,-190,495,862,-95,203,-1375,-100,206,-1346,-94,200,-1404,-73,539,-1241,-123,623,849,-84,612,-1306,-123,530,901,-126,555,774,-123,491,841,-24,215,-1346,-38,204,-1404,-109,595,822,-116,518,881,-62,561,-1268,-25,219,-1374,-142,271,1080,-91,275,1076,-77,262,1054,-92,248,1029,-142,245,1035,-158,254,1057,-35,1203,1167,-159,787,-505,-64,857,-751,-2,1390,1184,-29,1438,1175,-105,1456,1093,-79,1300,1060,-44,837,-702,-100,787,-478,-94,1339,126,-102,1325,60,-144,728,-258,-176,688,45,-72,1170,682,-194,1146,623,140,1091,645,161,963,665,151,915,738,136,781,1054,131,653,1061,119,348,995,120,207,810,122,262,809,120,324,807,117,373,912,127,674,973,128,727,971,167,726,585,209,806,499,-218,858,442,-183,750,487,-170,548,767,-160,487,844,-117,237,1017,-104,163,1170,-107,198,1221,-104,229,1267,-116,283,1093,-162,536,920,-174,638,871,-163,867,702,-165,942,667,-138,1083,673,163,804,-739,169,755,-804,137,542,-1009,60,135,-876,47,108,-829,27,20,-778,15,27,-733,20,33,-660,40,115,-729,56,196,-807,125,536,-908,184,589,-717,241,703,-402,-159,930,-1002,-154,793,-1070,-115,609,-1306,-66,190,-1417,-57,140,-1384,-46,37,-1377,-37,22,-1334,-48,-3,-1265,-59,102,-1291,-65,205,-1326,-109,545,-1216,-161,628,-980,-221,701,-683,169,320,877,148,353,911,119,361,923,89,356,911,65,318,877,89,287,895,119,274,906,148,286,889,-81,255,1154,-56,229,1134,-84,235,1085,-114,230,1071,-143,231,1091,-160,219,1139,-140,250,1159,-111,264,1163,-43,1251,1155,-4,1267,1202,21,1267,1203,46,1269,1197,77,1255,1144,-32,1349,-915,-42,1304,-944,0,1290,-944,43,1304,-945,34,1349,-915,0,1362,-915,-80,1219,-1359,0,1207,-1349,80,1223,-1362,44,1312,-1376,-3,1356,-1369,-50,1310,-1374,193,607,-959,169,639,-998,167,657,-1018,91,657,-1011,92,624,-988,87,587,-924,146,574,-907,189,582,-919,-69,703,-1267,-145,703,-1278,-147,681,-1259,-171,640,-1224,-167,605,-1187,-123,593,-1174,-64,612,-1187,-70,665,-1249,90,1445,1132,104,1471,1119,104,1462,1090,95,1433,1100,-72,1439,1147,-90,1464,1137,-95,1454,1108,-82,1427,1116,108,1451,1114,-94,1443,1133] },
{ "name": "horse_A_015", "vertices": [0,1342,54,0,1360,122,0,1335,-283,0,1400,-541,0,1089,-958,0,1218,-940,0,1354,-827,0,770,-488,0,724,-253,0,672,21,-6,1616,564,-12,1380,896,0,931,709,0,997,-946,0,901,-854,-2,856,657,-1,768,436,-5,1681,1052,3,1631,1128,-7,1345,910,26,1253,1227,12,1489,1172,3,1282,993,17,1167,1099,31,1195,1259,17,1131,1090,25,1087,1154,20,1171,1134,21,1099,1116,24,1096,1147,0,815,-685,21,1344,1204,30,1105,1215,0,1342,-857,0,1294,-898,0,1381,-1067,1,1275,-1062,0,1432,-1183,1,1286,-1222,-3,1276,-1578,-2,1141,-1635,31,1134,1230,0,1448,289,0,1034,712,-19,1705,812,0,863,-769,17,1416,1189,0,1145,698,-1,792,565,274,976,194,227,1189,9,271,1124,-172,246,966,-379,285,802,-26,145,1238,212,250,1052,471,144,1300,-345,201,1362,-529,277,801,-641,172,1238,527,138,1307,-841,209,785,-256,256,895,470,210,1030,343,258,833,655,232,994,605,222,899,701,105,1486,718,65,1591,593,77,1448,897,104,929,685,147,959,-891,233,818,-738,249,761,623,115,1526,956,48,1659,1084,104,1552,995,35,1629,1126,111,1433,896,107,1516,1092,93,1354,900,71,1214,1111,96,1422,1113,47,1253,1223,49,1491,1166,68,1296,987,54,1175,1101,273,1084,-662,104,1079,-965,83,1173,1120,70,1209,1232,60,1128,1113,72,1113,1140,70,1118,1137,192,787,-469,93,847,649,78,825,-770,83,737,496,111,1629,1140,72,1713,1226,68,1703,1228,172,232,1064,151,189,1101,156,278,1025,82,1,-1010,72,-7,-932,60,7,-1034,79,186,1101,87,278,1024,-21,6,-928,-9,18,-1028,62,790,-659,-32,14,-974,58,1626,1123,84,1612,1103,89,1610,1086,63,1641,1112,50,1342,1197,81,1620,1045,43,1246,-920,93,1153,1182,79,1133,1178,202,847,375,23,1329,-864,33,1304,-878,34,1348,-1063,65,1286,-1061,46,1393,-1196,83,1307,-1226,43,1284,-1515,76,1226,-1547,93,1190,1191,73,1176,1190,108,1507,1146,70,1629,1116,99,1659,1168,111,1671,1163,82,1627,1059,68,782,624,61,232,1062,67,1435,306,79,1048,686,62,1143,1216,59,1109,1205,59,1092,1148,51,1171,1121,53,1101,1142,42,1103,1114,60,1679,1172,88,1658,1144,116,1630,1128,97,1672,1079,63,1689,1166,302,733,-495,282,1054,-441,211,1068,-864,225,631,-787,244,687,-815,206,742,-846,127,777,-860,84,682,-836,123,622,-776,79,86,-965,0,104,-972,-5,102,-1013,15,109,-1039,68,98,-1036,81,84,-1014,86,1595,892,43,1676,815,161,544,-1038,160,539,-995,185,737,960,189,768,986,178,797,1008,146,557,-1070,165,680,1031,156,687,1055,157,671,1004,88,168,-1046,91,179,-1019,87,158,-1073,84,529,-1007,83,792,1001,102,582,-1087,89,687,1052,84,724,948,90,665,984,16,192,-1025,31,166,-1078,69,765,982,82,680,1030,75,543,-1038,19,189,-1054,141,389,1150,90,388,1148,76,385,1124,91,379,1098,142,380,1102,158,385,1125,77,1235,1173,162,783,-482,67,847,-697,33,1421,1185,55,1469,1169,112,1487,1073,94,1327,1055,45,833,-677,101,786,-489,94,1346,121,102,1329,60,143,755,-250,171,706,27,73,1177,672,197,1147,591,-273,1019,200,-227,1189,9,-269,1104,-197,-239,937,-577,-285,802,-26,-144,1259,230,-247,1099,517,-142,1268,-347,-201,1348,-525,-274,904,-941,-171,1241,555,-139,1314,-849,-205,765,-313,-256,984,436,-205,1131,389,-265,856,520,-232,991,609,-228,868,604,-125,1484,711,-79,1590,588,-107,1446,895,-107,892,656,-155,1054,-995,-235,976,-1023,-256,812,459,-131,1517,980,-51,1655,1094,-114,1544,1016,-27,1627,1132,-131,1424,920,-97,1508,1111,-107,1347,919,-36,1210,1121,-75,1416,1129,5,1251,1227,-24,1488,1173,-62,1291,1000,-19,1172,1108,-275,1108,-718,-108,1146,-961,-43,1169,1132,-12,1206,1240,-18,1126,1121,-25,1109,1149,-23,1115,1145,-188,813,-606,-97,839,578,-82,1007,-1053,-87,781,407,-103,1640,1155,-61,1751,1200,-57,1742,1205,-120,83,936,-101,108,987,-103,62,879,-139,202,-1684,-132,127,-1660,-116,225,-1691,-29,119,986,-35,71,876,-36,124,-1654,-46,220,-1685,-60,914,-967,-24,168,-1668,-51,1624,1134,-79,1607,1119,-87,1604,1104,-59,1638,1122,-8,1340,1203,-87,1614,1061,-45,1262,-907,-40,1148,1195,-25,1129,1188,-202,928,337,-23,1329,-864,-33,1304,-878,-32,1348,-1063,-63,1285,-1060,-46,1392,-1195,-81,1304,-1224,-49,1282,-1514,-81,1224,-1545,-41,1185,1204,-20,1173,1199,-87,1500,1165,-64,1626,1129,-91,1679,1169,-104,1688,1162,-86,1619,1076,-72,780,542,-11,98,930,-67,1435,306,-79,1031,699,-2,1140,1222,0,1107,1210,-9,1089,1154,-12,1168,1127,-4,1099,1148,0,1101,1118,-53,1700,1160,-82,1669,1145,-110,1637,1144,-100,1660,1081,-58,1707,1152,-293,786,-808,-277,1011,-573,-217,1143,-886,-214,713,-1077,-236,768,-1108,-199,823,-1140,-122,860,-1155,-75,768,-1128,-112,709,-1065,-127,197,-1588,-47,206,-1583,-40,242,-1603,-59,270,-1606,-113,266,-1609,-129,240,-1611,-119,1592,892,-82,1673,817,-159,638,-1368,-159,611,-1327,-207,565,672,-210,584,713,-200,605,749,-140,663,-1390,-176,484,739,-168,489,763,-169,479,711,-125,302,-1548,-129,297,-1520,-125,310,-1574,-85,601,-1347,-105,607,740,-93,687,-1395,-101,498,759,-107,561,652,-102,484,689,-53,302,-1520,-68,314,-1575,-91,588,707,-95,495,736,-73,628,-1369,-54,315,-1545,-110,192,827,-60,199,824,-46,194,799,-61,190,770,-112,184,776,-127,183,800,-32,1231,1183,-160,797,-542,-66,880,-794,0,1419,1189,-27,1466,1177,-103,1479,1094,-77,1321,1071,-45,851,-738,-100,788,-506,-94,1346,121,-102,1329,60,-142,743,-272,-171,706,27,-73,1174,679,-196,1141,631,140,1091,643,161,954,655,151,897,715,134,808,1017,128,691,1072,115,395,1168,120,175,1111,123,217,1076,121,264,1036,116,374,1083,127,665,985,128,717,941,166,717,564,209,797,480,-211,887,389,-173,776,412,-150,555,643,-139,479,691,-87,184,755,-69,74,894,-72,97,951,-70,119,1002,-85,198,843,-139,495,780,-156,614,764,-157,851,629,-163,928,635,-139,1073,673,160,821,-792,166,773,-858,133,577,-1085,59,147,-1086,46,108,-1044,27,10,-1015,15,6,-970,21,-4,-897,40,91,-945,55,185,-1002,121,539,-987,179,607,-773,237,715,-456,-165,1012,-1073,-160,855,-1153,-125,685,-1395,-97,310,-1590,-91,276,-1606,-83,207,-1683,-73,164,-1669,-81,94,-1647,-88,179,-1579,-93,288,-1504,-120,603,-1318,-168,692,-1062,-227,759,-775,168,305,1094,147,352,1098,117,366,1101,88,354,1095,64,303,1092,87,289,1126,117,284,1141,147,287,1124,-49,167,897,-24,147,872,-52,162,825,-82,158,809,-111,155,830,-127,133,875,-108,160,901,-80,173,911,-41,1278,1168,-1,1298,1214,23,1297,1215,48,1299,1209,80,1282,1156,-32,1359,-929,-42,1314,-960,0,1300,-960,43,1315,-960,34,1359,-929,0,1371,-929,-81,1262,-1395,0,1249,-1385,79,1265,-1397,44,1356,-1403,-3,1399,-1393,-49,1354,-1402,189,625,-1015,164,663,-1052,162,684,-1071,87,684,-1063,88,647,-1043,82,601,-979,141,584,-964,184,594,-977,-75,765,-1347,-150,767,-1357,-153,744,-1339,-177,701,-1306,-174,663,-1272,-130,649,-1259,-71,668,-1272,-76,725,-1330,92,1471,1134,105,1496,1119,106,1485,1090,97,1457,1102,-70,1465,1149,-88,1489,1138,-94,1478,1110,-80,1451,1119,110,1476,1115,-92,1468,1135] }
],
"morphColors": [
{ "name": "horse_colorMap", "colors": [0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.240,0.120,0.090,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.750,0.570,0.420,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.750,0.570,0.420,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.750,0.570,0.420,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.220,0.110,0.090,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.350,0.160,0.100,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.360,0.220,0.210,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.750,0.570,0.420,0.240,0.120,0.090,0.750,0.570,0.420,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.240,0.120,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.750,0.570,0.420,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.350,0.160,0.100,0.350,0.160,0.100,0.650,0.360,0.220,0.650,0.360,0.220,0.220,0.110,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.220,0.110,0.090,0.220,0.110,0.090,0.220,0.110,0.090,0.220,0.110,0.090,0.220,0.110,0.090,0.220,0.110,0.090,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220,0.650,0.360,0.220] }
],
"normals": [],
"colors": [],
"uvs": [[0.448620,0.529399,0.416272,0.497377,0.336939,0.484467,0.353083,0.543663,0.412052,0.590391,0.317679,0.592247,0.321725,0.532901,0.294803,0.573531,0.528703,0.493874,0.517961,0.541268,0.287719,0.460762,0.391785,0.432560,0.252392,0.457865,0.274426,0.519441,0.577758,0.555090,0.631081,0.525947,0.239532,0.460301,0.244234,0.517700,0.909079,0.311955,0.881905,0.307722,0.491907,0.578810,0.518764,0.585592,0.568992,0.627229,0.614655,0.631727,0.629909,0.617449,0.647716,0.593320,0.593608,0.442145,0.083679,0.217254,0.157074,0.275340,0.180338,0.200676,0.116178,0.150781,0.755107,0.105826,0.776456,0.108499,0.806134,0.116032,0.219545,0.564538,0.259562,0.564962,0.839270,0.313162,0.683083,0.562401,0.755016,0.212912,0.768605,0.214509,0.856595,0.448744,0.863080,0.449751,0.853753,0.377497,0.829794,0.379881,0.662924,0.653966,0.644562,0.675804,0.191061,0.095103,0.157435,0.061005,0.100212,0.080212,0.228324,0.102289,0.213134,0.073691,0.207633,0.042607,0.313178,0.136170,0.268864,0.129625,0.272717,0.160418,0.291926,0.160894,0.236716,0.203528,0.240792,0.158661,0.290159,0.095923,0.329056,0.128973,0.304291,0.086711,0.274767,0.204309,0.300841,0.190356,0.239891,0.079419,0.239277,0.076692,0.498842,0.449753,0.271535,0.420346,0.253660,0.423588,0.220900,0.438695,0.363919,0.604435,0.345705,0.664995,0.402715,0.653643,0.213601,0.325620,0.246160,0.266939,0.186881,0.508599,0.178806,0.556069,0.204865,0.549716,0.212216,0.508022,0.183835,0.580529,0.200311,0.568395,0.657784,0.689384,0.680358,0.664843,0.503354,0.671921,0.142700,0.023015,0.067275,0.040797,0.253846,0.038787,0.257187,0.013533,0.205939,0.006708,0.267961,0.247575,0.346092,0.119764,0.321232,0.078470,0.293134,0.227031,0.314633,0.207931,0.286943,0.062124,0.304841,0.050293,0.207747,0.484584,0.326770,0.143301,0.332008,0.148408,0.345432,0.150362,0.343181,0.136009,0.311369,0.166823,0.320043,0.180461,0.356980,0.152072,0.353631,0.132660,0.330518,0.192926,0.336440,0.153512,0.340285,0.157448,0.351643,0.163322,0.847264,0.062608,0.882816,0.054963,0.815980,0.306398,0.792789,0.308508,0.126016,0.372202,0.741446,0.213386,0.871790,0.450617,0.824355,0.377986,0.811315,0.377671,0.726031,0.111187,0.899376,0.196896,0.914374,0.196797,0.916020,0.063441,0.944843,0.073250,0.764570,0.307954,0.795555,0.377061,0.235306,0.085310,0.232653,0.076789,0.247165,0.105246,0.244592,0.084865,0.273795,0.082085,0.251799,0.077947,0.254435,0.068048,0.579812,0.681733,0.502411,0.691818,0.581707,0.696312,0.204052,0.601822,0.188050,0.611262,0.212543,0.656931,0.220374,0.636205,0.332590,0.163875,0.316360,0.167934,0.319999,0.168952,0.337409,0.171224,0.326506,0.182207,0.333347,0.184798,0.326082,0.173864,0.331226,0.169778,0.780124,0.214561,0.775712,0.238360,0.790837,0.238330,0.759075,0.237832,0.854267,0.471589,0.865949,0.474456,0.843297,0.447300,0.839248,0.469354,0.882496,0.195799,0.864834,0.194489,0.853265,0.223612,0.873834,0.229854,0.172056,0.399007,0.741083,0.239048,0.878960,0.471705,0.804374,0.449801,0.795275,0.448443,0.792550,0.473850,0.807206,0.475517,0.386821,0.415024,0.388824,0.697340,0.892459,0.227099,0.910105,0.224998,0.785683,0.448328,0.779285,0.471824,0.300359,0.617958,0.279467,0.658239,0.713677,0.303104,0.771809,0.447735,0.759398,0.469865,0.149334,0.714967,0.101030,0.715346,0.112709,0.741649,0.140764,0.741363,0.019361,0.683787,0.008075,0.715908,0.019397,0.739997,0.049952,0.739976,0.069902,0.721874,0.243698,0.078814,0.238276,0.079154,0.236435,0.075945,0.240871,0.074567,0.224019,0.122967,0.054063,0.446416,0.053310,0.442271,0.050633,0.437415,0.052359,0.452293,0.331553,0.156146,0.325437,0.154252,0.328037,0.160953,0.344872,0.168499,0.335807,0.160145,0.515975,0.630650,0.198455,0.463542,0.197107,0.473974,0.197428,0.459486,0.190080,0.489251,0.193914,0.479398,0.274903,0.692300,0.330594,0.688092,0.159409,0.469525,0.161350,0.460397,0.122364,0.459425,0.122678,0.463511,0.161571,0.454003,0.123048,0.453028,0.157336,0.478246,0.121809,0.471155,0.239701,0.075696,0.236803,0.067189,0.239474,0.074078,0.510421,0.408256,0.140199,0.685877,0.112139,0.685732,0.030193,0.102811,0.675476,0.616115,0.699849,0.632259,0.587899,0.403711,0.014499,0.055576,0.323645,0.174652,0.238975,0.076435,0.239347,0.075534,0.937149,0.318413,0.842241,0.090448,0.794728,0.069773,0.758361,0.005070,0.737921,0.053037,0.704185,0.081500,0.982352,0.053080,0.918260,0.033651,0.869065,0.008364,0.817747,0.015248,0.970268,0.279984,0.938952,0.264731,0.891325,0.272093,0.837155,0.291223,0.820828,0.283650,0.792036,0.285922,0.774985,0.287144,0.664395,0.283391,0.874761,0.380440,0.762675,0.376930,0.886450,0.386978,0.884339,0.493419,0.868847,0.496801,0.773430,0.494287,0.749914,0.492433,0.788595,0.494306,0.805248,0.496526,0.852193,0.493125,0.838839,0.488594,0.865297,0.268014,0.839696,0.259737,0.888877,0.265003,0.911201,0.260512,0.762025,0.266882,0.739847,0.267853,0.781403,0.268411,0.801923,0.268072,0.201695,0.581882,0.331561,0.821659,0.363908,0.789637,0.443242,0.776727,0.427098,0.835923,0.368129,0.882651,0.462502,0.884506,0.458456,0.825161,0.485378,0.865791,0.492462,0.753022,0.388396,0.724819,0.527789,0.750125,0.505755,0.811701,0.202423,0.847349,0.149100,0.818207,0.251478,0.786134,0.262220,0.833528,0.540649,0.752561,0.535947,0.809960,0.776289,0.875849,0.741961,0.807367,0.769134,0.803133,0.797288,0.872911,0.288274,0.871069,0.261417,0.877852,0.211189,0.919489,0.165526,0.923986,0.150272,0.909709,0.132465,0.885580,0.186573,0.734405,0.632824,0.217254,0.559428,0.275340,0.536165,0.200676,0.600325,0.150781,0.935289,0.545225,0.918101,0.598006,0.896757,0.600679,0.878490,0.561956,0.914849,0.497255,0.867085,0.608214,0.830967,0.582627,0.560636,0.856798,0.520619,0.857222,0.811775,0.808572,0.821250,0.875292,0.918196,0.705088,0.904602,0.706686,0.794442,0.944152,0.787969,0.945167,0.117257,0.946226,0.135619,0.968064,0.525441,0.095103,0.559068,0.061005,0.616291,0.080212,0.403325,0.136170,0.447639,0.129625,0.443786,0.160418,0.424576,0.160894,0.479786,0.203528,0.475710,0.158661,0.426343,0.095923,0.387447,0.128973,0.412212,0.086711,0.441735,0.204309,0.415662,0.190356,0.281339,0.742013,0.508646,0.712606,0.526521,0.715848,0.559281,0.730954,0.416263,0.896695,0.434476,0.957255,0.377466,0.945903,0.502901,0.325620,0.470343,0.266939,0.593300,0.800859,0.601375,0.848329,0.575316,0.841976,0.567965,0.800281,0.122397,0.981644,0.099822,0.957103,0.276827,0.964181,0.573802,0.023015,0.649228,0.040797,0.508870,0.042607,0.462656,0.038787,0.459315,0.013533,0.510564,0.006708,0.448542,0.247575,0.370410,0.119764,0.395271,0.078470,0.423368,0.227031,0.401869,0.207931,0.429560,0.062124,0.411662,0.050293,0.572434,0.776844,0.389732,0.143301,0.384494,0.148408,0.371071,0.150362,0.373321,0.136009,0.405133,0.166823,0.396459,0.180461,0.359523,0.152072,0.362871,0.132660,0.385985,0.192926,0.380062,0.153512,0.376218,0.157448,0.364859,0.163322,0.849327,0.516025,0.819845,0.563383,0.784244,0.555709,0.797979,0.509115,0.835063,0.801809,0.858255,0.803919,0.839728,0.873082,0.826688,0.873397,0.931768,0.705562,0.779251,0.946026,0.764590,0.882392,0.969009,0.573688,0.947161,0.603363,0.767695,0.697676,0.752700,0.697573,0.748830,0.534424,0.751026,0.564203,0.722240,0.574027,0.684726,0.553849,0.886473,0.803365,0.855488,0.872472,0.503369,0.073691,0.488179,0.102289,0.481197,0.085310,0.483849,0.076789,0.471910,0.084865,0.469338,0.105246,0.442707,0.082085,0.464704,0.077947,0.479699,0.067189,0.462068,0.068048,0.200369,0.973993,0.277770,0.984078,0.198474,0.988572,0.576129,0.894082,0.592130,0.903522,0.567638,0.949191,0.559807,0.928465,0.383913,0.163875,0.400142,0.167934,0.396503,0.168952,0.379094,0.171224,0.389997,0.182207,0.383155,0.184798,0.390421,0.173864,0.385277,0.169778,0.893083,0.706738,0.897494,0.730541,0.882366,0.730510,0.914135,0.730012,0.796777,0.967000,0.785096,0.969866,0.807749,0.942713,0.811794,0.964766,0.784577,0.696573,0.802237,0.695267,0.813800,0.724386,0.793238,0.730628,0.932131,0.731231,0.772084,0.967117,0.846669,0.945212,0.855768,0.943854,0.858493,0.969261,0.843837,0.970929,0.774615,0.727869,0.756972,0.725774,0.865361,0.943739,0.871758,0.967235,0.479822,0.910218,0.500714,0.950499,0.937366,0.798515,0.888369,0.872341,0.879235,0.943146,0.891646,0.965276,0.148932,0.645423,0.100628,0.644944,0.112362,0.618666,0.140417,0.619010,0.021276,0.621508,0.051811,0.620398,0.064275,0.652082,0.053851,0.676572,0.023316,0.677680,0.002710,0.660326,0.472805,0.078814,0.476612,0.079419,0.478227,0.079154,0.480068,0.075945,0.477029,0.074078,0.475632,0.074567,0.492484,0.122967,0.726118,0.738676,0.726871,0.734531,0.729548,0.729675,0.727822,0.744552,0.384949,0.156146,0.391065,0.154252,0.388466,0.160953,0.371630,0.168499,0.380695,0.160145,0.264206,0.922910,0.581726,0.755802,0.583074,0.766234,0.582753,0.751746,0.590101,0.781510,0.586266,0.771658,0.618831,0.752657,0.620772,0.761785,0.618610,0.746263,0.622845,0.770506,0.505278,0.984560,0.449587,0.980351,0.657817,0.751685,0.657503,0.755771,0.657133,0.745288,0.658372,0.763415,0.477225,0.076692,0.476802,0.075696,0.477155,0.075534,0.477527,0.076435,0.139736,0.674495,0.111676,0.674581,0.686309,0.102811,0.104705,0.908375,0.080332,0.924519,0.392857,0.174652,0.713897,0.813824,0.680775,0.775394,0.712090,0.760142,0.759721,0.767504,0.813891,0.786633,0.830216,0.779061,0.859008,0.781333,0.876058,0.782556,0.766705,0.988829,0.782198,0.992212,0.877613,0.989698,0.901129,0.987844,0.862448,0.989717,0.845795,0.991937,0.798849,0.988537,0.812205,0.984003,0.801772,0.768776,0.827368,0.760502,0.778196,0.765767,0.755877,0.761277,0.911186,0.759067,0.933366,0.760037,0.891804,0.760597,0.871280,0.760257,0.578486,0.874142,0.596346,0.872789,0.702004,0.055576,0.192282,0.695970,0.269760,0.700516,0.393361,0.707284,0.391357,0.989600,0.590487,0.372202,0.544447,0.399007,0.097098,0.854661,0.579870,0.860655,0.661596,0.604718,0.646417,0.635707,0.843406,0.011806,0.629609,0.653765,0.865040,0.058786,0.873665,0.195144,0.863549,0.226733,0.126169,0.685805,0.852497,0.263875,0.125182,0.715157,0.750936,0.267368,0.126736,0.741506,0.750079,0.238440,0.748231,0.213149,0.740569,0.108507,0.509664,0.651286,0.721053,0.067269,0.505335,0.582201,0.274846,0.874461,0.952149,0.559456,0.270517,0.943546,0.932631,0.600684,0.924982,0.705325,0.923133,0.730622,0.126390,0.618838,0.922276,0.759552,0.124780,0.645184,0.814570,0.764639,0.125706,0.674538,0.803519,0.727507,0.793407,0.695920,0.802045,0.559546,0.150572,0.946025,0.823653,0.512570,0.133764,0.927967,0.118585,0.896978,0.209928,0.566467,0.806432,0.284786,0.804384,0.307453,0.817835,0.377828,0.799824,0.449122,0.799878,0.474684,0.796922,0.495416,0.034675,0.739987,0.038989,0.718891,0.034638,0.683777,0.876593,0.495110,0.872454,0.473081,0.867435,0.450184,0.880606,0.383709,0.923114,0.315184,0.954610,0.272358,0.306241,0.582889,0.844612,0.780197,0.570253,0.858727,0.846659,0.802864,0.833208,0.873240,0.851219,0.944533,0.851165,0.970095,0.038583,0.677126,0.854121,0.990827,0.033493,0.656204,0.774451,0.990521,0.036544,0.620953,0.778590,0.968492,0.783610,0.945597,0.770439,0.879120,0.727929,0.810595,0.473940,0.875149,0.696433,0.767768,0.777419,0.247376,0.759960,0.246547,0.750336,0.247118,0.910434,0.235652,0.740712,0.247690,0.891384,0.238470,0.871273,0.241302,0.860234,0.237876,0.794163,0.247252,0.849194,0.234449,0.795798,0.742072,0.775689,0.739238,0.932501,0.739873,0.756643,0.736425,0.922876,0.739301,0.913250,0.738729,0.895787,0.739558,0.817870,0.735221,0.879040,0.739434,0.806834,0.738647,0.396948,0.139515,0.381343,0.132013,0.367146,0.125348,0.349357,0.125348,0.335192,0.132030,0.319974,0.139736,0.599092,0.754330,0.600718,0.764152,0.176794,0.478859,0.603387,0.771119,0.179463,0.471892,0.181089,0.462070,0.599536,0.749180,0.180645,0.456920,0.693768,0.746736,0.085103,0.461186,0.695078,0.753446,0.086413,0.454476,0.085867,0.450359,0.695406,0.737036,0.084775,0.444777,0.694314,0.742619,0.856568,0.370520,0.823517,0.370827,0.830741,0.373209,0.816490,0.370791,0.809463,0.370754,0.792457,0.370150,0.757775,0.369548,0.891520,0.380121,0.884856,0.376856,0.878193,0.373592,0.841581,0.866166,0.834553,0.866202,0.820302,0.868620,0.827525,0.866238,0.794472,0.865933,0.772856,0.869001,0.766188,0.872268,0.759520,0.875535,0.893268,0.864958,0.858587,0.865562,0.282067,0.103295,0.255306,0.106892,0.271687,0.119154,0.283597,0.116927,0.436355,0.105044,0.462701,0.106588,0.445289,0.120910,0.432792,0.117001,0.275065,0.111499,0.444929,0.111304]],
"faces": [10,53,51,49,0,4,2,0,10,49,51,50,0,0,2,1,10,52,94,421,0,3,5,586,10,50,51,210,0,1,2,11,10,210,51,56,0,11,2,10,10,56,154,57,0,10,6,12,10,57,154,87,0,12,6,13,10,55,63,59,0,14,9,15,10,59,63,54,0,15,9,8,10,155,60,87,0,17,16,13,10,87,60,57,0,13,16,12,10,468,157,475,0,646,19,655,10,475,157,156,0,655,19,18,10,63,62,122,0,9,21,20,10,122,62,394,0,20,21,551,10,63,55,62,0,9,14,21,10,62,55,64,0,21,14,22,10,55,65,64,0,14,24,22,10,64,65,66,0,22,24,23,10,59,214,55,0,15,25,14,10,55,214,65,0,14,25,24,10,59,54,140,0,15,8,26,10,59,67,213,0,27,30,28,10,213,67,69,0,28,30,29,10,73,62,64,0,233,232,231,10,66,174,64,0,230,33,231,10,64,174,173,0,231,33,32,10,87,58,155,0,13,35,17,10,155,58,72,0,17,35,34,10,157,468,158,0,19,646,36,10,158,468,469,0,36,646,648,10,172,173,178,0,31,32,38,10,178,173,176,0,38,32,39,10,179,170,180,0,40,42,41,10,180,170,171,0,41,42,247,10,383,66,382,0,537,23,535,10,382,66,65,0,535,23,24,10,68,169,67,0,48,47,30,10,67,169,168,0,30,47,46,10,80,69,78,0,56,29,57,10,86,85,81,0,62,61,55,10,81,85,206,0,55,61,54,10,154,153,87,0,6,7,13,10,87,153,58,0,13,7,35,10,50,210,54,0,1,11,8,10,54,210,209,0,8,11,65,10,57,3,56,0,12,67,10,10,56,3,2,0,10,67,66,10,140,54,209,0,26,8,65,10,3,57,6,0,67,12,68,10,6,57,60,0,68,12,16,10,61,53,211,0,69,4,70,10,211,53,212,0,70,4,71,10,69,11,213,0,29,73,28,10,213,11,47,0,28,73,72,10,4,88,13,0,74,77,75,10,13,88,71,0,75,77,76,10,12,15,70,0,81,80,44,10,70,15,95,0,44,80,45,10,53,97,212,0,4,82,71,10,10,44,68,0,84,83,48,10,68,44,169,0,48,83,47,10,17,18,75,0,87,86,51,10,75,18,77,0,51,86,85,10,19,11,80,0,88,73,56,10,80,11,69,0,56,73,29,10,31,117,203,0,89,59,60,10,203,117,204,0,60,59,58,10,22,19,85,0,91,88,61,10,85,19,80,0,61,88,56,10,23,22,86,0,92,91,62,10,86,22,85,0,62,91,61,10,18,21,77,0,86,94,85,10,77,21,84,0,85,94,93,10,60,155,119,0,16,17,95,10,119,155,88,0,95,17,77,10,83,90,200,0,99,98,96,10,200,90,131,0,96,98,97,10,91,86,89,0,101,62,100,10,89,86,81,0,100,62,55,10,83,20,90,0,99,103,98,10,90,20,24,0,98,103,102,10,91,25,86,0,101,104,62,10,86,25,23,0,62,104,92,10,90,132,131,0,98,105,97,10,90,24,142,0,98,102,106,10,142,24,41,0,106,102,107,10,66,383,174,0,238,536,108,10,174,383,384,0,108,536,538,10,410,470,159,0,572,649,111,10,159,470,471,0,111,649,650,10,391,392,178,0,547,548,38,10,178,392,172,0,38,548,31,10,419,182,418,0,583,249,582,10,418,182,188,0,582,249,114,10,73,172,393,0,233,31,550,10,393,172,392,0,550,31,548,10,191,190,187,0,118,120,119,10,187,190,186,0,119,120,121,10,97,186,138,0,235,121,236,10,138,186,190,0,236,121,120,10,159,471,160,0,111,650,122,10,160,471,472,0,122,650,651,10,76,118,115,0,49,50,124,10,118,137,115,0,50,125,124,10,114,79,115,0,127,126,124,10,115,79,76,0,124,126,49,10,79,114,133,0,126,127,128,10,133,114,134,0,128,127,129,10,75,77,116,0,51,85,216,10,116,77,113,0,216,85,130,10,48,16,138,0,133,132,131,10,138,16,97,0,131,132,82,10,202,207,45,0,134,137,135,10,45,207,30,0,135,137,136,10,26,27,144,0,141,140,138,10,144,27,145,0,138,140,139,10,28,25,147,0,143,104,142,10,147,25,91,0,142,104,101,10,145,27,146,0,139,140,144,10,146,27,29,0,144,140,145,10,146,29,147,0,144,145,142,10,147,29,28,0,142,145,143,10,194,199,177,0,148,147,146,10,177,199,176,0,146,147,39,10,199,198,176,0,147,149,39,10,176,198,178,0,39,149,38,10,162,167,180,0,151,150,41,10,180,167,179,0,41,150,40,10,167,166,179,0,150,153,40,10,179,166,181,0,40,153,152,10,386,194,385,0,540,156,539,10,385,194,177,0,539,156,155,10,178,198,391,0,38,149,547,10,391,198,390,0,547,149,546,10,188,163,418,0,114,160,582,10,418,163,417,0,582,160,581,10,413,165,412,0,575,163,574,10,412,165,189,0,574,163,162,10,187,197,191,0,119,168,118,10,191,197,196,0,118,168,167,10,165,164,189,0,163,170,162,10,189,164,193,0,162,170,169,10,208,207,201,0,172,137,171,10,201,207,202,0,171,137,134,10,472,473,160,0,651,652,122,10,160,473,161,0,122,652,173,10,192,193,182,0,123,169,248,10,182,193,188,0,248,169,174,10,193,164,188,0,169,170,174,10,188,164,163,0,174,170,175,10,82,205,487,0,52,53,669,10,487,205,486,0,669,53,668,10,53,122,97,0,4,20,82,10,388,389,101,0,543,545,177,10,101,389,103,0,177,545,178,10,114,98,134,0,127,63,129,10,134,98,149,0,129,63,185,10,115,150,114,0,124,186,127,10,114,150,98,0,127,186,63,10,137,151,115,0,125,187,124,10,115,151,150,0,124,187,186,10,152,116,148,0,217,216,188,10,148,116,113,0,188,216,130,10,453,454,31,0,627,628,89,10,31,454,117,0,89,628,59,10,67,168,69,0,30,46,29,10,69,168,74,0,29,46,189,10,40,39,130,0,193,192,190,10,130,39,129,0,190,192,191,10,121,92,120,0,194,196,195,10,120,92,89,0,195,196,100,10,32,26,143,0,197,141,198,10,143,26,144,0,198,141,138,10,393,394,73,0,549,551,199,10,73,394,62,0,199,551,21,10,119,124,60,0,95,201,16,10,124,123,60,0,201,200,16,10,60,123,6,0,16,200,68,10,6,123,33,0,68,200,202,10,5,34,119,0,203,204,95,10,119,34,124,0,95,204,201,10,459,460,124,0,634,635,201,10,124,460,123,0,201,635,200,10,460,461,123,0,635,637,200,10,123,461,33,0,200,637,202,10,458,459,34,0,632,634,204,10,34,459,124,0,204,634,201,10,211,8,208,0,70,206,172,10,208,8,7,0,172,206,205,10,53,61,52,0,4,69,3,10,52,61,94,0,3,69,5,10,51,52,56,0,2,3,10,10,56,52,154,0,10,3,6,10,128,127,126,0,210,209,207,10,126,127,125,0,207,209,208,10,127,37,125,0,209,212,208,10,125,37,35,0,208,212,211,10,36,38,126,0,213,214,207,10,126,38,128,0,207,214,210,10,464,465,128,0,641,642,210,10,128,465,127,0,210,642,209,10,465,466,127,0,642,644,209,10,127,466,37,0,209,644,212,10,464,128,463,0,641,210,639,10,463,128,38,0,639,210,214,10,120,89,131,0,195,100,97,10,131,89,200,0,97,100,96,10,121,120,132,0,194,195,105,10,132,120,131,0,105,195,97,10,32,143,41,0,197,198,107,10,41,143,142,0,107,198,106,10,134,113,133,0,129,130,128,10,133,113,84,0,128,130,93,10,148,113,149,0,188,130,185,10,149,113,134,0,185,130,129,10,135,136,100,0,64,227,215,10,100,136,99,0,215,227,228,10,152,151,116,0,217,187,216,10,116,151,137,0,216,187,125,10,116,137,75,0,216,125,51,10,75,137,118,0,51,125,50,10,15,48,95,0,80,133,45,10,95,48,138,0,45,133,131,10,95,138,183,0,237,236,109,10,183,138,190,0,109,236,120,10,195,185,196,0,157,154,167,10,196,185,191,0,167,154,118,10,117,82,484,0,59,52,666,10,484,82,487,0,666,52,669,10,387,388,102,0,541,543,220,10,102,388,101,0,220,543,177,10,176,173,177,0,39,32,146,10,177,173,174,0,146,32,33,10,174,384,177,0,108,538,155,10,177,384,385,0,155,538,539,10,183,190,185,0,109,120,154,10,185,190,191,0,154,120,118,10,59,140,67,0,27,221,30,10,67,140,68,0,30,221,48,10,43,12,141,0,223,81,222,10,141,12,70,0,222,81,44,10,193,192,189,0,169,123,162,10,189,192,184,0,162,123,116,10,184,411,189,0,116,573,162,10,189,411,412,0,162,573,574,10,170,179,175,0,42,40,43,10,175,179,181,0,43,40,152,10,63,49,54,0,9,0,8,10,54,49,50,0,8,0,1,10,53,49,122,0,4,0,20,10,122,49,63,0,20,0,9,10,90,142,132,0,98,106,105,10,143,121,142,0,198,194,106,10,142,121,132,0,106,194,105,10,92,121,144,0,196,194,138,10,144,121,143,0,138,194,198,10,144,145,92,0,138,139,196,10,92,145,89,0,196,139,100,10,89,145,93,0,100,139,226,10,93,145,146,0,226,139,144,10,146,147,93,0,144,142,226,10,93,147,91,0,226,142,101,10,89,93,91,0,100,226,101,10,135,100,149,0,64,215,185,10,98,135,149,0,63,64,185,10,150,136,98,0,186,227,63,10,98,136,135,0,63,227,64,10,99,136,151,0,228,227,187,10,473,474,161,0,653,654,229,10,161,474,420,0,229,654,584,10,88,155,71,0,77,17,76,10,71,155,72,0,76,17,34,10,94,161,421,0,239,229,585,10,421,161,420,0,585,229,584,10,153,156,58,0,240,18,241,10,58,156,157,0,241,18,19,10,58,157,72,0,241,19,242,10,72,157,158,0,242,19,36,10,96,409,159,0,244,571,111,10,159,409,410,0,111,571,572,10,160,111,159,0,122,245,111,10,159,111,96,0,111,245,244,10,94,111,161,0,246,245,173,10,161,111,160,0,173,245,122,10,416,417,109,0,580,581,250,10,109,417,163,0,250,581,160,10,112,415,109,0,184,578,253,10,109,415,416,0,253,578,579,10,112,164,110,0,252,170,254,10,110,164,165,0,254,170,163,10,414,110,413,0,576,254,575,10,413,110,165,0,575,254,163,10,104,106,167,0,256,257,150,10,167,106,166,0,150,257,153,10,105,104,162,0,251,256,151,10,162,104,167,0,151,256,150,10,4,5,88,0,74,203,77,10,88,5,119,0,77,203,95,10,74,168,76,0,189,46,49,10,76,168,118,0,49,46,50,10,169,75,168,0,47,51,46,10,168,75,118,0,46,51,50,10,44,17,169,0,83,87,47,10,169,17,75,0,47,87,51,10,441,442,386,0,611,613,540,10,386,442,194,0,540,613,156,10,440,195,439,0,610,157,609,10,439,195,196,0,609,157,167,10,439,196,438,0,609,167,607,10,438,196,197,0,607,167,168,10,436,437,198,0,605,606,149,10,198,437,390,0,149,606,546,10,435,436,199,0,604,605,147,10,199,436,198,0,147,605,149,10,442,435,194,0,612,604,148,10,194,435,199,0,148,604,147,10,148,100,152,0,188,215,217,10,152,100,99,0,217,215,228,10,82,117,455,0,52,59,629,10,455,117,454,0,629,59,628,10,82,455,206,0,52,629,54,10,206,455,81,0,54,629,55,10,94,61,201,0,5,69,171,10,201,61,211,0,171,69,70,10,111,94,202,0,266,5,134,10,94,201,202,0,5,171,134,10,202,45,111,0,134,135,266,10,111,45,14,0,266,135,78,10,69,74,78,0,29,189,57,10,84,21,203,0,93,94,60,10,203,21,46,0,60,94,90,10,133,84,204,0,128,93,58,10,204,84,203,0,58,93,60,10,133,204,484,0,128,58,666,10,79,205,76,0,126,53,49,10,206,78,205,0,54,57,53,10,205,78,74,0,53,57,189,10,85,80,206,0,61,56,54,10,206,80,78,0,54,56,57,10,7,30,208,0,205,136,172,10,208,30,207,0,172,136,137,10,42,10,140,0,225,84,221,10,140,10,68,0,221,84,48,10,42,140,1,0,224,26,218,10,1,140,209,0,218,26,65,10,210,0,209,0,11,165,65,10,209,0,1,0,65,165,218,10,56,2,210,0,10,66,11,10,210,2,0,0,11,66,165,10,212,9,211,0,71,166,70,10,211,9,8,0,70,166,206,10,16,9,97,0,132,166,82,10,97,9,212,0,82,166,71,10,201,211,208,0,171,70,172,10,382,65,381,0,535,24,534,10,381,65,214,0,534,24,25,10,43,141,47,0,158,112,72,10,47,141,213,0,72,112,28,10,381,213,141,0,534,37,222,10,136,150,151,0,227,186,187,10,152,99,151,0,217,228,187,10,100,148,149,0,215,188,185,10,13,96,14,0,75,79,78,10,14,96,111,0,78,79,266,10,72,409,71,0,34,570,76,10,77,84,113,0,85,93,130,10,217,218,219,0,269,270,271,10,320,319,218,0,273,274,270,10,218,319,434,0,270,274,602,10,216,376,217,0,268,276,269,10,217,376,222,0,269,276,275,10,222,223,320,0,275,277,273,10,320,223,253,0,273,277,278,10,221,225,229,0,279,280,282,10,229,225,220,0,282,280,281,10,223,226,253,0,277,283,278,10,253,226,321,0,278,283,284,10,322,323,480,0,286,287,661,10,480,323,479,0,661,287,660,10,395,228,288,0,552,290,289,10,288,228,229,0,289,290,282,10,230,221,228,0,291,279,290,10,228,221,229,0,290,279,282,10,221,230,231,0,279,291,293,10,231,230,232,0,293,291,292,10,231,380,221,0,293,294,279,10,221,380,225,0,279,294,280,10,225,306,220,0,280,295,281,10,225,379,233,0,296,297,299,10,233,379,235,0,299,297,298,10,338,339,239,0,301,302,300,10,239,339,230,0,300,302,303,10,339,340,230,0,302,305,303,10,230,340,232,0,303,305,306,10,238,224,321,0,307,308,284,10,321,224,253,0,284,308,278,10,323,324,479,0,287,309,660,10,479,324,478,0,660,309,658,10,342,343,339,0,312,419,302,10,339,343,340,0,302,419,305,10,345,346,336,0,313,314,288,10,336,346,337,0,288,314,285,10,231,232,407,0,293,292,568,10,407,232,406,0,568,292,566,10,334,335,233,0,317,318,299,10,233,335,234,0,299,318,319,10,248,371,372,0,320,321,322,10,246,244,235,0,324,325,298,10,370,283,369,0,326,327,328,10,369,283,31,0,328,327,354,10,372,251,247,0,322,329,323,10,247,251,252,0,323,329,330,10,320,253,319,0,273,278,274,10,319,253,224,0,274,278,308,10,375,376,220,0,331,276,281,10,220,376,216,0,281,276,268,10,223,222,3,0,277,275,333,10,3,222,2,0,333,275,332,10,306,375,220,0,295,331,281,10,3,6,223,0,333,334,277,10,223,6,226,0,277,334,283,10,227,377,219,0,335,336,271,10,219,377,378,0,271,336,337,10,235,379,11,0,298,297,339,10,11,379,47,0,339,297,338,10,4,13,254,0,340,341,343,10,254,13,237,0,343,341,342,10,261,15,236,0,316,344,315,10,236,15,12,0,315,344,345,10,219,378,263,0,271,337,346,10,335,44,234,0,318,347,319,10,234,44,10,0,319,347,348,10,243,18,241,0,350,351,349,10,241,18,17,0,349,351,352,10,235,11,246,0,298,339,324,10,246,11,19,0,324,339,353,10,369,31,46,0,328,354,355,10,246,19,251,0,324,353,329,10,251,19,22,0,329,353,356,10,251,22,252,0,329,356,330,10,252,22,23,0,330,356,357,10,250,21,243,0,358,359,350,10,243,21,18,0,350,359,351,10,226,285,321,0,283,360,284,10,321,285,254,0,284,360,343,10,297,256,366,0,362,363,361,10,366,256,249,0,361,363,364,10,247,252,255,0,323,330,365,10,255,252,257,0,365,330,366,10,249,256,20,0,364,363,368,10,20,256,24,0,368,363,367,10,23,25,252,0,357,369,330,10,252,25,257,0,330,369,366,10,256,297,298,0,363,362,370,10,256,308,24,0,363,371,367,10,24,308,41,0,367,371,372,10,232,340,406,0,373,374,567,10,406,340,405,0,567,374,565,10,324,423,478,0,377,589,659,10,478,423,477,0,659,589,657,10,340,343,405,0,374,428,565,10,405,343,404,0,565,428,564,10,337,346,432,0,285,314,600,10,432,346,431,0,600,314,599,10,397,338,396,0,555,301,553,10,396,338,239,0,553,301,300,10,356,352,304,0,389,390,388,10,304,352,263,0,388,390,391,10,325,326,476,0,378,392,656,10,476,326,483,0,656,392,665,10,242,281,284,0,395,396,394,10,281,303,284,0,396,397,394,10,280,281,245,0,398,396,399,10,245,281,242,0,399,396,395,10,245,299,280,0,399,400,398,10,280,299,300,0,398,400,401,10,279,243,282,0,403,350,402,10,282,243,241,0,402,350,349,10,263,16,304,0,346,405,404,10,304,16,48,0,404,405,406,10,368,45,373,0,407,408,410,10,373,45,30,0,410,408,409,10,311,27,310,0,412,413,411,10,310,27,26,0,411,413,414,10,257,25,313,0,366,369,415,10,313,25,28,0,415,369,416,10,311,312,27,0,412,417,413,10,27,312,29,0,413,417,418,10,312,313,29,0,417,415,418,10,29,313,28,0,418,415,416,10,342,365,343,0,312,420,419,10,343,365,360,0,419,420,421,10,344,364,342,0,311,422,312,10,342,364,365,0,312,422,420,10,345,333,346,0,313,423,314,10,346,333,328,0,314,423,424,10,347,332,345,0,425,426,313,10,345,332,333,0,313,426,423,10,343,360,404,0,428,429,564,10,404,360,403,0,564,429,563,10,344,398,364,0,311,556,422,10,364,398,399,0,422,556,557,10,346,328,431,0,314,424,599,10,431,328,430,0,599,424,598,10,347,425,332,0,433,591,436,10,332,425,426,0,436,591,592,10,353,357,363,0,387,386,438,10,363,357,362,0,438,386,437,10,359,330,355,0,439,440,434,10,355,330,331,0,434,440,435,10,368,373,367,0,407,410,441,10,367,373,374,0,441,410,442,10,327,482,326,0,443,664,392,10,326,482,483,0,392,664,665,10,354,359,348,0,445,439,444,10,348,359,358,0,444,439,393,10,359,354,330,0,439,445,440,10,330,354,329,0,440,445,446,10,219,263,288,0,271,346,289,10,401,267,400,0,560,448,558,10,400,267,269,0,558,448,449,10,272,427,270,0,454,593,453,10,270,427,428,0,453,593,595,10,280,300,264,0,398,401,458,10,264,300,315,0,458,401,457,10,264,316,280,0,458,459,398,10,280,316,281,0,398,459,396,10,316,317,281,0,459,460,396,10,281,317,303,0,396,460,397,10,318,314,282,0,461,462,402,10,282,314,279,0,402,462,403,10,283,452,31,0,327,625,354,10,31,452,453,0,354,625,626,10,240,334,235,0,463,317,298,10,235,334,233,0,298,317,299,10,295,39,296,0,465,466,464,10,296,39,40,0,464,466,467,10,287,286,258,0,468,469,470,10,258,286,255,0,470,469,365,10,32,309,26,0,471,472,414,10,26,309,310,0,414,472,411,10,396,239,395,0,554,473,552,10,395,239,228,0,552,473,290,10,285,226,290,0,360,283,475,10,226,289,290,0,283,474,475,10,226,6,289,0,283,334,474,10,289,6,33,0,474,334,476,10,5,285,34,0,477,360,478,10,34,285,290,0,478,360,475,10,289,456,290,0,474,630,475,10,290,456,457,0,475,630,631,10,33,461,289,0,476,636,474,10,289,461,456,0,474,636,630,10,458,34,457,0,633,478,631,10,457,34,290,0,631,478,475,10,377,374,8,0,336,442,484,10,8,374,7,0,484,442,483,10,219,218,227,0,271,270,335,10,227,218,260,0,335,270,272,10,217,222,218,0,269,275,270,10,218,222,320,0,270,275,273,10,291,293,292,0,479,485,480,10,292,293,294,0,480,485,486,10,35,37,291,0,481,487,479,10,291,37,293,0,479,487,485,10,36,292,38,0,482,480,488,10,38,292,294,0,488,480,486,10,293,467,294,0,485,645,486,10,294,467,462,0,486,645,638,10,37,466,293,0,487,643,485,10,293,466,467,0,485,643,645,10,38,294,463,0,488,486,640,10,463,294,462,0,640,486,638,10,366,255,297,0,361,365,362,10,297,255,286,0,362,365,469,10,297,286,298,0,362,469,370,10,298,286,287,0,370,469,468,10,308,309,41,0,371,472,372,10,41,309,32,0,372,472,471,10,300,299,279,0,401,400,403,10,279,299,250,0,403,400,358,10,300,279,315,0,401,403,457,10,315,279,314,0,457,403,462,10,301,266,302,0,489,490,492,10,302,266,265,0,492,490,491,10,303,317,282,0,397,460,402,10,282,317,318,0,402,460,461,10,282,241,303,0,402,349,397,10,303,241,284,0,397,349,394,10,304,48,261,0,404,406,316,10,261,48,15,0,316,406,344,10,261,349,304,0,376,375,388,10,304,349,356,0,388,375,389,10,349,351,356,0,375,427,389,10,356,351,357,0,389,427,386,10,357,351,362,0,386,427,437,10,362,351,361,0,437,427,430,10,490,493,489,0,672,675,671,10,402,268,401,0,562,494,560,10,401,268,267,0,560,494,448,10,225,233,306,0,296,299,495,10,306,233,234,0,495,299,319,10,236,12,307,0,315,345,496,10,307,12,43,0,496,345,497,10,359,355,358,0,439,434,393,10,358,355,350,0,393,434,379,10,424,425,341,0,590,591,380,10,341,425,347,0,380,591,433,10,347,345,341,0,425,313,310,10,341,345,336,0,310,313,288,10,216,215,220,0,268,267,281,10,220,215,229,0,281,267,282,10,219,288,215,0,271,289,267,10,215,288,229,0,267,289,282,10,256,298,308,0,363,370,371,10,309,308,287,0,472,371,468,10,287,308,298,0,468,371,370,10,309,287,310,0,472,468,411,10,310,287,258,0,411,468,470,10,255,311,258,0,365,412,470,10,258,311,310,0,470,412,411,10,255,259,311,0,365,498,412,10,311,259,312,0,412,498,417,10,257,313,259,0,366,415,498,10,259,313,312,0,498,415,417,10,255,257,259,0,365,366,498,10,301,315,266,0,489,457,490,10,264,315,301,0,458,457,489,10,316,264,302,0,459,458,492,10,302,264,301,0,492,458,489,10,265,317,302,0,491,460,492,10,481,433,480,0,662,601,661,10,480,433,322,0,661,601,286,10,254,237,321,0,343,342,284,10,321,237,238,0,284,342,307,10,342,339,344,0,312,302,311,10,344,339,338,0,311,302,301,10,398,344,397,0,556,311,555,10,397,344,338,0,555,311,301,10,357,353,356,0,386,387,389,10,356,353,352,0,389,387,390,10,434,319,433,0,603,501,601,10,433,319,322,0,601,501,286,10,319,224,322,0,501,502,286,10,322,224,323,0,286,502,287,10,224,238,323,0,502,503,287,10,323,238,324,0,287,503,309,10,324,238,423,0,377,504,589,10,423,238,422,0,589,504,587,10,326,325,277,0,392,378,506,10,277,325,262,0,506,378,505,10,429,430,271,0,596,598,508,10,271,430,328,0,508,598,424,10,330,329,278,0,440,446,509,10,278,329,275,0,509,446,510,10,331,330,276,0,435,440,511,10,276,330,278,0,511,440,509,10,332,426,272,0,436,592,512,10,272,426,427,0,512,592,594,10,270,333,272,0,513,423,514,10,272,333,332,0,514,423,426,10,271,328,270,0,508,424,513,10,270,328,333,0,513,424,423,10,4,254,5,0,340,343,477,10,5,254,285,0,477,343,360,10,284,334,242,0,394,317,395,10,242,334,240,0,395,317,463,10,335,334,241,0,318,317,349,10,241,334,284,0,349,317,394,10,44,335,17,0,347,318,352,10,17,335,241,0,352,318,349,10,450,403,449,0,623,563,621,10,449,403,360,0,621,563,429,10,362,361,444,0,437,430,615,10,444,361,443,0,615,430,614,10,363,362,445,0,438,437,617,10,445,362,444,0,617,437,615,10,447,364,446,0,619,422,618,10,446,364,399,0,618,422,557,10,448,365,447,0,620,420,619,10,447,365,364,0,619,420,422,10,449,360,448,0,622,421,620,10,448,360,365,0,620,421,420,10,265,266,318,0,491,490,461,10,318,266,314,0,461,490,462,10,248,451,283,0,320,624,327,10,283,451,452,0,327,624,625,10,377,227,367,0,336,335,441,10,367,227,260,0,441,335,272,10,367,260,368,0,441,272,407,10,260,277,368,0,272,523,407,10,14,45,277,0,524,408,523,10,277,45,368,0,523,408,407,10,235,244,240,0,298,325,463,10,250,369,21,0,358,328,359,10,21,369,46,0,359,328,355,10,299,370,250,0,400,326,358,10,250,370,369,0,358,326,328,10,242,240,371,0,395,463,321,10,372,371,244,0,322,321,325,10,244,371,240,0,325,321,463,10,251,372,246,0,329,322,324,10,246,372,244,0,324,322,325,10,373,30,374,0,410,409,442,10,374,30,7,0,442,409,483,10,42,306,10,0,525,495,348,10,10,306,234,0,348,495,319,10,42,1,306,0,526,527,295,10,306,1,375,0,295,527,331,10,376,375,0,0,276,331,528,10,0,375,1,0,528,331,527,10,222,376,2,0,275,276,332,10,2,376,0,0,332,276,528,10,378,377,9,0,337,336,529,10,9,377,8,0,529,336,484,10,378,9,263,0,337,529,346,10,263,9,16,0,346,529,405,10,367,374,377,0,441,442,336,10,380,231,408,0,294,293,569,10,408,231,407,0,569,293,568,10,379,307,47,0,297,530,338,10,47,307,43,0,338,530,531,10,225,380,379,0,280,294,532,10,379,380,408,0,532,294,569,10,302,317,316,0,492,460,459,10,318,317,265,0,461,460,491,10,266,315,314,0,490,457,462,10,277,262,14,0,523,533,524,10,14,262,13,0,524,533,341,10,422,237,262,0,588,342,533,10,262,237,13,0,533,342,341,10,243,279,250,0,350,403,358,10,53,52,51,0,4,3,2,10,205,74,76,0,53,189,49,10,64,173,73,0,231,32,233,10,73,173,172,0,233,32,31,10,112,110,415,0,184,183,578,10,415,110,414,0,578,183,577,10,429,271,428,0,597,452,595,10,428,271,270,0,595,452,453,10,216,217,215,0,268,269,267,10,215,217,219,0,267,269,271,10,239,230,228,0,300,303,304,10,70,382,141,0,44,535,222,10,141,382,381,0,222,535,534,10,95,383,70,0,45,537,44,10,70,383,382,0,44,537,535,10,383,95,384,0,536,237,538,10,384,95,183,0,538,237,109,10,384,183,385,0,538,109,539,10,385,183,185,0,539,109,154,10,185,195,385,0,154,157,539,10,385,195,386,0,539,157,540,10,441,386,440,0,611,540,610,10,440,386,195,0,610,540,157,10,139,388,107,0,176,543,219,10,107,388,387,0,219,543,541,10,108,389,139,0,179,545,176,10,139,389,388,0,176,545,543,10,390,437,197,0,546,606,159,10,197,437,438,0,159,606,608,10,391,390,187,0,547,546,113,10,187,390,197,0,113,546,159,10,187,186,391,0,113,117,547,10,391,186,392,0,547,117,548,10,97,393,186,0,234,550,117,10,186,393,392,0,117,550,548,10,122,394,97,0,20,551,82,10,97,394,393,0,82,551,549,10,396,395,263,0,554,552,346,10,263,395,288,0,346,552,289,10,263,352,396,0,384,385,553,10,396,352,397,0,553,385,555,10,353,398,352,0,381,556,385,10,352,398,397,0,385,556,555,10,398,353,399,0,556,381,557,10,399,353,363,0,557,381,431,10,399,363,446,0,557,431,618,10,446,363,445,0,618,431,616,10,401,400,305,0,560,558,447,10,305,400,274,0,447,558,450,10,402,401,273,0,562,560,493,10,273,401,305,0,493,560,447,10,450,443,403,0,623,614,563,10,403,443,361,0,563,614,430,10,351,404,361,0,427,564,430,10,361,404,403,0,430,564,563,10,405,404,349,0,565,564,375,10,349,404,351,0,375,564,427,10,406,405,261,0,567,565,376,10,261,405,349,0,376,565,375,10,407,406,236,0,568,566,315,10,236,406,261,0,315,566,316,10,408,407,307,0,569,568,496,10,307,407,236,0,496,568,315,10,409,72,410,0,571,243,572,10,410,72,158,0,572,243,110,10,158,469,410,0,110,647,572,10,410,469,470,0,572,647,649,10,411,175,412,0,573,115,574,10,412,175,181,0,574,115,161,10,181,166,412,0,161,164,574,10,412,166,413,0,574,164,575,10,414,413,106,0,576,575,255,10,106,413,166,0,255,575,164,10,415,414,104,0,578,577,181,10,104,414,106,0,181,577,182,10,416,415,105,0,579,578,180,10,105,415,104,0,180,578,181,10,416,105,417,0,580,251,581,10,417,105,162,0,581,251,151,10,417,162,418,0,581,151,582,10,418,162,180,0,582,151,41,10,171,419,180,0,247,583,41,10,180,419,418,0,41,583,582,10,420,474,156,0,584,654,18,10,156,474,475,0,18,654,655,10,421,420,153,0,585,584,240,10,153,420,156,0,240,584,18,10,423,422,325,0,589,587,378,10,325,422,262,0,378,587,505,10,423,325,477,0,589,378,657,10,477,325,476,0,657,378,656,10,350,355,424,0,379,434,590,10,424,355,425,0,590,434,591,10,426,425,331,0,592,591,435,10,331,425,355,0,435,591,434,10,427,426,276,0,594,592,511,10,276,426,331,0,511,592,435,10,427,276,428,0,593,455,595,10,428,276,278,0,595,455,456,10,429,428,275,0,597,595,451,10,275,428,278,0,451,595,456,10,329,430,275,0,432,598,507,10,275,430,429,0,507,598,596,10,354,431,329,0,382,599,432,10,329,431,430,0,432,599,598,10,432,431,348,0,600,599,383,10,348,431,354,0,383,599,382,10,482,327,481,0,663,499,662,10,481,327,433,0,662,499,601,10,260,434,327,0,500,603,443,10,327,434,433,0,443,603,601,10,218,434,260,0,270,602,272,10,421,153,52,0,586,7,3,10,52,153,154,0,3,7,6,10,381,214,213,0,534,25,37,10,213,214,59,0,37,25,15,10,379,408,307,0,532,569,496,10,101,103,435,0,264,262,604,10,435,103,436,0,604,262,605,10,103,389,436,0,262,544,605,10,436,389,437,0,605,544,606,10,438,437,108,0,608,606,263,10,108,437,389,0,263,606,544,10,139,439,108,0,260,609,261,10,108,439,438,0,261,609,607,10,107,440,139,0,258,610,260,10,139,440,439,0,260,610,609,10,387,441,107,0,542,611,258,10,107,441,440,0,258,611,610,10,387,102,441,0,542,259,611,10,441,102,442,0,611,259,613,10,102,101,442,0,265,264,612,10,442,101,435,0,612,264,604,10,444,443,305,0,615,614,517,10,305,443,273,0,517,614,515,10,445,444,274,0,617,615,518,10,274,444,305,0,518,615,517,10,400,446,274,0,559,618,520,10,274,446,445,0,520,618,616,10,269,447,400,0,519,619,559,10,400,447,446,0,559,619,618,10,267,448,269,0,521,620,519,10,269,448,447,0,519,620,619,10,268,449,267,0,522,622,521,10,267,449,448,0,521,622,620,10,402,450,268,0,561,623,516,10,268,450,449,0,516,623,621,10,443,450,273,0,614,623,515,10,273,450,402,0,515,623,561,10,255,366,247,0,365,361,323,10,247,366,451,0,323,361,624,10,451,366,452,0,624,361,625,10,452,366,249,0,625,361,364,10,452,249,453,0,625,364,626,10,453,249,20,0,626,364,368,10,454,453,83,0,628,627,99,10,83,453,20,0,99,627,103,10,455,454,200,0,629,628,96,10,200,454,83,0,96,628,99,10,89,81,200,0,100,55,96,10,200,81,455,0,96,55,629,10,82,206,205,0,52,54,53,10,248,372,451,0,320,322,624,10,451,372,247,0,624,322,323,10,456,291,457,0,630,479,631,10,457,291,292,0,631,479,480,10,458,457,36,0,633,631,482,10,36,457,292,0,482,631,480,10,126,459,36,0,207,634,213,10,36,459,458,0,213,634,632,10,460,459,125,0,635,634,208,10,125,459,126,0,208,634,207,10,460,125,461,0,635,208,637,10,461,125,35,0,637,208,211,10,456,461,291,0,630,636,479,10,291,461,35,0,479,636,481,10,40,463,296,0,467,640,464,10,296,463,462,0,464,640,638,10,40,130,463,0,193,190,639,10,463,130,464,0,639,190,641,10,465,464,129,0,642,641,191,10,129,464,130,0,191,641,190,10,465,129,466,0,642,191,644,10,466,129,39,0,644,191,192,10,467,466,295,0,645,643,465,10,295,466,39,0,465,643,466,10,467,295,462,0,645,465,638,10,462,295,296,0,638,465,464,10,170,175,468,0,42,43,646,10,468,175,469,0,646,43,648,10,470,469,411,0,649,647,573,10,411,469,175,0,573,647,115,10,471,470,184,0,650,649,116,10,184,470,411,0,116,649,573,10,471,184,472,0,650,116,651,10,472,184,192,0,651,116,123,10,472,192,473,0,651,123,652,10,473,192,182,0,652,123,248,10,182,419,473,0,249,583,653,10,473,419,474,0,653,583,654,10,475,474,171,0,655,654,247,10,171,474,419,0,247,654,583,10,170,468,171,0,42,646,247,10,171,468,475,0,247,646,655,10,424,477,350,0,590,657,379,10,350,477,476,0,379,657,656,10,477,424,478,0,657,590,659,10,478,424,341,0,659,590,380,10,478,341,479,0,658,310,660,10,479,341,336,0,660,310,288,10,480,479,337,0,661,660,285,10,337,479,336,0,285,660,288,10,432,481,337,0,600,662,285,10,337,481,480,0,285,662,661,10,348,482,432,0,383,663,600,10,432,482,481,0,600,663,662,10,483,482,358,0,665,664,393,10,358,482,348,0,393,664,444,10,476,483,350,0,656,665,379,10,350,483,358,0,379,665,393,10,203,46,31,0,60,90,89,10,238,237,422,0,307,342,588,10,409,96,71,0,570,79,76,10,71,96,13,0,76,79,75,10,109,163,112,0,253,175,184,10,112,163,164,0,184,175,170,10,260,327,277,0,500,443,506,10,277,327,326,0,506,443,392,10,484,492,485,0,666,674,667,10,245,489,299,0,399,671,400,10,299,489,488,0,400,671,670,10,245,371,489,0,399,321,671,10,489,371,490,0,671,321,672,10,490,371,491,0,672,321,673,10,491,371,248,0,673,321,320,10,283,488,248,0,327,670,320,10,248,488,491,0,320,670,673,10,487,492,484,0,669,674,666,10,486,492,487,0,668,674,669,10,485,492,486,0,667,674,668,10,489,493,488,0,671,675,670,10,491,493,490,0,673,675,672,10,488,493,491,0,670,675,673,10,484,485,133,0,666,667,128,10,133,485,79,0,128,667,126,10,204,117,484,0,58,59,666,10,79,485,205,0,126,667,53,10,205,485,486,0,53,667,668,10,245,242,371,0,399,395,321,10,370,488,283,0,326,670,327,10,299,488,370,0,400,670,326]
}
HEADER CSD ENTRY GLOBAL
CRYST1 4.7589 4.7589 12.9912 90.00 90.00 120.00 R-3c
SCALE1 0.210133 0.121320 -0.000000 0.000000
SCALE2 0.000000 0.242640 -0.000000 0.000000
SCALE3 0.000000 0.000000 0.076975 0.000000
HETATM 1 Al UNK 0 1 2.379 4.121 4.573 1.00 0.00
HETATM 2 O UNK 0 1 3.835 4.121 3.248 1.00 0.00
HETATM 3 Al UNK 0 1 2.379 4.121 1.923 1.00 0.00
HETATM 4 O UNK 0 1 1.652 5.382 3.248 1.00 0.00
HETATM 5 O UNK 0 1 1.652 2.861 3.248 1.00 0.00
HETATM 6 Al UNK 0 1 -0.000 2.748 4.088 1.00 0.00
HETATM 7 Al UNK 0 1 4.759 2.748 4.088 1.00 0.00
HETATM 8 O UNK 0 1 3.303 2.748 5.413 1.00 0.00
HETATM 9 Al UNK 0 1 2.379 6.869 4.088 1.00 0.00
HETATM 10 O UNK 0 1 3.107 5.608 5.413 1.00 0.00
HETATM 11 O UNK 0 1 0.728 4.008 5.413 1.00 0.00
HETATM 12 Al UNK 0 1 4.759 5.495 2.408 1.00 0.00
HETATM 13 Al UNK 0 1 2.379 1.374 2.408 1.00 0.00
HETATM 14 Al UNK 0 1 0.000 5.495 2.408 1.00 0.00
HETATM 15 O UNK 0 1 0.728 4.234 1.083 1.00 0.00
HETATM 16 O UNK 0 1 3.303 5.495 1.083 1.00 0.00
HETATM 17 O UNK 0 1 3.107 2.634 1.083 1.00 0.00
HETATM 18 Al UNK 0 1 -2.379 4.121 4.573 1.00 0.00
HETATM 19 O UNK 0 1 -3.107 5.382 3.248 1.00 0.00
HETATM 20 Al UNK 0 1 -2.379 4.121 1.923 1.00 0.00
HETATM 21 O UNK 0 1 -3.107 2.861 3.248 1.00 0.00
HETATM 22 O UNK 0 1 -0.924 4.121 3.248 1.00 0.00
HETATM 23 Al UNK 0 1 -2.379 6.869 4.088 1.00 0.00
HETATM 24 O UNK 0 1 -1.652 5.608 5.413 1.00 0.00
HETATM 25 Al UNK 0 1 -4.759 2.748 4.088 1.00 0.00
HETATM 26 O UNK 0 1 -4.031 4.008 5.413 1.00 0.00
HETATM 27 O UNK 0 1 -1.456 2.748 5.413 1.00 0.00
HETATM 28 Al UNK 0 1 -4.759 5.495 2.408 1.00 0.00
HETATM 29 Al UNK 0 1 -2.379 1.374 2.408 1.00 0.00
HETATM 30 O UNK 0 1 -1.652 2.634 1.083 1.00 0.00
HETATM 31 O UNK 0 1 -4.031 4.234 1.083 1.00 0.00
HETATM 32 O UNK 0 1 -1.456 5.495 1.083 1.00 0.00
HETATM 33 Al UNK 0 1 0.000 0.000 4.573 1.00 0.00
HETATM 34 O UNK 0 1 -0.728 -1.261 3.248 1.00 0.00
HETATM 35 Al UNK 0 1 0.000 0.000 1.923 1.00 0.00
HETATM 36 O UNK 0 1 1.456 0.000 3.248 1.00 0.00
HETATM 37 O UNK 0 1 -0.728 1.261 3.248 1.00 0.00
HETATM 38 Al UNK 0 1 -2.379 -1.374 4.088 1.00 0.00
HETATM 39 O UNK 0 1 -1.652 -0.113 5.413 1.00 0.00
HETATM 40 Al UNK 0 1 2.379 -1.374 4.088 1.00 0.00
HETATM 41 O UNK 0 1 0.924 -1.374 5.413 1.00 0.00
HETATM 42 O UNK 0 1 0.728 1.487 5.413 1.00 0.00
HETATM 43 Al UNK 0 1 -0.000 -2.748 2.408 1.00 0.00
HETATM 44 O UNK 0 1 0.924 1.374 1.083 1.00 0.00
HETATM 45 O UNK 0 1 0.728 -1.487 1.083 1.00 0.00
HETATM 46 O UNK 0 1 -1.652 0.113 1.083 1.00 0.00
HETATM 47 Al UNK 0 1 4.759 0.000 4.573 1.00 0.00
HETATM 48 O UNK 0 1 4.031 -1.261 3.248 1.00 0.00
HETATM 49 Al UNK 0 1 4.759 0.000 1.923 1.00 0.00
HETATM 50 O UNK 0 1 6.215 0.000 3.248 1.00 0.00
HETATM 51 O UNK 0 1 4.031 1.261 3.248 1.00 0.00
HETATM 52 O UNK 0 1 3.107 -0.113 5.413 1.00 0.00
HETATM 53 Al UNK 0 1 7.138 -1.374 4.088 1.00 0.00
HETATM 54 O UNK 0 1 5.683 -1.374 5.413 1.00 0.00
HETATM 55 O UNK 0 1 5.487 1.487 5.413 1.00 0.00
HETATM 56 Al UNK 0 1 4.759 -2.748 2.408 1.00 0.00
HETATM 57 Al UNK 0 1 7.138 1.374 2.408 1.00 0.00
HETATM 58 O UNK 0 1 5.683 1.374 1.083 1.00 0.00
HETATM 59 O UNK 0 1 5.487 -1.487 1.083 1.00 0.00
HETATM 60 O UNK 0 1 3.107 0.113 1.083 1.00 0.00
HETATM 61 Al UNK 0 1 -0.000 2.748 13.234 1.00 0.00
HETATM 62 O UNK 0 1 1.456 2.748 11.909 1.00 0.00
HETATM 63 Al UNK 0 1 -0.000 2.748 10.583 1.00 0.00
HETATM 64 O UNK 0 1 -0.728 4.008 11.909 1.00 0.00
HETATM 65 O UNK 0 1 -0.728 1.487 11.909 1.00 0.00
HETATM 66 Al UNK 0 1 -2.379 1.374 12.749 1.00 0.00
HETATM 67 Al UNK 0 1 2.379 1.374 12.749 1.00 0.00
HETATM 68 O UNK 0 1 0.924 1.374 14.074 1.00 0.00
HETATM 69 Al UNK 0 1 -0.000 5.495 12.749 1.00 0.00
HETATM 70 O UNK 0 1 0.728 4.234 14.074 1.00 0.00
HETATM 71 O UNK 0 1 -1.652 2.634 14.074 1.00 0.00
HETATM 72 Al UNK 0 1 2.379 4.121 11.069 1.00 0.00
HETATM 73 Al UNK 0 1 0.000 0.000 11.069 1.00 0.00
HETATM 74 Al UNK 0 1 -2.379 4.121 11.069 1.00 0.00
HETATM 75 O UNK 0 1 -1.652 2.861 9.743 1.00 0.00
HETATM 76 O UNK 0 1 0.924 4.121 9.743 1.00 0.00
HETATM 77 O UNK 0 1 0.728 1.261 9.743 1.00 0.00
HETATM 78 Al UNK 0 1 2.379 1.374 8.903 1.00 0.00
HETATM 79 O UNK 0 1 3.835 1.374 7.578 1.00 0.00
HETATM 80 Al UNK 0 1 2.379 1.374 6.253 1.00 0.00
HETATM 81 O UNK 0 1 1.652 2.634 7.578 1.00 0.00
HETATM 82 O UNK 0 1 1.652 0.113 7.578 1.00 0.00
HETATM 83 Al UNK 0 1 0.000 0.000 8.418 1.00 0.00
HETATM 84 Al UNK 0 1 4.759 0.000 8.418 1.00 0.00
HETATM 85 O UNK 0 1 3.303 0.000 9.743 1.00 0.00
HETATM 86 Al UNK 0 1 2.379 4.121 8.418 1.00 0.00
HETATM 87 O UNK 0 1 3.107 2.861 9.743 1.00 0.00
HETATM 88 Al UNK 0 1 4.759 2.748 6.738 1.00 0.00
HETATM 89 Al UNK 0 1 2.379 -1.374 6.738 1.00 0.00
HETATM 90 Al UNK 0 1 0.000 2.748 6.738 1.00 0.00
HETATM 91 O UNK 0 1 -1.456 0.000 9.743 1.00 0.00
HETATM 92 O UNK 0 1 0.728 -1.261 9.743 1.00 0.00
HETATM 93 Al UNK 0 1 -2.379 1.374 8.903 1.00 0.00
HETATM 94 O UNK 0 1 -0.924 1.374 7.578 1.00 0.00
HETATM 95 Al UNK 0 1 0.000 -2.748 8.903 1.00 0.00
HETATM 96 O UNK 0 1 -0.728 -1.487 7.578 1.00 0.00
HETATM 97 Al UNK 0 1 -2.379 -1.374 10.583 1.00 0.00
HETATM 98 Al UNK 0 1 2.379 -1.374 10.583 1.00 0.00
HETATM 99 O UNK 0 1 1.652 -0.113 11.909 1.00 0.00
HETATM 100 O UNK 0 1 -0.924 -1.374 11.909 1.00 0.00
HETATM 101 Al UNK 0 1 -2.379 4.121 8.418 1.00 0.00
HETATM 102 O UNK 0 1 -3.835 4.121 9.743 1.00 0.00
HETATM 103 O UNK 0 1 -1.652 5.382 9.743 1.00 0.00
HETATM 104 Al UNK 0 1 0.000 5.495 8.903 1.00 0.00
HETATM 105 Al UNK 0 1 -4.759 5.495 8.903 1.00 0.00
HETATM 106 O UNK 0 1 -3.303 5.495 7.578 1.00 0.00
HETATM 107 O UNK 0 1 -3.107 2.634 7.578 1.00 0.00
HETATM 108 O UNK 0 1 -0.728 4.234 7.578 1.00 0.00
HETATM 109 Al UNK 0 1 -4.759 2.748 10.583 1.00 0.00
HETATM 110 Al UNK 0 1 -2.379 6.869 10.583 1.00 0.00
HETATM 111 O UNK 0 1 -3.303 2.748 11.909 1.00 0.00
HETATM 112 O UNK 0 1 -3.107 5.608 11.909 1.00 0.00
HETATM 113 Al UNK 0 1 4.759 0.000 11.069 1.00 0.00
HETATM 114 O UNK 0 1 5.487 -1.261 9.743 1.00 0.00
HETATM 115 O UNK 0 1 5.487 1.261 9.743 1.00 0.00
HETATM 116 Al UNK 0 1 7.138 1.374 8.903 1.00 0.00
HETATM 117 Al UNK 0 1 4.759 -2.748 8.903 1.00 0.00
HETATM 118 O UNK 0 1 4.031 -1.487 7.578 1.00 0.00
HETATM 119 O UNK 0 1 6.410 0.113 7.578 1.00 0.00
HETATM 120 Al UNK 0 1 4.759 2.748 10.583 1.00 0.00
HETATM 121 Al UNK 0 1 7.138 -1.374 10.583 1.00 0.00
HETATM 122 O UNK 0 1 6.410 -0.113 11.909 1.00 0.00
HETATM 123 O UNK 0 1 3.835 -1.374 11.909 1.00 0.00
HETATM 124 O UNK 0 1 4.031 1.487 11.909 1.00 0.00
HETATM 125 O UNK 0 1 3.107 5.382 9.743 1.00 0.00
HETATM 126 Al UNK 0 1 4.759 5.495 8.903 1.00 0.00
HETATM 127 O UNK 0 1 1.456 5.495 7.578 1.00 0.00
HETATM 128 O UNK 0 1 4.031 4.234 7.578 1.00 0.00
HETATM 129 Al UNK 0 1 2.379 6.869 10.583 1.00 0.00
HETATM 130 O UNK 0 1 4.031 4.008 11.909 1.00 0.00
HETATM 131 O UNK 0 1 1.652 5.608 11.909 1.00 0.00
HETATM 132 Al UNK 0 1 -2.379 1.374 6.253 1.00 0.00
HETATM 133 Al UNK 0 1 -0.000 5.495 6.253 1.00 0.00
HETATM 134 Al UNK 0 1 2.379 1.374 -0.243 1.00 0.00
HETATM 135 Al UNK 0 1 4.759 2.748 0.243 1.00 0.00
HETATM 136 Al UNK 0 1 0.000 2.748 0.243 1.00 0.00
HETATM 137 O UNK 0 1 1.456 2.748 -1.083 1.00 0.00
HETATM 138 Al UNK 0 1 2.379 -1.374 0.243 1.00 0.00
HETATM 139 O UNK 0 1 1.652 -0.113 -1.083 1.00 0.00
HETATM 140 O UNK 0 1 4.031 1.487 -1.083 1.00 0.00
CONECT 1 2 3 4
CONECT 2 3 7 12
CONECT 3 4 5 12
CONECT 4 9 14
CONECT 5 1 6 13
CONECT 6 1 11 18
CONECT 7 1 47 51
CONECT 8 1 80
CONECT 9 1
CONECT 10 1
CONECT 11 1 90 133
CONECT 12
CONECT 13 3 17 35
CONECT 14 3 20 22
CONECT 15 3
CONECT 16 3
CONECT 17 3 134 135
CONECT 18 19 20 21
CONECT 19 20 23 28
CONECT 20 21 22 28
CONECT 21 25 29
CONECT 22 6 18
CONECT 23 18
CONECT 24 18
CONECT 25 18
CONECT 26 18
CONECT 27 6 18 90
CONECT 28
CONECT 29 20 35 37
CONECT 30 20
CONECT 31 20
CONECT 32 20
CONECT 33 6 34 35
CONECT 34 35 38 43
CONECT 35 36 37 43
CONECT 36 13 33 40
CONECT 37 6 33
CONECT 38 33
CONECT 39 33
CONECT 40 33 47 48
CONECT 41 33
CONECT 42 6 33 80
CONECT 43
CONECT 44 13 35 134
CONECT 45 35
CONECT 46 35
CONECT 47 48 49 50
CONECT 48 49 56
CONECT 49 13 50 51
CONECT 50 53 57
CONECT 51 13 47
CONECT 52 47 80
CONECT 53 47
CONECT 54 47
CONECT 55 47
CONECT 56 49
CONECT 57 49
CONECT 58 49
CONECT 59 49
CONECT 60 13 49 134
CONECT 61 62 63 64
CONECT 62 63 67 72
CONECT 63 64 65 72
CONECT 64 69 74
CONECT 65 61 66 73
CONECT 66 61
CONECT 67 61
CONECT 68 61
CONECT 69 61
CONECT 70 61
CONECT 71 61
CONECT 72 76 86 87
CONECT 73 63 77 83
CONECT 74 63 75 101
CONECT 75 63 93 101
CONECT 76 63 86 104
CONECT 77 63 78 83
CONECT 78 79 80 81
CONECT 79 80 84 88
CONECT 80 81 82 88
CONECT 81 86 90
CONECT 82 78 83 89
CONECT 83 78 91 92
CONECT 84 78 85 113
CONECT 85 78 98 113
CONECT 86 78 87 104
CONECT 87 78 120
CONECT 88
CONECT 89 80
CONECT 90 6 42 80
CONECT 91 73 93 97
CONECT 92 73 95 98
CONECT 93 83 101
CONECT 94 83 90
CONECT 95 83
CONECT 96 83
CONECT 97 73
CONECT 98 73 113
CONECT 99 73
CONECT 100 73
CONECT 101 102 103 104
CONECT 102 74 105 109
CONECT 103 74 104 110
CONECT 104
CONECT 105 101
CONECT 106 101
CONECT 107 101
CONECT 108 90 101
CONECT 109 74
CONECT 110 74
CONECT 111 74
CONECT 112 74
CONECT 113 114 115 120
CONECT 114 84 117 121
CONECT 115 84 116 120
CONECT 116 84
CONECT 117 84
CONECT 118 84
CONECT 119 84
CONECT 120 72
CONECT 121 113
CONECT 122 113
CONECT 123 113
CONECT 124 113
CONECT 125 72 86 126
CONECT 126 86
CONECT 127 86
CONECT 128 86
CONECT 129 72 125
CONECT 130 72
CONECT 131 72
CONECT 132 27 90
CONECT 133 90
CONECT 134 13 135 136
CONECT 135
CONECT 136 44
CONECT 137 134
CONECT 138 60 134
CONECT 139 134
CONECT 140 134
MASTER 0 0 0 0 0 0 0 0 3 140 0 140 0
END
HEADER NONAME 22-Apr-10 NONE 1
TITLE NONE 2
AUTHOR Chemical Structure Services at http://cactus.nci.nih.gov NONE 3
REVDAT 1 22-Apr-10 0 NONE 4
ATOM 1 C 0 2.154 1.017 -0.012 0.00 0.00 C+0
ATOM 2 C 0 -0.545 1.675 0.087 0.00 0.00 C+0
ATOM 3 C 0 1.761 2.338 0.015 0.00 0.00 C+0
ATOM 4 C 0 0.416 2.666 0.064 0.00 0.00 C+0
ATOM 5 C 0 -3.466 -1.377 0.133 0.00 0.00 C+0
ATOM 6 C 0 1.192 0.004 0.010 0.00 0.00 C+0
ATOM 7 C 0 -0.168 0.341 0.060 0.00 0.00 C+0
ATOM 8 O 0 0.765 -2.290 -0.001 0.00 0.00 O+0
ATOM 9 O 0 -2.733 0.825 -0.277 0.00 0.00 O+0
ATOM 10 O 0 2.912 -1.731 -0.067 0.00 0.00 O+0
ATOM 11 C 0 1.604 -1.411 -0.019 0.00 0.00 C+0
ATOM 12 C 0 -2.411 -0.315 -0.036 0.00 0.00 C+0
ATOM 13 O 0 -1.112 -0.634 0.081 0.00 0.00 O+0
ATOM 14 H 0 3.183 -2.659 -0.086 0.00 0.00 H+0
ATOM 15 H 0 3.203 0.765 -0.054 0.00 0.00 H+0
ATOM 16 H 0 -1.591 1.939 0.125 0.00 0.00 H+0
ATOM 17 H 0 2.506 3.120 -0.002 0.00 0.00 H+0
ATOM 18 H 0 0.118 3.704 0.085 0.00 0.00 H+0
ATOM 19 H 0 -3.762 -1.431 1.181 0.00 0.00 H+0
ATOM 20 H 0 -4.334 -1.127 -0.477 0.00 0.00 H+0
ATOM 21 H 0 -3.066 -2.340 -0.182 0.00 0.00 H+0
CONECT 1 6 3 15 0 NONE 26
CONECT 2 7 4 16 0 NONE 27
CONECT 3 1 4 17 0 NONE 28
CONECT 4 2 3 18 0 NONE 29
CONECT 5 12 19 20 21 NONE 30
CONECT 6 7 1 11 0 NONE 31
CONECT 7 6 2 13 0 NONE 32
CONECT 8 11 0 0 0 NONE 33
CONECT 9 12 0 0 0 NONE 34
CONECT 10 11 14 0 0 NONE 35
CONECT 11 6 10 8 0 NONE 36
CONECT 12 13 5 9 0 NONE 37
CONECT 13 7 12 0 0 NONE 38
END NONE 39
COMPND bucky.pdb
HETATM 1 C -3.4306 0.3484 0.3630
HETATM 2 C -3.1790 1.1810 -0.7334
HETATM 3 C -2.9160 0.3690 -1.8427
HETATM 4 C -3.0048 -0.9660 -1.4314
HETATM 5 C -3.3229 -0.9791 -0.0682
HETATM 6 C -1.9449 0.7442 -2.7732
HETATM 7 C -1.2332 1.9362 -2.5954
HETATM 8 C -1.4944 2.7485 -1.4902
HETATM 9 C -2.4680 2.3700 -0.5585
HETATM 10 C -2.0114 2.7298 0.7143
HETATM 11 C -2.2640 1.9005 1.8090
HETATM 12 C -2.9745 0.7074 1.6331
HETATM 13 C -2.4129 -0.2585 2.4753
HETATM 14 C -2.3071 -1.5829 2.0466
HETATM 15 C -2.7627 -1.9425 0.7730
HETATM 16 C -1.8823 -2.8972 0.2521
HETATM 17 C -1.5635 -2.8861 -1.1071
HETATM 18 C -2.1254 -1.9193 -1.9490
HETATM 19 C -1.1533 -1.5397 -2.8812
HETATM 20 C -1.0615 -0.2088 -3.2934
HETATM 21 C 0.0879 1.7218 -3.0046
HETATM 22 C -0.4365 3.3422 -0.7917
HETATM 23 C -0.7555 3.3307 0.5716
HETATM 24 C -1.2619 1.6696 2.7586
HETATM 25 C -1.3534 0.3346 3.1711
HETATM 26 C -1.1426 -2.3137 2.3104
HETATM 27 C -0.8795 -3.1267 1.2011
HETATM 28 C -0.2429 -3.1010 -1.5184
HETATM 29 C 0.0114 -2.2689 -2.6155
HETATM 30 C 0.1936 0.3941 -3.4362
HETATM 31 C 3.3266 0.9826 0.0695
HETATM 32 C 3.0096 0.9706 1.4326
HETATM 33 C 2.9177 -0.3640 1.8443
HETATM 34 C 3.1778 -1.1770 0.7349
HETATM 35 C 3.4306 -0.3451 -0.3621
HETATM 36 C 1.9473 -0.7475 2.7721
HETATM 37 C 1.0645 0.2062 3.2916
HETATM 38 C 1.1547 1.5385 2.8834
HETATM 39 C 2.1280 1.9203 1.9528
HETATM 40 C 1.5657 2.8862 1.1107
HETATM 41 C 1.8834 2.9000 -0.2489
HETATM 42 C 2.7651 1.9463 -0.7707
HETATM 43 C 2.3092 1.5866 -2.0437
HETATM 44 C 2.4144 0.2631 -2.4755
HETATM 45 C 2.9758 -0.7031 -1.6328
HETATM 46 C 2.2666 -1.8962 -1.8100
HETATM 47 C 2.0133 -2.7276 -0.7172
HETATM 48 C 2.4693 -2.3670 0.5560
HETATM 49 C 1.4973 -2.7481 1.4877
HETATM 50 C 1.2349 -1.9394 2.5952
HETATM 51 C -0.1917 -0.3936 3.4362
HETATM 52 C -0.0088 2.2691 2.6153
HETATM 53 C 0.2447 3.1026 1.5191
HETATM 54 C 0.8815 3.1269 -1.2000
HETATM 55 C 1.1442 2.3150 -2.3100
HETATM 56 C 1.3558 -0.3333 -3.1706
HETATM 57 C 1.2640 -1.6687 -2.7595
HETATM 58 C 0.7577 -3.3290 -0.5712
HETATM 59 C 0.4382 -3.3422 0.7920
HETATM 60 C -0.0856 -1.7214 3.0049
CONECT 1 2 5 12
CONECT 2 1 3 9
CONECT 3 2 4 6
CONECT 4 3 5 18
CONECT 5 1 4 15
CONECT 6 3 7 20
CONECT 7 6 8 21
CONECT 8 7 9 22
CONECT 9 2 8 10
CONECT 10 9 11 23
CONECT 11 10 12 24
CONECT 12 1 11 13
CONECT 13 12 14 25
CONECT 14 13 15 26
CONECT 15 5 14 16
CONECT 16 15 17 27
CONECT 17 16 18 28
CONECT 18 4 17 19
CONECT 19 18 20 29
CONECT 20 6 19 30
CONECT 21 7 30 55
CONECT 22 8 23 54
CONECT 23 10 22 53
CONECT 24 11 25 52
CONECT 25 13 24 51
CONECT 26 14 27 60
CONECT 27 16 26 59
CONECT 28 17 29 58
CONECT 29 19 28 57
CONECT 30 20 21 56
CONECT 31 32 35 42
CONECT 32 31 33 39
CONECT 33 32 34 36
CONECT 34 33 35 48
CONECT 35 31 34 45
CONECT 36 33 37 50
CONECT 37 36 38 51
CONECT 38 37 39 52
CONECT 39 32 38 40
CONECT 40 39 41 53
CONECT 41 40 42 54
CONECT 42 31 41 43
CONECT 43 42 44 55
CONECT 44 43 45 56
CONECT 45 35 44 46
CONECT 46 45 47 57
CONECT 47 46 48 58
CONECT 48 34 47 49
CONECT 49 48 50 59
CONECT 50 36 49 60
CONECT 51 25 37 60
CONECT 52 24 38 53
CONECT 53 23 40 52
CONECT 54 22 41 55
CONECT 55 21 43 54
CONECT 56 30 44 57
CONECT 57 29 46 56
CONECT 58 28 47 59
CONECT 59 27 49 58
CONECT 60 26 50 51
END
HEADER MOLECULE
COMPND CAF2 (FLUORITE), VIEW CENTERED ON ANIONS
AUTHOR A. W. MAVERICK
ATOM 1 F UNK 1 -1.366 -1.366 -1.366 1.00 0.00
ATOM 2 F UNK 1 -1.366 -1.366 1.366 1.00 0.00
ATOM 3 F UNK 1 -1.366 1.366 -1.366 1.00 0.00
ATOM 4 F UNK 1 -1.366 1.366 1.366 1.00 0.00
ATOM 5 F UNK 1 1.366 -1.366 -1.366 1.00 0.00
ATOM 6 F UNK 1 1.366 -1.366 1.366 1.00 0.00
ATOM 7 F UNK 1 1.366 1.366 -1.366 1.00 0.00
ATOM 8 F UNK 1 1.366 1.366 1.366 1.00 0.00
ATOM 9 CA UNK 1 -2.732 -2.732 -2.732 1.00 0.00
ATOM 10 CA UNK 1 0.000 0.000 -2.732 1.00 0.00
ATOM 11 CA UNK 1 0.000 -2.732 0.000 1.00 0.00
ATOM 12 CA UNK 1 -2.732 0.000 0.000 1.00 0.00
ATOM 13 CA UNK 1 -2.732 -2.732 2.732 1.00 0.00
ATOM 14 CA UNK 1 0.000 0.000 2.732 1.00 0.00
ATOM 15 CA UNK 1 -2.732 2.732 -2.732 1.00 0.00
ATOM 16 CA UNK 1 0.000 2.732 0.000 1.00 0.00
ATOM 17 CA UNK 1 -2.732 2.732 2.732 1.00 0.00
ATOM 18 CA UNK 1 2.732 -2.732 -2.732 1.00 0.00
ATOM 19 CA UNK 1 2.732 0.000 0.000 1.00 0.00
ATOM 20 CA UNK 1 2.732 -2.732 2.732 1.00 0.00
ATOM 21 CA UNK 1 2.732 2.732 -2.732 1.00 0.00
ATOM 22 CA UNK 1 2.732 2.732 2.732 1.00 0.00
CONECT 1 9 10 11 12
CONECT 2 11 12 13 14
CONECT 3 10 12 15 16
CONECT 4 12 14 16 17
CONECT 5 10 11 18 19
CONECT 6 11 14 19 20
CONECT 7 10 16 19 21
CONECT 8 14 16 19 22
CONECT 9 1
CONECT 10 1 3 5 7
CONECT 11 1 2 5 6
CONECT 12 1 2 3 4
CONECT 13 2
CONECT 14 2 4 6 8
CONECT 15 3
CONECT 16 3 4 7 8
CONECT 17 4
CONECT 18 5
CONECT 19 5 6 7 8
CONECT 20 6
CONECT 21 7
CONECT 22 8
MASTER 0 0 0 0 0 0 0 0 22 0 22 0
END
HEADER NONAME 22-Apr-10 NONE 1
TITLE NONE 2
AUTHOR Chemical Structure Services at http://cactus.nci.nih.gov NONE 3
REVDAT 1 22-Apr-10 0 NONE 4
ATOM 1 C 0 -2.561 1.251 -0.000 0.00 0.00 C+0
ATOM 2 C 0 -3.261 -1.161 -0.000 0.00 0.00 C+0
ATOM 3 C 0 1.534 2.629 0.000 0.00 0.00 C+0
ATOM 4 C 0 2.247 -2.176 -0.000 0.00 0.00 C+0
ATOM 5 O 0 -0.438 -2.428 0.000 0.00 0.00 O+0
ATOM 6 O 0 2.994 0.384 0.000 0.00 0.00 O+0
ATOM 7 C 0 -0.016 -1.285 -0.000 0.00 0.00 C+0
ATOM 8 C 0 1.791 0.208 0.000 0.00 0.00 C+0
ATOM 9 C 0 -0.911 -0.194 -0.000 0.00 0.00 C+0
ATOM 10 C 0 -0.403 1.099 -0.000 0.00 0.00 C+0
ATOM 11 N 0 -1.445 1.934 -0.000 0.00 0.00 N+0
ATOM 12 N 0 0.971 1.277 -0.000 0.00 0.00 N+0
ATOM 13 N 0 1.312 -1.048 -0.000 0.00 0.00 N+0
ATOM 14 N 0 -2.286 -0.068 0.000 0.00 0.00 N+0
ATOM 15 H 0 -3.552 1.680 0.004 0.00 0.00 H+0
ATOM 16 H 0 -3.503 -1.433 1.028 0.00 0.00 H+0
ATOM 17 H 0 -4.168 -0.840 -0.514 0.00 0.00 H+0
ATOM 18 H 0 -2.839 -2.025 -0.514 0.00 0.00 H+0
ATOM 19 H 0 1.673 2.965 1.028 0.00 0.00 H+0
ATOM 20 H 0 2.495 2.623 -0.514 0.00 0.00 H+0
ATOM 21 H 0 0.851 3.307 -0.514 0.00 0.00 H+0
ATOM 22 H 0 2.478 -2.456 -1.028 0.00 0.00 H+0
ATOM 23 H 0 3.164 -1.888 0.513 0.00 0.00 H+0
ATOM 24 H 0 1.793 -3.024 0.514 0.00 0.00 H+0
CONECT 1 14 11 15 0 NONE 29
CONECT 2 14 16 17 18 NONE 30
CONECT 3 12 19 20 21 NONE 31
CONECT 4 13 22 23 24 NONE 32
CONECT 5 7 0 0 0 NONE 33
CONECT 6 8 0 0 0 NONE 34
CONECT 7 9 13 5 0 NONE 35
CONECT 8 12 6 13 0 NONE 36
CONECT 9 10 7 14 0 NONE 37
CONECT 10 9 12 11 0 NONE 38
CONECT 11 10 1 0 0 NONE 39
CONECT 12 10 8 3 0 NONE 40
CONECT 13 7 4 8 0 NONE 41
CONECT 14 9 1 2 0 NONE 42
END NONE 43
ORIGX1 1.000000 0.000000 0.000000 0.00000
ORIGX2 0.000000 1.000000 0.000000 0.00000
ORIGX3 0.000000 0.000000 1.000000 0.00000
SCALE1 0.100000 0.000000 0.000000 0.00000
SCALE2 0.000000 0.100000 0.000000 0.00000
SCALE3 0.000000 0.000000 0.100000 0.00000
ATOM 1 C 1 -7.323 0.716 -5.120 1.00 0.00
ATOM 2 C 1 -8.580 0.025 -4.537 1.00 0.00
ATOM 3 C 1 -9.814 0.931 -4.416 1.00 0.00
ATOM 4 C 1 -9.476 2.171 -3.582 1.00 0.00
ATOM 5 O 1 -10.603 3.009 -3.488 1.00 0.00
ATOM 6 C 1 -7.105 2.022 -4.368 1.00 0.00
ATOM 7 C 1 -8.298 2.936 -4.191 1.00 0.00
ATOM 8 H 1 -9.230 1.870 -2.536 1.00 0.00
ATOM 9 H 1 -10.862 3.297 -4.348 1.00 0.00
ATOM 10 H 1 -10.173 1.239 -5.425 1.00 0.00
ATOM 11 H 1 -10.653 0.372 -3.935 1.00 0.00
ATOM 12 C 1 -5.905 2.409 -3.906 1.00 0.00
ATOM 13 C 1 -4.641 1.613 -4.039 1.00 0.00
ATOM 14 H 1 -8.856 -0.863 -5.151 1.00 0.00
ATOM 15 H 1 -8.349 -0.350 -3.512 1.00 0.00
ATOM 16 H 1 -8.053 3.806 -3.539 1.00 0.00
ATOM 17 H 1 -8.589 3.360 -5.178 1.00 0.00
ATOM 18 C 1 -7.556 1.063 -6.606 1.00 0.00
ATOM 19 H 1 -6.656 1.519 -7.073 1.00 0.00
ATOM 20 H 1 -7.847 0.176 -7.211 1.00 0.00
ATOM 21 H 1 -8.382 1.793 -6.753 1.00 0.00
ATOM 22 C 1 -6.098 -0.229 -4.938 1.00 0.00
ATOM 23 C 1 -4.758 0.515 -5.105 1.00 0.00
ATOM 24 H 1 -3.807 2.303 -4.306 1.00 0.00
ATOM 25 H 1 -4.416 1.181 -3.036 1.00 0.00
ATOM 26 H 1 -6.101 -0.569 -3.874 1.00 0.00
ATOM 27 H 1 -4.726 1.004 -6.104 1.00 0.00
ATOM 28 C 1 -6.149 -1.518 -5.786 1.00 0.00
ATOM 29 C 1 -3.583 -0.466 -4.987 1.00 0.00
ATOM 30 C 1 -3.610 -1.635 -5.997 1.00 0.00
ATOM 31 C 1 -4.900 -2.410 -5.665 1.00 0.00
ATOM 32 H 1 -7.038 -2.128 -5.500 1.00 0.00
ATOM 33 H 1 -6.283 -1.269 -6.861 1.00 0.00
ATOM 34 H 1 -4.850 -2.821 -4.629 1.00 0.00
ATOM 35 H 1 -5.024 -3.287 -6.338 1.00 0.00
ATOM 36 H 1 -3.640 -0.901 -3.959 1.00 0.00
ATOM 37 C 1 -3.594 -1.172 -7.468 1.00 0.00
ATOM 38 H 1 -3.716 -2.030 -8.165 1.00 0.00
ATOM 39 H 1 -4.409 -0.460 -7.718 1.00 0.00
ATOM 40 H 1 -2.644 -0.664 -7.746 1.00 0.00
ATOM 41 C 1 -2.273 -2.341 -5.642 1.00 0.00
ATOM 42 C 1 -1.314 -1.155 -5.356 1.00 0.00
ATOM 43 C 1 -2.169 0.102 -5.114 1.00 0.00
ATOM 44 H 1 -0.681 -1.369 -4.463 1.00 0.00
ATOM 45 H 1 -0.630 -0.965 -6.217 1.00 0.00
ATOM 46 H 1 -2.116 0.800 -5.982 1.00 0.00
ATOM 47 H 1 -1.847 0.664 -4.206 1.00 0.00
ATOM 48 H 1 -2.438 -2.878 -4.677 1.00 0.00
ATOM 49 C 1 -1.661 -3.375 -6.619 1.00 0.00
ATOM 50 C 1 -2.627 -4.529 -6.939 1.00 0.00
ATOM 51 C 1 -0.337 -3.949 -6.059 1.00 0.00
ATOM 52 C 1 0.515 -4.714 -7.088 1.00 0.00
ATOM 53 C 1 1.887 -5.111 -6.518 1.00 0.00
ATOM 54 C 1 2.733 -5.984 -7.466 1.00 0.00
ATOM 55 C 1 4.014 -6.450 -6.753 1.00 0.00
ATOM 56 C 1 3.101 -5.250 -8.766 1.00 0.00
ATOM 57 H 1 -2.156 -5.315 -7.569 1.00 0.00
ATOM 58 H 1 -2.994 -5.018 -6.008 1.00 0.00
ATOM 59 H 1 -3.504 -4.190 -7.530 1.00 0.00
ATOM 60 H 1 0.302 -3.122 -5.677 1.00 0.00
ATOM 61 H 1 -0.560 -4.605 -5.185 1.00 0.00
ATOM 62 H 1 -0.009 -5.640 -7.418 1.00 0.00
ATOM 63 H 1 0.654 -4.067 -7.985 1.00 0.00
ATOM 64 H 1 4.625 -7.113 -7.409 1.00 0.00
ATOM 65 H 1 4.650 -5.583 -6.461 1.00 0.00
ATOM 66 H 1 3.779 -7.028 -5.830 1.00 0.00
ATOM 67 H 1 3.761 -5.877 -9.409 1.00 0.00
ATOM 68 H 1 2.201 -5.009 -9.377 1.00 0.00
ATOM 69 H 1 3.639 -4.299 -8.553 1.00 0.00
ATOM 70 H 1 2.141 -6.894 -7.733 1.00 0.00
ATOM 71 H 1 2.463 -4.192 -6.255 1.00 0.00
ATOM 72 H 1 1.720 -5.673 -5.569 1.00 0.00
ATOM 73 H 1 -1.419 -2.850 -7.574 1.00 0.00
ATOM 74 H 1 -5.813 3.367 -3.367 1.00 0.00
TER 75
CONECT 1 2
CONECT 2 1
CONECT 2 3
CONECT 3 2
CONECT 3 4
CONECT 4 3
CONECT 4 5
CONECT 5 4
CONECT 1 6
CONECT 6 1
CONECT 6 7
CONECT 7 6
CONECT 7 4
CONECT 4 7
CONECT 4 8
CONECT 8 4
CONECT 5 9
CONECT 9 5
CONECT 3 10
CONECT 10 3
CONECT 3 11
CONECT 11 3
CONECT 6 12
CONECT 12 6
CONECT 12 13
CONECT 13 12
CONECT 2 14
CONECT 14 2
CONECT 2 15
CONECT 15 2
CONECT 7 16
CONECT 16 7
CONECT 7 17
CONECT 17 7
CONECT 1 18
CONECT 18 1
CONECT 18 19
CONECT 19 18
CONECT 18 20
CONECT 20 18
CONECT 18 21
CONECT 21 18
CONECT 1 22
CONECT 22 1
CONECT 22 23
CONECT 23 22
CONECT 23 13
CONECT 13 23
CONECT 13 24
CONECT 24 13
CONECT 13 25
CONECT 25 13
CONECT 22 26
CONECT 26 22
CONECT 23 27
CONECT 27 23
CONECT 22 28
CONECT 28 22
CONECT 23 29
CONECT 29 23
CONECT 29 30
CONECT 30 29
CONECT 28 31
CONECT 31 28
CONECT 31 30
CONECT 30 31
CONECT 28 32
CONECT 32 28
CONECT 28 33
CONECT 33 28
CONECT 31 34
CONECT 34 31
CONECT 31 35
CONECT 35 31
CONECT 29 36
CONECT 36 29
CONECT 30 37
CONECT 37 30
CONECT 37 38
CONECT 38 37
CONECT 37 39
CONECT 39 37
CONECT 37 40
CONECT 40 37
CONECT 30 41
CONECT 41 30
CONECT 41 42
CONECT 42 41
CONECT 42 43
CONECT 43 42
CONECT 43 29
CONECT 29 43
CONECT 42 44
CONECT 44 42
CONECT 42 45
CONECT 45 42
CONECT 43 46
CONECT 46 43
CONECT 43 47
CONECT 47 43
CONECT 41 48
CONECT 48 41
CONECT 41 49
CONECT 49 41
CONECT 49 50
CONECT 50 49
CONECT 49 51
CONECT 51 49
CONECT 51 52
CONECT 52 51
CONECT 52 53
CONECT 53 52
CONECT 53 54
CONECT 54 53
CONECT 54 55
CONECT 55 54
CONECT 54 56
CONECT 56 54
CONECT 50 57
CONECT 57 50
CONECT 50 58
CONECT 58 50
CONECT 50 59
CONECT 59 50
CONECT 51 60
CONECT 60 51
CONECT 51 61
CONECT 61 51
CONECT 52 62
CONECT 62 52
CONECT 52 63
CONECT 63 52
CONECT 55 64
CONECT 64 55
CONECT 55 65
CONECT 65 55
CONECT 55 66
CONECT 66 55
CONECT 56 67
CONECT 67 56
CONECT 56 68
CONECT 68 56
CONECT 56 69
CONECT 69 56
CONECT 54 70
CONECT 70 54
CONECT 53 71
CONECT 71 53
CONECT 53 72
CONECT 72 53
CONECT 49 73
CONECT 73 49
CONECT 12 74
CONECT 74 12
MASTER 0 0 0 0 0 0 0 6 74 1 154 0
END
COMPND
REMARK 1 PDB to MMOD atom-numbering translation table; the mmod numbers
REMARK 1 pertain to the .dat file from which this file was created,
REMARK 1 not to one created from this file:
REMARK 1 PDB: 1 2 3 4 5 6 7 8 9
REMARK 1 MMOD: 1 2 3 4 5 6 7 8 19 /
REMARK 1 PDB: 10 11 12 13 14 15 16 17 18
REMARK 1 MMOD: 23 24 25 26 30 31 32 33 34 /
REMARK 1 PDB: 19 20 21 22 23 24 25 26 27
REMARK 1 MMOD: 35 36 37 38 9 10 11 12 13 /
REMARK 1 PDB: 28 29 30 31 32 33 34 35 36
REMARK 1 MMOD: 14 15 16 17 18 20 21 22 27 /
REMARK 1 PDB: 37 38 39 40 41 42 43
REMARK 1 MMOD: 28 29 39 40 41 42 43 /
HETATM 1 C01 UNK 0 -0.579 -1.681 0.616 0.00 0.00 0
HETATM 2 C02 UNK 0 -1.566 0.560 -0.170 0.04 0.04 0
HETATM 3 C03 UNK 0 -1.162 1.032 1.249 0.01 0.01 0
HETATM 4 C04 UNK 0 -2.199 0.552 2.293 0.00 0.00 0
HETATM 5 C05 UNK 0 -1.649 -0.811 2.760 0.00 0.00 0
HETATM 6 C06 UNK 0 -0.340 -0.968 1.960 0.01 0.01 0
HETATM 7 N07 UNK 0 0.044 0.417 1.782 0.19 0.19 0
HETATM 8 C08 UNK 0 -1.653 -0.989 -0.246 0.07 0.07 0
HETATM 9 C19 UNK 0 1.272 0.616 1.044 0.01 0.01 0
HETATM 10 C23 UNK 0 -0.901 1.274 -1.354 0.38 0.38 0
HETATM 11 O24 UNK 0 -0.195 2.368 -0.946 0.59 0.59 0
HETATM 12 O25 UNK 0 -1.037 0.929 -2.512 -0.45 -0.45 0
HETATM 13 C26 UNK 0 0.440 3.093 -1.986 0.07 0.07 0
HETATM 14 O30 UNK 0 -1.609 -1.430 -1.593 0.59 0.59 0
HETATM 15 C31 UNK 0 -1.789 -2.754 -1.882 0.42 0.42 0
HETATM 16 O32 UNK 0 -2.125 -3.580 -1.053 -0.45 -0.45 0
HETATM 17 C33 UNK 0 -1.523 -3.209 -3.279 0.00 0.00 0
HETATM 18 C34 UNK 0 -0.997 -2.329 -4.230 0.00 0.00 0
HETATM 19 C35 UNK 0 -0.765 -2.755 -5.540 0.00 0.00 0
HETATM 20 C36 UNK 0 -1.059 -4.064 -5.914 0.00 0.00 0
HETATM 21 C37 UNK 0 -1.581 -4.946 -4.971 0.00 0.00 0
HETATM 22 C38 UNK 0 -1.813 -4.523 -3.662 0.00 0.00 0
HETATM 23 H09 UNK 0 -0.884 -2.728 0.852 0.00 0.00 0
HETATM 24 H10 UNK 0 0.374 -1.778 0.044 0.00 0.00 0
HETATM 25 H11 UNK 0 -2.605 0.931 -0.328 0.00 0.00 0
HETATM 26 H12 UNK 0 -1.090 2.146 1.298 0.00 0.00 0
HETATM 27 H13 UNK 0 -2.229 1.262 3.154 0.00 0.00 0
HETATM 28 H14 UNK 0 -3.233 0.480 1.883 0.00 0.00 0
HETATM 29 H15 UNK 0 -1.434 -0.778 3.855 0.00 0.00 0
HETATM 30 H16 UNK 0 -2.361 -1.651 2.584 0.00 0.00 0
HETATM 31 H17 UNK 0 0.429 -1.522 2.552 0.00 0.00 0
HETATM 32 H18 UNK 0 -2.651 -1.286 0.167 0.00 0.00 0
HETATM 33 H20 UNK 0 1.203 0.272 -0.011 0.00 0.00 0
HETATM 34 H21 UNK 0 1.546 1.695 1.056 0.00 0.00 0
HETATM 35 H22 UNK 0 2.105 0.067 1.538 0.00 0.00 0
HETATM 36 H27 UNK 0 1.178 3.787 -1.521 0.00 0.00 0
HETATM 37 H28 UNK 0 0.992 2.401 -2.667 0.00 0.00 0
HETATM 38 H29 UNK 0 -0.320 3.686 -2.550 0.00 0.00 0
HETATM 39 H39 UNK 0 -0.751 -1.289 -3.968 0.00 0.00 0
HETATM 40 H40 UNK 0 -0.350 -2.053 -6.284 0.00 0.00 0
HETATM 41 H41 UNK 0 -0.880 -4.399 -6.951 0.00 0.00 0
HETATM 42 H42 UNK 0 -1.815 -5.985 -5.264 0.00 0.00 0
HETATM 43 H43 UNK 0 -2.228 -5.248 -2.942 0.00 0.00 0
CONECT 1 6 8 23 24
CONECT 2 3 8 25 10
CONECT 3 2 4 7 26
CONECT 4 3 5 27 28
CONECT 5 4 6 29 30
CONECT 6 5 1 7 31
CONECT 7 6 3 9
CONECT 8 2 1 32 14
CONECT 9 7 33 34 35
CONECT 10 11 2
CONECT 10 12
CONECT 10 12
CONECT 11 10 13
CONECT 12 10
CONECT 12 10
CONECT 13 11 36 37 38
CONECT 14 8 15
CONECT 15 14 17
CONECT 15 16
CONECT 15 16
CONECT 16 15
CONECT 16 15
CONECT 17 22 15
CONECT 17 18
CONECT 17 18
CONECT 18 19 39
CONECT 18 17
CONECT 18 17
CONECT 19 18 40
CONECT 19 20
CONECT 19 20
CONECT 20 21 41
CONECT 20 19
CONECT 20 19
CONECT 21 20 42
CONECT 21 22
CONECT 21 22
CONECT 22 17 43
CONECT 22 21
CONECT 22 21
CONECT 23 1
CONECT 24 1
CONECT 25 2
CONECT 26 3
CONECT 27 4
CONECT 28 4
CONECT 29 5
CONECT 30 5
CONECT 31 6
CONECT 32 8
CONECT 33 9
CONECT 34 9
CONECT 35 9
CONECT 36 13
CONECT 37 13
CONECT 38 13
CONECT 39 18
CONECT 40 19
CONECT 41 20
CONECT 42 21
CONECT 43 22
END
HEADER MOLECULE
COMPND COPPER, MULTILAYER
AUTHOR A. W. MAVERICK
ATOM 1 CU UNK 1 -1.278 -2.214 -6.261 1.00 0.00
ATOM 2 CU UNK 1 1.278 -2.214 -6.261 1.00 0.00
ATOM 3 CU UNK 1 0.000 0.000 -6.261 1.00 0.00
ATOM 4 CU UNK 1 2.556 0.000 -6.261 1.00 0.00
ATOM 5 CU UNK 1 1.278 2.214 -6.261 1.00 0.00
ATOM 6 CU UNK 1 -1.278 2.214 -6.261 1.00 0.00
ATOM 7 CU UNK 1 -2.556 0.000 -6.261 1.00 0.00
ATOM 8 CU UNK 1 0.000 -1.476 -4.174 1.00 0.00
ATOM 9 CU UNK 1 2.556 -1.476 -4.174 1.00 0.00
ATOM 10 CU UNK 1 1.278 0.738 -4.174 1.00 0.00
ATOM 11 CU UNK 1 -1.278 0.738 -4.174 1.00 0.00
ATOM 12 CU UNK 1 0.000 2.951 -4.174 1.00 0.00
ATOM 13 CU UNK 1 -2.556 -1.476 -4.174 1.00 0.00
ATOM 14 CU UNK 1 -1.278 -0.738 -2.087 1.00 0.00
ATOM 15 CU UNK 1 -2.556 1.476 -2.087 1.00 0.00
ATOM 16 CU UNK 1 0.000 1.476 -2.087 1.00 0.00
ATOM 17 CU UNK 1 1.278 -0.738 -2.087 1.00 0.00
ATOM 18 CU UNK 1 2.556 1.476 -2.087 1.00 0.00
ATOM 19 CU UNK 1 0.000 -2.951 -2.087 1.00 0.00
ATOM 20 CU UNK 1 -1.278 -2.214 0.000 1.00 0.00
ATOM 21 CU UNK 1 1.278 -2.214 0.000 1.00 0.00
ATOM 22 CU UNK 1 0.000 0.000 0.000 1.00 0.00
ATOM 23 CU UNK 1 2.556 0.000 0.000 1.00 0.00
ATOM 24 CU UNK 1 1.278 2.214 0.000 1.00 0.00
ATOM 25 CU UNK 1 -1.278 2.214 0.000 1.00 0.00
ATOM 26 CU UNK 1 -2.556 0.000 0.000 1.00 0.00
ATOM 27 CU UNK 1 0.000 -1.476 2.087 1.00 0.00
ATOM 28 CU UNK 1 2.556 -1.476 2.087 1.00 0.00
ATOM 29 CU UNK 1 1.278 0.738 2.087 1.00 0.00
ATOM 30 CU UNK 1 -1.278 0.738 2.087 1.00 0.00
ATOM 31 CU UNK 1 0.000 2.951 2.087 1.00 0.00
ATOM 32 CU UNK 1 -2.556 -1.476 2.087 1.00 0.00
ATOM 33 CU UNK 1 -1.278 -0.738 4.174 1.00 0.00
ATOM 34 CU UNK 1 -2.556 1.476 4.174 1.00 0.00
ATOM 35 CU UNK 1 0.000 1.476 4.174 1.00 0.00
ATOM 36 CU UNK 1 1.278 -0.738 4.174 1.00 0.00
ATOM 37 CU UNK 1 2.556 1.476 4.174 1.00 0.00
ATOM 38 CU UNK 1 0.000 -2.951 4.174 1.00 0.00
ATOM 39 CU UNK 1 -1.278 -2.214 6.261 1.00 0.00
ATOM 40 CU UNK 1 1.278 -2.214 6.261 1.00 0.00
ATOM 41 CU UNK 1 0.000 0.000 6.261 1.00 0.00
ATOM 42 CU UNK 1 2.556 0.000 6.261 1.00 0.00
ATOM 43 CU UNK 1 1.278 2.214 6.261 1.00 0.00
ATOM 44 CU UNK 1 -1.278 2.214 6.261 1.00 0.00
ATOM 45 CU UNK 1 -2.556 0.000 6.261 1.00 0.00
CONECT 1 13
CONECT 1 2 3 7 8
CONECT 2 9
CONECT 2 1 3 4 8
CONECT 3 1 2 4 5
CONECT 3 6 7 8 10
CONECT 3 11
CONECT 4 10
CONECT 4 2 3 5 9
CONECT 5 3 4 6 10
CONECT 5 12
CONECT 6 3 5 7 11
CONECT 6 12
CONECT 7 1 3 6 11
CONECT 7 13
CONECT 8 1 2 3 9
CONECT 8 17 19
CONECT 8 10 11 13 14
CONECT 9 2 4 8 10
CONECT 9 17
CONECT 10 17 18
CONECT 10 3 4 5 8
CONECT 10 9 11 12 16
CONECT 11 10 12 13 14
CONECT 11 3 6 7 8
CONECT 11 15 16
CONECT 12 16
CONECT 12 5 6 10 11
CONECT 13 14
CONECT 13 1 7 8 11
CONECT 14 22 26
CONECT 14 8 11 13 15
CONECT 14 16 17 19 20
CONECT 15 11 14 16 25
CONECT 15 26
CONECT 16 24 25
CONECT 16 10 11 12 14
CONECT 16 15 17 18 22
CONECT 17 16 18 19 21
CONECT 17 8 9 10 14
CONECT 17 22 23
CONECT 18 24
CONECT 18 10 16 17 23
CONECT 19 21
CONECT 19 8 14 17 20
CONECT 20 14 19 21 22
CONECT 20 26 27 32
CONECT 21 17 19 20 22
CONECT 21 23 27 28
CONECT 22 26 27 29 30
CONECT 22 21 23 24 25
CONECT 22 14 16 17 20
CONECT 23 17 18 21 22
CONECT 23 24 28 29
CONECT 24 25 29 31
CONECT 24 16 18 22 23
CONECT 25 15 16 22 24
CONECT 25 26 30 31
CONECT 26 14 15 20 22
CONECT 26 25 30 32
CONECT 27 36 38
CONECT 27 29 30 32 33
CONECT 27 20 21 22 28
CONECT 28 21 23 27 29
CONECT 28 36
CONECT 29 36 37
CONECT 29 28 30 31 35
CONECT 29 22 23 24 27
CONECT 30 29 31 32 33
CONECT 30 34 35
CONECT 30 22 25 26 27
CONECT 31 35
CONECT 31 24 25 29 30
CONECT 32 33
CONECT 32 20 26 27 30
CONECT 33 35 36 38 39
CONECT 33 41 45
CONECT 33 27 30 32 34
CONECT 34 45
CONECT 34 30 33 35 44
CONECT 35 29 30 31 33
CONECT 35 34 36 37 41
CONECT 35 43 44
CONECT 36 27 28 29 33
CONECT 36 35 37 38 40
CONECT 36 41 42
CONECT 37 43
CONECT 37 29 35 36 42
CONECT 38 40
CONECT 38 27 33 36 39
CONECT 39 33 38 40 41
CONECT 39 45
CONECT 40 36 38 39 41
CONECT 40 42
CONECT 41 33 35 36 39
CONECT 41 45
CONECT 41 40 42 43 44
CONECT 42 36 37 40 41
CONECT 42 43
CONECT 43 35 37 41 42
CONECT 43 44
CONECT 44 34 35 41 43
CONECT 44 45
CONECT 45 33 34 39 41
CONECT 45 44
MASTER 0 0 0 0 0 0 0 0 45 0 45 0
END
HEADER NONAME 23-Apr-10 NONE 1
TITLE NONE 2
AUTHOR Chemical Structure Services at http://cactus.nci.nih.gov NONE 3
REVDAT 1 23-Apr-10 0 NONE 4
ATOM 1 C 0 0.414 0.765 0.999 0.00 0.00 C+0
ATOM 2 C 0 0.414 -0.765 0.999 0.00 0.00 C+0
ATOM 3 C 0 0.999 0.765 -0.414 0.00 0.00 C+0
ATOM 4 C 0 -1.000 0.765 0.414 0.00 0.00 C+0
ATOM 5 C 0 0.999 -0.765 -0.414 0.00 0.00 C+0
ATOM 6 C 0 -1.000 -0.765 0.414 0.00 0.00 C+0
ATOM 7 C 0 -0.414 0.765 -1.000 0.00 0.00 C+0
ATOM 8 C 0 -0.414 -0.765 -1.000 0.00 0.00 C+0
ATOM 9 H 0 0.756 1.394 1.822 0.00 0.00 H+0
ATOM 10 H 0 0.756 -1.394 1.822 0.00 0.00 H+0
ATOM 11 H 0 1.823 1.394 -0.754 0.00 0.00 H+0
ATOM 12 H 0 -1.822 1.394 0.756 0.00 0.00 H+0
ATOM 13 H 0 1.823 -1.394 -0.754 0.00 0.00 H+0
ATOM 14 H 0 -1.822 -1.394 0.756 0.00 0.00 H+0
ATOM 15 H 0 -0.754 1.396 -1.821 0.00 0.00 H+0
ATOM 16 H 0 -0.754 -1.396 -1.821 0.00 0.00 H+0
CONECT 1 2 3 4 9 NONE 21
CONECT 2 1 5 6 10 NONE 22
CONECT 3 1 5 7 11 NONE 23
CONECT 4 1 6 7 12 NONE 24
CONECT 5 2 3 8 13 NONE 25
CONECT 6 2 4 8 14 NONE 26
CONECT 7 3 4 8 15 NONE 27
CONECT 8 5 6 7 16 NONE 28
END NONE 29
HEADER NONAME 23-Apr-10 NONE 1
TITLE NONE 2
AUTHOR Chemical Structure Services at http://cactus.nci.nih.gov NONE 3
REVDAT 1 23-Apr-10 0 NONE 4
ATOM 1 C 0 0.011 -0.566 0.000 0.00 0.00 C+0
ATOM 2 C 0 -1.285 0.246 -0.000 0.00 0.00 C+0
ATOM 3 H 0 1.925 -0.229 -0.000 0.00 0.00 H+0
ATOM 4 O 0 1.130 0.322 0.000 0.00 0.00 O+0
ATOM 5 H 0 0.046 -1.195 0.890 0.00 0.00 H+0
ATOM 6 H 0 0.046 -1.195 -0.890 0.00 0.00 H+0
ATOM 7 H 0 -2.139 -0.432 0.000 0.00 0.00 H+0
ATOM 8 H 0 -1.320 0.875 0.890 0.00 0.00 H+0
ATOM 9 H 0 -1.320 0.875 -0.890 0.00 0.00 H+0
CONECT 1 2 4 5 6 NONE 14
CONECT 2 7 8 9 0 NONE 15
CONECT 4 3 0 0 0 NONE 16
END NONE 17
COMPND
REMARK 1 PDB to MMOD atom-numbering translation table; the mmod numbers
REMARK 1 pertain to the .dat file from which this file was created,
REMARK 1 not to one created from this file:
REMARK 1 PDB: 1 2 3 4 5 6 7 8 9
REMARK 1 MMOD: 1 2 3 4 5 6 7 8 9 /
REMARK 1 PDB: 10 11 12 13 14 15 16 17 18
REMARK 1 MMOD: 10 11 23 12 13 14 15 16 17 /
REMARK 1 PDB: 19 20 21 22 23 24
REMARK 1 MMOD: 18 19 20 21 22 24 /
HETATM 1 C01 UNK A 1 -10.447 3.465 0.000 0.00 0.00 0
HETATM 2 C02 UNK A 1 -11.071 4.006 1.273 0.00 0.00 0
HETATM 3 C03 UNK A 1 -12.577 4.148 1.128 0.00 0.00 0
HETATM 4 C04 UNK A 1 -12.891 4.988 -0.105 0.00 0.00 0
HETATM 5 C05 UNK A 1 -12.200 4.411 -1.349 0.00 0.00 0
HETATM 6 O06 UNK A 1 -10.802 4.239 -1.130 0.00 0.00 0
HETATM 7 O07 UNK A 1 -10.803 3.104 2.323 0.00 0.00 0
HETATM 8 O08 UNK A 1 -13.072 4.770 2.296 0.00 0.00 0
HETATM 9 O09 UNK A 1 -14.294 4.984 -0.281 0.00 0.00 0
HETATM 10 C10 UNK A 1 -12.311 5.317 -2.577 0.00 0.00 0
HETATM 11 O11 UNK A 1 -13.660 5.466 -2.961 0.00 0.00 0
HETATM 12 O23 UNK A 1 -9.045 3.478 0.138 0.00 0.00 0
HETATM 13 H12 UNK A 1 -9.995 3.339 2.755 0.00 0.00 0
HETATM 14 H13 UNK A 1 -12.863 4.206 3.024 0.00 0.00 0
HETATM 15 H14 UNK A 1 -13.704 6.000 -3.739 0.00 0.00 0
HETATM 16 H15 UNK A 1 -10.793 2.419 -0.156 0.00 0.00 0
HETATM 17 H16 UNK A 1 -10.626 4.997 1.513 0.00 0.00 0
HETATM 18 H17 UNK A 1 -13.037 3.141 1.020 0.00 0.00 0
HETATM 19 H18 UNK A 1 -12.542 6.032 0.061 0.00 0.00 0
HETATM 20 H19 UNK A 1 -12.653 3.423 -1.588 0.00 0.00 0
HETATM 21 H20 UNK A 1 -14.475 5.505 -1.044 0.00 0.00 0
HETATM 22 H21 UNK A 1 -11.886 6.317 -2.335 0.00 0.00 0
HETATM 23 H22 UNK A 1 -11.738 4.866 -3.418 0.00 0.00 0
HETATM 24 H24 UNK A 1 -8.822 2.951 0.906 0.00 0.00 0
CONECT 1 2 6 12 16
CONECT 2 1 3 7 17
CONECT 3 2 4 8 18
CONECT 4 3 5 9 19
CONECT 5 4 6 10 20
CONECT 6 5 1
CONECT 7 2 13
CONECT 8 3 14
CONECT 9 4 21
CONECT 10 5 11 22 23
CONECT 11 10 15
CONECT 12 1 24
CONECT 13 7
CONECT 14 8
CONECT 15 11
CONECT 16 1
CONECT 17 2
CONECT 18 3
CONECT 19 4
CONECT 20 5
CONECT 21 9
CONECT 22 10
CONECT 23 10
CONECT 24 12
END
HEADER
REMARK Spartan exported Fri Jan 30 16:10:52 1998
HETATM 1 C UNK 0001 4.141 3.305 -3.641
HETATM 2 C UNK 0001 3.254 3.762 -2.621
HETATM 3 C UNK 0001 1.962 0.786 -4.295
HETATM 4 C UNK 0001 2.087 0.286 -2.965
HETATM 5 C UNK 0001 -0.217 -1.734 -4.949
HETATM 6 C UNK 0001 -1.104 -1.278 -3.929
HETATM 7 C UNK 0001 -2.397 -4.254 -5.603
HETATM 8 C UNK 0001 -2.272 -4.753 -4.273
HETATM 9 C UNK 0001 2.265 4.743 -2.925
HETATM 10 C UNK 0001 1.378 5.199 -1.906
HETATM 11 C UNK 0001 0.085 2.223 -3.579
HETATM 12 C UNK 0001 0.210 1.724 -2.249
HETATM 13 C UNK 0001 -2.094 -0.297 -4.233
HETATM 14 C UNK 0001 -2.981 0.160 -3.214
HETATM 15 C UNK 0001 -4.273 -2.817 -4.887
HETATM 16 C UNK 0001 -4.148 -3.316 -3.557
HETATM 17 C UNK 0001 0.388 6.180 -2.210
HETATM 18 C UNK 0001 -0.499 6.636 -1.190
HETATM 19 C UNK 0001 -1.792 3.660 -2.864
HETATM 20 C UNK 0001 -1.666 3.161 -1.533
HETATM 21 C UNK 0001 -3.971 1.141 -3.518
HETATM 22 C UNK 0001 -4.858 1.597 -2.498
HETATM 23 C UNK 0001 -6.150 -1.379 -4.172
HETATM 24 C UNK 0001 -6.025 -1.878 -2.841
HETATM 25 C UNK 0001 -1.489 7.617 -1.494
HETATM 26 C UNK 0001 -2.376 8.074 -0.474
HETATM 27 C UNK 0001 -3.668 5.098 -2.148
HETATM 28 C UNK 0001 -3.543 4.598 -0.818
HETATM 29 C UNK 0001 -5.848 2.578 -2.802
HETATM 30 C UNK 0001 -6.734 3.034 -1.782
HETATM 31 C UNK 0001 -8.027 0.058 -3.456
HETATM 32 C UNK 0001 -7.902 -0.441 -2.126
HETATM 33 C UNK 0001 -3.366 9.055 -0.778
HETATM 34 C UNK 0001 -4.252 9.511 0.242
HETATM 35 C UNK 0001 -5.545 6.535 -1.432
HETATM 36 C UNK 0001 -5.420 6.036 -0.102
HETATM 37 C UNK 0001 -7.724 4.015 -2.086
HETATM 38 C UNK 0001 -8.611 4.472 -1.066
HETATM 39 C UNK 0001 -9.904 1.496 -2.740
HETATM 40 C UNK 0001 -9.779 0.996 -1.410
HETATM 41 C UNK 0001 5.300 1.876 -1.994
HETATM 42 C UNK 0001 4.413 2.332 -0.974
HETATM 43 C UNK 0001 3.121 -0.644 -2.648
HETATM 44 C UNK 0001 3.246 -1.143 -1.317
HETATM 45 C UNK 0001 0.941 -3.164 -3.302
HETATM 46 C UNK 0001 0.055 -2.707 -2.282
HETATM 47 C UNK 0001 -1.238 -5.684 -3.956
HETATM 48 C UNK 0001 -1.113 -6.183 -2.625
HETATM 49 C UNK 0001 3.423 3.313 -1.278
HETATM 50 C UNK 0001 2.536 3.769 -0.258
HETATM 51 C UNK 0001 1.244 0.793 -1.932
HETATM 52 C UNK 0001 1.369 0.294 -0.601
HETATM 53 C UNK 0001 -0.935 -1.727 -2.586
HETATM 54 C UNK 0001 -1.822 -1.270 -1.566
HETATM 55 C UNK 0001 -3.115 -4.246 -3.240
HETATM 56 C UNK 0001 -2.990 -4.746 -1.910
HETATM 57 C UNK 0001 1.546 4.750 -0.562
HETATM 58 C UNK 0001 0.660 5.207 0.458
HETATM 59 C UNK 0001 -0.633 2.231 -1.216
HETATM 60 C UNK 0001 -0.508 1.731 0.114
HETATM 61 C UNK 0001 -2.812 -0.289 -1.870
HETATM 62 C UNK 0001 -3.699 0.167 -0.850
HETATM 63 C UNK 0001 -4.991 -2.809 -2.524
HETATM 64 C UNK 0001 -4.866 -3.308 -1.194
HETATM 65 C UNK 0001 -0.330 6.188 0.154
HETATM 66 C UNK 0001 -1.217 6.644 1.173
HETATM 67 C UNK 0001 -2.510 3.668 -0.500
HETATM 68 C UNK 0001 -2.385 3.169 0.830
HETATM 69 C UNK 0001 -4.689 1.148 -1.154
HETATM 70 C UNK 0001 -5.576 1.605 -0.135
HETATM 71 C UNK 0001 -6.868 -1.371 -1.808
HETATM 72 C UNK 0001 -6.743 -1.871 -0.478
HETATM 73 C UNK 0001 -2.207 7.625 0.869
HETATM 74 C UNK 0001 -3.094 8.082 1.889
HETATM 75 C UNK 0001 -4.386 5.105 0.215
HETATM 76 C UNK 0001 -4.261 4.606 1.546
HETATM 77 C UNK 0001 -6.566 2.586 -0.439
HETATM 78 C UNK 0001 -7.452 3.042 0.581
HETATM 79 C UNK 0001 -8.745 0.066 -1.093
HETATM 80 C UNK 0001 -8.620 -0.433 0.238
HETATM 81 C UNK 0001 6.459 0.446 -0.346
HETATM 82 C UNK 0001 5.572 0.902 0.674
HETATM 83 C UNK 0001 4.279 -2.074 -1.000
HETATM 84 C UNK 0001 4.404 -2.573 0.330
HETATM 85 C UNK 0001 2.100 -4.594 -1.654
HETATM 86 C UNK 0001 1.213 -4.137 -0.634
HETATM 87 C UNK 0001 -0.079 -7.113 -2.308
HETATM 88 C UNK 0001 0.046 -7.613 -0.978
HETATM 89 C UNK 0001 4.582 1.883 0.370
HETATM 90 C UNK 0001 3.695 2.340 1.389
HETATM 91 C UNK 0001 2.403 -0.637 -0.284
HETATM 92 C UNK 0001 2.528 -1.136 1.046
HETATM 93 C UNK 0001 0.223 -3.156 -0.938
HETATM 94 C UNK 0001 -0.664 -2.700 0.081
HETATM 95 C UNK 0001 -1.956 -5.676 -1.592
HETATM 96 C UNK 0001 -1.831 -6.175 -0.262
HETATM 97 C UNK 0001 2.705 3.321 1.085
HETATM 98 C UNK 0001 1.818 3.777 2.105
HETATM 99 C UNK 0001 0.526 0.801 0.431
HETATM 100 C UNK 0001 0.651 0.302 1.762
HETATM 101 C UNK 0001 -1.653 -1.719 -0.223
HETATM 102 C UNK 0001 -2.540 -1.262 0.797
HETATM 103 C UNK 0001 -3.833 -4.239 -0.877
HETATM 104 C UNK 0001 -3.708 -4.738 0.454
HETATM 105 C UNK 0001 0.828 4.758 1.801
HETATM 106 C UNK 0001 -0.058 5.214 2.821
HETATM 107 C UNK 0001 -1.351 2.238 1.147
HETATM 108 C UNK 0001 -1.226 1.739 2.477
HETATM 109 C UNK 0001 -3.530 -0.281 0.493
HETATM 110 C UNK 0001 -4.417 0.175 1.513
HETATM 111 C UNK 0001 -5.710 -2.801 -0.161
HETATM 112 C UNK 0001 -5.584 -3.300 1.169
HETATM 113 C UNK 0001 -1.048 6.195 2.517
HETATM 114 C UNK 0001 -1.935 6.652 3.537
HETATM 115 C UNK 0001 -3.228 3.676 1.863
HETATM 116 C UNK 0001 -3.103 3.176 3.193
HETATM 117 C UNK 0001 -5.407 1.156 1.209
HETATM 118 C UNK 0001 -6.294 1.612 2.229
HETATM 119 C UNK 0001 -7.586 -1.364 0.555
HETATM 120 C UNK 0001 -7.461 -1.863 1.885
HETATM 121 C UNK 0001 7.617 -0.984 1.301
HETATM 122 C UNK 0001 6.730 -0.528 2.321
HETATM 123 C UNK 0001 5.438 -3.504 0.647
HETATM 124 C UNK 0001 5.563 -4.003 1.978
HETATM 125 C UNK 0001 3.259 -6.023 -0.007
HETATM 126 C UNK 0001 2.372 -5.567 1.013
HETATM 127 C UNK 0001 1.079 -8.543 -0.661
HETATM 128 C UNK 0001 1.204 -9.042 0.670
HETATM 129 C UNK 0001 5.740 0.453 2.017
HETATM 130 C UNK 0001 4.854 0.910 3.037
HETATM 131 C UNK 0001 3.561 -2.066 1.363
HETATM 132 C UNK 0001 3.686 -2.566 2.694
HETATM 133 C UNK 0001 1.382 -4.586 0.709
HETATM 134 C UNK 0001 0.495 -4.130 1.729
HETATM 135 C UNK 0001 -0.797 -7.106 0.055
HETATM 136 C UNK 0001 -0.672 -7.605 1.385
HETATM 137 C UNK 0001 3.864 1.891 2.733
HETATM 138 C UNK 0001 2.977 2.347 3.753
HETATM 139 C UNK 0001 1.684 -0.629 2.079
HETATM 140 C UNK 0001 1.809 -1.128 3.409
HETATM 141 C UNK 0001 -0.495 -3.149 1.425
HETATM 142 C UNK 0001 -1.382 -2.692 2.445
HETATM 143 C UNK 0001 -2.674 -5.668 0.771
HETATM 144 C UNK 0001 -2.549 -6.168 2.101
HETATM 145 C UNK 0001 1.987 3.328 3.449
HETATM 146 C UNK 0001 1.100 3.785 4.468
HETATM 147 C UNK 0001 -0.192 0.809 2.795
HETATM 148 C UNK 0001 -0.067 0.309 4.125
HETATM 149 C UNK 0001 -2.372 -1.711 2.141
HETATM 150 C UNK 0001 -3.258 -1.255 3.160
HETATM 151 C UNK 0001 -4.551 -4.231 1.487
HETATM 152 C UNK 0001 -4.426 -4.730 2.817
HETATM 153 C UNK 0001 0.110 4.766 4.164
HETATM 154 C UNK 0001 -0.777 5.222 5.184
HETATM 155 C UNK 0001 -2.069 2.246 3.510
HETATM 156 C UNK 0001 -1.944 1.747 4.841
HETATM 157 C UNK 0001 -4.248 -0.274 2.856
HETATM 158 C UNK 0001 -5.135 0.183 3.876
HETATM 159 C UNK 0001 -6.428 -2.794 2.202
HETATM 160 C UNK 0001 -6.303 -3.293 3.533
HETATM 161 C UNK 0001 8.776 -2.414 2.949
HETATM 162 C UNK 0001 7.889 -1.957 3.969
HETATM 163 C UNK 0001 6.597 -4.933 2.295
HETATM 164 C UNK 0001 6.722 -5.433 3.625
HETATM 165 C UNK 0001 4.417 -7.453 1.641
HETATM 166 C UNK 0001 3.531 -6.997 2.661
HETATM 167 C UNK 0001 2.238 -9.973 0.987
HETATM 168 C UNK 0001 2.363 -10.472 2.317
HETATM 169 C UNK 0001 6.899 -0.976 3.665
HETATM 170 C UNK 0001 6.012 -0.520 4.684
HETATM 171 C UNK 0001 4.720 -3.496 3.011
HETATM 172 C UNK 0001 4.845 -3.995 4.341
HETATM 173 C UNK 0001 2.541 -6.016 2.357
HETATM 174 C UNK 0001 1.654 -5.559 3.376
HETATM 175 C UNK 0001 0.361 -8.535 1.703
HETATM 176 C UNK 0001 0.486 -9.035 3.033
HETATM 177 C UNK 0001 5.022 0.461 4.380
HETATM 178 C UNK 0001 4.136 0.918 5.400
HETATM 179 C UNK 0001 2.843 -2.059 3.726
HETATM 180 C UNK 0001 2.968 -2.558 5.057
HETATM 181 C UNK 0001 0.664 -4.578 3.072
HETATM 182 C UNK 0001 -0.223 -4.122 4.092
HETATM 183 C UNK 0001 -1.515 -7.098 2.418
HETATM 184 C UNK 0001 -1.390 -7.597 3.749
HETATM 185 C UNK 0001 3.146 1.898 5.096
HETATM 186 C UNK 0001 2.259 2.355 6.116
HETATM 187 C UNK 0001 0.966 -0.621 4.442
HETATM 188 C UNK 0001 1.091 -1.120 5.772
HETATM 189 C UNK 0001 -1.213 -3.141 3.788
HETATM 190 C UNK 0001 -2.100 -2.685 4.808
HETATM 191 C UNK 0001 -3.392 -5.661 3.134
HETATM 192 C UNK 0001 -3.267 -6.160 4.464
HETATM 193 C UNK 0001 1.269 3.336 5.812
HETATM 194 C UNK 0001 0.382 3.792 6.832
HETATM 195 C UNK 0001 -0.910 0.816 5.158
HETATM 196 C UNK 0001 -0.785 0.317 6.488
HETATM 197 C UNK 0001 -3.090 -1.704 4.504
HETATM 198 C UNK 0001 -3.976 -1.247 5.524
HETATM 199 C UNK 0001 -5.269 -4.223 3.850
HETATM 200 C UNK 0001 -5.144 -4.723 5.180
CONECT 1 2
CONECT 2 1 9 49
CONECT 3 4
CONECT 4 3 43 51
CONECT 5 6
CONECT 6 5 13 53
CONECT 7 8
CONECT 8 7 47 55
CONECT 9 2 10
CONECT 10 9 17 57
CONECT 11 12
CONECT 12 11 51 59
CONECT 13 6 14
CONECT 14 13 21 61
CONECT 15 16
CONECT 16 15 55 63
CONECT 17 10 18
CONECT 18 17 25 65
CONECT 19 20
CONECT 20 19 59 67
CONECT 21 14 22
CONECT 22 21 29 69
CONECT 23 24
CONECT 24 23 63 71
CONECT 25 18 26
CONECT 26 25 33 73
CONECT 27 28
CONECT 28 27 67 75
CONECT 29 22 30
CONECT 30 29 37 77
CONECT 31 32
CONECT 32 31 71 79
CONECT 33 26 34
CONECT 34 33
CONECT 35 36
CONECT 36 35 75
CONECT 37 30 38
CONECT 38 37
CONECT 39 40
CONECT 40 39 79
CONECT 41 42
CONECT 42 41 49 89
CONECT 43 4 44
CONECT 44 43 83 91
CONECT 45 46
CONECT 46 45 53 93
CONECT 47 8 48
CONECT 48 47 87 95
CONECT 49 2 42 50
CONECT 50 49 57 97
CONECT 51 4 12 52
CONECT 52 51 91 99
CONECT 53 6 46 54
CONECT 54 53 61 101
CONECT 55 8 16 56
CONECT 56 55 95 103
CONECT 57 10 50 58
CONECT 58 57 65 105
CONECT 59 12 20 60
CONECT 60 59 99 107
CONECT 61 14 54 62
CONECT 62 61 69 109
CONECT 63 16 24 64
CONECT 64 63 103 111
CONECT 65 18 58 66
CONECT 66 65 73 113
CONECT 67 20 28 68
CONECT 68 67 107 115
CONECT 69 22 62 70
CONECT 70 69 77 117
CONECT 71 24 32 72
CONECT 72 71 111 119
CONECT 73 26 66 74
CONECT 74 73
CONECT 75 28 36 76
CONECT 76 75 115
CONECT 77 30 70 78
CONECT 78 77
CONECT 79 32 40 80
CONECT 80 79 119
CONECT 81 82
CONECT 82 81 89 129
CONECT 83 44 84
CONECT 84 83 123 131
CONECT 85 86
CONECT 86 85 93 133
CONECT 87 48 88
CONECT 88 87 127 135
CONECT 89 42 82 90
CONECT 90 89 97 137
CONECT 91 44 52 92
CONECT 92 91 131 139
CONECT 93 46 86 94
CONECT 94 93 101 141
CONECT 95 48 56 96
CONECT 96 95 135 143
CONECT 97 50 90 98
CONECT 98 97 105 145
CONECT 99 52 60 100
CONECT 100 99 139 147
CONECT 101 54 94 102
CONECT 102 101 109 149
CONECT 103 56 64 104
CONECT 104 103 143 151
CONECT 105 58 98 106
CONECT 106 105 113 153
CONECT 107 60 68 108
CONECT 108 107 147 155
CONECT 109 62 102 110
CONECT 110 109 117 157
CONECT 111 64 72 112
CONECT 112 111 151 159
CONECT 113 66 106 114
CONECT 114 113
CONECT 115 68 76 116
CONECT 116 115 155
CONECT 117 70 110 118
CONECT 118 117
CONECT 119 72 80 120
CONECT 120 119 159
CONECT 121 122
CONECT 122 121 129 169
CONECT 123 84 124
CONECT 124 123 163 171
CONECT 125 126
CONECT 126 125 133 173
CONECT 127 88 128
CONECT 128 127 167 175
CONECT 129 82 122 130
CONECT 130 129 137 177
CONECT 131 84 92 132
CONECT 132 131 171 179
CONECT 133 86 126 134
CONECT 134 133 141 181
CONECT 135 88 96 136
CONECT 136 135 175 183
CONECT 137 90 130 138
CONECT 138 137 145 185
CONECT 139 92 100 140
CONECT 140 139 179 187
CONECT 141 94 134 142
CONECT 142 141 149 189
CONECT 143 96 104 144
CONECT 144 143 183 191
CONECT 145 98 138 146
CONECT 146 145 153 193
CONECT 147 100 108 148
CONECT 148 147 187 195
CONECT 149 102 142 150
CONECT 150 149 157 197
CONECT 151 104 112 152
CONECT 152 151 191 199
CONECT 153 106 146 154
CONECT 154 153
CONECT 155 108 116 156
CONECT 156 155 195
CONECT 157 110 150 158
CONECT 158 157
CONECT 159 112 120 160
CONECT 160 159 199
CONECT 161 162
CONECT 162 161 169
CONECT 163 124 164
CONECT 164 163
CONECT 165 166
CONECT 166 165 173
CONECT 167 128 168
CONECT 168 167
CONECT 169 122 162 170
CONECT 170 169 177
CONECT 171 124 132 172
CONECT 172 171
CONECT 173 126 166 174
CONECT 174 173 181
CONECT 175 128 136 176
CONECT 176 175
CONECT 177 130 170 178
CONECT 178 177 185
CONECT 179 132 140 180
CONECT 180 179
CONECT 181 134 174 182
CONECT 182 181 189
CONECT 183 136 144 184
CONECT 184 183
CONECT 185 138 178 186
CONECT 186 185 193
CONECT 187 140 148 188
CONECT 188 187
CONECT 189 142 182 190
CONECT 190 189 197
CONECT 191 144 152 192
CONECT 192 191
CONECT 193 146 186 194
CONECT 194 193
CONECT 195 148 156 196
CONECT 196 195
CONECT 197 150 190 198
CONECT 198 197
CONECT 199 152 160 200
CONECT 200 199
END
HEADER NONAME 23-Apr-10 NONE 1
TITLE NONE 2
AUTHOR Chemical Structure Services at http://cactus.nci.nih.gov NONE 3
REVDAT 1 23-Apr-10 0 NONE 4
ATOM 1 C 0 -1.049 1.569 -0.186 0.00 0.00 C+0
ATOM 2 C 0 1.717 0.715 0.155 0.00 0.00 C+0
ATOM 3 C 0 -1.635 -2.212 -0.674 0.00 0.00 C+0
ATOM 4 C 0 -4.657 0.896 0.691 0.00 0.00 C+0
ATOM 5 C 0 -4.065 -2.519 -0.433 0.00 0.00 C+0
ATOM 6 C 0 -2.792 -2.984 -0.745 0.00 0.00 C+0
ATOM 7 C 0 4.762 -1.453 -0.659 0.00 0.00 C+0
ATOM 8 C 0 3.241 -1.347 1.369 0.00 0.00 C+0
ATOM 9 C 0 -0.294 3.762 -0.536 0.00 0.00 C+0
ATOM 10 C 0 6.055 -0.727 -0.281 0.00 0.00 C+0
ATOM 11 C 0 4.117 -0.699 2.443 0.00 0.00 C+0
ATOM 12 H 0 -6.116 -0.586 0.423 0.00 0.00 H+0
ATOM 13 O 0 3.348 0.665 -1.551 0.00 0.00 O+0
ATOM 14 C 0 -2.243 1.917 0.716 0.00 0.00 C+0
ATOM 15 C 0 1.270 2.005 -0.544 0.00 0.00 C+0
ATOM 16 C 0 2.958 0.178 -0.511 0.00 0.00 C+0
ATOM 17 C 0 -1.715 -0.898 -0.270 0.00 0.00 C+0
ATOM 18 C 0 -3.338 0.903 0.522 0.00 0.00 C+0
ATOM 19 C 0 0.596 -0.284 0.030 0.00 0.00 C+0
ATOM 20 N 0 0.046 2.483 0.100 0.00 0.00 N+0
ATOM 21 C 0 -0.654 0.118 -0.131 0.00 0.00 C+0
ATOM 22 C 0 -4.182 -1.194 -0.016 0.00 0.00 C+0
ATOM 23 N 0 3.634 -0.844 0.050 0.00 0.00 N+0
ATOM 24 N 0 -5.176 -0.349 0.374 0.00 0.00 N+0
ATOM 25 C 0 -3.008 -0.439 0.056 0.00 0.00 C+0
ATOM 26 H 0 -1.370 1.771 -1.208 0.00 0.00 H+0
ATOM 27 H 0 -0.679 -2.642 -0.934 0.00 0.00 H+0
ATOM 28 H 0 -1.924 1.911 1.758 0.00 0.00 H+0
ATOM 29 H 0 -2.616 2.907 0.457 0.00 0.00 H+0
ATOM 30 H 0 -5.240 1.741 1.027 0.00 0.00 H+0
ATOM 31 H 0 -4.930 -3.161 -0.511 0.00 0.00 H+0
ATOM 32 H 0 0.816 -1.341 0.073 0.00 0.00 H+0
ATOM 33 H 0 -2.694 -4.011 -1.065 0.00 0.00 H+0
ATOM 34 H 0 1.919 0.915 1.207 0.00 0.00 H+0
ATOM 35 H 0 2.050 2.761 -0.453 0.00 0.00 H+0
ATOM 36 H 0 1.074 1.803 -1.597 0.00 0.00 H+0
ATOM 37 H 0 -1.230 4.137 -0.122 0.00 0.00 H+0
ATOM 38 H 0 0.501 4.484 -0.349 0.00 0.00 H+0
ATOM 39 H 0 -0.405 3.615 -1.611 0.00 0.00 H+0
ATOM 40 H 0 4.601 -1.373 -1.734 0.00 0.00 H+0
ATOM 41 H 0 4.842 -2.504 -0.381 0.00 0.00 H+0
ATOM 42 H 0 3.370 -2.429 1.399 0.00 0.00 H+0
ATOM 43 H 0 2.196 -1.100 1.555 0.00 0.00 H+0
ATOM 44 H 0 6.894 -1.180 -0.809 0.00 0.00 H+0
ATOM 45 H 0 5.975 0.324 -0.559 0.00 0.00 H+0
ATOM 46 H 0 6.215 -0.807 0.794 0.00 0.00 H+0
ATOM 47 H 0 3.829 -1.077 3.424 0.00 0.00 H+0
ATOM 48 H 0 5.163 -0.940 2.253 0.00 0.00 H+0
ATOM 49 H 0 3.983 0.383 2.418 0.00 0.00 H+0
CONECT 1 21 20 14 26 NONE 54
CONECT 2 19 16 15 34 NONE 55
CONECT 3 17 6 27 0 NONE 56
CONECT 4 18 24 30 0 NONE 57
CONECT 5 22 6 31 0 NONE 58
CONECT 6 3 5 33 0 NONE 59
CONECT 7 23 10 40 41 NONE 60
CONECT 8 23 11 42 43 NONE 61
CONECT 9 20 37 38 39 NONE 62
CONECT 10 7 44 45 46 NONE 63
CONECT 11 8 47 48 49 NONE 64
CONECT 13 16 0 0 0 NONE 65
CONECT 14 18 1 28 29 NONE 66
CONECT 15 20 2 35 36 NONE 67
CONECT 16 2 23 13 0 NONE 68
CONECT 17 25 21 3 0 NONE 69
CONECT 18 25 14 4 0 NONE 70
CONECT 19 21 2 32 0 NONE 71
CONECT 20 1 15 9 0 NONE 72
CONECT 21 17 1 19 0 NONE 73
CONECT 22 25 24 5 0 NONE 74
CONECT 23 16 7 8 0 NONE 75
CONECT 24 22 4 12 0 NONE 76
CONECT 25 17 18 22 0 NONE 77
END NONE 78
HEADER PROTEIN 05-MAY-09 NONE
TITLE NULL
COMPND NULL
SOURCE NULL
KEYWDS NULL
EXPDTA NULL
AUTHOR Marvin
REVDAT 1 05-MAY-09 0
HETATM 1 C UNK 0 -1.075 0.818 0.485 0.00 0.00 C+0
HETATM 2 C UNK 0 -20.084 -9.817 -16.179 0.00 0.00 C+0
HETATM 3 C UNK 0 -0.713 -0.346 1.456 0.00 0.00 C+0
HETATM 4 C UNK 0 -19.685 -11.316 -16.318 0.00 0.00 C+0
HETATM 5 C UNK 0 1.324 0.571 4.582 0.00 0.00 C+0
HETATM 6 C UNK 0 2.150 -0.422 2.437 0.00 0.00 C+0
HETATM 7 C UNK 0 -21.966 -13.277 -16.664 0.00 0.00 C+0
HETATM 8 C UNK 0 -21.411 -13.321 -19.105 0.00 0.00 C+0
HETATM 9 C UNK 0 -20.930 -9.245 -13.860 0.00 0.00 C+0
HETATM 10 C UNK 0 -0.272 0.398 -1.881 0.00 0.00 C+0
HETATM 11 C UNK 0 -17.605 -7.104 -10.656 0.00 0.00 C+0
HETATM 12 C UNK 0 -3.688 -1.419 -5.187 0.00 0.00 C+0
HETATM 13 C UNK 0 -7.197 -3.296 -7.958 0.00 0.00 C+0
HETATM 14 C UNK 0 -14.089 -5.242 -7.881 0.00 0.00 C+0
HETATM 15 C UNK 0 1.029 0.084 3.233 0.00 0.00 C+0
HETATM 16 C UNK 0 -21.125 -12.803 -17.765 0.00 0.00 C+0
HETATM 17 C UNK 0 -1.350 0.342 -0.884 0.00 0.00 C+0
HETATM 18 C UNK 0 -19.823 -9.290 -14.825 0.00 0.00 C+0
HETATM 19 C UNK 0 -16.638 -7.337 -11.747 0.00 0.00 C+0
HETATM 20 C UNK 0 -4.573 -1.473 -4.006 0.00 0.00 C+0
HETATM 21 C UNK 0 -8.014 -3.326 -6.733 0.00 0.00 C+0
HETATM 22 C UNK 0 -13.187 -5.516 -9.012 0.00 0.00 C+0
HETATM 23 C UNK 0 -20.123 -11.908 -17.582 0.00 0.00 C+0
HETATM 24 C UNK 0 -0.240 0.124 2.758 0.00 0.00 C+0
HETATM 25 C UNK 0 -18.570 -8.892 -14.489 0.00 0.00 C+0
HETATM 26 C UNK 0 -2.571 -0.167 -1.186 0.00 0.00 C+0
HETATM 27 C UNK 0 -15.311 -7.135 -11.542 0.00 0.00 C+0
HETATM 28 C UNK 0 -5.784 -2.084 -4.084 0.00 0.00 C+0
HETATM 29 C UNK 0 -11.851 -5.294 -8.909 0.00 0.00 C+0
HETATM 30 C UNK 0 -9.256 -3.873 -6.736 0.00 0.00 C+0
HETATM 31 C UNK 0 -4.199 -0.885 -2.811 0.00 0.00 C+0
HETATM 32 C UNK 0 -17.065 -7.742 -12.999 0.00 0.00 C+0
HETATM 33 C UNK 0 -13.701 -5.957 -10.216 0.00 0.00 C+0
HETATM 34 C UNK 0 -7.540 -2.746 -5.572 0.00 0.00 C+0
HETATM 35 C UNK 0 -2.930 -0.738 -2.378 0.00 0.00 C+0
HETATM 36 C UNK 0 -18.165 -8.484 -13.246 0.00 0.00 C+0
HETATM 37 C UNK 0 -14.749 -6.793 -10.348 0.00 0.00 C+0
HETATM 38 C UNK 0 -6.252 -2.750 -5.177 0.00 0.00 C+0
HETATM 39 C UNK 0 -11.189 -4.811 -7.807 0.00 0.00 C+0
HETATM 40 C UNK 0 -9.894 -4.441 -7.811 0.00 0.00 C+0
CONECT 1 3 17
CONECT 2 4 18
CONECT 3 1 24
CONECT 4 2 23
CONECT 5 15
CONECT 6 15
CONECT 7 16
CONECT 8 16
CONECT 9 18
CONECT 10 17
CONECT 11 19
CONECT 12 20
CONECT 13 21
CONECT 14 22
CONECT 15 5 6 24
CONECT 16 7 8 23
CONECT 17 1 10 26
CONECT 18 2 9 25
CONECT 19 11 27 32
CONECT 20 12 28 31
CONECT 21 13 30 34
CONECT 22 14 29 33
CONECT 23 4 16
CONECT 24 3 15
CONECT 25 18 36
CONECT 26 17 35
CONECT 27 19 37
CONECT 28 20 38
CONECT 29 22 39
CONECT 30 21 40
CONECT 31 20 35
CONECT 32 19 36
CONECT 33 22 37
CONECT 34 21 38
CONECT 35 26 31
CONECT 36 25 32
CONECT 37 27 33
CONECT 38 28 34
CONECT 39 29 40
CONECT 40 30 39
MASTER 0 0 0 0 0 0 0 0 40 0 78 0
END
HEADER MOLECULE
COMPND SODIUM CHLORIDE BIG CRYSTAL
AUTHOR A. W. MAVERICK
ATOM 1 CL UNK 1 -5.640 -2.820 -4.230 1.00 0.00
ATOM 2 NA UNK 1 -5.640 -2.820 -1.410 1.00 0.00
ATOM 3 CL UNK 1 -5.640 -2.820 1.410 1.00 0.00
ATOM 4 NA UNK 1 -5.640 -2.820 4.230 1.00 0.00
ATOM 5 NA UNK 1 -5.640 0.000 -4.230 1.00 0.00
ATOM 6 CL UNK 1 -5.640 0.000 -1.410 1.00 0.00
ATOM 7 NA UNK 1 -5.640 0.000 1.410 1.00 0.00
ATOM 8 CL UNK 1 -5.640 0.000 4.230 1.00 0.00
ATOM 9 CL UNK 1 -5.640 2.820 -4.230 1.00 0.00
ATOM 10 NA UNK 1 -5.640 2.820 -1.410 1.00 0.00
ATOM 11 CL UNK 1 -5.640 2.820 1.410 1.00 0.00
ATOM 12 NA UNK 1 -5.640 2.820 4.230 1.00 0.00
ATOM 13 NA UNK 1 -2.820 -2.820 -4.230 1.00 0.00
ATOM 14 CL UNK 1 -2.820 -2.820 -1.410 1.00 0.00
ATOM 15 NA UNK 1 -2.820 -2.820 1.410 1.00 0.00
ATOM 16 CL UNK 1 -2.820 -2.820 4.230 1.00 0.00
ATOM 17 CL UNK 1 -2.820 0.000 -4.230 1.00 0.00
ATOM 18 NA UNK 1 -2.820 0.000 -1.410 1.00 0.00
ATOM 19 CL UNK 1 -2.820 0.000 1.410 1.00 0.00
ATOM 20 NA UNK 1 -2.820 0.000 4.230 1.00 0.00
ATOM 21 NA UNK 1 -2.820 2.820 -4.230 1.00 0.00
ATOM 22 CL UNK 1 -2.820 2.820 -1.410 1.00 0.00
ATOM 23 NA UNK 1 -2.820 2.820 1.410 1.00 0.00
ATOM 24 CL UNK 1 -2.820 2.820 4.230 1.00 0.00
ATOM 25 CL UNK 1 0.000 -2.820 -4.230 1.00 0.00
ATOM 26 NA UNK 1 0.000 -2.820 -1.410 1.00 0.00
ATOM 27 CL UNK 1 0.000 -2.820 1.410 1.00 0.00
ATOM 28 NA UNK 1 0.000 -2.820 4.230 1.00 0.00
ATOM 29 NA UNK 1 0.000 0.000 -4.230 1.00 0.00
ATOM 30 CL UNK 1 0.000 0.000 -1.410 1.00 0.00
ATOM 31 NA UNK 1 0.000 0.000 1.410 1.00 0.00
ATOM 32 CL UNK 1 0.000 0.000 4.230 1.00 0.00
ATOM 33 CL UNK 1 0.000 2.820 -4.230 1.00 0.00
ATOM 34 NA UNK 1 0.000 2.820 -1.410 1.00 0.00
ATOM 35 CL UNK 1 0.000 2.820 1.410 1.00 0.00
ATOM 36 NA UNK 1 0.000 2.820 4.230 1.00 0.00
ATOM 37 NA UNK 1 2.820 -2.820 -4.230 1.00 0.00
ATOM 38 CL UNK 1 2.820 -2.820 -1.410 1.00 0.00
ATOM 39 NA UNK 1 2.820 -2.820 1.410 1.00 0.00
ATOM 40 CL UNK 1 2.820 -2.820 4.230 1.00 0.00
ATOM 41 CL UNK 1 2.820 0.000 -4.230 1.00 0.00
ATOM 42 NA UNK 1 2.820 0.000 -1.410 1.00 0.00
ATOM 43 CL UNK 1 2.820 0.000 1.410 1.00 0.00
ATOM 44 NA UNK 1 2.820 0.000 4.230 1.00 0.00
ATOM 45 NA UNK 1 2.820 2.820 -4.230 1.00 0.00
ATOM 46 CL UNK 1 2.820 2.820 -1.410 1.00 0.00
ATOM 47 NA UNK 1 2.820 2.820 1.410 1.00 0.00
ATOM 48 CL UNK 1 2.820 2.820 4.230 1.00 0.00
ATOM 49 CL UNK 1 5.640 -2.820 -4.230 1.00 0.00
ATOM 50 NA UNK 1 5.640 -2.820 -1.410 1.00 0.00
ATOM 51 CL UNK 1 5.640 -2.820 1.410 1.00 0.00
ATOM 52 NA UNK 1 5.640 -2.820 4.230 1.00 0.00
ATOM 53 NA UNK 1 5.640 0.000 -4.230 1.00 0.00
ATOM 54 CL UNK 1 5.640 0.000 -1.410 1.00 0.00
ATOM 55 NA UNK 1 5.640 0.000 1.410 1.00 0.00
ATOM 56 CL UNK 1 5.640 0.000 4.230 1.00 0.00
ATOM 57 CL UNK 1 5.640 2.820 -4.230 1.00 0.00
ATOM 58 NA UNK 1 5.640 2.820 -1.410 1.00 0.00
ATOM 59 CL UNK 1 5.640 2.820 1.410 1.00 0.00
ATOM 60 NA UNK 1 5.640 2.820 4.230 1.00 0.00
CONECT 1 2 5 13
CONECT 2 1 3 6 14
CONECT 3 2 4 7 15
CONECT 4 3 8 16
CONECT 5 1 6 9 17
CONECT 6 2 5 7 10 18
CONECT 7 3 6 8 11 19
CONECT 8 4 7 12 20
CONECT 9 5 10 21
CONECT 10 6 9 11 22
CONECT 11 7 10 12 23
CONECT 12 8 11 24
CONECT 13 1 14 17 25
CONECT 14 2 13 15 18 26
CONECT 15 3 14 16 19 27
CONECT 16 4 15 20 28
CONECT 17 5 13 18 21 29
CONECT 18 6 14 17 19
CONECT 18 22 30
CONECT 19 7 15 18 20
CONECT 19 23 31
CONECT 20 8 16 19 24 32
CONECT 21 9 17 22 33
CONECT 22 10 18 21 23 34
CONECT 23 11 19 22 24 35
CONECT 24 12 20 23 36
CONECT 25 13 26 29 37
CONECT 26 14 25 27 30 38
CONECT 27 15 26 28 31 39
CONECT 28 16 27 32 40
CONECT 29 17 25 30 33 41
CONECT 30 18 26 29 31
CONECT 30 34 42
CONECT 31 19 27 30 32
CONECT 31 35 43
CONECT 32 20 28 31 36 44
CONECT 33 21 29 34 45
CONECT 34 22 30 33 35 46
CONECT 35 23 31 34 36 47
CONECT 36 24 32 35 48
CONECT 37 25 38 41 49
CONECT 38 26 37 39 42 50
CONECT 39 27 38 40 43 51
CONECT 40 28 39 44 52
CONECT 41 29 37 42 45 53
CONECT 42 30 38 41 43
CONECT 42 46 54
CONECT 43 31 39 42 44
CONECT 43 47 55
CONECT 44 32 40 43 48 56
CONECT 45 33 41 46 57
CONECT 46 34 42 45 47 58
CONECT 47 35 43 46 48 59
CONECT 48 36 44 47 60
CONECT 49 37 50 53
CONECT 50 38 49 51 54
CONECT 51 39 50 52 55
CONECT 52 40 51 56
CONECT 53 41 49 54 57
CONECT 54 42 50 53 55
CONECT 54 58
CONECT 55 43 51 54 56
CONECT 55 59
CONECT 56 44 52 55 60
CONECT 57 45 53 58
CONECT 58 46 54 57 59
CONECT 59 47 55 58 60
CONECT 60 48 56 59
MASTER 0 0 0 0 0 0 0 0 60 0 60 0
END
HEADER PROTEIN 25-AUG-08 NONE
TITLE NULL
COMPND MOLECULE: 184
SOURCE NULL
KEYWDS NULL
EXPDTA NULL
AUTHOR Marvin
REVDAT 1 25-AUG-08 0
HETATM 1 N UNK 0 2.066 -2.269 0.129 0.00 0.00 N+0
HETATM 2 N UNK 0 -0.352 1.181 -0.413 0.00 0.00 N+0
HETATM 3 C UNK 0 2.542 -0.987 0.731 0.00 0.00 C+0
HETATM 4 C UNK 0 2.489 -1.212 2.267 0.00 0.00 C+0
HETATM 5 C UNK 0 1.783 -2.566 2.444 0.00 0.00 C+0
HETATM 6 C UNK 0 2.170 -3.317 1.164 0.00 0.00 C+0
HETATM 7 C UNK 0 1.723 0.195 0.320 0.00 0.00 C+0
HETATM 8 C UNK 0 2.616 -2.630 -1.204 0.00 0.00 C+0
HETATM 9 C UNK 0 2.288 1.493 0.336 0.00 0.00 C+0
HETATM 10 C UNK 0 0.364 0.083 -0.061 0.00 0.00 C+0
HETATM 11 C UNK 0 1.521 2.611 -0.035 0.00 0.00 C+0
HETATM 12 C UNK 0 0.180 2.427 -0.411 0.00 0.00 C+0
HETATM 13 H UNK 0 3.587 -0.824 0.438 0.00 0.00 H+0
HETATM 14 H UNK 0 3.506 -1.278 2.666 0.00 0.00 H+0
HETATM 15 H UNK 0 1.958 -0.426 2.811 0.00 0.00 H+0
HETATM 16 H UNK 0 2.114 -3.088 3.347 0.00 0.00 H+0
HETATM 17 H UNK 0 0.697 -2.426 2.484 0.00 0.00 H+0
HETATM 18 H UNK 0 3.194 -3.699 1.242 0.00 0.00 H+0
HETATM 19 H UNK 0 1.485 -4.144 0.969 0.00 0.00 H+0
HETATM 20 H UNK 0 3.695 -2.803 -1.157 0.00 0.00 H+0
HETATM 21 H UNK 0 2.421 -1.821 -1.910 0.00 0.00 H+0
HETATM 22 H UNK 0 2.131 -3.532 -1.581 0.00 0.00 H+0
HETATM 23 H UNK 0 3.263 1.631 0.620 0.00 0.00 H+0
HETATM 24 H UNK 0 -0.106 -0.822 -0.076 0.00 0.00 H+0
HETATM 25 H UNK 0 1.934 3.546 -0.026 0.00 0.00 H+0
HETATM 26 H UNK 0 -0.402 3.223 -0.680 0.00 0.00 H+0
CONECT 1 3 6 8
CONECT 2 10 12
CONECT 3 1 4 7 13
CONECT 4 3 5 14 15
CONECT 5 4 6 16 17
CONECT 6 1 5 18 19
CONECT 7 3 9 10
CONECT 8 1 20 21 22
CONECT 9 7 11 23
CONECT 10 2 7 24
CONECT 11 9 12 25
CONECT 12 2 11 26
CONECT 13 3
CONECT 14 4
CONECT 15 4
CONECT 16 5
CONECT 17 5
CONECT 18 6
CONECT 19 6
CONECT 20 8
CONECT 21 8
CONECT 22 8
CONECT 23 9
CONECT 24 10
CONECT 25 11
CONECT 26 12
MASTER 0 0 0 0 0 0 0 0 26 0 54 0
END
HEADER MOLECULE
COMPND "123" YBa2Cu3O7 SUPERCONDUCTOR
AUTHOR A. W. MAVERICK
ATOM 1 Y UNK 1 0.000 -4.290 0.000 1.00 0.00
ATOM 2 BA UNK 1 0.000 -0.602 0.000 1.00 0.00
ATOM 3 BA UNK 1 0.000 3.703 0.000 1.00 0.00
ATOM 4 CU UNK 1 -1.912 -5.976 1.943 1.00 0.00
ATOM 5 CU UNK 1 -1.912 -5.976 -1.943 1.00 0.00
ATOM 6 CU UNK 1 1.911 -5.976 1.943 1.00 0.00
ATOM 7 CU UNK 1 1.911 -5.976 -1.943 1.00 0.00
ATOM 8 CU UNK 1 -1.912 -2.603 1.943 1.00 0.00
ATOM 9 CU UNK 1 -1.912 -2.603 -1.943 1.00 0.00
ATOM 10 CU UNK 1 1.911 -2.603 1.943 1.00 0.00
ATOM 11 CU UNK 1 1.911 -2.603 -1.943 1.00 0.00
ATOM 12 CU UNK 1 -1.912 1.551 1.943 1.00 0.00
ATOM 13 CU UNK 1 -1.912 1.551 -1.943 1.00 0.00
ATOM 14 CU UNK 1 1.911 1.551 1.943 1.00 0.00
ATOM 15 CU UNK 1 1.911 1.551 -1.943 1.00 0.00
ATOM 16 CU UNK 1 -1.912 5.704 1.943 1.00 0.00
ATOM 17 CU UNK 1 -1.912 5.704 -1.943 1.00 0.00
ATOM 18 CU UNK 1 1.911 5.704 1.943 1.00 0.00
ATOM 19 CU UNK 1 1.911 5.704 -1.943 1.00 0.00
ATOM 20 O UNK 1 -3.823 -5.723 1.943 1.00 0.00
ATOM 21 O UNK 1 -3.823 -5.723 -1.943 1.00 0.00
ATOM 22 O UNK 1 0.000 -5.723 1.943 1.00 0.00
ATOM 23 O UNK 1 0.000 -5.723 -1.943 1.00 0.00
ATOM 24 O UNK 1 3.823 -5.723